summaryrefslogtreecommitdiffstats
path: root/make/gluegen-cpptasks-base.xml
diff options
context:
space:
mode:
authorSven Gothel <[email protected]>2010-04-08 02:22:12 +0200
committerSven Gothel <[email protected]>2010-04-08 02:22:12 +0200
commit7cc4bb2a8bcc4c16b6a12826abbd874bf38f9dc1 (patch)
treeeb932553d0f9b36dbe6d703356502bf352cc6eca /make/gluegen-cpptasks-base.xml
parent82ac66ba1e7494b0a76a2063f0d56d3b785c6c31 (diff)
http://jogamp.org/bugzilla/show_bug.cgi?id=393
Fixed junit test: test1 - Create seperate native libraries to reflect a real world example: test1 - the library to bind to (no more declaring __stdcall @nn functions) BindingTest1p1 - the dynamic fixed linkage binding test1p1, references dynamic library test1 at linktime. BindingTest1p2 - the dynamic runtime linkage binding test1p2, loads dynamic library test1 at runtime. Generic: - gluegen-cpptasks-base.xml - target 'gluegen.cpptasks.detect.os' Set new property 'system.env.library.path' DYLD_LIBRARY_PATH (macosx) LD_LIBRARY_PATH (unix) PATH (windows) - target 'gluegen.cpptasks.striplibs' Strips the symbols out of the native libraries in case c.compiler.debug is false. Maybe configured with the properties: c.strip.tool, c.strip.args - Using system.env.library.path in junit call to find the test1 library in case of runtime linkage and lookup (test1p2). - Use gluegen.cpptasks.striplibs for all native libs .. - Added macosx32 in analogy to macosx64, both defaults to true now - com.jogamp.common.os.WindowsDynamicLinkerImpl:lookupSymbol() - Added lookup for __stdcall @nn (stepping alignment 4, max-args: 12) in case no undecorated __cdecl symbol is found. Fixed Windows platform: - Use proper path.seperator on Windows. - test1.dll needs proper soname inside for fixed linkage (test1p1) hence the output name must be test1.dll, not libtest1.so +++ http://jogamp.org/bugzilla/show_bug.cgi?id=394 Fix MacOsX platform: The commit of cpptasks.jar, git hash 129e783741d91e9ee5cd7da5d5c962c32ec96b0b, broke the universal binary build on MacOSX. The above change used cpptasks-1.05b with a few patches in regards to crosscompilation, but missed one, which accepts the '-arch' argument for GccLinker undecorated. The new cpptasks.jar is vanilla 1.05b + cpptasks-1.0b5-darwin-patch.diff, the latter a more refined one. This version accepts the '-arch' argument undecorated on the darwin platform. +++
Diffstat (limited to 'make/gluegen-cpptasks-base.xml')
-rwxr-xr-xmake/gluegen-cpptasks-base.xml100
1 files changed, 78 insertions, 22 deletions
diff --git a/make/gluegen-cpptasks-base.xml b/make/gluegen-cpptasks-base.xml
index 9eedcd1..5375306 100755
--- a/make/gluegen-cpptasks-base.xml
+++ b/make/gluegen-cpptasks-base.xml
@@ -24,7 +24,6 @@
- isLinuxX86
- isOSX
- isOSXPPC
- - isOSXUniversal (if macosxfat=true)
- isSolaris
- isSolaris32Bit
- isSolarisAMD64
@@ -116,21 +115,37 @@
-->
<project name="GlueGen-cpptasks-base" 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>
+ <target name="gluegen.cpptasks.initialize" depends="gluegen.properties.load.user">
+ <!-- NOTE: the value of the debug attribute will not be overridden if already set externally -->
+ <property name="c.compiler.debug" value="false" />
+
+ <condition property="c.strip.libraries"><isfalse value="${c.compiler.debug}"/></condition>
+
+ <!-- NOTE: the values of the macos<arch> attributes will not be overridden if already set externally -->
+ <property name="macosppc" value="false" />
+ <property name="macosx32" value="true" />
+ <property name="macosx64" value="true" />
+
<!-- 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.macosx32">
+ <istrue value="${macosx32}" />
+ </condition>
<condition property="use.macosx64">
<istrue value="${macosx64}" />
</condition>
+ </target>
+
+ <!-- Detect OS and compiler configuration -->
+ <target name="gluegen.cpptasks.detect.os.1" depends="gluegen.cpptasks.initialize" unless="gluegen.cpptasks.detected.os">
+ <condition property="isOSX">
+ <and>
+ <os family="mac"/>
+ <os family="unix"/>
+ </and>
+ </condition>
<condition property="isUnix">
<and>
<os family="unix" />
@@ -265,6 +280,7 @@
<echo message="LinuxX86=${isLinuxX86}" />
<echo message="OS X=${isOSX}" />
<echo message="OS X PPC=${use.macosppc}" />
+ <echo message="OS X x32=${use.macosx32}" />
<echo message="OS X x64=${use.macosx64}" />
<echo message="Solaris=${isSolaris}" />
<echo message="Solaris32Bit=${isSolaris32Bit}" />
@@ -347,6 +363,26 @@
<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" />
+
+ <!-- Set the OS search library environment variable -->
+ <condition property="system.env.library.path"
+ value="DYLD_LIBRARY_PATH">
+ <isset property="isOSX"/>
+ </condition>
+ <condition property="system.env.library.path"
+ value="LD_LIBRARY_PATH">
+ <isset property="isUnix"/>
+ </condition>
+ <condition property="system.env.library.path"
+ value="PATH">
+ <isset property="isWindows"/>
+ </condition>
+
+ <!-- NOTE: the value of the c.strip.tool and c.strip.args attribute will not be overridden if already set externally -->
+ <property name="c.strip.tool" value="strip" />
+ <condition property="c.strip.args" value="-S -x"><isset property="isOSX"/></condition>
+ <property name="c.strip.args" value="" />
+
</target>
<!-- Detect compiler setup, in particular on Windows; separated
@@ -424,9 +460,6 @@
<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}" />
@@ -473,12 +506,14 @@
<compilerarg value="-m64"/>
</compiler>
- <compiler id="compiler.cfg.linux64.mingw64" classname="net.sf.antcontrib.cpptasks.gcc.Gcc64CCompiler">
+ <!--compiler id="compiler.cfg.linux64.mingw64" classname="net.sf.antcontrib.cpptasks.gcc.Gcc64CCompiler"-->
+ <compiler id="compiler.cfg.linux64.mingw64" classname="net.sf.antcontrib.cpptasks.gcc.GccCCompiler">
<compilerarg value="-fPIC"/>
<compilerarg value="-m64"/>
</compiler>
- <compiler id="compiler.cfg.linux64.mingw32" classname="net.sf.antcontrib.cpptasks.gcc.Gcc32CCompiler">
+ <!--compiler id="compiler.cfg.linux64.mingw32" classname="net.sf.antcontrib.cpptasks.gcc.Gcc32CCompiler"-->
+ <compiler id="compiler.cfg.linux64.mingw32" classname="net.sf.antcontrib.cpptasks.gcc.GccCCompiler">
<compilerarg value="-m32"/>
</compiler>
@@ -561,8 +596,8 @@
<!-- 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.macosx32"/>
+ <compilerarg value="i386" if="use.macosx32"/>
<compilerarg value="-arch" if="use.macosx64"/>
<compilerarg value="x86_64" if="use.macosx64"/>
<!-- Note: Apple doesn't seem to provide ppc64 binaries on Leopard -->
@@ -611,13 +646,15 @@
<linkerarg value="-m64"/>
</linker>
- <linker id="linker.cfg.linux64.mingw64" classname="net.sf.antcontrib.cpptasks.gcc.Gcc64Linker">
+ <!--linker id="linker.cfg.linux64.mingw64" classname="net.sf.antcontrib.cpptasks.gcc.Gcc64Linker"-->
+ <linker id="linker.cfg.linux64.mingw64" classname="net.sf.antcontrib.cpptasks.gcc.GccLinker">
<linkerarg value="-m64"/>
</linker>
- <linker id="linker.cfg.linux64.mingw32" classname="net.sf.antcontrib.cpptasks.gcc.Gcc32Linker">
+ <!--linker id="linker.cfg.linux64.mingw32" classname="net.sf.antcontrib.cpptasks.gcc.Gcc32Linker"-->
+ <linker id="linker.cfg.linux64.mingw32" classname="net.sf.antcontrib.cpptasks.gcc.GccLinker">
<linkerarg value="-m32"/>
- <linkerarg value="-Wl,--kill-at" /> <!-- remove @ from function names -->
+ <linkerarg value="-Wl,--kill-at" /> <!-- remove @ from function names, ie no __stdcall @nn -->
</linker>
<!--
<linker id="linker.cfg.solaris" name="suncc">
@@ -633,7 +670,7 @@
-->
<linker id="linker.cfg.win32.mingw" name="gcc" incremental="false">
<linkerarg value="-m32"/>
- <linkerarg value="-Wl,--kill-at" /> <!-- remove @ from function names -->
+ <linkerarg value="-Wl,--kill-at" /> <!-- remove @ from function names, ie no __stdcall @nn -->
</linker>
<linker id="linker.cfg.win32.msvc" name="msvc" incremental="false">
@@ -647,10 +684,11 @@
</linker>
<linker id="linker.cfg.macosx" name="gcc">
+ <!-- Note: Apple doesn't seem to provide ppc binaries on Snow Leopard -->
<linkerarg value="-arch" if="use.macosppc"/>
<linkerarg value="ppc" if="use.macosppc"/>
- <linkerarg value="-arch" />
- <linkerarg value="i386" />
+ <linkerarg value="-arch" if="use.macosx32"/>
+ <linkerarg value="i386" if="use.macosx32"/>
<linkerarg value="-arch" if="use.macosx64"/>
<linkerarg value="x86_64" if="use.macosx64"/>
<!-- Note: Apple doesn't seem to provide ppc64 binaries on Leopard -->
@@ -783,6 +821,24 @@
<!-- ================================================================== -->
<!--
+ - Helper strip.libraries for stripping off debug information
+ -->
+ <target name="gluegen.cpptasks.striplibs" depends="gluegen.cpptasks.initialize" if="c.strip.libraries">
+ <echo message="Strip symbols from libs in ${libdir}" />
+ <apply dir="${libdir}" executable="${c.strip.tool}" parallel="false"
+ failonerror="true">
+ <arg line="${c.strip.args}"/>
+ <fileset dir="${libdir}">
+ <include name="**/*.so"/> <!-- unix -->
+ <include name="**/*.dll"/> <!-- windows -->
+ <include name="**/*.dylib"/> <!-- macosx -->
+ <include name="**/*.jnilib"/> <!-- macosx -->
+ </fileset>
+ </apply>
+ </target>
+
+ <!-- ================================================================== -->
+ <!--
- Helper macrodef for installing manifest in generated DLLs, needed for VC8 and later
-->
<macrodef name="msvc.manifest">