diff options
Diffstat (limited to 'make/build-junit.xml')
-rw-r--r-- | make/build-junit.xml | 103 |
1 files changed, 72 insertions, 31 deletions
diff --git a/make/build-junit.xml b/make/build-junit.xml index f1f3b6f..2da5997 100644 --- a/make/build-junit.xml +++ b/make/build-junit.xml @@ -121,10 +121,8 @@ <property name="linker.cfg.id" value="${linker.cfg.id.base}" /> </target> - <target name="rename.mingw.dll" if="isMingW"> - <move file="${src}" tofile="${dest}" /> - </target> - + <!-- FIXME: this is a hack; the cpptask should have an option to change the + suffix or at least understand the override from dylib to jnilib --> <target name="rename.dylib" if="isOSX"> <move file="${src}" tofile="${dest}" /> </target> @@ -172,33 +170,30 @@ <syslibset dir="${java.lib.dir.platform}/server" libs="jvm" if="@{output.lib.name}.useLibJVM"/> </linker> </cc> - - <!-- FIXME: this is a hack; the cpptask should have an option to change the - suffix or at least understand the override from dylib to jnilib --> - <antcall target="rename.dylib" inheritRefs="true"> - <param name="src" value="${build_t.lib}/lib@{output.lib.name}.dylib" /> - <param name="dest" value="${build_t.lib}/lib@{output.lib.name}.jnilib" /> - </antcall> - - <!-- FIXME: this is a hack; the cpptask should have an option to change the - suffix or at least understand the override from dylib to jnilib --> - <antcall target="rename.mingw.dll" inheritRefs="true"> - <param name="src" value="${build_t.lib}/lib@{output.lib.name}.so" /> - <param name="dest" value="${build_t.lib}/@{output.lib.name}.dll" /> - </antcall> </sequential> </macrodef> - <target name="junit.compile" depends="init, java.generate, java.build, c.build"/> + <target name="junit.compile" depends="init, java.generate, java.build, native.build"/> + + <target name="junit.run" depends="init,gluegen.cpptasks.detect.os"> + <!-- Use absolute path --> + <property name="gluegen.lib.abs" location="${gluegen.lib}" /> + <property name="build_t.lib.abs" location="${build_t.lib}" /> + - <target name="junit.run" depends="init"> <!-- Perform the junit tests--> <mkdir dir="${results}"/> <junit forkmode="once" showoutput="true" fork="true"> - <jvmarg value="-Djava.library.path=${gluegen.lib}:${build_t.lib}"/> + <env key="${system.env.library.path}" path="${gluegen.lib.abs}${path.separator}${build_t.lib.abs}"/> + <jvmarg value="-Djava.library.path=${gluegen.lib.abs}${path.separator}${build_t.lib.abs}"/> <jvmarg value="-Drootrel.build=${rootrel.build}"/> - <!--jvmarg value="-Dgluegen.debug.NativeLibrary=true"/--> - <!--jvmarg value="-Dgluegen.debug.ProcAddressHelper=true"/--> + <!-- + <jvmarg value="-Dgluegen.debug.NativeLibrary=true"/> + <jvmarg value="-Dgluegen.debug.ProcAddressHelper=true"/> + <jvmarg value="-verbose:jni"/> + <jvmarg value="-client"/> + <jvmarg value="-d32"/> + --> <formatter usefile="false" type="plain"/> <formatter usefile="true" type="xml"/> <classpath refid="junit.run.classpath"/> @@ -221,7 +216,12 @@ <target name="java.generate" depends="junit.test1.java.generate"/> - <target name="c.build" depends="c.configure, junit.test1.c.build" unless="build.javaonly" /> + <target name="native.build" depends="c.configure, junit.test1.c.build" unless="build.javaonly"> + <antcall target="gluegen.cpptasks.striplibs" inheritRefs="true"> + <param name="libdir" value="${build_t.lib}"/> + </antcall> + </target> + <!-- @@ -266,30 +266,71 @@ </gluegen> </target> - <target name="junit.test1.c.build" depends="junit.test1p1.c.build, junit.test1p2.c.build" unless="build.javaonly" /> + <target name="junit.test1.c.build" depends="junit.test1i.c.build, junit.test1p1.c.build, junit.test1p2.c.build" unless="build.javaonly" /> + + <!-- this is the test1 implementation --> + <target name="junit.test1i.c.build"> + <patternset id="junit.test1i.c.src.files"> + <include name="${test.junit.rootrel}/generation/test1.c"/> + </patternset> + + <!-- Windows hacks ro make a proper DLL --> + <linker id="linker.test1.dll.cfg.id" extends="${linker.cfg.id}"> + <linkerarg value="-Wl,-soname=test1.dll" if="isMingW"/> + <linkerarg value="-Wl,--output=test1.dll" if="isMingW"/> + </linker> + <c.build c.compiler.src.files="junit.test1i.c.src.files" + output.lib.name="test1" + compiler.cfg.id="${compiler.cfg.id}" + linker.cfg.id="linker.test1.dll.cfg.id"/> + </target> + + <!-- this is a fixed binding to the test1 implementation --> <target name="junit.test1p1.c.build"> + <linker id="linker.test1.fixed.cfg.id" extends="${linker.cfg.id}"> + <linkerarg value="-Wl,-soname=BindingTest1p1.dll" if="isMingW"/> + <linkerarg value="-Wl,--output=BindingTest1p1.dll" if="isMingW"/> + <syslibset dir="${build_t.lib}" libs="test1"/> + </linker> + <patternset id="junit.test1p1.c.src.files"> - <include name="${test.junit.rootrel}/generation/test1.c"/> <include name="${build_t.gen.rootrel}/native/BindingTest1p1Impl_JNI.c"/> </patternset> <c.build c.compiler.src.files="junit.test1p1.c.src.files" - output.lib.name="test1p1" + output.lib.name="BindingTest1p1" compiler.cfg.id="${compiler.cfg.id}" - linker.cfg.id="${linker.cfg.id}"/> + linker.cfg.id="linker.test1.fixed.cfg.id"/> + + <antcall target="rename.dylib" inheritRefs="true"> + <param name="src" value="${build_t.lib}/libBindingTest1p1.dylib" /> + <param name="dest" value="${build_t.lib}/libBindingTest1p1.jnilib" /> + </antcall> + </target> + <!-- this is a dynamic lookup binding to the test1 implementation --> <target name="junit.test1p2.c.build"> + <linker id="linker.test1.runtime.cfg.id" extends="${linker.cfg.id}"> + <linkerarg value="-Wl,-soname=BindingTest1p2.dll" if="isMingW"/> + <linkerarg value="-Wl,--output=BindingTest1p2.dll" if="isMingW"/> + </linker> + <patternset id="junit.test1p2.c.src.files"> - <include name="${test.junit.rootrel}/generation/test1.c"/> <include name="${build_t.gen.rootrel}/native/BindingTest1p2Impl_JNI.c"/> </patternset> <c.build c.compiler.src.files="junit.test1p2.c.src.files" - output.lib.name="test1p2" + output.lib.name="BindingTest1p2" compiler.cfg.id="${compiler.cfg.id}" - linker.cfg.id="${linker.cfg.id}"/> + linker.cfg.id="linker.test1.runtime.cfg.id"/> + + <antcall target="rename.dylib" inheritRefs="true"> + <param name="src" value="${build_t.lib}/libBindingTest1p2.dylib" /> + <param name="dest" value="${build_t.lib}/libBindingTest1p2.jnilib" /> + </antcall> + </target> <!-- |