diff options
Diffstat (limited to 'make')
-rwxr-xr-x | make/build.xml | 41 | ||||
-rwxr-xr-x | make/gluegen-cpptasks.xml | 31 | ||||
-rwxr-xr-x | make/gluegen-properties.xml | 34 | ||||
-rw-r--r-- | make/make.gluegen.all.linux-x86.sh | 13 | ||||
-rw-r--r-- | make/make.gluegen.all.linux-x86_64.sh | 12 | ||||
-rw-r--r-- | make/runtest-cvm.bat | 8 | ||||
-rw-r--r-- | make/runtest-cvm.sh | 19 | ||||
-rw-r--r-- | make/runtest.sh | 16 |
8 files changed, 120 insertions, 54 deletions
diff --git a/make/build.xml b/make/build.xml index cc538ae..9d56682 100755 --- a/make/build.xml +++ b/make/build.xml @@ -18,16 +18,7 @@ <available property="antlr.jar" file="/usr/share/java/antlr.jar" value="/usr/share/java/antlr.jar"/> - <target name="load.user.properties" unless="user.properties.file"> - <!-- Load the user specified properties file that defines various host - - specific paths. The user will be notified if this is does not - - exist. --> - <property name="user.properties.file" value="${user.home}/gluegen.properties" /> - <property file="${user.properties.file}" /> - <echo message="Loaded ${user.properties.file}." /> - <fail message="antlr.jar was not specified in gluegen.properties. Please see README.txt for instructions" unless="antlr.jar"/> - <echo message="antlr.jar=${antlr.jar}" /> - </target> + <import file="gluegen-cpptasks.xml" /> <condition property="rootrel.build" value="build"> <not> @@ -55,7 +46,7 @@ <copy file="../src/java/com/sun/gluegen/runtime/PointerBuffer.java.javame_cdc_fp" tofile="${src.generated.java-cdc}/com/sun/gluegen/runtime/PointerBuffer.java" /> </target> - <target name="init" depends="load.user.properties,setup-excludes-1,setup-excludes-2"> + <target name="init" depends="gluegen.properties.load.user,setup-excludes-1,setup-excludes-2"> <!-- Declare all paths and user defined variables. --> <property name="javac.bootclasspath-cdc.jar" value="lib/cdc_fp.jar" /> @@ -141,7 +132,6 @@ the source tree. --> <property name="gluegen.root" value="../" /> - <import file="gluegen-cpptasks.xml" /> <target name="generate.nativelibrary.sources" depends="init" > <!-- Define the appropriate include paths --> <dirset id="stub.includes.fileset.windows" dir="."> @@ -187,11 +177,11 @@ <!-- - Set up java.home.dir appropriately on all platforms. --> - <target name="setup.java.home.dir.nonmacosx" depends="load.user.properties" unless="isOSX"> + <target name="setup.java.home.dir.nonmacosx" depends="gluegen.properties.load.user" unless="isOSX"> <!-- java home dir is up one directory as java.home points to '<java-install-dir>/jre' --> <property name="java.home.dir" value="${java.home}/.." /> </target> - <target name="setup.java.home.dir.macosx" depends="load.user.properties" if="isOSX"> + <target name="setup.java.home.dir.macosx" depends="gluegen.properties.load.user" if="isOSX"> <property name="java.home.dir" value="/System/Library/Frameworks/JavaVM.framework/Home" /> </target> <target name="setup.java.home.dir" depends="setup.java.home.dir.nonmacosx,setup.java.home.dir.macosx" > @@ -240,7 +230,7 @@ </target> <target name="declare.win32" depends="declare.win32.vc6,declare.win32.vc7,declare.win32.vc8,declare.win32.vc8_x64,declare.win32.vc9,declare.win32.mingw" if="isWindows" > - <property name="c.src.dir" value="windows" /> + <property name="c.src.dir.os" value="windows" /> <property name="java.includes.dir.platform" value="${java.includes.dir}/win32" /> </target> @@ -263,7 +253,7 @@ </target> <target name="declare.linux" depends="declare.linux.x86,declare.linux.amd64,declare.linux.ia64" if="isLinux" > - <property name="c.src.dir" value="unix" /> + <property name="c.src.dir.os" value="unix" /> <property name="java.includes.dir.platform" value="${java.includes.dir}/linux" /> </target> @@ -286,7 +276,7 @@ </target> <target name="declare.solaris" depends="declare.solaris32,declare.solarisSparcv9,declare.solarisAMD64" if="isSolaris" > - <property name="c.src.dir" value="unix" /> + <property name="c.src.dir.os" value="unix" /> <property name="java.includes.dir.platform" value="${java.includes.dir}/solaris" /> </target> @@ -294,7 +284,7 @@ <echo message="MacOSX" /> <property name="compiler.cfg.id" value="compiler.cfg.macosx" /> <property name="linker.cfg.id" value="linker.cfg.macosx" /> - <property name="c.src.dir" value="macosx" /> + <property name="c.src.dir.os" value="macosx" /> <property name="java.includes.dir.platform" value="/System/Library/Frameworks/JavaVM.framework/Versions/CurrentJDK/Headers" /> </target> @@ -302,7 +292,7 @@ <echo message="FreeBSD" /> <property name="compiler.cfg.id" value="compiler.cfg.freebsd" /> <property name="linker.cfg.id" value="linker.cfg.linux" /> - <property name="c.src.dir" value="unix" /> + <property name="c.src.dir.os" value="unix" /> <property name="java.includes.dir.freebsd" value="${java.includes.dir}/freebsd" /> </target> @@ -310,7 +300,7 @@ <echo message="HP-UX" /> <property name="compiler.cfg.id" value="compiler.cfg.hpux" /> <property name="linker.cfg.id" value="linker.cfg.hpux" /> - <property name="c.src.dir" value="unix" /> + <property name="c.src.dir.os" value="unix" /> <property name="java.includes.dir.hpux" value="${java.includes.dir}/hp-ux" /> </target> @@ -318,7 +308,7 @@ <!-- Common properties --> <property name="java.includes.dir" value="${java.home.dir}/include" /> <!-- NOTE: this MUST be relative for FileSet --> - <property name="c.compiler.src.files" value="src/native/${c.src.dir}/*.c" /> + <property name="c.compiler.src.files.os" value="src/native/${c.src.dir.os}/*.c" /> <property name="output.lib.name" value="gluegen-rt" /> </target> @@ -340,7 +330,7 @@ </target> <target name="c.build" depends="c.configure" unless="build.javaonly" > - <fail message="Requires '${c.compiler.src.files}'" unless="c.compiler.src.files"/> + <fail message="Requires '${c.compiler.src.files.os}'" unless="c.compiler.src.files.os"/> <fail message="Requires '${compiler.cfg.id}'" unless="compiler.cfg.id"/> <fail message="Requires '${linker.cfg.id}'" unless="linker.cfg.id"/> <fail message="Requires '${output.lib.name}'" unless="output.lib.name"/> @@ -356,7 +346,9 @@ <mkdir dir="${build}/obj" /> - <echo message="Compiling ${c.compiler.src.files}" /> + <property name="c.compiler.src.files.common" value="src/native/common/*.c" /> + + <echo message="Compiling ${c.compiler.src.files.os} ${c.compiler.src.files.common}" /> <echo message="user.dir=${user.dir}" /> <cc outtype="shared" @@ -378,7 +370,8 @@ <fileset dir=".."> <patternset> - <include name="${c.compiler.src.files}" /> + <include name="${c.compiler.src.files.os}" /> + <include name="${c.compiler.src.files.common}" /> </patternset> </fileset> diff --git a/make/gluegen-cpptasks.xml b/make/gluegen-cpptasks.xml index 32cabbc..d3f24b6 100755 --- a/make/gluegen-cpptasks.xml +++ b/make/gluegen-cpptasks.xml @@ -11,22 +11,8 @@ - directory (e.g., from which the parent project's build.xml is being - executed) to the top of the checked-out GlueGen workspace. - - - This Ant project file depends on the following properties being set - - externally: - - - - win32.c.compiler (required to be set on Windows): - - one of "vc6", "vc7", "vc8", or "mingw". - - c.compiler.debug: - - set to "true" if debug version of the compiled - - C code is desired. - - macosppc: - - set to "true" if ppc universal / fat binaries are desired - - on Mac OS X. Requires support for cross-compilation from the - - underlying C compiler. Note: Unsupported on Snow Leopard! - - macosx64: - - set to "true" if 64-bit universal / fat binaries are desired - - on Mac OS X. Requires support for cross-compilation from the - - underlying C compiler. + - This Ant project file depends on properties being set + - via gluegen.properties, see: gluegen-properties.xml ! - - The gluegen.cpptasks.detect.os target sets the following - properties appropriately. They are only set to "true" if the OS/CPU @@ -132,6 +118,10 @@ - <msvc.manifest objdir="${obj}" dllname="gluegen-rt" /> --> <project name="GlueGen-cpptasks" basedir="."> + + <!-- import properties --> + <import file="gluegen-properties.xml" /> + <!-- import cpptasks --> <typedef resource="net/sf/antcontrib/cpptasks/antlib.xml" classpath="${gluegen.root}/make/lib/cpptasks.jar"/> @@ -139,7 +129,7 @@ <import file="${user.home}/gluegen.compiler.xml" optional="true" /> <!-- Detect OS and compiler configuration --> - <target name="gluegen.cpptasks.detect.os.1" unless="gluegen.cpptasks.detected.os"> + <target name="gluegen.cpptasks.detect.os.1" depends="gluegen.properties.load.user" unless="gluegen.cpptasks.detected.os"> <condition property="isOSX"> <and> <os family="mac"/> @@ -286,6 +276,8 @@ <echo message="LinuxIA64=${isLinuxIA64}" /> <echo message="LinuxX86=${isLinuxX86}" /> <echo message="OS X=${isOSX}" /> + <echo message="OS X PPC=${use.macosppc}" /> + <echo message="OS X x64=${use.macosx64}" /> <echo message="Solaris=${isSolaris}" /> <echo message="Solaris32Bit=${isSolaris32Bit}" /> <echo message="SolarisSparc=${isSolarisSparc}" /> @@ -364,7 +356,7 @@ <target name="gluegen.cpptasks.detect.os.2" depends="gluegen.cpptasks.detect.os.freebsd,gluegen.cpptasks.detect.os.hpux,gluegen.cpptasks.detect.os.linux,gluegen.cpptasks.detect.os.osx,gluegen.cpptasks.detect.os.solaris,gluegen.cpptasks.detect.os.unix,gluegen.cpptasks.detect.os.windows" unless="gluegen.cpptasks.detected.os.2"> </target> - <target name="gluegen.cpptasks.detect.os" depends="gluegen.cpptasks.detect.os.1,gluegen.cpptasks.detect.os.2"> + <target name="gluegen.cpptasks.detect.os" depends="gluegen.properties.load.user,gluegen.cpptasks.detect.os.1,gluegen.cpptasks.detect.os.2"> <property name="gluegen.cpptasks.detected.os" value="true" /> <property name="gluegen.cpptasks.detected.os.2" value="true" /> </target> @@ -517,6 +509,9 @@ </compiler> <compiler id="compiler.cfg.win32.mingw" name="gcc"> + <compilerarg value="-g" if="c.compiler.use-debug"/> + <compilerarg value="-O0" if="c.compiler.use-debug"/> + <compilerarg value="-O2" unless="c.compiler.use-debug"/> <defineset> <define name="_DEBUG" if="c.compiler.use-debug"/> <define name="DEBUG" if="c.compiler.use-debug"/> diff --git a/make/gluegen-properties.xml b/make/gluegen-properties.xml new file mode 100755 index 0000000..834aae7 --- /dev/null +++ b/make/gluegen-properties.xml @@ -0,0 +1,34 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + - This Ant project file depends on the following properties being set + - externally: + - + - win32.c.compiler (required to be set on Windows): + - one of "vc6", "vc7", "vc8", or "mingw". + - c.compiler.debug: + - set to "true" if debug version of the compiled + - C code is desired. + - macosppc: + - set to "true" if ppc universal / fat binaries are desired + - on Mac OS X. Requires support for cross-compilation from the + - underlying C compiler. Note: Unsupported on Snow Leopard! + - macosx64: + - set to "true" if 64-bit universal / fat binaries are desired + - on Mac OS X. Requires support for cross-compilation from the + - underlying C compiler. + - + --> +<project name="GlueGen-properties" basedir="."> + + <target name="gluegen.properties.load.user" unless="gluegen.user.properties.file"> + <!-- Load the user specified properties file that defines various host + - specific paths. The user will be notified if this is does not + - exist. --> + <property name="gluegen.user.properties.file" value="${user.home}/gluegen.properties" /> + <property file="${gluegen.user.properties.file}" /> + <echo message="Loaded ${gluegen.user.properties.file}." /> + <fail message="antlr.jar was not specified in gluegen.properties. Please see README.txt for instructions" unless="antlr.jar"/> + <echo message="antlr.jar=${antlr.jar}" /> + </target> + +</project> diff --git a/make/make.gluegen.all.linux-x86.sh b/make/make.gluegen.all.linux-x86.sh index 58c4215..87352c3 100644 --- a/make/make.gluegen.all.linux-x86.sh +++ b/make/make.gluegen.all.linux-x86.sh @@ -3,12 +3,13 @@ . ../../setenv-build-jogl-x86.sh # -Dc.compiler.debug=true +# -Dgluegen.cpptasks.detected.os=true \ +# -DisUnix=true \ +# -DisLinux=true \ +# -DisLinuxX86=true \ +# -DisX11=true \ -ant -v \ +ant \ -Drootrel.build=build-x86 \ - -Dgluegen.cpptasks.detected.os=true \ - -DisUnix=true \ - -DisLinux=true \ - -DisLinuxX86=true \ - -DisX11=true \ + -Dos.arch=x86 \ $* 2>&1 | tee make.gluegen.all.linux-x86.log diff --git a/make/make.gluegen.all.linux-x86_64.sh b/make/make.gluegen.all.linux-x86_64.sh index a787c57..98ef4ed 100644 --- a/make/make.gluegen.all.linux-x86_64.sh +++ b/make/make.gluegen.all.linux-x86_64.sh @@ -3,12 +3,12 @@ . ../../setenv-build-jogl-x86_64.sh # -Dc.compiler.debug=true +# -Dgluegen.cpptasks.detected.os=true \ +# -DisUnix=true \ +# -DisLinux=true \ +# -DisLinuxAMD64=true \ +# -DisX11=true \ -ant -v \ +ant \ -Drootrel.build=build-x86_64 \ - -Dgluegen.cpptasks.detected.os=true \ - -DisUnix=true \ - -DisLinux=true \ - -DisLinuxAMD64=true \ - -DisX11=true \ $* 2>&1 | tee make.gluegen.all.linux-x86_64.log diff --git a/make/runtest-cvm.bat b/make/runtest-cvm.bat new file mode 100644 index 0000000..8178032 --- /dev/null +++ b/make/runtest-cvm.bat @@ -0,0 +1,8 @@ +set CVM_HOME=c:\cvm + +set JAR_DIR=jogl\lib +set LIB_DIR=jogl\lib + +%CVM_HOME%\bin\cvm "-Djava.awt.headless=true" "-Dsun.boot.library.path=%LIB_DIR%" "-Xbootclasspath/a:gluegen\classes-cdc" com.sun.gluegen.test.TestPointerBufferEndian +%CVM_HOME%\bin\cvm "-Djava.awt.headless=true" "-Dsun.boot.library.path=%LIB_DIR%" "-Xbootclasspath/a:gluegen\classes-cdc" com.sun.gluegen.test.TestStructAccessorEndian + diff --git a/make/runtest-cvm.sh b/make/runtest-cvm.sh new file mode 100644 index 0000000..268cf6e --- /dev/null +++ b/make/runtest-cvm.sh @@ -0,0 +1,19 @@ +#! /bin/sh + +CVM=$1 +shift + +builddir=$1 +shift + +if [ ! -x "$CVM" -o -z "$builddir" ] ; then + echo Usage $0 CVM-Binary build-dir + exit 1 +fi + +echo com.sun.gluegen.test.TestPointerBufferEndian +$CVM -Dsun.boot.library.path=$builddir/obj -Xbootclasspath/a:$builddir/classes-cdc com.sun.gluegen.test.TestPointerBufferEndian +echo +echo com.sun.gluegen.test.TestStructAccessorEndian +$CVM -Dsun.boot.library.path=$builddir/obj -Xbootclasspath/a:$builddir/classes-cdc com.sun.gluegen.test.TestStructAccessorEndian +echo diff --git a/make/runtest.sh b/make/runtest.sh new file mode 100644 index 0000000..8001c82 --- /dev/null +++ b/make/runtest.sh @@ -0,0 +1,16 @@ +#! /bin/sh + +builddir=$1 +shift + +if [ -z "$builddir" ] ; then + echo Usage $0 build-dir + exit 1 +fi + +echo com.sun.gluegen.test.TestPointerBufferEndian +java -Djava.library.path=$builddir/obj -classpath $builddir/classes com.sun.gluegen.test.TestPointerBufferEndian +echo +echo com.sun.gluegen.test.TestStructAccessorEndian +java -Djava.library.path=$builddir/obj -classpath $builddir/classes com.sun.gluegen.test.TestStructAccessorEndian +echo |