While I've been nativifying various bits of the Tomcat stack I've kept finding myself with bits of specfile like: for jar in %{name} %{name}-launcher; do aot-compile build/lib/$jar.jar build/lib/lib$jar.jar.so done The attached patch changes aot-compile's syntax to allow that bit f spec to be rewritten as: aot-compile build/lib/%{name}.jar build/lib/%{name}-launcher.jar With the attached patch you can pass build options to gcc by putting them before the jars on the command line: aot-compile -march=i386 -mtune=pentium4 build/lib/%{name}.jar or (more likely): aot-compile $RPM_OPTS build/lib/%{name}.jar Anyone see any problems? Cheers, Gary [ gbenson@xxxxxxxxxx ][ I am Red Hat ][ http://inauspicious.org/ ]
Index: aot-compile.in =================================================================== RCS file: /cvs/rhug/java-gcj-compat/aot-compile.in,v retrieving revision 1.1 diff -u -r1.1 aot-compile.in --- aot-compile.in 14 Apr 2005 22:12:54 -0000 1.1 +++ aot-compile.in 22 Apr 2005 15:34:44 -0000 @@ -4,12 +4,21 @@ : ${1?" aot-compile: Natively-compile a given JAR - Usage: $0 SRC_JARFILE DEST_SO_NAME BUILD_OPTIONS - SRC_JARFILE - the jar file we want to process - DEST_SO_NAME - the destination name of the .so of the compiled JAR + Usage: $0 [BUILD_OPTIONS] JARS + JARS - jar files we want to process BUILD_OPTIONS - a list of gcj options (outside of -findirect-dispatch -shared -Wl,-Bsymbolic) "} -@GCJ_BIN_DIR@/gcj@gcc_suffix@ $3 -findirect-dispatch \ - -shared -Wl,-Bsymbolic -o $2 $1 +unset opts +while [ ! -z "$1" ]; do + (echo -- "$1" | grep -q '\.jar$') && break + opts="$opts${opts:+ }$1" + shift +done +while [ ! -z "$1" ]; do + @GCJ_BIN_DIR@/gcj@gcc_suffix@ \ + $opts -findirect-dispatch -shared -Wl,-Bsymbolic \ + -o `dirname $1`/lib`basename $1`.so $1 + shift +done