costin 02/01/11 21:33:03 Modified: jk/jkant/java/org/apache/jk/ant/compilers CcCompiler.java CompilerAdapter.java LibtoolCompiler.java LibtoolLinker.java Log: Use 'cc' by default ( it works on both systems using gcc and cc, the reverse is not true ). Don't add the gcc warning options unless gcc is explicitely added. Define the os automatically, since java knows it. This could simplify some build files. Revision Changes Path 1.8 +25 -22 jakarta-tomcat-connectors/jk/jkant/java/org/apache/jk/ant/compilers/CcCompiler.java Index: CcCompiler.java =================================================================== RCS file: /home/cvs/jakarta-tomcat-connectors/jk/jkant/java/org/apache/jk/ant/compilers/CcCompiler.java,v retrieving revision 1.7 retrieving revision 1.8 diff -u -r1.7 -r1.8 --- CcCompiler.java 12 Dec 2001 22:09:16 -0000 1.7 +++ CcCompiler.java 12 Jan 2002 05:33:03 -0000 1.8 @@ -84,18 +84,19 @@ return co_mapper.mapFileName( name ); } - + + String cc; + /** Compile using 'standard' gcc flags. This assume a 'current' gcc on * a 'normal' platform - no need for libtool */ - public void compileSingleFile(Source sourceObj) throws BuildException { File f=sourceObj.getFile(); String source=f.toString(); Commandline cmd = new Commandline(); - String cc=project.getProperty("build.native.cc"); - if(cc==null) cc="gcc"; + cc=project.getProperty("build.native.cc"); + if(cc==null) cc="cc"; cmd.setExecutable( cc ); @@ -123,24 +124,26 @@ if( optWgcc ) { cmd.createArgument().setValue("-W"); - - //cmd.createArgument().setValue("-Wall"); - cmd.createArgument().setValue("-Wimplicit"); - cmd.createArgument().setValue("-Wreturn-type"); - cmd.createArgument().setValue("-Wcomment"); - cmd.createArgument().setValue("-Wformat"); - cmd.createArgument().setValue("-Wchar-subscripts"); - cmd.createArgument().setValue("-O"); - cmd.createArgument().setValue("-Wuninitialized"); - - // Non -Wall - // cmd.createArgument().setValue("-Wtraditional"); - // cmd.createArgument().setValue("-Wredundant-decls"); - cmd.createArgument().setValue("-Wmissing-declarations"); - cmd.createArgument().setValue("-Wmissing-prototypes"); - // cmd.createArgument().setValue("-Wconversions"); - cmd.createArgument().setValue("-Wcast-align"); - // cmd.createArgument().setValue("-pedantic" ); + + if( cc!= null && cc.indexOf( "gcc" ) >= 0 ) { + //cmd.createArgument().setValue("-Wall"); + cmd.createArgument().setValue("-Wimplicit"); + cmd.createArgument().setValue("-Wreturn-type"); + cmd.createArgument().setValue("-Wcomment"); + cmd.createArgument().setValue("-Wformat"); + cmd.createArgument().setValue("-Wchar-subscripts"); + cmd.createArgument().setValue("-O"); + cmd.createArgument().setValue("-Wuninitialized"); + + // Non -Wall + // cmd.createArgument().setValue("-Wtraditional"); + // cmd.createArgument().setValue("-Wredundant-decls"); + cmd.createArgument().setValue("-Wmissing-declarations"); + cmd.createArgument().setValue("-Wmissing-prototypes"); + // cmd.createArgument().setValue("-Wconversions"); + cmd.createArgument().setValue("-Wcast-align"); + // cmd.createArgument().setValue("-pedantic" ); + } } } protected void addOptimize( Commandline cmd ) { 1.8 +4 -1 jakarta-tomcat-connectors/jk/jkant/java/org/apache/jk/ant/compilers/CompilerAdapter.java Index: CompilerAdapter.java =================================================================== RCS file: /home/cvs/jakarta-tomcat-connectors/jk/jkant/java/org/apache/jk/ant/compilers/CompilerAdapter.java,v retrieving revision 1.7 retrieving revision 1.8 diff -u -r1.7 -r1.8 --- CompilerAdapter.java 12 Dec 2001 22:09:16 -0000 1.7 +++ CompilerAdapter.java 12 Jan 2002 05:33:03 -0000 1.8 @@ -297,7 +297,10 @@ } protected void addDefines( Commandline cmd ) { - if( defines.size() > 0 ) { + // Define by default the OS ( as known to java ) + String os=System.getProperty("java.os"); + + if( defines.size() > 0 ) { Enumeration defs=defines.elements(); while( defs.hasMoreElements() ) { Def d=(Def)defs.nextElement(); 1.8 +1 -1 jakarta-tomcat-connectors/jk/jkant/java/org/apache/jk/ant/compilers/LibtoolCompiler.java Index: LibtoolCompiler.java =================================================================== RCS file: /home/cvs/jakarta-tomcat-connectors/jk/jkant/java/org/apache/jk/ant/compilers/LibtoolCompiler.java,v retrieving revision 1.7 retrieving revision 1.8 diff -u -r1.7 -r1.8 --- LibtoolCompiler.java 12 Dec 2001 22:09:16 -0000 1.7 +++ LibtoolCompiler.java 12 Jan 2002 05:33:03 -0000 1.8 @@ -106,7 +106,7 @@ cmd.createArgument().setValue("--mode=compile"); String cc=project.getProperty("build.native.cc"); - if(cc==null) cc="gcc"; + if(cc==null) cc="cc"; cmd.createArgument().setValue( cc ); 1.7 +1 -1 jakarta-tomcat-connectors/jk/jkant/java/org/apache/jk/ant/compilers/LibtoolLinker.java Index: LibtoolLinker.java =================================================================== RCS file: /home/cvs/jakarta-tomcat-connectors/jk/jkant/java/org/apache/jk/ant/compilers/LibtoolLinker.java,v retrieving revision 1.6 retrieving revision 1.7 diff -u -r1.6 -r1.7 --- LibtoolLinker.java 12 Dec 2001 22:09:16 -0000 1.6 +++ LibtoolLinker.java 12 Jan 2002 05:33:03 -0000 1.7 @@ -92,7 +92,7 @@ cmd.createArgument().setValue("--mode=link"); String cc=project.getProperty("build.native.cc"); - if(cc==null) cc="gcc"; + if(cc==null) cc="cc"; cmd.createArgument().setValue( cc );
-- To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]> For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>