diff options
author | Sven Gothel <[email protected]> | 2010-03-25 22:49:16 +0100 |
---|---|---|
committer | Sven Gothel <[email protected]> | 2010-03-25 22:49:16 +0100 |
commit | 9a1b43908b3bb1cd5dd5fadafb3b23d6e9a2cf46 (patch) | |
tree | a73f826bae48eaf9132403511e9f20742463e1a9 /make | |
parent | 3a32650d4229f9b4ad1f527d9e30c24ddb69bb3f (diff) |
http://www.jogamp.org/bugzilla/show_bug.cgi?id=390
Adding 'plain' junit tests.
Plain stands for the simple processing of:
ant.junit.compile: gluegen -> java/c files, javac/cc, jar
ant.junit.run: junit batch run
Avoiding 'black magic', ie kicking off gluegen and ant-compilation
from within the junit tests.
Same methodology as the JOGL junit tests,
junit test sources are under 'src/junit'
This way, the migration to other platform tests might be easier,
as well as the we don't need to pass through ant properties (ant - junit - ant),
see 3a32650d4229f9b4ad1f527d9e30c24ddb69bb3f.
Diffstat (limited to 'make')
-rw-r--r-- | make/build-junit.xml | 256 | ||||
-rwxr-xr-x | make/build.xml | 8 | ||||
-rwxr-xr-x | make/gluegen-cpptasks-base.xml | 799 | ||||
-rw-r--r-- | make/gluegen-cpptasks-custom.xml | 50 | ||||
-rwxr-xr-x | make/gluegen-cpptasks.xml | 819 | ||||
-rw-r--r-- | make/gluegen.compiler.xml | 36 | ||||
-rw-r--r-- | make/lib/gluegen-cpptasks-linux-32bit.xml | 50 | ||||
-rw-r--r-- | make/lib/gluegen.compiler.linux-32bit.xml | 38 | ||||
-rw-r--r-- | make/make.gluegen.all.linux-x86.sh | 2 |
9 files changed, 1181 insertions, 877 deletions
diff --git a/make/build-junit.xml b/make/build-junit.xml new file mode 100644 index 0000000..34f0a66 --- /dev/null +++ b/make/build-junit.xml @@ -0,0 +1,256 @@ +<?xml version="1.0" encoding="UTF-8"?> + +<project name="GlueGenTest" basedir="."> + + <description>JUNIT Tests GlueGen</description> + + <!-- On jpackage.org-compatible systems, antlr.jar can be found in /usr/share/java --> + <available property="antlr.jar" file="/usr/share/java/antlr.jar" + value="/usr/share/java/antlr.jar"/> + + <property name="gluegen.root" value=".." /> + + <import file="gluegen-cpptasks.xml" /> + + <condition property="rootrel.build" value="build"> + <not> + <isset property="rootrel.build"/> + </not> + </condition> + + <target name="init" depends="gluegen.properties.load.user"> + + <!-- Call the external config validator script to make sure the config is ok and consistent --> + <ant antfile="validate-properties.xml" inheritall="true"/> + + <property name="project.root" value=".." /> + + <property name="test.base.dir" value="${project.root}/src/junit" /> + <property name="test.junit.rel" value="com/jogamp/gluegen/test/junit" /> + <property name="test.junit.dir" value="${test.base.dir}/${test.junit.rel}" /> + + <property name="test.dir" value="${project.root}/${rootrel.build}/test"/> + <property name="results" value="${test.dir}/results" /> + <property name="build" value="${test.dir}/build" /> + <property name="build.gen" value="${build}/gensrc"/> + <property name="build.java" value="${build}/classes"/> + <property name="build.obj" value="${build}/obj"/> + <property name="build.lib" value="${build}/natives"/> + + <property name="test.junit.rootrel" value="src/junit/${test.junit.rel}" /> + <property name="build.gen.rootrel" value="${rootrel.build}/test/build/gensrc"/> + + <mkdir dir="${test.dir}"/> + <mkdir dir="${results}"/> + <mkdir dir="${build}"/> + <mkdir dir="${build.gen}"/> + <mkdir dir="${build.java}"/> + <mkdir dir="${build.obj}"/> + <mkdir dir="${build.lib}"/> + + <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="junit.jar" value="${gluegen.root}/make/lib/junit-4.5.jar" /> + + <property name="gluegen-test.jar" value="${build}/gluegen-test.jar" /> + + <path id="gluegen.classpath"> + <pathelement location="${gluegen.jar}" /> + <pathelement location="${antlr.jar}" /> + </path> + + <path id="gluegen_rt.classpath"> + <pathelement location="${gluegen-rt.jar}" /> + </path> + + <path id="junit.compile.classpath"> + <pathelement location="${junit.jar}" /> + <pathelement location="${gluegen-rt.jar}" /> + </path> + + <path id="junit.run.classpath"> + <pathelement location="${junit.jar}" /> + <pathelement location="${gluegen-rt.jar}" /> + <pathelement location="${gluegen-test.jar}" /> + </path> + + <echo message="test.base.dir: ${test.base.dir} "/> + <echo message="test.junit.dir: ${test.junit.dir} "/> + <echo message="test.dir: ${test.dir} "/> + <echo message="results: ${results} "/> + <echo message="build: ${build} "/> + <echo message="build.gen: ${build.gen} "/> + <echo message="build.java: ${build.java} "/> + <echo message="build.obj: ${build.obj} "/> + <echo message="build.lib: ${build.lib} "/> + + <!-- Add the GlueGen and BuildStaticGLInfo tasks to ANT --> + <taskdef name="gluegen" classname="com.sun.gluegen.ant.GlueGenTask" + classpathref="gluegen.classpath" /> + <taskdef name="staticglgen" classname="com.sun.gluegen.ant.StaticGLGenTask" + classpathref="gluegen.classpath" /> + </target> + + <target name="java.build" depends="java.generate"> + <echo message=" - - - compiling all java files - - - "/> + + <javac destdir="${build.java}" + source="1.5" debug="true" + fork="yes" + verbose="true" + debuglevel="lines,vars,source"> + <classpath refid="junit.compile.classpath"/> + <src path="${test.base.dir}"/> + <src path="${build.gen}" /> + </javac> + + <jar destfile="${gluegen-test.jar}"> + <fileset dir="${build.java}"> + <include name="${test.junit.rel}/*.class"/> + </fileset> + </jar> + </target> + + <target name="c.configure" depends="gluegen.cpptasks.detect.os,gluegen.cpptasks.setup.compiler"> + <property name="compiler.cfg.id" value="${compiler.cfg.id.base}" /> + <property name="linker.cfg.id" value="${linker.cfg.id.base}" /> + </target> + + <target name="rename.mingw.dll" if="isMingW"> + <move file="${src}" tofile="${dest}" /> + </target> + + <target name="rename.dylib" if="isOSX"> + <move file="${src}" tofile="${dest}" /> + </target> + + <macrodef name="c.build"> + <attribute name="c.compiler.src.files" /> + <attribute name="compiler.cfg.id" /> + <attribute name="linker.cfg.id" /> + <attribute name="output.lib.name" /> + <sequential> + <echo message="Compiling @{output.lib.name}" /> + <echo message=" c.compiler.src.files @{c.compiler.src.files}" /> + <echo message=" compiler.cfg.id @{compiler.cfg.id}" /> + <echo message=" linker.cfg.id @{linker.cfg.id}" /> + <echo message=" output.lib.name @{output.lib.name}" /> + + <!-- NOTE: the value of the debug and optimise attributes will not be overridden if already set externally --> + <property name="c.compiler.debug" value="false" /> + <!-- Optimise flags one of { none, size, speed, minimal, full, aggressive, extreme, unsafe } --> + <property name="c.compiler.optimise" value="none" /> + + <condition property="c.compiler.use-debug"><istrue value="${c.compiler.debug}"/></condition> + + <cc outtype="shared" + objdir="${build.obj}" + outfile="${build.lib}/@{output.lib.name}" + optimize="${c.compiler.optimise}" + debug="${c.compiler.debug}" + multithreaded="true" + exceptions="false" + rtti="false"> + + <fileset dir="${project.root}"><patternset refid="@{c.compiler.src.files}"/></fileset> + + <compiler extends="@{compiler.cfg.id}" > + <includepath path="${test.junit.dir}"/> + <includepath path="${build.gen}/native"/> + </compiler> + + <linker extends="@{linker.cfg.id}"> + <syslibset dir="${java.lib.dir.platform}" libs="jawt" if="@{output.lib.name}.useLibJAWT"/> + <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.lib}/lib@{output.lib.name}.dylib" /> + <param name="dest" value="${build.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.lib}/lib@{output.lib.name}.so" /> + <param name="dest" value="${build.lib}/@{output.lib.name}.dll" /> + </antcall> + </sequential> + </macrodef> + + <target name="junit.compile" depends="init, java.generate, java.build, c.build"/> + + <target name="junit.run" depends="init"> + <!-- Perform the junit tests--> + <mkdir dir="${results}"/> + <junit forkmode="once" showoutput="true" fork="true" haltonerror="true"> + <jvmarg value="-Djava.library.path=${build.lib}"/> + <jvmarg value="-Drootrel.build=${rootrel.build}"/> + <formatter usefile="false" type="plain"/> + <formatter usefile="true" type="xml"/> + <classpath refid="junit.run.classpath"/> + + <batchtest todir="${results}"> + <fileset dir="${build.java}"> + <include name="${test.junit.rel}/Test*"/> + </fileset> + <formatter usefile="false" type="brief"/> + <formatter usefile="true" type="xml"/> + </batchtest> + </junit> + </target> + + <!-- + + Hook all junit.test* .. + + --> + + <target name="java.generate" depends="junit.test1.java.generate"/> + + <target name="c.build" depends="c.configure, junit.test1.c.build" unless="build.javaonly" /> + + <!-- + + junit.test1 + + --> + + <target name="junit.test1.java.generate"> + <echo message=" - - - junit.test1.java.generate" /> + + <dirset id="stub.includes.fileset.test" dir="." includes="${test.junit.dir}/*" /> + + <gluegen src="${test.junit.dir}/test1-gluegen.c" + outputRootDir="${build.gen}" + config="${test.junit.dir}/test1-gluegen.cfg" + literalInclude="${test.junit.dir}" + includeRefid="stub.includes.fileset.test" + emitter="com.sun.gluegen.JavaEmitter"> + <!-- emitter="com.sun.gluegen.procaddress.ProcAddressEmitter" --> + <classpath refid="gluegen.classpath" /> + </gluegen> + </target> + + <target name="junit.test1.c.build" unless="build.javaonly" > + <patternset id="junit.test1.c.src.files"> + <include name="${test.junit.rootrel}/test1.c"/> + <include name="${build.gen.rootrel}/native/BindingTest1_JNI.c"/> + </patternset> + + <c.build c.compiler.src.files="junit.test1.c.src.files" + output.lib.name="test1" + compiler.cfg.id="${compiler.cfg.id}" + linker.cfg.id="${linker.cfg.id}"/> + </target> + + <!-- + + junit.test2 + + --> + +</project> diff --git a/make/build.xml b/make/build.xml index 2209d57..99ea011 100755 --- a/make/build.xml +++ b/make/build.xml @@ -598,4 +598,12 @@ </junit> </target> + <target name="junit.compile"> + <ant antfile="build-junit.xml" target="junit.compile"/> + </target> + + <target name="junit.run"> + <ant antfile="build-junit.xml" target="junit.run"/> + </target> + </project> diff --git a/make/gluegen-cpptasks-base.xml b/make/gluegen-cpptasks-base.xml new file mode 100755 index 0000000..7ebe96f --- /dev/null +++ b/make/gluegen-cpptasks-base.xml @@ -0,0 +1,799 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + - Ant project file which sets up cpptasks to compile native code + - generated by GlueGen for multiple supported platforms. This Ant + - project file is not intended to be executed standalone, but imported + - by other projects which use GlueGen to generate native code and + - need to compile that native code. + - + - Before importing this file, the property "gluegen.root" must be + - defined; this is the relative path from the current working + - directory (e.g., from which the parent project's build.xml is being + - executed) to the top of the checked-out GlueGen workspace. + - + - The gluegen.cpptasks.detect.os target sets the following + - properties appropriately. They are only set to "true" if the OS/CPU + - configuration is exactly as specified. + - + - isFreeBSD + - isHPUX + - isIA64 + - isLinux + - isLinuxAMD64 + - isLinuxIA64 + - isLinuxX86 + - isOSX + - isOSXPPC + - isOSXUniversal (if macosxfat=true) + - isSolaris + - isSolaris32Bit + - isSolarisAMD64 + - isSolarisSparc + - isSolarisSparcv9 + - isSolarisX86 + - isUnix + - isWindows + - isWindowsX86 + - isWindowsAMD64 + - isX11 + - + - isX11 is set if: !isWindows && !isOSX && !noX11 + - + - It also sets the following properties which are useful for + - building native library jar files for Java Web Start and + - understanding on what OS and architecture things are being built. + - + - os.and.arch (i.e., "windows-i586") + - native.library.suffix (i.e.., "so", "dll") + - + - The gluegen.cpptasks.setup.compiler target is the preferred target + - to depend upon in your build.xml. It depends on gluegen.cpptasks.detect.compiler + - and gluegen.cpptasks.configure.compiler, below, and also sets up the following + - compiler and linker IDs for the host platform: + - + - compiler.cfg.id.base + - linker.cfg.id.base + - + - and the following properties: + - + - java.home.dir : path to the JDK home directory + - java.includes.dir : path to the JNI headers (.../jdk/include) + - java.includes.dir.platform : path to the platform JNI headers (.../jdk/include/linux) + - java.lib.dir.platform : path to the Java library dir (libjawt.so, etc.) + - + - If your project requires only minimal changes to the compiler + - configuration, you may be able to simply refer to the + - gluegen.cpptasks.setup.compiler target and avoid any platform- + - specific compiler subclassing. + - + - The gluegen.cpptasks.detect.compiler target sets the following + - properties appropriately. They are only set to "true" if the OS/compiler + - configuration is exactly as specified. + - + - isVCFamily + - isVC6 + - isVC7 + - isVC8 + - isVC8_X64 + - isVC8Family (= isVC8 || isVC8_X64 || isVC9) (requires manifest in DLL) + - isVC9 + - isMingW + - + - The gluegen.cpptasks.configure.compiler target initializes several + - cpptasks compiler and linker configurations designed to support + - compilation of C code on multiple platforms. Generally if it is + - necessary to set up include paths, link paths, etc., then these + - compilers and linkers will need to be subclassed in sub-projects. + - However, at least the base-level configuration does not need to + - be replicated. + - + - The following compiler and linker IDs are defined by this target: + - + - compiler.cfg.linux + - compiler.cfg.linux.amd64 + - compiler.cfg.solaris + - compiler.cfg.solaris.sparcv9 + - compiler.cfg.solaris.amd64 + - compiler.cfg.win32.mingw + - compiler.cfg.win32.msvc + - compiler.cfg.macosx + - compiler.cfg.freebsd + - compiler.cfg.hpux + - linker.cfg.linux + - linker.cfg.linux.amd64 + - linker.cfg.solaris + - linker.cfg.solaris.sparcv9 + - linker.cfg.solaris.amd64 + - linker.cfg.win32.mingw + - linker.cfg.win32.msvc + - linker.cfg.macosx + - linker.cfg.hpux + - + - This project file also defines a macrodef called "msvc.manifest" + - which helps insert manifests into DLLs compiled with MSVC 8.0 and + - later. Example usage is: + - <msvc.manifest objdir="${obj}" dllname="gluegen-rt" /> + --> +<project name="GlueGen-cpptasks" basedir="."> + + <!-- Detect OS and compiler configuration --> + <target name="gluegen.cpptasks.detect.os.1" depends="gluegen.properties.load.user" unless="gluegen.cpptasks.detected.os"> + <condition property="isOSX"> + <and> + <os family="mac"/> + <os family="unix"/> + </and> + </condition> + <!-- Need a way to be able to disable the macosx64 property specification in a build.xml --> + <condition property="use.macosppc"> + <istrue value="${macosppc}" /> + </condition> + <condition property="use.macosx64"> + <istrue value="${macosx64}" /> + </condition> + <condition property="isUnix"> + <and> + <os family="unix" /> + <not> + <os family="mac" /> + </not> + </and> + </condition> + <condition property="isLinux"> + <os name="Linux" /> + </condition> + <condition property="isSolaris"> + <os name="SunOS" /> + </condition> + <condition property="isWindows"> + <os family="windows" /> + </condition> + <condition property="isWindowsX86"> + <and> + <istrue value="${isWindows}" /> + <or> + <os arch="i386" /> + <os arch="x86" /> + </or> + </and> + </condition> + <condition property="isWindowsAMD64"> + <and> + <istrue value="${isWindows}" /> + <os arch="amd64" /> + </and> + </condition> + <condition property="isFreeBSD"> + <os name="FreeBSD" /> + </condition> + <condition property="isHPUX"> + <os name="HP-UX" /> + </condition> + <condition property="isLinuxX86"> + <and> + <istrue value="${isLinux}" /> + <or> + <os arch="i386" /> + <os arch="x86" /> + </or> + </and> + </condition> + <condition property="isLinuxAMD64"> + <and> + <istrue value="${isLinux}" /> + <or> + <os arch="AMD64" /> + <os arch="x86_64" /> + </or> + </and> + </condition> + <condition property="isLinuxIA64"> + <and> + <istrue value="${isLinux}" /> + <os arch="IA64" /> + </and> + </condition> + <condition property="isIA64"> + <os arch="IA64" /> + </condition> + <condition property="isSolaris32Bit"> + <and> + <istrue value="${isSolaris}" /> + <or> + <os arch="i386" /> + <os arch="x86" /> + <os arch="sparc" /> + </or> + </and> + </condition> + <condition property="isSolarisSparc"> + <and> + <istrue value="${isSolaris}" /> + <os arch="sparc" /> + </and> + </condition> + <condition property="isSolarisSparcv9"> + <and> + <istrue value="${isSolaris}" /> + <os arch="sparcv9" /> + </and> + </condition> + <condition property="isSolarisAMD64"> + <and> + <istrue value="${isSolaris}" /> + <os arch="AMD64" /> + </and> + </condition> + <condition property="isSolarisX86"> + <and> + <istrue value="${isSolaris}" /> + <or> + <os arch="i386" /> + <os arch="x86" /> + </or> + </and> + </condition> + + <!-- Note: assumes X11 platform by default --> + <condition property="isX11"> + <and> + <isfalse value="${isWindows}" /> + <isfalse value="${isOSX}" /> + <isfalse value="${noX11}" /> + </and> + </condition> + + <condition property="solaris.cpu" value="sparc"> + <os name="SunOS" arch="sparc" /> + </condition> + <condition property="solaris.cpu" value="sparcv9"> + <os name="SunOS" arch="sparcv9" /> + </condition> + <condition property="solaris.cpu" value="i386"> + <os name="SunOS" arch="x86" /> + </condition> + <condition property="solaris.cpu" value="amd64"> + <os name="SunOS" arch="amd64" /> + </condition> + + <echo message="FreeBSD=${isFreeBSD}" /> + <echo message="HPUX=${isHPUX}" /> + <echo message="IA64=${isIA64}" /> + <echo message="Linux=${isLinux}" /> + <echo message="LinuxAMD64=${isLinuxAMD64}" /> + <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}" /> + <echo message="SolarisSparcv9=${isSolarisSparcv9}" /> + <echo message="SolarisAMD64=${isSolarisAMD64}" /> + <echo message="SolarisX86=${isSolarisX86}" /> + <echo message="Unix=${isUnix}" /> + <echo message="Windows=${isWindows}" /> + <echo message="X11=${isX11}" /> + </target> + + <target name="gluegen.cpptasks.detect.os.freebsd" unless="gluegen.cpptasks.detected.os.2" if="isFreeBSD"> + <property name="os.and.arch" value="freebsd-i586" /> + </target> + + <target name="gluegen.cpptasks.detect.os.hpux" unless="gluegen.cpptasks.detected.os.2" if="isHPUX"> + <property name="os.and.arch" value="hpux-hppa" /> + </target> + + <target name="gluegen.cpptasks.detect.os.linux.amd64" unless="gluegen.cpptasks.detected.os.2" if="isLinuxAMD64"> + <property name="os.and.arch" value="linux-amd64" /> + </target> + + <target name="gluegen.cpptasks.detect.os.linux.ia64" unless="gluegen.cpptasks.detected.os.2" if="isLinuxIA64"> + <property name="os.and.arch" value="linux-ia64" /> + </target> + + <target name="gluegen.cpptasks.detect.os.linux.x86" unless="gluegen.cpptasks.detected.os.2" if="isLinuxX86"> + <property name="os.and.arch" value="linux-i586" /> + </target> + + <target name="gluegen.cpptasks.detect.os.linux" depends="gluegen.cpptasks.detect.os.linux.amd64,gluegen.cpptasks.detect.os.linux.ia64,gluegen.cpptasks.detect.os.linux.x86" unless="gluegen.cpptasks.detected.os.2" /> + + <target name="gluegen.cpptasks.detect.os.osx" unless="gluegen.cpptasks.detected.os.2" if="isOSX"> + <property name="native.library.suffix" value="*lib" /> + <property name="native.library.suffix-cdc" value="so" /> + <property name="os.and.arch" value="macosx-universal" /> + </target> + + <target name="gluegen.cpptasks.detect.os.solaris.sparc" unless="gluegen.cpptasks.detected.os.2" if="isSolarisSparc"> + <property name="os.and.arch" value="solaris-sparc" /> + </target> + + <target name="gluegen.cpptasks.detect.os.solaris.sparcv9" unless="gluegen.cpptasks.detected.os.2" if="isSolarisSparcv9"> + <property name="os.and.arch" value="solaris-sparcv9" /> + </target> + + <target name="gluegen.cpptasks.detect.os.solaris.amd64" unless="gluegen.cpptasks.detected.os.2" if="isSolarisAMD64"> + <property name="os.and.arch" value="solaris-amd64" /> + </target> + + <target name="gluegen.cpptasks.detect.os.solaris.x86" unless="gluegen.cpptasks.detected.os.2" if="isSolarisX86"> + <property name="os.and.arch" value="solaris-i586" /> + </target> + + <target name="gluegen.cpptasks.detect.os.solaris" depends="gluegen.cpptasks.detect.os.solaris.sparc,gluegen.cpptasks.detect.os.solaris.sparcv9,gluegen.cpptasks.detect.os.solaris.amd64,gluegen.cpptasks.detect.os.solaris.x86" unless="gluegen.cpptasks.detected.os.2" /> + + <target name="gluegen.cpptasks.detect.os.unix" unless="gluegen.cpptasks.detected.os.2" if="isUnix"> + <property name="native.library.suffix" value="so" /> + <property name="native.library.suffix-cdc" value="so" /> + </target> + + <target name="gluegen.cpptasks.detect.os.windows.amd64" unless="gluegen.cpptasks.detected.os.2" if="isWindowsAMD64"> + <property name="os.and.arch" value="windows-amd64" /> + </target> + + <target name="gluegen.cpptasks.detect.os.windows.x86" unless="gluegen.cpptasks.detected.os.2" if="isWindowsX86"> + <property name="os.and.arch" value="windows-i586" /> + </target> + + <target name="gluegen.cpptasks.detect.os.windows" depends="gluegen.cpptasks.detect.os.windows.amd64,gluegen.cpptasks.detect.os.windows.x86" unless="gluegen.cpptasks.detected.os.2" if="isWindows"> + <property name="native.library.suffix" value="dll" /> + <property name="native.library.suffix-cdc" value="dll" /> + </target> + + <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.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> + + <!-- Detect compiler setup, in particular on Windows; separated + - out because this must sometimes be called late in the setup process + --> + <target name="gluegen.cpptasks.detect.compiler"> + <!-- Set up compiler selection on Windows --> + <condition property="isVCFamily"> + <and> + <istrue value="${isWindows}" /> + <not> + <equals arg1="${win32.c.compiler}" arg2="mingw" /> + </not> + </and> + </condition> + <condition property="isVC6"> + <and> + <istrue value="${isWindows}" /> + <equals arg1="${win32.c.compiler}" arg2="vc6" /> + </and> + </condition> + <condition property="isVC7"> + <and> + <istrue value="${isWindows}" /> + <equals arg1="${win32.c.compiler}" arg2="vc7" /> + </and> + </condition> + <condition property="isVC8"> + <and> + <istrue value="${isWindows}" /> + <equals arg1="${win32.c.compiler}" arg2="vc8" /> + </and> + </condition> + <condition property="isVC9"> + <and> + <istrue value="${isWindows}" /> + <equals arg1="${win32.c.compiler}" arg2="vc9" /> + </and> + </condition> + <condition property="isVC8_X64"> + <and> + <istrue value="${isWindows}" /> + <equals arg1="${win32.c.compiler}" arg2="vc8_x64" /> + </and> + </condition> + <condition property="isVC8Family"> + <or> + <istrue value="${isVC8}" /> + <istrue value="${isVC8_X64}" /> + <istrue value="${isVC9}" /> + </or> + </condition> + <condition property="isMingW"> + <and> + <istrue value="${isWindows}" /> + <equals arg1="${win32.c.compiler}" arg2="mingw" /> + </and> + </condition> + <condition property="WindowsFailure"> + <and> + <istrue value="${isWindows}" /> + <isfalse value="${isVC6}" /> + <isfalse value="${isVC7}" /> + <isfalse value="${isVC8}" /> + <isfalse value="${isVC8_X64}" /> + <isfalse value="${isVC9}" /> + <isfalse value="${isMingW}" /> + </and> + </condition> + <fail message="Must specify either win32.c.compiler in e.g. jogl.properties or use e.g. win32.vc6 build target" if="WindowsFailure" /> + <echo message="VC6=${isVC6}" /> + <echo message="VC7=${isVC7}" /> + <echo message="VC8=${isVC8}" /> + <echo message="VC8_X64=${isVC8_X64}" /> + <echo message="VC9=${isVC9}" /> + <echo message="MingW=${isMingW}" /> + + <!-- NOTE: the value of the debug and optimise attributes will not be overridden if already set externally --> + <property name="c.compiler.debug" value="false" /> + + <condition property="isVC7Debug"> + <and> + <istrue value="${isVC7}" /> + <istrue value="${c.compiler.debug}" /> + </and> + </condition> + <condition property="isVC8Debug"> + <and> + <istrue value="${isVC8}" /> + <istrue value="${c.compiler.debug}" /> + </and> + </condition> + <condition property="isVC9Debug"> + <and> + <istrue value="${isVC9}" /> + <istrue value="${c.compiler.debug}" /> + </and> + </condition> + </target> + + <!-- ================================================================== --> + <!-- + - Set up java.home.dir appropriately on all platforms. + --> + <target name="setup.java.home.dir.nonmacosx" 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" 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"> + <property name="java.includes.dir" value="${java.home.dir}/include" /> + </target> + + <target name="gluegen.cpptasks.configure.compiler" depends="setup.java.home.dir"> + <!-- compiler configuration --> + <compiler id="compiler.cfg.linux" name="gcc"> + <compilerarg value="-m32"/> + </compiler> + + <compiler id="compiler.cfg.linux.amd64" name="gcc"> + <compilerarg value="-fPIC"/> + <compilerarg value="-m64"/> + </compiler> + + <compiler id="compiler.cfg.linux64.mingw64" classname="net.sf.antcontrib.cpptasks.gcc.Gcc64CCompiler"> + <compilerarg value="-fPIC"/> + <compilerarg value="-m64"/> + </compiler> + + <compiler id="compiler.cfg.linux64.mingw32" classname="net.sf.antcontrib.cpptasks.gcc.Gcc32CCompiler"> + <compilerarg value="-m32"/> + </compiler> + +<!-- + <compiler id="compiler.cfg.solaris" name="suncc"> + <defineset> + <define name="SOLARIS" /> + </defineset> + </compiler> + + <compiler id="compiler.cfg.solaris.sparcv9" name="suncc"> + <compilerarg value="-fast" /> + <compilerarg value="-xchip=ultra" /> + <compilerarg value="-xarch=v9a" /> + <defineset> + <define name="SOLARIS" /> + </defineset> + </compiler> +--> +<!-- + <compiler id="compiler.cfg.solaris.amd64" name="suncc"> + <compilerarg value="-fast" /> + <compilerarg value="-xchip=opteron" /> + <compilerarg value="-xarch=amd64" /> + --> + <!-- <compilerarg value="-xcache=64/64/2:1024/64/16" /> --> +<!-- + <defineset> + <define name="SOLARIS" /> + </defineset> + </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"/> + <define name="NDEBUG" unless="c.compiler.use-debug"/> + + <define name="DBUILD_DLL" /> + <define name="_WINGDI_" /> + <define name="_STRICT_ANSI" /> + <define name="_JNI_IMPLEMENTATION_" /> + <define name="MINGW" /> + <define name="WINVER" value="0x0500"/> <!-- set windows version to >= Windows 2000 --> + <define name="_WIN32_WINNT" value="0x0500"/> <!-- set windows version to >= Windows 2000 --> + </defineset> + </compiler> + + <compiler id="compiler.cfg.win32.msvc" name="msvc"> + <compilerarg value="/W3"/> <!-- set warning level --> + <compilerarg value="/Ob1"/> <!-- inline only functions marked inline --> + <compilerarg value="/GF"/> <!-- enable string pooling --> + <compilerarg value="/Gy"/> <!-- enable function level linking --> + <compilerarg value="/GS" if="isVC7"/> <!-- buffer security checks --> + <compilerarg value="/Wp64" if="isVC7"/> <!-- detect 64-bit port problems --> + <compilerarg value="/RTCcsu" if="isVC7Debug"/> <!-- various runtime checks --> + <!-- Note: previous compiler options for VC7 were: + Debug: /MDd /Yd /GS /RTCs /RTCu /RTCc /W3 /Od /GF /EHsc /Zi /GS /Gy /Wp64 /Zi /D "_DEBUG" + Optimized: /MD /W3 /O2 /Ob1 /GF /EHsc /GS /Gy /Wp64 /D "NDEBUG" --> + <compilerarg value="/GS" if="isVC8"/> <!-- buffer security checks --> + <compilerarg value="/Wp64" if="isVC8"/> <!-- detect 64-bit port problems --> + <compilerarg value="/RTCcsu" if="isVC8Debug"/> <!-- various runtime checks --> + <compilerarg value="/NODEFAULTLIB:oldnames.lib" if="isVC8"/> <!-- library not available with VC8 --> + <compilerarg value="/GS" if="isVC9"/> <!-- buffer security checks --> + <compilerarg value="/RTCcsu" if="isVC9Debug"/> <!-- various runtime checks --> + <!--compilerarg value="/MT" if="isVC9"/--> <!-- static multithreaded - somehow overwritten by default /MD --> + + <defineset> + <define name="_DEBUG" if="c.compiler.use-debug"/> + <define name="DEBUG" if="c.compiler.use-debug"/> + <define name="NDEBUG" unless="c.compiler.use-debug"/> + </defineset> + </compiler> + + <compiler id="compiler.cfg.macosx" name="gcc"> + <!-- Note: Apple doesn't seem to provide ppc binaries on Snow Leopard --> + <compilerarg value="-arch" if="use.macosppc"/> + <compilerarg value="ppc" if="use.macosppc"/> + <compilerarg value="-arch" /> + <compilerarg value="i386" /> + <compilerarg value="-arch" if="use.macosx64"/> + <compilerarg value="x86_64" if="use.macosx64"/> + <!-- Note: Apple doesn't seem to provide ppc64 binaries on Leopard --> + <compilerarg value="-Wmost" /> + <compilerarg value="-ObjC" /> + <defineset> + <define name="macosx" /> + </defineset> + </compiler> + + <compiler id="compiler.cfg.freebsd" name="gcc"> + <defineset> + <define name="FREEBSD" /> + <define name="BSD" /> + </defineset> + </compiler> + + <compiler id="compiler.cfg.hpux" name="aCC"> + <!-- Interpret source as ANSI C89 (not C++) --> + <compilerarg value="-Ae"/> + <!-- Dereferences are performed with four-byte loads and stores. --> + <compilerarg value="+u4"/> + <!-- Suppress warnings: + 942: signed/unsigned assignment compatibility + 129: redeclarations in stub_includes --> + <compilerarg value="+W942,129"/> + <defineset> + <!-- aCC doesn't seem to define a generic system macro, a la + "__sun". The documentation claims it defines the following, + but don't seem to work: __HP_aCC, __LP64__, __RISC_0__. + HP-UX docs on JNI say to use the defs below + (http://www.hp.com/products1/unix/java/infolibrary/prog_guide/JNI_java2.html) --> + <!-- Single underscore prefix, as recommended by aCC docs... --> + <define name="_HPUX"/> + <define name="_POSIX_C_SOURCE" value="199506L"/> + </defineset> + </compiler> + + <!-- linker configuration --> + + <linker id="linker.cfg.linux" name="gcc"> + <linkerarg value="-m32"/> + </linker> + + <linker id="linker.cfg.linux.amd64" name="gcc"> + <linkerarg value="-m64"/> + </linker> + + <linker id="linker.cfg.linux64.mingw64" classname="net.sf.antcontrib.cpptasks.gcc.Gcc64Linker"> + <linkerarg value="-m64"/> + </linker> + + <linker id="linker.cfg.linux64.mingw32" classname="net.sf.antcontrib.cpptasks.gcc.Gcc32Linker"> + <linkerarg value="-m32"/> + <linkerarg value="-Wl,--kill-at" /> <!-- remove @ from function names --> + </linker> +<!-- + <linker id="linker.cfg.solaris" name="suncc"> + </linker> + + <linker id="linker.cfg.solaris.sparcv9" name="suncc"> + <linkerarg value="-xarch=v9a" /> + </linker> + + <linker id="linker.cfg.solaris.amd64" name="suncc"> + <linkerarg value="-xarch=amd64" /> + </linker> +--> + <linker id="linker.cfg.win32.mingw" name="gcc" incremental="false"> + <linkerarg value="-m32"/> + <linkerarg value="-Wl,--kill-at" /> <!-- remove @ from function names --> + </linker> + + <linker id="linker.cfg.win32.msvc" name="msvc" incremental="false"> + <linkerarg value="/OPT:REF,ICF" /> <!-- enable link-time optimisations --> + <linkerarg value="/SUBSYSTEM:WINDOWS" /> <!-- output is not a console app as uses WinMain entry point --> + <linkerarg value="/MACHINE:X86" if="isVC6" /> <!-- explicity set target platform --> + <linkerarg value="/MACHINE:X86" if="isVC7" /> <!-- explicity set target platform --> + <linkerarg value="/MACHINE:X86" if="isVC8" /> <!-- explicity set target platform --> + <linkerarg value="/MACHINE:X64" if="isVC8_X64"/> <!-- explicity set target platform (IX64) --> + <linkerarg value="/MACHINE:X86" if="isVC9" /> <!-- explicity set target platform --> + </linker> + + <linker id="linker.cfg.macosx" name="gcc"> + <linkerarg value="-arch" if="use.macosppc"/> + <linkerarg value="ppc" if="use.macosppc"/> + <linkerarg value="-arch" /> + <linkerarg value="i386" /> + <linkerarg value="-arch" if="use.macosx64"/> + <linkerarg value="x86_64" if="use.macosx64"/> + <!-- Note: Apple doesn't seem to provide ppc64 binaries on Leopard --> + </linker> + + <linker id="linker.cfg.hpux" name="aCC"> + </linker> + </target> + + <!-- ================================================================== --> + <!-- + - Platform specific declares. + --> + <target name="gluegen.cpptasks.declare.compiler.win32.vc6" if="isVC6"> + <echo message="Win32.VC6" /> + <property name="compiler.cfg.id.base" value="compiler.cfg.win32.msvc" /> + <property name="linker.cfg.id.base" value="linker.cfg.win32.msvc" /> + </target> + + <target name="gluegen.cpptasks.declare.compiler.win32.vc7" if="isVC7"> + <echo message="Win32.VC7" /> + <property name="compiler.cfg.id.base" value="compiler.cfg.win32.msvc" /> + <property name="linker.cfg.id.base" value="linker.cfg.win32.msvc" /> + </target> + + <target name="gluegen.cpptasks.declare.compiler.win32.vc8" if="isVC8"> + <echo message="Win32.VC8" /> + <property name="compiler.cfg.id.base" value="compiler.cfg.win32.msvc" /> + <property name="linker.cfg.id.base" value="linker.cfg.win32.msvc" /> + </target> + + <target name="gluegen.cpptasks.declare.compiler.win32.vc8_x64" if="isVC8_X64"> + <echo message="Win32.VC8_X64" /> + <property name="compiler.cfg.id.base" value="compiler.cfg.win32.msvc" /> + <property name="linker.cfg.id.base" value="linker.cfg.win32.msvc" /> + </target> + + <target name="gluegen.cpptasks.declare.compiler.win32.vc9" if="isVC9"> + <echo message="Win32.VC9" /> + <property name="compiler.cfg.id.base" value="compiler.cfg.win32.msvc" /> + <property name="linker.cfg.id.base" value="linker.cfg.win32.msvc" /> + </target> + + <target name="gluegen.cpptasks.declare.compiler.win32.mingw" if="isMingW"> + <echo message="Win32.MingW" /> + <property name="compiler.cfg.id.base" value="compiler.cfg.win32.mingw" /> + <property name="linker.cfg.id.base" value="linker.cfg.win32.mingw" /> + </target> + + <target name="gluegen.cpptasks.declare.compiler.win32" depends="gluegen.cpptasks.declare.compiler.win32.vc6,gluegen.cpptasks.declare.compiler.win32.vc7,gluegen.cpptasks.declare.compiler.win32.vc8,gluegen.cpptasks.declare.compiler.win32.vc8_x64,gluegen.cpptasks.declare.compiler.win32.vc9,gluegen.cpptasks.declare.compiler.win32.mingw" if="isWindows"> + <property name="java.includes.dir.platform" value="${java.includes.dir}/win32" /> + <property name="java.lib.dir.platform" value="${java.home.dir}/lib" /> + </target> + + <target name="gluegen.cpptasks.declare.compiler.linux.x86" if="isLinuxX86"> + <echo message="Linux.x86" /> + <property name="compiler.cfg.id.base" value="compiler.cfg.linux" /> + <property name="linker.cfg.id.base" value="linker.cfg.linux" /> + <property name="java.lib.dir.platform" value="${java.home.dir}/jre/lib/i386" /> + </target> + + <target name="gluegen.cpptasks.declare.compiler.linux.amd64" if="isLinuxAMD64"> + <echo message="Linux.AMD64" /> + <property name="compiler.cfg.id.base" value="compiler.cfg.linux.amd64" /> + <property name="linker.cfg.id.base" value="linker.cfg.linux.amd64" /> + <property name="java.lib.dir.platform" value="${java.home.dir}/jre/lib/amd64" /> + </target> + + <target name="gluegen.cpptasks.declare.compiler.linux.ia64" if="isLinuxIA64"> + <echo message="Linux.IA64" /> + <property name="compiler.cfg.id.base" value="compiler.cfg.linux" /> + <property name="linker.cfg.id.base" value="linker.cfg.linux" /> + <property name="java.lib.dir.platform" value="${java.home.dir}/jre/lib/ia64" /> + </target> + + <target name="gluegen.cpptasks.declare.compiler.linux" depends="gluegen.cpptasks.declare.compiler.linux.x86,gluegen.cpptasks.declare.compiler.linux.amd64,gluegen.cpptasks.declare.compiler.linux.ia64" if="isLinux"> + <property name="java.includes.dir.platform" value="${java.includes.dir}/linux" /> + </target> + + <target name="gluegen.cpptasks.declare.compiler.solaris32" if="isSolaris32Bit"> + <echo message="Solaris" /> + <property name="compiler.cfg.id.base" value="compiler.cfg.solaris" /> + <property name="linker.cfg.id.base" value="linker.cfg.solaris" /> + </target> + + <target name="gluegen.cpptasks.declare.compiler.solaris.sparcv9" if="isSolarisSparcv9"> + <echo message="SolarisSparcv9" /> + <property name="compiler.cfg.id.base" value="compiler.cfg.solaris.sparcv9" /> + <property name="linker.cfg.id.base" value="linker.cfg.solaris.sparcv9" /> + </target> + + <target name="gluegen.cpptasks.declare.compiler.solaris.amd64" if="isSolarisAMD64"> + <echo message="SolarisAMD64" /> + <property name="compiler.cfg.id.base" value="compiler.cfg.solaris.amd64" /> + <property name="linker.cfg.id.base" value="linker.cfg.solaris.amd64" /> + </target> + + <target name="gluegen.cpptasks.declare.compiler.solaris" depends="gluegen.cpptasks.declare.compiler.solaris32,gluegen.cpptasks.declare.compiler.solaris.sparcv9,gluegen.cpptasks.declare.compiler.solaris.amd64" if="isSolaris"> + <property name="java.includes.dir.platform" value="${java.includes.dir}/solaris" /> + <property name="java.lib.dir.platform" value="${java.home.dir}/jre/lib/${solaris.cpu}" /> + </target> + + <target name="gluegen.cpptasks.declare.compiler.macosx" if="isOSX"> + <echo message="MacOSX" /> + <property name="compiler.cfg.id.base" value="compiler.cfg.macosx" /> + <property name="linker.cfg.id.base" value="linker.cfg.macosx" /> + <property name="java.includes.dir.platform" value="/System/Library/Frameworks/JavaVM.framework/Versions/CurrentJDK/Headers" /> + <property name="java.lib.dir.platform" value="/System/Library/Frameworks/JavaVM.framework/Libraries" /> + </target> + + <target name="gluegen.cpptasks.declare.compiler.freebsd" if="isFreeBSD"> + <echo message="FreeBSD" /> + <property name="compiler.cfg.id.base" value="compiler.cfg.freebsd" /> + <property name="linker.cfg.id.base" value="linker.cfg.linux" /> + <property name="java.includes.dir.platform" value="${java.includes.dir}/freebsd" /> + <property name="java.lib.dir.platform" value="${java.home.dir}/jre/lib/i386" /> + </target> + + <target name="gluegen.cpptasks.declare.compiler.hpux" if="isHPUX"> + <echo message="HP-UX" /> + <property name="compiler.cfg.id.base" value="compiler.cfg.hpux" /> + <property name="linker.cfg.id.base" value="linker.cfg.hpux" /> + <property name="java.includes.dir.platform" value="${java.includes.dir}/hp-ux" /> + <property name="java.lib.dir.platform" value="${java.home.dir}/jre/lib/PA_RISC2.0" /> + </target> + + <target name="gluegen.cpptasks.declare.compiler" depends="gluegen.cpptasks.declare.compiler.win32,gluegen.cpptasks.declare.compiler.linux,gluegen.cpptasks.declare.compiler.solaris,gluegen.cpptasks.declare.compiler.macosx,gluegen.cpptasks.declare.compiler.freebsd,gluegen.cpptasks.declare.compiler.hpux" /> + + <target name="gluegen.cpptasks.setup.compiler" depends="gluegen.cpptasks.detect.compiler,gluegen.cpptasks.configure.compiler,gluegen.cpptasks.declare.compiler" /> + + <!-- ================================================================== --> + <!-- + - Helper macrodef for installing manifest in generated DLLs, needed for VC8 and later + --> + <macrodef name="msvc.manifest"> + <attribute name="objdir" /> + <attribute name="dllname" /> + <sequential> + <exec executable="mt"> + <arg value="-manifest"/> + <arg value="@{objdir}/@{dllname}.dll.manifest"/> + <arg value="-outputresource:@{objdir}/@{dllname}.dll;#2"/> + </exec> + </sequential> + </macrodef> +</project> diff --git a/make/gluegen-cpptasks-custom.xml b/make/gluegen-cpptasks-custom.xml new file mode 100644 index 0000000..c05033d --- /dev/null +++ b/make/gluegen-cpptasks-custom.xml @@ -0,0 +1,50 @@ +<?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-cpptasks.file', ie: + + -Dgluegen-cpptasks.file=`pwd`/lib/gluegen-cpptasks-linux-32bit.xml + + In case you want to compile for 32bit on a 64bit machine, + you might also need to set the 'os.arch' to 'x86'. + Example: gluegen/make/make.gluegen.all.linux-x86.sh + --> + +<project name="GlueGen-cpptasks" basedir="." > + +<import file="../gluegen-cpptasks-base.xml" optional="false" /> + +<target name="gluegen.cpptasks.configure.compiler" depends="setup.java.home.dir"> + <echo message="Custom forced compiler.cfg.linux, linker.cfg.linux" /> + <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> + +<target name="gluegen.cpptasks.declare.compiler" depends="setup.java.home.dir"> + <echo message="Custom forced Linux.x86" /> + <!-- + <property name="isLinux" value="true"/> + <property name="isLinuxX86" value="true"/> + --> + <property name="compiler.cfg.id.base" value="compiler.cfg.linux" /> + <property name="linker.cfg.id.base" value="linker.cfg.linux" /> + <property name="java.lib.dir.platform" value="${java.home.dir}/jre/lib/i386" /> + <property name="java.includes.dir.platform" value="${java.includes.dir}/linux" /> +</target> + +</project> + + diff --git a/make/gluegen-cpptasks.xml b/make/gluegen-cpptasks.xml index 1c905b7..e71805b 100755 --- a/make/gluegen-cpptasks.xml +++ b/make/gluegen-cpptasks.xml @@ -1,821 +1,36 @@ <?xml version="1.0" encoding="UTF-8"?> <!-- - - Ant project file which sets up cpptasks to compile native code - - generated by GlueGen for multiple supported platforms. This Ant - - project file is not intended to be executed standalone, but imported - - by other projects which use GlueGen to generate native code and - - need to compile that native code. - - - - Before importing this file, the property "gluegen.root" must be - - defined; this is the relative path from the current working - - 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 properties being set - - via gluegen.properties, see: gluegen-properties.xml and gluegen.properties ! - - + - Ant project file for setting up cpptasks (indirection). - You may overwrite the following compiler configuration - - as define below in 'gluegen.cpptasks.configure.compiler' - - with your custom one, see gluegen.compiler.xml ! - - - - The gluegen.cpptasks.detect.os target sets the following - - properties appropriately. They are only set to "true" if the OS/CPU - - configuration is exactly as specified. - - - - isFreeBSD - - isHPUX - - isIA64 - - isLinux - - isLinuxAMD64 - - isLinuxIA64 - - isLinuxX86 - - isOSX - - isOSXPPC - - isOSXUniversal (if macosxfat=true) - - isSolaris - - isSolaris32Bit - - isSolarisAMD64 - - isSolarisSparc - - isSolarisSparcv9 - - isSolarisX86 - - isUnix - - isWindows - - isWindowsX86 - - isWindowsAMD64 - - isX11 - - - - isX11 is set if: !isWindows && !isOSX && !noX11 - - - - It also sets the following properties which are useful for - - building native library jar files for Java Web Start and - - understanding on what OS and architecture things are being built. + - with your custom one, see 'gluegen-cpptasks-custom.xml'. - - - os.and.arch (i.e., "windows-i586") - - native.library.suffix (i.e.., "so", "dll") + - To use your custom cpptasks file, + - define the property 'gluegen-cpptasks.file'. - - - The gluegen.cpptasks.setup.compiler target is the preferred target - - to depend upon in your build.xml. It depends on gluegen.cpptasks.detect.compiler - - and gluegen.cpptasks.configure.compiler, below, and also sets up the following - - compiler and linker IDs for the host platform: - - - - compiler.cfg.id.base - - linker.cfg.id.base - - - - and the following properties: - - - - java.home.dir : path to the JDK home directory - - java.includes.dir : path to the JNI headers (.../jdk/include) - - java.includes.dir.platform : path to the platform JNI headers (.../jdk/include/linux) - - java.lib.dir.platform : path to the Java library dir (libjawt.so, etc.) - - - - If your project requires only minimal changes to the compiler - - configuration, you may be able to simply refer to the - - gluegen.cpptasks.setup.compiler target and avoid any platform- - - specific compiler subclassing. - - - - The gluegen.cpptasks.detect.compiler target sets the following - - properties appropriately. They are only set to "true" if the OS/compiler - - configuration is exactly as specified. - - - - isVCFamily - - isVC6 - - isVC7 - - isVC8 - - isVC8_X64 - - isVC8Family (= isVC8 || isVC8_X64 || isVC9) (requires manifest in DLL) - - isVC9 - - isMingW - - - - The gluegen.cpptasks.configure.compiler target initializes several - - cpptasks compiler and linker configurations designed to support - - compilation of C code on multiple platforms. Generally if it is - - necessary to set up include paths, link paths, etc., then these - - compilers and linkers will need to be subclassed in sub-projects. - - However, at least the base-level configuration does not need to - - be replicated. - - - - The following compiler and linker IDs are defined by this target: - - - - compiler.cfg.linux - - compiler.cfg.linux.amd64 - - compiler.cfg.solaris - - compiler.cfg.solaris.sparcv9 - - compiler.cfg.solaris.amd64 - - compiler.cfg.win32.mingw - - compiler.cfg.win32.msvc - - compiler.cfg.macosx - - compiler.cfg.freebsd - - compiler.cfg.hpux - - linker.cfg.linux - - linker.cfg.linux.amd64 - - linker.cfg.solaris - - linker.cfg.solaris.sparcv9 - - linker.cfg.solaris.amd64 - - linker.cfg.win32.mingw - - linker.cfg.win32.msvc - - linker.cfg.macosx - - linker.cfg.hpux - - - - This project file also defines a macrodef called "msvc.manifest" - - which helps insert manifests into DLLs compiled with MSVC 8.0 and - - later. Example usage is: - - <msvc.manifest objdir="${obj}" dllname="gluegen-rt" /> + - This Ant project file depends on properties being set + - via gluegen.properties, see: gluegen-properties.xml and gluegen.properties ! --> <project name="GlueGen-cpptasks" basedir="."> + <condition property="gluegen.root" value=".."> + <not> + <isset property="gluegen.root"/> + </not> + </condition> + + <!-- import properties --> <import file="gluegen-properties.xml" /> <!-- import cpptasks --> <typedef resource="net/sf/antcontrib/cpptasks/antlib.xml" classpath="${gluegen.root}/make/lib/cpptasks.jar;${gluegen.root}/make/lib/CppTasksGCCNamespaceHack.jar"/> - <condition property="gluegen.user.compiler.file" - value="${user.home}/gluegen.compiler.xml"> + <condition property="gluegen-cpptasks.file" + value="${gluegen.root}/make/gluegen-cpptasks-base.xml"> <not> - <isset property="gluegen.user.compiler.file" /> + <isset property="gluegen-cpptask.file" /> </not> </condition> - <available file="${gluegen.user.compiler.file}" property="gluegen.compiler.present"/> - <import file="${gluegen.user.compiler.file}" optional="true" /> - - <!-- Detect OS and compiler configuration --> - <target name="gluegen.cpptasks.detect.os.1" depends="gluegen.properties.load.user" unless="gluegen.cpptasks.detected.os"> - <condition property="isOSX"> - <and> - <os family="mac"/> - <os family="unix"/> - </and> - </condition> - <!-- Need a way to be able to disable the macosx64 property specification in a build.xml --> - <condition property="use.macosppc"> - <istrue value="${macosppc}" /> - </condition> - <condition property="use.macosx64"> - <istrue value="${macosx64}" /> - </condition> - <condition property="isUnix"> - <and> - <os family="unix" /> - <not> - <os family="mac" /> - </not> - </and> - </condition> - <condition property="isLinux"> - <os name="Linux" /> - </condition> - <condition property="isSolaris"> - <os name="SunOS" /> - </condition> - <condition property="isWindows"> - <os family="windows" /> - </condition> - <condition property="isWindowsX86"> - <and> - <istrue value="${isWindows}" /> - <or> - <os arch="i386" /> - <os arch="x86" /> - </or> - </and> - </condition> - <condition property="isWindowsAMD64"> - <and> - <istrue value="${isWindows}" /> - <os arch="amd64" /> - </and> - </condition> - <condition property="isFreeBSD"> - <os name="FreeBSD" /> - </condition> - <condition property="isHPUX"> - <os name="HP-UX" /> - </condition> - <condition property="isLinuxX86"> - <and> - <istrue value="${isLinux}" /> - <or> - <os arch="i386" /> - <os arch="x86" /> - </or> - </and> - </condition> - <condition property="isLinuxAMD64"> - <and> - <istrue value="${isLinux}" /> - <or> - <os arch="AMD64" /> - <os arch="x86_64" /> - </or> - </and> - </condition> - <condition property="isLinuxIA64"> - <and> - <istrue value="${isLinux}" /> - <os arch="IA64" /> - </and> - </condition> - <condition property="isIA64"> - <os arch="IA64" /> - </condition> - <condition property="isSolaris32Bit"> - <and> - <istrue value="${isSolaris}" /> - <or> - <os arch="i386" /> - <os arch="x86" /> - <os arch="sparc" /> - </or> - </and> - </condition> - <condition property="isSolarisSparc"> - <and> - <istrue value="${isSolaris}" /> - <os arch="sparc" /> - </and> - </condition> - <condition property="isSolarisSparcv9"> - <and> - <istrue value="${isSolaris}" /> - <os arch="sparcv9" /> - </and> - </condition> - <condition property="isSolarisAMD64"> - <and> - <istrue value="${isSolaris}" /> - <os arch="AMD64" /> - </and> - </condition> - <condition property="isSolarisX86"> - <and> - <istrue value="${isSolaris}" /> - <or> - <os arch="i386" /> - <os arch="x86" /> - </or> - </and> - </condition> - - <!-- Note: assumes X11 platform by default --> - <condition property="isX11"> - <and> - <isfalse value="${isWindows}" /> - <isfalse value="${isOSX}" /> - <isfalse value="${noX11}" /> - </and> - </condition> - - <condition property="solaris.cpu" value="sparc"> - <os name="SunOS" arch="sparc" /> - </condition> - <condition property="solaris.cpu" value="sparcv9"> - <os name="SunOS" arch="sparcv9" /> - </condition> - <condition property="solaris.cpu" value="i386"> - <os name="SunOS" arch="x86" /> - </condition> - <condition property="solaris.cpu" value="amd64"> - <os name="SunOS" arch="amd64" /> - </condition> - - <echo message="FreeBSD=${isFreeBSD}" /> - <echo message="HPUX=${isHPUX}" /> - <echo message="IA64=${isIA64}" /> - <echo message="Linux=${isLinux}" /> - <echo message="LinuxAMD64=${isLinuxAMD64}" /> - <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}" /> - <echo message="SolarisSparcv9=${isSolarisSparcv9}" /> - <echo message="SolarisAMD64=${isSolarisAMD64}" /> - <echo message="SolarisX86=${isSolarisX86}" /> - <echo message="Unix=${isUnix}" /> - <echo message="Windows=${isWindows}" /> - <echo message="X11=${isX11}" /> - </target> - - <target name="gluegen.cpptasks.detect.os.freebsd" unless="gluegen.cpptasks.detected.os.2" if="isFreeBSD"> - <property name="os.and.arch" value="freebsd-i586" /> - </target> - - <target name="gluegen.cpptasks.detect.os.hpux" unless="gluegen.cpptasks.detected.os.2" if="isHPUX"> - <property name="os.and.arch" value="hpux-hppa" /> - </target> - - <target name="gluegen.cpptasks.detect.os.linux.amd64" unless="gluegen.cpptasks.detected.os.2" if="isLinuxAMD64"> - <property name="os.and.arch" value="linux-amd64" /> - </target> - - <target name="gluegen.cpptasks.detect.os.linux.ia64" unless="gluegen.cpptasks.detected.os.2" if="isLinuxIA64"> - <property name="os.and.arch" value="linux-ia64" /> - </target> - - <target name="gluegen.cpptasks.detect.os.linux.x86" unless="gluegen.cpptasks.detected.os.2" if="isLinuxX86"> - <property name="os.and.arch" value="linux-i586" /> - </target> - - <target name="gluegen.cpptasks.detect.os.linux" depends="gluegen.cpptasks.detect.os.linux.amd64,gluegen.cpptasks.detect.os.linux.ia64,gluegen.cpptasks.detect.os.linux.x86" unless="gluegen.cpptasks.detected.os.2" /> - - <target name="gluegen.cpptasks.detect.os.osx" unless="gluegen.cpptasks.detected.os.2" if="isOSX"> - <property name="native.library.suffix" value="*lib" /> - <property name="native.library.suffix-cdc" value="so" /> - <property name="os.and.arch" value="macosx-universal" /> - </target> - - <target name="gluegen.cpptasks.detect.os.solaris.sparc" unless="gluegen.cpptasks.detected.os.2" if="isSolarisSparc"> - <property name="os.and.arch" value="solaris-sparc" /> - </target> - - <target name="gluegen.cpptasks.detect.os.solaris.sparcv9" unless="gluegen.cpptasks.detected.os.2" if="isSolarisSparcv9"> - <property name="os.and.arch" value="solaris-sparcv9" /> - </target> - - <target name="gluegen.cpptasks.detect.os.solaris.amd64" unless="gluegen.cpptasks.detected.os.2" if="isSolarisAMD64"> - <property name="os.and.arch" value="solaris-amd64" /> - </target> - - <target name="gluegen.cpptasks.detect.os.solaris.x86" unless="gluegen.cpptasks.detected.os.2" if="isSolarisX86"> - <property name="os.and.arch" value="solaris-i586" /> - </target> - - <target name="gluegen.cpptasks.detect.os.solaris" depends="gluegen.cpptasks.detect.os.solaris.sparc,gluegen.cpptasks.detect.os.solaris.sparcv9,gluegen.cpptasks.detect.os.solaris.amd64,gluegen.cpptasks.detect.os.solaris.x86" unless="gluegen.cpptasks.detected.os.2" /> - - <target name="gluegen.cpptasks.detect.os.unix" unless="gluegen.cpptasks.detected.os.2" if="isUnix"> - <property name="native.library.suffix" value="so" /> - <property name="native.library.suffix-cdc" value="so" /> - </target> - - <target name="gluegen.cpptasks.detect.os.windows.amd64" unless="gluegen.cpptasks.detected.os.2" if="isWindowsAMD64"> - <property name="os.and.arch" value="windows-amd64" /> - </target> - - <target name="gluegen.cpptasks.detect.os.windows.x86" unless="gluegen.cpptasks.detected.os.2" if="isWindowsX86"> - <property name="os.and.arch" value="windows-i586" /> - </target> - - <target name="gluegen.cpptasks.detect.os.windows" depends="gluegen.cpptasks.detect.os.windows.amd64,gluegen.cpptasks.detect.os.windows.x86" unless="gluegen.cpptasks.detected.os.2" if="isWindows"> - <property name="native.library.suffix" value="dll" /> - <property name="native.library.suffix-cdc" value="dll" /> - </target> - - <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.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> - - <!-- Detect compiler setup, in particular on Windows; separated - - out because this must sometimes be called late in the setup process - --> - <target name="gluegen.cpptasks.detect.compiler"> - <!-- Set up compiler selection on Windows --> - <condition property="isVCFamily"> - <and> - <istrue value="${isWindows}" /> - <not> - <equals arg1="${win32.c.compiler}" arg2="mingw" /> - </not> - </and> - </condition> - <condition property="isVC6"> - <and> - <istrue value="${isWindows}" /> - <equals arg1="${win32.c.compiler}" arg2="vc6" /> - </and> - </condition> - <condition property="isVC7"> - <and> - <istrue value="${isWindows}" /> - <equals arg1="${win32.c.compiler}" arg2="vc7" /> - </and> - </condition> - <condition property="isVC8"> - <and> - <istrue value="${isWindows}" /> - <equals arg1="${win32.c.compiler}" arg2="vc8" /> - </and> - </condition> - <condition property="isVC9"> - <and> - <istrue value="${isWindows}" /> - <equals arg1="${win32.c.compiler}" arg2="vc9" /> - </and> - </condition> - <condition property="isVC8_X64"> - <and> - <istrue value="${isWindows}" /> - <equals arg1="${win32.c.compiler}" arg2="vc8_x64" /> - </and> - </condition> - <condition property="isVC8Family"> - <or> - <istrue value="${isVC8}" /> - <istrue value="${isVC8_X64}" /> - <istrue value="${isVC9}" /> - </or> - </condition> - <condition property="isMingW"> - <and> - <istrue value="${isWindows}" /> - <equals arg1="${win32.c.compiler}" arg2="mingw" /> - </and> - </condition> - <condition property="WindowsFailure"> - <and> - <istrue value="${isWindows}" /> - <isfalse value="${isVC6}" /> - <isfalse value="${isVC7}" /> - <isfalse value="${isVC8}" /> - <isfalse value="${isVC8_X64}" /> - <isfalse value="${isVC9}" /> - <isfalse value="${isMingW}" /> - </and> - </condition> - <fail message="Must specify either win32.c.compiler in e.g. jogl.properties or use e.g. win32.vc6 build target" if="WindowsFailure" /> - <echo message="VC6=${isVC6}" /> - <echo message="VC7=${isVC7}" /> - <echo message="VC8=${isVC8}" /> - <echo message="VC8_X64=${isVC8_X64}" /> - <echo message="VC9=${isVC9}" /> - <echo message="MingW=${isMingW}" /> - - <!-- NOTE: the value of the debug and optimise attributes will not be overridden if already set externally --> - <property name="c.compiler.debug" value="false" /> - - <condition property="isVC7Debug"> - <and> - <istrue value="${isVC7}" /> - <istrue value="${c.compiler.debug}" /> - </and> - </condition> - <condition property="isVC8Debug"> - <and> - <istrue value="${isVC8}" /> - <istrue value="${c.compiler.debug}" /> - </and> - </condition> - <condition property="isVC9Debug"> - <and> - <istrue value="${isVC9}" /> - <istrue value="${c.compiler.debug}" /> - </and> - </condition> - </target> - - <!-- ================================================================== --> - <!-- - - Set up java.home.dir appropriately on all platforms. - --> - <target name="setup.java.home.dir.nonmacosx" 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" 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"> - <property name="java.includes.dir" value="${java.home.dir}/include" /> - </target> - - <target name="gluegen.cpptasks.configure.compiler" depends="setup.java.home.dir" unless="gluegen.compiler.present"> - <!-- compiler configuration --> - <compiler id="compiler.cfg.linux" name="gcc"> - <compilerarg value="-m32"/> - </compiler> - - <compiler id="compiler.cfg.linux.amd64" name="gcc"> - <compilerarg value="-fPIC"/> - <compilerarg value="-m64"/> - </compiler> - - <compiler id="compiler.cfg.linux64.mingw64" classname="net.sf.antcontrib.cpptasks.gcc.Gcc64CCompiler"> - <compilerarg value="-fPIC"/> - <compilerarg value="-m64"/> - </compiler> - - <compiler id="compiler.cfg.linux64.mingw32" classname="net.sf.antcontrib.cpptasks.gcc.Gcc32CCompiler"> - <compilerarg value="-m32"/> - </compiler> - -<!-- - <compiler id="compiler.cfg.solaris" name="suncc"> - <defineset> - <define name="SOLARIS" /> - </defineset> - </compiler> - - <compiler id="compiler.cfg.solaris.sparcv9" name="suncc"> - <compilerarg value="-fast" /> - <compilerarg value="-xchip=ultra" /> - <compilerarg value="-xarch=v9a" /> - <defineset> - <define name="SOLARIS" /> - </defineset> - </compiler> ---> -<!-- - <compiler id="compiler.cfg.solaris.amd64" name="suncc"> - <compilerarg value="-fast" /> - <compilerarg value="-xchip=opteron" /> - <compilerarg value="-xarch=amd64" /> - --> - <!-- <compilerarg value="-xcache=64/64/2:1024/64/16" /> --> -<!-- - <defineset> - <define name="SOLARIS" /> - </defineset> - </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"/> - <define name="NDEBUG" unless="c.compiler.use-debug"/> - - <define name="DBUILD_DLL" /> - <define name="_WINGDI_" /> - <define name="_STRICT_ANSI" /> - <define name="_JNI_IMPLEMENTATION_" /> - <define name="MINGW" /> - <define name="WINVER" value="0x0500"/> <!-- set windows version to >= Windows 2000 --> - <define name="_WIN32_WINNT" value="0x0500"/> <!-- set windows version to >= Windows 2000 --> - </defineset> - </compiler> - - <compiler id="compiler.cfg.win32.msvc" name="msvc"> - <compilerarg value="/W3"/> <!-- set warning level --> - <compilerarg value="/Ob1"/> <!-- inline only functions marked inline --> - <compilerarg value="/GF"/> <!-- enable string pooling --> - <compilerarg value="/Gy"/> <!-- enable function level linking --> - <compilerarg value="/GS" if="isVC7"/> <!-- buffer security checks --> - <compilerarg value="/Wp64" if="isVC7"/> <!-- detect 64-bit port problems --> - <compilerarg value="/RTCcsu" if="isVC7Debug"/> <!-- various runtime checks --> - <!-- Note: previous compiler options for VC7 were: - Debug: /MDd /Yd /GS /RTCs /RTCu /RTCc /W3 /Od /GF /EHsc /Zi /GS /Gy /Wp64 /Zi /D "_DEBUG" - Optimized: /MD /W3 /O2 /Ob1 /GF /EHsc /GS /Gy /Wp64 /D "NDEBUG" --> - <compilerarg value="/GS" if="isVC8"/> <!-- buffer security checks --> - <compilerarg value="/Wp64" if="isVC8"/> <!-- detect 64-bit port problems --> - <compilerarg value="/RTCcsu" if="isVC8Debug"/> <!-- various runtime checks --> - <compilerarg value="/NODEFAULTLIB:oldnames.lib" if="isVC8"/> <!-- library not available with VC8 --> - <compilerarg value="/GS" if="isVC9"/> <!-- buffer security checks --> - <compilerarg value="/RTCcsu" if="isVC9Debug"/> <!-- various runtime checks --> - <!--compilerarg value="/MT" if="isVC9"/--> <!-- static multithreaded - somehow overwritten by default /MD --> - - <defineset> - <define name="_DEBUG" if="c.compiler.use-debug"/> - <define name="DEBUG" if="c.compiler.use-debug"/> - <define name="NDEBUG" unless="c.compiler.use-debug"/> - </defineset> - </compiler> - - <compiler id="compiler.cfg.macosx" name="gcc"> - <!-- Note: Apple doesn't seem to provide ppc binaries on Snow Leopard --> - <compilerarg value="-arch" if="use.macosppc"/> - <compilerarg value="ppc" if="use.macosppc"/> - <compilerarg value="-arch" /> - <compilerarg value="i386" /> - <compilerarg value="-arch" if="use.macosx64"/> - <compilerarg value="x86_64" if="use.macosx64"/> - <!-- Note: Apple doesn't seem to provide ppc64 binaries on Leopard --> - <compilerarg value="-Wmost" /> - <compilerarg value="-ObjC" /> - <defineset> - <define name="macosx" /> - </defineset> - </compiler> - - <compiler id="compiler.cfg.freebsd" name="gcc"> - <defineset> - <define name="FREEBSD" /> - <define name="BSD" /> - </defineset> - </compiler> - - <compiler id="compiler.cfg.hpux" name="aCC"> - <!-- Interpret source as ANSI C89 (not C++) --> - <compilerarg value="-Ae"/> - <!-- Dereferences are performed with four-byte loads and stores. --> - <compilerarg value="+u4"/> - <!-- Suppress warnings: - 942: signed/unsigned assignment compatibility - 129: redeclarations in stub_includes --> - <compilerarg value="+W942,129"/> - <defineset> - <!-- aCC doesn't seem to define a generic system macro, a la - "__sun". The documentation claims it defines the following, - but don't seem to work: __HP_aCC, __LP64__, __RISC_0__. - HP-UX docs on JNI say to use the defs below - (http://www.hp.com/products1/unix/java/infolibrary/prog_guide/JNI_java2.html) --> - <!-- Single underscore prefix, as recommended by aCC docs... --> - <define name="_HPUX"/> - <define name="_POSIX_C_SOURCE" value="199506L"/> - </defineset> - </compiler> - - <!-- linker configuration --> - - <linker id="linker.cfg.linux" name="gcc"> - <linkerarg value="-m32"/> - </linker> - - <linker id="linker.cfg.linux.amd64" name="gcc"> - <linkerarg value="-m64"/> - </linker> - - <linker id="linker.cfg.linux64.mingw64" classname="net.sf.antcontrib.cpptasks.gcc.Gcc64Linker"> - <linkerarg value="-m64"/> - </linker> - - <linker id="linker.cfg.linux64.mingw32" classname="net.sf.antcontrib.cpptasks.gcc.Gcc32Linker"> - <linkerarg value="-m32"/> - <linkerarg value="-Wl,--kill-at" /> <!-- remove @ from function names --> - </linker> -<!-- - <linker id="linker.cfg.solaris" name="suncc"> - </linker> - - <linker id="linker.cfg.solaris.sparcv9" name="suncc"> - <linkerarg value="-xarch=v9a" /> - </linker> - - <linker id="linker.cfg.solaris.amd64" name="suncc"> - <linkerarg value="-xarch=amd64" /> - </linker> ---> - <linker id="linker.cfg.win32.mingw" name="gcc" incremental="false"> - <linkerarg value="-m32"/> - <linkerarg value="-Wl,--kill-at" /> <!-- remove @ from function names --> - </linker> - - <linker id="linker.cfg.win32.msvc" name="msvc" incremental="false"> - <linkerarg value="/OPT:REF,ICF" /> <!-- enable link-time optimisations --> - <linkerarg value="/SUBSYSTEM:WINDOWS" /> <!-- output is not a console app as uses WinMain entry point --> - <linkerarg value="/MACHINE:X86" if="isVC6" /> <!-- explicity set target platform --> - <linkerarg value="/MACHINE:X86" if="isVC7" /> <!-- explicity set target platform --> - <linkerarg value="/MACHINE:X86" if="isVC8" /> <!-- explicity set target platform --> - <linkerarg value="/MACHINE:X64" if="isVC8_X64"/> <!-- explicity set target platform (IX64) --> - <linkerarg value="/MACHINE:X86" if="isVC9" /> <!-- explicity set target platform --> - </linker> - - <linker id="linker.cfg.macosx" name="gcc"> - <linkerarg value="-arch" if="use.macosppc"/> - <linkerarg value="ppc" if="use.macosppc"/> - <linkerarg value="-arch" /> - <linkerarg value="i386" /> - <linkerarg value="-arch" if="use.macosx64"/> - <linkerarg value="x86_64" if="use.macosx64"/> - <!-- Note: Apple doesn't seem to provide ppc64 binaries on Leopard --> - </linker> - - <linker id="linker.cfg.hpux" name="aCC"> - </linker> - </target> - - <!-- ================================================================== --> - <!-- - - Platform specific declares. - --> - <target name="gluegen.cpptasks.declare.compiler.win32.vc6" if="isVC6"> - <echo message="Win32.VC6" /> - <property name="compiler.cfg.id.base" value="compiler.cfg.win32.msvc" /> - <property name="linker.cfg.id.base" value="linker.cfg.win32.msvc" /> - </target> - - <target name="gluegen.cpptasks.declare.compiler.win32.vc7" if="isVC7"> - <echo message="Win32.VC7" /> - <property name="compiler.cfg.id.base" value="compiler.cfg.win32.msvc" /> - <property name="linker.cfg.id.base" value="linker.cfg.win32.msvc" /> - </target> - - <target name="gluegen.cpptasks.declare.compiler.win32.vc8" if="isVC8"> - <echo message="Win32.VC8" /> - <property name="compiler.cfg.id.base" value="compiler.cfg.win32.msvc" /> - <property name="linker.cfg.id.base" value="linker.cfg.win32.msvc" /> - </target> - - <target name="gluegen.cpptasks.declare.compiler.win32.vc8_x64" if="isVC8_X64"> - <echo message="Win32.VC8_X64" /> - <property name="compiler.cfg.id.base" value="compiler.cfg.win32.msvc" /> - <property name="linker.cfg.id.base" value="linker.cfg.win32.msvc" /> - </target> - - <target name="gluegen.cpptasks.declare.compiler.win32.vc9" if="isVC9"> - <echo message="Win32.VC9" /> - <property name="compiler.cfg.id.base" value="compiler.cfg.win32.msvc" /> - <property name="linker.cfg.id.base" value="linker.cfg.win32.msvc" /> - </target> - - <target name="gluegen.cpptasks.declare.compiler.win32.mingw" if="isMingW"> - <echo message="Win32.MingW" /> - <property name="compiler.cfg.id.base" value="compiler.cfg.win32.mingw" /> - <property name="linker.cfg.id.base" value="linker.cfg.win32.mingw" /> - </target> - - <target name="gluegen.cpptasks.declare.compiler.win32" depends="gluegen.cpptasks.declare.compiler.win32.vc6,gluegen.cpptasks.declare.compiler.win32.vc7,gluegen.cpptasks.declare.compiler.win32.vc8,gluegen.cpptasks.declare.compiler.win32.vc8_x64,gluegen.cpptasks.declare.compiler.win32.vc9,gluegen.cpptasks.declare.compiler.win32.mingw" if="isWindows"> - <property name="java.includes.dir.platform" value="${java.includes.dir}/win32" /> - <property name="java.lib.dir.platform" value="${java.home.dir}/lib" /> - </target> - - <target name="gluegen.cpptasks.declare.compiler.linux.x86" if="isLinuxX86"> - <echo message="Linux.x86" /> - <property name="compiler.cfg.id.base" value="compiler.cfg.linux" /> - <property name="linker.cfg.id.base" value="linker.cfg.linux" /> - <property name="java.lib.dir.platform" value="${java.home.dir}/jre/lib/i386" /> - </target> - - <target name="gluegen.cpptasks.declare.compiler.linux.amd64" if="isLinuxAMD64"> - <echo message="Linux.AMD64" /> - <property name="compiler.cfg.id.base" value="compiler.cfg.linux.amd64" /> - <property name="linker.cfg.id.base" value="linker.cfg.linux.amd64" /> - <property name="java.lib.dir.platform" value="${java.home.dir}/jre/lib/amd64" /> - </target> - - <target name="gluegen.cpptasks.declare.compiler.linux.ia64" if="isLinuxIA64"> - <echo message="Linux.IA64" /> - <property name="compiler.cfg.id.base" value="compiler.cfg.linux" /> - <property name="linker.cfg.id.base" value="linker.cfg.linux" /> - <property name="java.lib.dir.platform" value="${java.home.dir}/jre/lib/ia64" /> - </target> - - <target name="gluegen.cpptasks.declare.compiler.linux" depends="gluegen.cpptasks.declare.compiler.linux.x86,gluegen.cpptasks.declare.compiler.linux.amd64,gluegen.cpptasks.declare.compiler.linux.ia64" if="isLinux"> - <property name="java.includes.dir.platform" value="${java.includes.dir}/linux" /> - </target> - - <target name="gluegen.cpptasks.declare.compiler.solaris32" if="isSolaris32Bit"> - <echo message="Solaris" /> - <property name="compiler.cfg.id.base" value="compiler.cfg.solaris" /> - <property name="linker.cfg.id.base" value="linker.cfg.solaris" /> - </target> - - <target name="gluegen.cpptasks.declare.compiler.solaris.sparcv9" if="isSolarisSparcv9"> - <echo message="SolarisSparcv9" /> - <property name="compiler.cfg.id.base" value="compiler.cfg.solaris.sparcv9" /> - <property name="linker.cfg.id.base" value="linker.cfg.solaris.sparcv9" /> - </target> - - <target name="gluegen.cpptasks.declare.compiler.solaris.amd64" if="isSolarisAMD64"> - <echo message="SolarisAMD64" /> - <property name="compiler.cfg.id.base" value="compiler.cfg.solaris.amd64" /> - <property name="linker.cfg.id.base" value="linker.cfg.solaris.amd64" /> - </target> - - <target name="gluegen.cpptasks.declare.compiler.solaris" depends="gluegen.cpptasks.declare.compiler.solaris32,gluegen.cpptasks.declare.compiler.solaris.sparcv9,gluegen.cpptasks.declare.compiler.solaris.amd64" if="isSolaris"> - <property name="java.includes.dir.platform" value="${java.includes.dir}/solaris" /> - <property name="java.lib.dir.platform" value="${java.home.dir}/jre/lib/${solaris.cpu}" /> - </target> - - <target name="gluegen.cpptasks.declare.compiler.macosx" if="isOSX"> - <echo message="MacOSX" /> - <property name="compiler.cfg.id.base" value="compiler.cfg.macosx" /> - <property name="linker.cfg.id.base" value="linker.cfg.macosx" /> - <property name="java.includes.dir.platform" value="/System/Library/Frameworks/JavaVM.framework/Versions/CurrentJDK/Headers" /> - <property name="java.lib.dir.platform" value="/System/Library/Frameworks/JavaVM.framework/Libraries" /> - </target> - - <target name="gluegen.cpptasks.declare.compiler.freebsd" if="isFreeBSD"> - <echo message="FreeBSD" /> - <property name="compiler.cfg.id.base" value="compiler.cfg.freebsd" /> - <property name="linker.cfg.id.base" value="linker.cfg.linux" /> - <property name="java.includes.dir.platform" value="${java.includes.dir}/freebsd" /> - <property name="java.lib.dir.platform" value="${java.home.dir}/jre/lib/i386" /> - </target> - - <target name="gluegen.cpptasks.declare.compiler.hpux" if="isHPUX"> - <echo message="HP-UX" /> - <property name="compiler.cfg.id.base" value="compiler.cfg.hpux" /> - <property name="linker.cfg.id.base" value="linker.cfg.hpux" /> - <property name="java.includes.dir.platform" value="${java.includes.dir}/hp-ux" /> - <property name="java.lib.dir.platform" value="${java.home.dir}/jre/lib/PA_RISC2.0" /> - </target> - - <target name="gluegen.cpptasks.declare.compiler" depends="gluegen.cpptasks.declare.compiler.win32,gluegen.cpptasks.declare.compiler.linux,gluegen.cpptasks.declare.compiler.solaris,gluegen.cpptasks.declare.compiler.macosx,gluegen.cpptasks.declare.compiler.freebsd,gluegen.cpptasks.declare.compiler.hpux" unless="gluegen.compiler.present"/> - - <target name="gluegen.cpptasks.setup.compiler" depends="gluegen.cpptasks.detect.compiler,gluegen.cpptasks.configure.compiler,gluegen.cpptasks.declare.compiler" /> + <import file="${gluegen-cpptasks.file}" optional="false" /> - <!-- ================================================================== --> - <!-- - - Helper macrodef for installing manifest in generated DLLs, needed for VC8 and later - --> - <macrodef name="msvc.manifest"> - <attribute name="objdir" /> - <attribute name="dllname" /> - <sequential> - <exec executable="mt"> - <arg value="-manifest"/> - <arg value="@{objdir}/@{dllname}.dll.manifest"/> - <arg value="-outputresource:@{objdir}/@{dllname}.dll;#2"/> - </exec> - </sequential> - </macrodef> </project> diff --git a/make/gluegen.compiler.xml b/make/gluegen.compiler.xml deleted file mode 100644 index 7d94567..0000000 --- a/make/gluegen.compiler.xml +++ /dev/null @@ -1,36 +0,0 @@ -<?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" /> - <compilerarg value="-I/devtools/i686-unknown-linux-gnu/include" /> - <compilerarg value="-I/devtools/share/include" /> - <compilerarg value="-I/devtools/i686-unknown-linux-gnu/xfree86-4.3.0-linux-ix86-glibc23/include" /> - <defineset> - <define name="LINUX" /> - </defineset> - </compiler> - - <linker id="linker.cfg.linux" name="gcc"> - <linkerarg value="-m32" /> - <linkerarg value="-L/devtools/i686-unknown-linux-gnu/lib" /> - <linkerarg value="-L/devtools/i686-unknown-linux-gnu/xfree86-4.3.0-linux-ix86-glibc23/lib" /> - </linker> -</target> -</project> diff --git a/make/lib/gluegen-cpptasks-linux-32bit.xml b/make/lib/gluegen-cpptasks-linux-32bit.xml new file mode 100644 index 0000000..c05033d --- /dev/null +++ b/make/lib/gluegen-cpptasks-linux-32bit.xml @@ -0,0 +1,50 @@ +<?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-cpptasks.file', ie: + + -Dgluegen-cpptasks.file=`pwd`/lib/gluegen-cpptasks-linux-32bit.xml + + In case you want to compile for 32bit on a 64bit machine, + you might also need to set the 'os.arch' to 'x86'. + Example: gluegen/make/make.gluegen.all.linux-x86.sh + --> + +<project name="GlueGen-cpptasks" basedir="." > + +<import file="../gluegen-cpptasks-base.xml" optional="false" /> + +<target name="gluegen.cpptasks.configure.compiler" depends="setup.java.home.dir"> + <echo message="Custom forced compiler.cfg.linux, linker.cfg.linux" /> + <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> + +<target name="gluegen.cpptasks.declare.compiler" depends="setup.java.home.dir"> + <echo message="Custom forced Linux.x86" /> + <!-- + <property name="isLinux" value="true"/> + <property name="isLinuxX86" value="true"/> + --> + <property name="compiler.cfg.id.base" value="compiler.cfg.linux" /> + <property name="linker.cfg.id.base" value="linker.cfg.linux" /> + <property name="java.lib.dir.platform" value="${java.home.dir}/jre/lib/i386" /> + <property name="java.includes.dir.platform" value="${java.includes.dir}/linux" /> +</target> + +</project> + + diff --git a/make/lib/gluegen.compiler.linux-32bit.xml b/make/lib/gluegen.compiler.linux-32bit.xml deleted file mode 100644 index ce1554c..0000000 --- a/make/lib/gluegen.compiler.linux-32bit.xml +++ /dev/null @@ -1,38 +0,0 @@ -<?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 - - In case you want to compile for 32bit on a 64bit machine, - you might also need to set the 'os.arch' to 'x86'. - Example: gluegen/make/make.gluegen.all.linux-x86.sh - - More properties need to be overwritten in case you like to change the - target OS .. and/or components, see gluegen-cpptasks.xml for more information. - --> - -<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.gluegen.all.linux-x86.sh b/make/make.gluegen.all.linux-x86.sh index b76d85f..ef81f0e 100644 --- a/make/make.gluegen.all.linux-x86.sh +++ b/make/make.gluegen.all.linux-x86.sh @@ -10,7 +10,7 @@ # -DisX11=true \ ant \ - -Dgluegen.user.compiler.file=`pwd`/lib/gluegen.compiler.linux-32bit.xml \ + -Dgluegen-cpptasks.file=`pwd`/lib/gluegen-cpptasks-linux-32bit.xml \ -Drootrel.build=build-x86 \ -Dos.arch=x86 \ $* 2>&1 | tee make.gluegen.all.linux-x86.log |