summaryrefslogtreecommitdiffstats
path: root/make
diff options
context:
space:
mode:
authorSven Gothel <[email protected]>2015-07-14 18:28:29 +0200
committerSven Gothel <[email protected]>2015-07-14 18:28:29 +0200
commitf7c50fca34df0b5d393ffab0da09bce19ddfba64 (patch)
tree5a8031dd5cb9d346e37e8b7e6554e5aa11b19bc1 /make
parent263bc4eba018a78f76dcc311c55372697d592627 (diff)
Include Khronos derived glcorearb.h before cl_gl.h, avoiding typedef mismatch w/ APPLE's GL
LLVM's clang reports a typedef mismatch of GLintptr and GLsizeiptr between the Khronos derived glcorearb.h (from JOGL) and APPLE's gltypes.h when producing 32bit builds. +++ In file included from /usr/local/projects/jogamp/jocl/build-macosx-java6/gensrc/native/jocl/CLAbstractImpl_JNI.c:15: /usr/local/projects/jogamp/jogl/make/stub_includes/opengl/GL/glcorearb.h:604:19: error: typedef redefinition with different types ('ptrdiff_t' (aka 'int') vs 'intptr_t' (aka 'long')) typedef ptrdiff_t GLintptr; ^ /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.10.sdk/System/Library/Frameworks/OpenGL.framework/Headers/gltypes.h:51:18: note: previous definition is here typedef intptr_t GLintptr; +++ I.e. Khronos uses ptrdiff_t (aka 'int' on 32bit), where APPLE uses intptr_t (aka 'long' on 32bit). On OSX 32bit both ('int' and 'long') have the same sizeof value, i.e. 4 bytes, see below, hence the ABI is compatible! However, clang produces a typedef mismatch. Fix includes the Khronos derived (JOGL) glcorearb.h before cl_gl.h, hence favors the former 'canonical' definition. +++ OSX 10.10 32bit: sizeof int: 4 sizeof long: 4 sizeof long long: 8 sizeof intptr_t: 4 sizeof uintptr_t: 4 sizeof ptrdiff_t: 4 sizeof size_t: 4 sizeof float: 4 sizeof double: 8 sizeof long double: 16 OSX 10.10 64bit: sizeof int: 4 sizeof long: 8 sizeof long long: 8 sizeof intptr_t: 8 sizeof uintptr_t: 8 sizeof ptrdiff_t: 8 sizeof size_t: 8 sizeof float: 4 sizeof double: 8 sizeof long double: 16
Diffstat (limited to 'make')
-rw-r--r--make/config/cl-impl.cfg4
-rwxr-xr-xmake/scripts/make.jocl.all.macosx-java6.sh (renamed from make/scripts/make.jocl.all.macosx-clang.sh)14
-rwxr-xr-xmake/scripts/make.jocl.all.macosx.sh6
3 files changed, 11 insertions, 13 deletions
diff --git a/make/config/cl-impl.cfg b/make/config/cl-impl.cfg
index 62ce703..d942302 100644
--- a/make/config/cl-impl.cfg
+++ b/make/config/cl-impl.cfg
@@ -56,11 +56,11 @@ Ignore clGetExtensionFunctionAddress
ForceProcAddressGen clGetExtensionFunctionAddress
#append to generated c files
+CustomCCode #include <inttypes.h>
+CustomCCode #include <GL/glcorearb.h>
CustomCCode #include <CL/cl.h>
CustomCCode #include <CL/cl_ext.h>
CustomCCode #include <CL/cl_gl.h>
-CustomCCode #include <GL/glcorearb.h>
-CustomCCode #include <inttypes.h>
# implement manually via custom code
Ignore clCreateContext
diff --git a/make/scripts/make.jocl.all.macosx-clang.sh b/make/scripts/make.jocl.all.macosx-java6.sh
index 6e5552d..2d678ac 100755
--- a/make/scripts/make.jocl.all.macosx-clang.sh
+++ b/make/scripts/make.jocl.all.macosx-java6.sh
@@ -1,10 +1,13 @@
#! /bin/sh
+SDIR=`dirname $0`
+
if [ -e /opt-share/etc/profile.ant ] ; then
. /opt-share/etc/profile.ant
fi
-JAVA_HOME=`/usr/libexec/java_home -version 1.7`
+#JAVA_HOME=`/usr/libexec/java_home -version 1.8`
+JAVA_HOME=`/usr/libexec/java_home -version 1.6`
PATH=$JAVA_HOME/bin:$PATH
export JAVA_HOME PATH
@@ -14,12 +17,9 @@ 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="../../gluegen/make/lib/gluegen-xcode_clang.properties"
-# or -Dgcc.compat.compiler=xcode.clang
-
#export JOGAMP_JAR_CODEBASE="Codebase: *.jogamp.org"
export JOGAMP_JAR_CODEBASE="Codebase: *.goethel.localnet"
-ant \
- -Drootrel.build=build-macosx \
- $* 2>&1 | tee make.joal.all.macosx.log
+ant \
+ -Drootrel.build=build-macosx-java6 \
+ $* 2>&1 | tee make.jocl.all.macosx-java6.log
diff --git a/make/scripts/make.jocl.all.macosx.sh b/make/scripts/make.jocl.all.macosx.sh
index 20f65b9..88e6bfe 100755
--- a/make/scripts/make.jocl.all.macosx.sh
+++ b/make/scripts/make.jocl.all.macosx.sh
@@ -6,7 +6,8 @@ if [ -e /opt-share/etc/profile.ant ] ; then
. /opt-share/etc/profile.ant
fi
-JAVA_HOME=`/usr/libexec/java_home -version 1.7`
+JAVA_HOME=`/usr/libexec/java_home -version 1.8`
+#JAVA_HOME=`/usr/libexec/java_home -version 1.6`
PATH=$JAVA_HOME/bin:$PATH
export JAVA_HOME PATH
@@ -16,9 +17,6 @@ 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="../../gluegen/make/lib/gluegen-clang.properties"
-# or -Dgcc.compat.compiler=clang
-
#export JOGAMP_JAR_CODEBASE="Codebase: *.jogamp.org"
export JOGAMP_JAR_CODEBASE="Codebase: *.goethel.localnet"