ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Arnaud Vandyck <arnaud.vand...@ulg.ac.be>
Subject gcj task patch to compile java to native
Date Fri, 09 Apr 2004 13:15:24 GMT
Index: src/main/org/apache/tools/ant/taskdefs/compilers/Gcj.java
===================================================================
RCS file: /home/cvspublic/ant/src/main/org/apache/tools/ant/taskdefs/compilers/Gcj.java,v
retrieving revision 1.19
diff -r1.19 Gcj.java
104a105
>          * ... if no 'compile to native' argument is passed
106c107,109
<         cmd.createArgument().setValue("-C");
---
>         if (!isNativeBuild()) {
>           cmd.createArgument().setValue("-C");
>         }
111a115,134
> 
>   public boolean isNativeBuild() {
>     boolean nativeBuild = false;
>     String[] additionalArguments = getJavac().getCurrentCompilerArgs();
>     int argsLength=0;
>     while (!nativeBuild && argsLength<additionalArguments.length) {
>       int conflictLength=0;
>       while (!nativeBuild && conflictLength<CONFLICT_WITH_DASH_C.length) {
>         nativeBuild = (additionalArguments[argsLength].startsWith
>                        (CONFLICT_WITH_DASH_C[conflictLength]));
>         conflictLength++;
>       }
>       argsLength++;
>     }
>     return nativeBuild;
>   }
> 
>   private static final String [] CONFLICT_WITH_DASH_C = 
>   { "-o" , "--main=", "-D", "-fjni", "-L" };
> 


Mime
View raw message