diff options
Diffstat (limited to 'make')
-rw-r--r-- | make/build-jogl.xml | 75 | ||||
-rw-r--r-- | make/build.xml | 6 | ||||
-rw-r--r-- | make/lib/gluegen.compiler.linux-32bit.xml | 31 | ||||
-rw-r--r-- | make/make.jogl.all.linux-x86.sh | 1 | ||||
-rw-r--r-- | make/make.jogl.cdcfp.linux-x86.sh | 1 |
5 files changed, 113 insertions, 1 deletions
diff --git a/make/build-jogl.xml b/make/build-jogl.xml index 6f97a336e..ba92540b8 100644 --- a/make/build-jogl.xml +++ b/make/build-jogl.xml @@ -215,6 +215,7 @@ <target name="base.init.sourcelevel.1"> <property name="jogl.sourcelevel" value="1.4" /> + <property name="junit.sourcelevel" value="1.5" /> </target> <!--target name="base.init.sourcelevel.2" if="gluegen.nsig"> @@ -264,6 +265,7 @@ </condition> <property name="rootrel.build.jogl" value="${rootrel.build}/jogl" /> <property name="rootrel.src.java" value="src/jogl/classes" /> + <property name="rootrel.src.junit" value="src/jogl/junit" /> <property name="rootrel.src.c" value="src/jogl/native" /> <property name="rootrel.src.c.openmax" value="src/jogl/native/openmax" /> @@ -283,16 +285,22 @@ <property name="gluegen.build.xml" value="${gluegen.make.dir}/build.xml" /> <property name="gluegen.jar" value="${gluegen.root}/${rootrel.build}/gluegen.jar" /> <property name="gluegen-rt.jar" value="${gluegen.root}/${rootrel.build}/gluegen-rt.jar" /> + <property name="gluegen.so.dir" value="${gluegen.root}/${rootrel.build}/obj" /> + <property name="junit.jar" value="${gluegen.make.dir}/lib/junit-4.5.jar" /> <property name="nativewindow.core.jar" value="../${rootrel.build}/nativewindow/nativewindow.core.jar" /> <property name="nativewindow.x11.jar" value="../${rootrel.build}/nativewindow/nativewindow.x11.jar" /> <property name="nativewindow.awt.jar" value="../${rootrel.build}/nativewindow/nativewindow.awt.jar" /> + <property name="nativewindow.so.dir" value="../${rootrel.build}/nativewindow/obj" /> <property name="gluegen-rt-cdc.jar" value="${gluegen.root}/${rootrel.build}/gluegen-rt-cdc.jar" /> <property name="nativewindow.core.cdc.jar" value="../${rootrel.build}/nativewindow/nativewindow.core.cdc.jar" /> <property name="nativewindow.x11.cdc.jar" value="../${rootrel.build}/nativewindow/nativewindow.x11.cdc.jar" /> + <property name="newt.so.dir" value="../${rootrel.build}/newt/obj" /> + <!-- The source directories. --> <property name="src.java" value="${project.root}/${rootrel.src.java}" /> + <property name="src.junit" value="${project.root}/${rootrel.src.junit}" /> <property name="src.c" value="${project.root}/${rootrel.src.c}" /> <property name="build" value="${project.root}/${rootrel.build.jogl}" /> <property name="tempdir" value="${project.root}/build-temp" /> @@ -313,6 +321,8 @@ <property name="obj.jogl" value="${project.root}/${rootrel.obj.jogl}" /> <property name="obj.cg" value="${project.root}/${rootrel.obj.cg}" /> + <property name="all.so.dir" value="${gluegen.so.dir}:${nativewindow.so.dir}:${obj}:${newt.so.dir}" /> + <!-- The GL headers from which Java files are generated --> <property name="config" value="${make}/config/jogl" /> <property name="stub.includes" value="${make}/stub_includes" /> @@ -411,6 +421,7 @@ <property name="jogl.sdk.jar" value="${build}/jogl.sdk.jar" /> <property name="jogl.all.jar" value="${build}/jogl.all.jar"/> <property name="jogl.all-noawt.jar" value="${build}/jogl.all-noawt.jar"/> + <property name="jogl.test.jar" value="${build}/jogl.test.jar"/> <!-- The resulting CDC jogl.jar. --> <property name="jogl.core.cdc.jar" value="${build}/jogl.core.cdc.jar" /> @@ -428,6 +439,25 @@ <property name="jogl.util.fixedfuncemu.cdc.jar" value="${build}/jogl.util.fixedfuncemu.cdc.jar" /> <property name="jogl.all.cdc.jar" value="${build}/jogl.all.cdc.jar"/> + <path id="jogl_junit.compile.classpath"> + <pathelement location="${junit.jar}" /> + <pathelement location="${gluegen-rt.jar}" /> + <pathelement location="${nativewindow.core.jar}" /> + <pathelement location="${nativewindow.x11.jar}" /> + <pathelement location="${nativewindow.awt.jar}" /> + <pathelement location="${jogl.all.jar}" /> + </path> + + <path id="jogl_junit.run.classpath"> + <pathelement location="${junit.jar}" /> + <pathelement location="${gluegen-rt.jar}" /> + <pathelement location="${nativewindow.core.jar}" /> + <pathelement location="${nativewindow.x11.jar}" /> + <pathelement location="${nativewindow.awt.jar}" /> + <pathelement location="${jogl.all.jar}" /> + <pathelement location="${jogl.test.jar}" /> + </path> + <!-- The javadoc dirs. --> <property name="javadoc" value="${project.root}/javadoc_jogl_public" /> <property name="javadoc.spec" value="${project.root}/javadoc_jogl_spec" /> @@ -2041,9 +2071,52 @@ <!-- ================================================================== --> <!-- + - Build/run junit. + --> + <target name="junit.compile"> + <!-- Perform the junit pass Java compile --> + <javac destdir="${classes}" + source="${junit.sourcelevel}" + fork="yes" + memoryMaximumSize="${javac.memorymax}" + debug="${javacdebug}" debuglevel="${javacdebuglevel}"> + <classpath refid="jogl_junit.compile.classpath"/> + <src path="${src.junit}" /> + </javac> + <jar destfile="${jogl.test.jar}" filesonly="true"> + <fileset dir="${classes}"> + <include name="com/jogamp/opengl/test/**" /> + </fileset> + </jar> + </target> + + <target name="junit.run" depends="declare.common"> + <condition property="system.env.library.path" + value="LD_LIBRARY_PATH"> + <not> + <isset property="isWindows"/> + </not> + </condition> + <condition property="system.env.library.path" + value="PATH"> + <isset property="isWindows"/> + </condition> + + <!-- Perform the junit pass Java compile --> + <java fork="true" + classname="org.junit.runner.JUnitCore" + failonerror="true"> + <env key="${system.env.library.path}" path="${all.so.dir}"/> + <arg value="com.jogamp.opengl.test.junit.texture.awt.Texture1"/> + <classpath refid="jogl_junit.run.classpath"/> + </java> + </target> + + <!-- ================================================================== --> + <!-- - Build everything. --> - <target name="all" description="Build JOGL JAR file(s) and native libraries." depends="load.user.properties,init,jar,c.build.jogl,generate.version.txt" /> + <target name="all" description="Build JOGL JAR file(s) and native libraries." depends="load.user.properties,init,jar,c.build.jogl,generate.version.txt,junit.compile" /> <target name="setup-version-RI" if="jogl.ri"> <property name="tmp.version" value="${jogl_base_version}" /> diff --git a/make/build.xml b/make/build.xml index b3a77945c..b8b3872ca 100644 --- a/make/build.xml +++ b/make/build.xml @@ -74,6 +74,10 @@ <ant antfile="${jogl.build.xml}" dir="${jogl.make.dir}" target="all" inheritAll="false"/> </target> + <target name="junit.run.jogl" depends="init"> + <ant antfile="${jogl.build.xml}" dir="${jogl.make.dir}" target="junit.run" inheritAll="false"/> + </target> + <target name="build.newt" depends="init"> <ant antfile="${newt.build.xml}" dir="${newt.make.dir}" target="all" inheritAll="false"/> </target> @@ -178,6 +182,8 @@ <target name="all" description="Build nativewindow, jogl and newt projects" depends="init,build.nativewindow,build.jogl,build.newt,one-lib-dir,developer-zip-archive,source-archive" /> + <target name="junit.run" description="Run JUNIT tests in nativewindow, jogl and newt projects" depends="init,junit.run.jogl" /> + <target name="clean" depends="init"> <ant antfile="${nativewindow.build.xml}" dir="${nativewindow.make.dir}" target="clean" inheritAll="false"/> <ant antfile="${jogl.build.xml}" dir="${jogl.make.dir}" target="clean" inheritAll="false"/> diff --git a/make/lib/gluegen.compiler.linux-32bit.xml b/make/lib/gluegen.compiler.linux-32bit.xml new file mode 100644 index 000000000..344d9da27 --- /dev/null +++ b/make/lib/gluegen.compiler.linux-32bit.xml @@ -0,0 +1,31 @@ +<?xml version="1.0" encoding="UTF-8"?> + +<!-- + This is an example of how to add custom compiler/linker + arguments for a crosscompiler. + + You can use such files with setting the property 'gluegen.user.compiler.file', ie: + + -Dgluegen.user.compiler.file=`pwd`/lib/gluegen.compiler.xml + + or by having such file in your home directory, ie: + + ~/gluegen.compiler.xml + --> + +<project name="GlueGen-cpptasks" basedir="." > + +<target name="gluegen.cpptasks.configure.compiler" depends="setup.java.home.dir"> + <compiler id="compiler.cfg.linux" name="gcc"> + <compilerarg value="-m32" /> + <compilerarg value="-Wall" /> + <defineset> + <define name="LINUX" /> + </defineset> + </compiler> + + <linker id="linker.cfg.linux" name="gcc"> + <linkerarg value="-m32" /> + </linker> +</target> +</project> diff --git a/make/make.jogl.all.linux-x86.sh b/make/make.jogl.all.linux-x86.sh index 081d8328b..5387cf97a 100644 --- a/make/make.jogl.all.linux-x86.sh +++ b/make/make.jogl.all.linux-x86.sh @@ -17,6 +17,7 @@ fi # -Djogl.cg=1 -Dx11.cg.lib=../../lib-linux-x86 \ ant \ + -Dgluegen.user.compiler.file=`pwd`/lib/gluegen.compiler.linux-32bit.xml \ -Dbuild.noarchives=true \ -Djogl.cg=1 -Dx11.cg.lib=../../lib-linux-x86 \ -Drootrel.build=build-x86 \ diff --git a/make/make.jogl.cdcfp.linux-x86.sh b/make/make.jogl.cdcfp.linux-x86.sh index 4a2241669..d212bd81d 100644 --- a/make/make.jogl.cdcfp.linux-x86.sh +++ b/make/make.jogl.cdcfp.linux-x86.sh @@ -15,6 +15,7 @@ fi BUILD_SUBDIR=build-cdcfp-x86 ant -v \ + -Dgluegen.user.compiler.file=`pwd`/lib/gluegen.compiler.linux-32bit.xml \ -Dbuild.noarchives=true \ -Drootrel.build=$BUILD_SUBDIR \ -Dsetup.cdcfp=true \ |