tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cos...@apache.org
Subject cvs commit: jakarta-tomcat-connectors/jk/jkant/java/org/apache/jk/ant/compilers CcCompiler.java CompilerAdapter.java LibtoolCompiler.java LibtoolLinker.java
Date Wed, 12 Dec 2001 22:09:16 GMT
costin      01/12/12 14:09:16

  Modified:    jk/jkant/java/org/apache/jk/ant SoTask.java
               jk/jkant/java/org/apache/jk/ant/compilers CcCompiler.java
                        CompilerAdapter.java LibtoolCompiler.java
                        LibtoolLinker.java
  Log:
  Few changes to get warnings to work, and some fixes ( debug was not added )
  
  Revision  Changes    Path
  1.22      +8 -0      jakarta-tomcat-connectors/jk/jkant/java/org/apache/jk/ant/SoTask.java
  
  Index: SoTask.java
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat-connectors/jk/jkant/java/org/apache/jk/ant/SoTask.java,v
  retrieving revision 1.21
  retrieving revision 1.22
  diff -u -r1.21 -r1.22
  --- SoTask.java	2001/11/16 22:18:50	1.21
  +++ SoTask.java	2001/12/12 22:09:16	1.22
  @@ -115,6 +115,7 @@
       protected int debug;
   
       protected boolean optG=true;
  +    protected boolean optWgcc=true;
       protected boolean optimize=false;
       protected boolean profile=false;
       protected Vector defines    = new Vector();
  @@ -154,6 +155,7 @@
   	so.buildDir=buildDir;
   	so.debug=debug;
   	so.optG=optG;
  +        so.optWgcc=optWgcc;
   	so.optimize=optimize;
   	so.profile=profile;
   	so.defines=defines;
  @@ -190,6 +192,12 @@
        */
       public void setProfile(boolean b) {
   	profile=b;
  +    }
  +
  +    /** Gcc warnings
  +     */
  +    public void setGccWarn(boolean b) {
  +	optWgcc=b;
       }
   
       /** Debug the <so> task
  
  
  
  1.7       +20 -11    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.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- CcCompiler.java	2001/11/16 22:23:22	1.6
  +++ CcCompiler.java	2001/12/12 22:09:16	1.7
  @@ -103,7 +103,7 @@
   
   	addIncludes(cmd);
   	addExtraFlags( cmd );
  -	addDefines(cmd);
  +	addDebug(cmd);
   	addDefines( cmd );
   	addOptimize( cmd );
   	addProfile( cmd );
  @@ -113,25 +113,34 @@
   	project.log( "Compiling " + source);
   
   	int result=execute( cmd );
  -	if( result!=0 ) {
  -	    displayError( result, source, cmd );
  -	}
  +        displayError( result, source, cmd );
   	closeStreamHandler();
       }
       protected void addDebug(Commandline cmd) {
   	if( optG ) {
   	    cmd.createArgument().setValue("-g" );
  +        }
  +
  +        if( optWgcc ) {
   	    cmd.createArgument().setValue("-W");
  -	    cmd.createArgument().setValue("-Wall");
  -	    
  -	    cmd.createArgument().setValue("-Wtraditional");
  -	    cmd.createArgument().setValue("-Wredundant-decls");
  +            
  +            //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("-Wconversions");
   	    cmd.createArgument().setValue("-Wcast-align");
  -
  -	    cmd.createArgument().setValue("-pedantic" );
  +            // 	    cmd.createArgument().setValue("-pedantic" );
   	}
       }
       protected void addOptimize( Commandline cmd ) {
  
  
  
  1.7       +10 -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.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- CompilerAdapter.java	2001/11/16 22:21:03	1.6
  +++ CompilerAdapter.java	2001/12/12 22:09:16	1.7
  @@ -250,6 +250,16 @@
       protected void displayError( int result, String source, Commandline cmd )
   	throws BuildException
       {
  +        if( result == 0 ) {
  +            String err=errorstream.toString();
  +            if(err==null ) return;
  +            if( err.indexOf( "warning" ) <= 0 )
  +                return;
  +            log("Warnings: ");
  +            log( err );
  +            return;
  +        }
  +        
   	log("Compile failed " + result + " " +  source );
   	log("Command:" + cmd.toString());
   	log("Output:" );
  @@ -298,7 +308,6 @@
   		if( val!=null )
   		    arg+= "=" + val;
   		cmd.createArgument().setValue( arg );
  -		if( debug > 0 ) project.log(arg);
               }
           }
       }
  
  
  
  1.7       +15 -4     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.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- LibtoolCompiler.java	2001/11/11 01:09:59	1.6
  +++ LibtoolCompiler.java	2001/12/12 22:09:16	1.7
  @@ -79,6 +79,18 @@
   	super();
       };
   
  +    public void compile(Vector sourceFiles ) throws BuildException {
  +        compileList=findCompileList(sourceFiles);
  +        
  +        log("Compiling " + compileList.size() + " out of " + sourceFiles.size());
  +	Enumeration en=compileList.elements();
  +	while( en.hasMoreElements() ) {
  +	    Source source=(Source)en.nextElement();
  +	    compileSingleFile(source);
  +	}
  +    }
  +    
  +
       /** Compile using libtool.
        */
       public void compileSingleFile(Source sourceObj) throws BuildException {
  @@ -115,7 +127,7 @@
   
   	addIncludes(cmd);
   	addExtraFlags( cmd );
  -	addDefines(cmd);
  +	addDebug(cmd);
   	addDefines( cmd );
   	addOptimize( cmd );
   	addProfile( cmd );
  @@ -123,10 +135,9 @@
   	project.log( "Compiling " + source);
   	cmd.createArgument().setValue( source );
   
  +        if( debug > 0 ) project.log(cmd.toString());
   	int result=execute( cmd );
  -	if( result!=0 ) {
  -	    displayError( result, source, cmd );
  -	}
  +        displayError( result, source, cmd );
   	closeStreamHandler();
       }
   }
  
  
  
  1.6       +9 -0      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.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- LibtoolLinker.java	2001/11/16 22:23:22	1.5
  +++ LibtoolLinker.java	2001/12/12 22:09:16	1.6
  @@ -110,6 +110,15 @@
   	// All .o files must be included
   	project.log( "Linking " + buildDir + "/" + soFile + ".so");
   
  +        if( libs!=null ) {
  +            String libsA[]=libs.list(); 
  +            for( int i=0; i< libsA.length; i++ ) {
  +                cmd.createArgument().setValue( "-l" + libsA[i] );
  +                //XXX debug
  +                project.log("XXX -l" + libsA[i] );
  +            }
  +        }
  +	
   	for( int i=0; i<srcList.size(); i++ ) {
   	    Source sourceObj=(Source)srcList.elementAt(i);
   	    
  
  
  

--
To unsubscribe, e-mail:   <mailto:tomcat-dev-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:tomcat-dev-help@jakarta.apache.org>


Mime
View raw message