diff options
author | Sven Gothel <[email protected]> | 2013-09-13 12:53:50 +0200 |
---|---|---|
committer | Sven Gothel <[email protected]> | 2013-09-13 12:53:50 +0200 |
commit | 040bba68fc5e06414176f8e7887c83be20dab0f0 (patch) | |
tree | 265a05d4e3b0c5468324130cb82301cb4dd05d4e /make | |
parent | ce9a936961d64e6cf6c54b35f997d564491ffd93 (diff) |
Add clang support: 'gluegen.properties' adds 'gcc.compat.compiler' = ['gcc', 'clang']; Use 'gcc.compat.compiler' for all gcc based compiler/linker definitions.
Diffstat (limited to 'make')
-rwxr-xr-x | make/gluegen-cpptasks-base.xml | 100 | ||||
-rwxr-xr-x | make/gluegen-properties.xml | 6 | ||||
-rwxr-xr-x | make/gluegen.properties | 4 | ||||
-rwxr-xr-x | make/lib/gluegen-clang.properties | 1 | ||||
-rwxr-xr-x | make/scripts/make.gluegen.all.macosx-clang.sh | 29 |
5 files changed, 95 insertions, 45 deletions
diff --git a/make/gluegen-cpptasks-base.xml b/make/gluegen-cpptasks-base.xml index f8455e8..cae62c0 100755 --- a/make/gluegen-cpptasks-base.xml +++ b/make/gluegen-cpptasks-base.xml @@ -99,6 +99,8 @@ - properties appropriately. They are only set to "true" if the OS/compiler - configuration is exactly as specified. - + - isGCC + - isCLANG - isVCFamily - isVC6 - isVC7 @@ -737,6 +739,15 @@ - out because this must sometimes be called late in the setup process --> <target name="gluegen.cpptasks.detect.compiler"> + <condition property="isGCC"> + <equals arg1="${gcc.compat.compiler}" arg2="gcc" /> + </condition> + <condition property="isCLANG"> + <equals arg1="${gcc.compat.compiler}" arg2="clang" /> + </condition> + <echo message="GCC=${isGCC}" /> + <echo message="CLANG=${isCLANG}" /> + <!-- Set up compiler selection on Windows --> <condition property="isVCFamily"> <and> @@ -878,7 +889,7 @@ <!-- UNIX compiler configuration --> - <compiler id="compiler.cfg.freebsd" name="gcc"> + <compiler id="compiler.cfg.freebsd" name="${gcc.compat.compiler}"> <defineset> <define name="__unix__"/> <define name="__X11__" if="isX11"/> @@ -890,7 +901,7 @@ </defineset> </compiler> - <compiler id="compiler.cfg.linux" name="gcc"> + <compiler id="compiler.cfg.linux" name="${gcc.compat.compiler}"> <defineset> <define name="__unix__"/> <define name="__X11__" if="isX11"/> @@ -900,7 +911,7 @@ </defineset> </compiler> - <compiler id="compiler.cfg.linux.x86" name="gcc"> + <compiler id="compiler.cfg.linux.x86" name="${gcc.compat.compiler}"> <compilerarg value="-m32"/> <defineset> <define name="__unix__"/> @@ -911,7 +922,7 @@ </defineset> </compiler> - <compiler id="compiler.cfg.linux.amd64" name="gcc"> + <compiler id="compiler.cfg.linux.amd64" name="${gcc.compat.compiler}"> <compilerarg value="-fPIC"/> <compilerarg value="-m64"/> <defineset> @@ -927,7 +938,7 @@ - lib/gluegen-cpptasks-linux-armv6.xml (armv5te + softfp), or - lib/gluegen-cpptasks-linux-armv6hf.xml (armv6 + hardfp) for official JogAmp builds! --> - <compiler id="compiler.cfg.linux.armv6" name="gcc"> + <compiler id="compiler.cfg.linux.armv6" name="${gcc.compat.compiler}"> <defineset> <define name="__unix__"/> <define name="__X11__" if="isX11"/> @@ -938,11 +949,11 @@ <compilerarg value="-fpic" /> </compiler> - <compiler id="compiler.cfg.android" name="gcc"> + <compiler id="compiler.cfg.android" name="${gcc.compat.compiler}"> <!-- shall be defined in custom ${gluegen-cpptasks.file} ! --> </compiler> - <compiler id="compiler.cfg.freebsd" name="gcc"> + <compiler id="compiler.cfg.freebsd" name="${gcc.compat.compiler}"> <defineset> <define name="__unix__"/> <define name="__X11__" if="isX11"/> @@ -982,7 +993,7 @@ <!-- SOLARIS compiler configuration --> - <compiler id="compiler.cfg.solaris" name="gcc"> + <compiler id="compiler.cfg.solaris" name="${gcc.compat.compiler}"> <compilerarg value="-m32"/> <defineset> <define name="__unix__"/> @@ -994,7 +1005,7 @@ </defineset> </compiler> - <compiler id="compiler.cfg.solaris.sparcv9" name="gcc"> + <compiler id="compiler.cfg.solaris.sparcv9" name="${gcc.compat.compiler}"> <compilerarg value="-fast" /> <compilerarg value="-xchip=ultra" /> <compilerarg value="-xarch=v9a" /> @@ -1008,7 +1019,7 @@ </defineset> </compiler> - <compiler id="compiler.cfg.solaris.amd64" name="gcc"> + <compiler id="compiler.cfg.solaris.amd64" name="${gcc.compat.compiler}"> <compilerarg value="-fPIC"/> <compilerarg value="-m64"/> <!-- compilerarg value="-fast" /--> @@ -1027,7 +1038,7 @@ <!-- MacOSX compiler configuration --> - <compiler id="compiler.cfg.macosx" name="gcc"> + <compiler id="compiler.cfg.macosx" name="${gcc.compat.compiler}"> <!-- Note: Apple doesn't seem to provide ppc binaries on Snow Leopard --> <compilerarg value="-arch" if="use.macosppc"/> <compilerarg value="ppc" if="use.macosppc"/> @@ -1040,7 +1051,6 @@ <compilerarg value="-ObjC" /> <compilerarg value="-mmacosx-version-min=10.5"/> <defineset> - <define name="macosx" /> <define name="_DEBUG" if="c.compiler.use-debug"/> <define name="DEBUG" if="c.compiler.use-debug"/> <define name="NDEBUG" unless="c.compiler.use-debug"/> @@ -1060,7 +1070,7 @@ <compilerarg value="-m32"/> </compiler> - <compiler id="compiler.cfg.win32.mingw" name="gcc"> + <compiler id="compiler.cfg.win32.mingw" name="${gcc.compat.compiler}"> <compilerarg value="-g" if="c.compiler.use-debug"/> <compilerarg value="-O0" if="c.compiler.use-debug"/> <compilerarg value="-O2" unless="c.compiler.use-debug"/> @@ -1077,7 +1087,7 @@ </defineset> </compiler> - <compiler id="compiler.cfg.win64.mingw" name="gcc"> + <compiler id="compiler.cfg.win64.mingw" name="${gcc.compat.compiler}"> <compilerarg value="-g" if="c.compiler.use-debug"/> <compilerarg value="-O0" if="c.compiler.use-debug"/> <compilerarg value="-O2" unless="c.compiler.use-debug"/> @@ -1124,91 +1134,91 @@ <!-- Unix linker configuration --> - <linker id="linker.cfg.linux" name="gcc"> - <linkerarg value="-static-libgcc"/> + <linker id="linker.cfg.linux" name="${gcc.compat.compiler}"> + <linkerarg value="-static-libgcc" if="isGCC"/> </linker> - <linker id="linker.cfg.linux.x86" name="gcc"> + <linker id="linker.cfg.linux.x86" name="${gcc.compat.compiler}"> <linkerarg value="-m32"/> - <linkerarg value="-static-libgcc"/> + <linkerarg value="-static-libgcc" if="isGCC"/> </linker> - <linker id="linker.cfg.linux.amd64" name="gcc"> + <linker id="linker.cfg.linux.amd64" name="${gcc.compat.compiler}"> <linkerarg value="-m64"/> - <linkerarg value="-static-libgcc"/> + <linkerarg value="-static-libgcc" if="isGCC"/> </linker> <!-- Using default compiler settings - utilize: - lib/gluegen-cpptasks-linux-armv6.xml (armv5te + softfp), or - lib/gluegen-cpptasks-linux-armv6hf.xml (armv6 + hardfp) for official JogAmp builds! --> - <linker id="linker.cfg.linux.armv6" name="gcc"> + <linker id="linker.cfg.linux.armv6" name="${gcc.compat.compiler}"> <linkerarg value="-fpic" /> <linkerarg value="-nostdlib" /> <linkerarg value="-Bdynamic" /> - <linkerarg value="-static-libgcc"/> + <linkerarg value="-static-libgcc" if="isGCC"/> </linker> - <linker id="linker.cfg.linux.alpha" name="gcc"> + <linker id="linker.cfg.linux.alpha" name="${gcc.compat.compiler}"> </linker> - <linker id="linker.cfg.linux.hppa" name="gcc"> + <linker id="linker.cfg.linux.hppa" name="${gcc.compat.compiler}"> </linker> - <linker id="linker.cfg.linux.mips" name="gcc"> + <linker id="linker.cfg.linux.mips" name="${gcc.compat.compiler}"> </linker> - <linker id="linker.cfg.linux.mipsel" name="gcc"> + <linker id="linker.cfg.linux.mipsel" name="${gcc.compat.compiler}"> </linker> - <linker id="linker.cfg.linux.ppc" name="gcc"> + <linker id="linker.cfg.linux.ppc" name="${gcc.compat.compiler}"> </linker> - <linker id="linker.cfg.linux.s390" name="gcc"> + <linker id="linker.cfg.linux.s390" name="${gcc.compat.compiler}"> </linker> - <linker id="linker.cfg.linux.s390x" name="gcc"> + <linker id="linker.cfg.linux.s390x" name="${gcc.compat.compiler}"> </linker> - <linker id="linker.cfg.linux.sparc" name="gcc"> + <linker id="linker.cfg.linux.sparc" name="${gcc.compat.compiler}"> </linker> - <compiler id="linker.cfg.android" name="gcc"> + <compiler id="linker.cfg.android" name="${gcc.compat.compiler}"> <!-- shall be defined in custom ${gluegen-cpptasks.file} ! --> </compiler> <linker id="linker.cfg.hpux" name="aCC"> </linker> - <linker id="linker.cfg.freebsd.x86" name="gcc"> + <linker id="linker.cfg.freebsd.x86" name="${gcc.compat.compiler}"> <linkerarg value="-m32"/> </linker> - <linker id="linker.cfg.freebsd.amd64" name="gcc"> + <linker id="linker.cfg.freebsd.amd64" name="${gcc.compat.compiler}"> <linkerarg value="-m64"/> </linker> <!-- SOLARIS linker configuration --> - <linker id="linker.cfg.solaris" name="gcc"> + <linker id="linker.cfg.solaris" name="${gcc.compat.compiler}"> <linkerarg value="-m32"/> - <linkerarg value="-static-libgcc"/> + <linkerarg value="-static-libgcc" if="isGCC"/> </linker> - <linker id="linker.cfg.solaris.sparcv9" name="gcc"> + <linker id="linker.cfg.solaris.sparcv9" name="${gcc.compat.compiler}"> <linkerarg value="-xarch=v9a" /> - <linkerarg value="-static-libgcc"/> + <linkerarg value="-static-libgcc" if="isGCC"/> </linker> - <linker id="linker.cfg.solaris.amd64" name="gcc"> + <linker id="linker.cfg.solaris.amd64" name="${gcc.compat.compiler}"> <linkerarg value="-m64"/> - <linkerarg value="-static-libgcc"/> + <linkerarg value="-static-libgcc" if="isGCC"/> <!-- linkerarg value="-xarch=amd64" / --> </linker> <!-- MacOSX linker configuration --> - <linker id="linker.cfg.macosx" name="gcc"> + <linker id="linker.cfg.macosx" name="${gcc.compat.compiler}"> <!-- Note: Apple doesn't seem to provide ppc binaries on Snow Leopard --> <linkerarg value="-arch" if="use.macosppc"/> <linkerarg value="ppc" if="use.macosppc"/> @@ -1217,7 +1227,7 @@ <linkerarg value="-arch" if="use.macosx64"/> <linkerarg value="x86_64" if="use.macosx64"/> <linkerarg value="-mmacosx-version-min=10.5"/> - <linkerarg value="-static-libgcc"/> + <linkerarg value="-static-libgcc" if="isGCC"/> <!-- Note: Apple doesn't seem to provide ppc64 binaries on Leopard --> </linker> @@ -1236,20 +1246,20 @@ <linkerarg value="-static-libgcc"/> </linker> - <linker id="linker.cfg.win32.mingw" name="gcc" incremental="false"> + <linker id="linker.cfg.win32.mingw" name="${gcc.compat.compiler}" incremental="false"> <linkerarg value="-m32"/> <linkerarg value="-Wl,--enable-auto-import"/> <!-- for linking against dll directly --> <linkerarg value="-Wl,--enable-stdcall-fixup"/> <!-- for linking against dll directly --> <linkerarg value="-Wl,--kill-at" /> <!-- remove @ from function names, ie no __stdcall @nn --> - <linkerarg value="-static-libgcc"/> + <linkerarg value="-static-libgcc" if="isGCC"/> </linker> - <linker id="linker.cfg.win64.mingw" name="gcc" incremental="false"> + <linker id="linker.cfg.win64.mingw" name="${gcc.compat.compiler}" incremental="false"> <linkerarg value="-m64"/> <linkerarg value="-Wl,--enable-auto-import"/> <!-- for linking against dll directly --> <linkerarg value="-Wl,--enable-stdcall-fixup"/> <!-- for linking against dll directly --> <linkerarg value="-Wl,--kill-at" /> <!-- remove @ from function names, ie no __stdcall @nn --> - <linkerarg value="-static-libgcc"/> + <linkerarg value="-static-libgcc" if="isGCC"/> </linker> <linker id="linker.cfg.win32.msvc" name="msvc" incremental="false"> diff --git a/make/gluegen-properties.xml b/make/gluegen-properties.xml index 7efc4c1..cac32bb 100755 --- a/make/gluegen-properties.xml +++ b/make/gluegen-properties.xml @@ -6,6 +6,9 @@ - This Ant project file depends on the following properties being set - externally: - + - gcc.compat.compiler + - either "gcc" (default) or "clang" + - - win32.c.compiler (required to be set on Windows): - one of "vc6", "vc7", "vc8", "mingw32" (default) or "mingw64". - c.compiler.debug: @@ -79,6 +82,9 @@ <property name="ant-junit-all.apk" value="${gluegen.root}/make/lib/ant-junit-all.apk" /> + <!-- maybe overriden, e.g. with "clang" --> + <property name="gcc.compat.compiler" value="gcc"/> + <condition property="win32.c.compiler" value="mingw64"> <and> <os family="windows" /> diff --git a/make/gluegen.properties b/make/gluegen.properties index 03aec9c..62bb84d 100755 --- a/make/gluegen.properties +++ b/make/gluegen.properties @@ -30,6 +30,10 @@ # MinGW is used per default, hence the default value "mingw32". # win32.c.compiler=mingw32 +# You can set the gcc compatible compiler to either gcc or clang: +#gcc.compat.compiler=gcc +#gcc.compat.compiler=clang + # MacOsX libraries can be universal / fat binaries. # The following switches enables/disables a target platform. # If non of them is enabled, the default diff --git a/make/lib/gluegen-clang.properties b/make/lib/gluegen-clang.properties new file mode 100755 index 0000000..bbb77ae --- /dev/null +++ b/make/lib/gluegen-clang.properties @@ -0,0 +1 @@ +gcc.compat.compiler=clang diff --git a/make/scripts/make.gluegen.all.macosx-clang.sh b/make/scripts/make.gluegen.all.macosx-clang.sh new file mode 100755 index 0000000..4f84d39 --- /dev/null +++ b/make/scripts/make.gluegen.all.macosx-clang.sh @@ -0,0 +1,29 @@ +#! /bin/sh + +if [ -e /opt-share/etc/profile.ant ] ; then + . /opt-share/etc/profile.ant +fi + +# -Dc.compiler.debug=true +# +# -Dtarget.sourcelevel=1.6 \ +# -Dtarget.targetlevel=1.6 \ +# -Dtarget.rt.jar=/opt-share/jre1.6.0_30/lib/rt.jar \ + +JAVA_HOME=`/usr/libexec/java_home -version 1.7` +PATH=$JAVA_HOME/bin:$PATH +export JAVA_HOME PATH + +export SOURCE_LEVEL=1.6 +export TARGET_LEVEL=1.6 +export TARGET_RT_JAR=/opt-share/jre1.6.0_30/lib/rt.jar + +export GLUEGEN_PROPERTIES_FILE="lib/gluegen-clang.properties" +# or -Dgcc.compat.compiler=clang + +#export JOGAMP_JAR_CODEBASE="Codebase: *.jogamp.org" +export JOGAMP_JAR_CODEBASE="Codebase: *.goethel.localnet" + +ant \ + -Drootrel.build=build-macosx \ + $* 2>&1 | tee make.gluegen.all.macosx.log |