summaryrefslogtreecommitdiff
path: root/external/glew
diff options
context:
space:
mode:
authorTor Lillqvist <tml@collabora.com>2014-04-08 12:49:14 +0300
committerTor Lillqvist <tml@collabora.com>2014-04-08 12:51:54 +0300
commitd8ad7d5790d5770ae5c197f57bb26e414fdff07e (patch)
tree0a1eaebeb31fc710b4d678eb1feed32809a7418c /external/glew
parentdf2c663fef3435a8c3d541b364780876229ccd29 (diff)
Build GLEW for all platforms
Whether it actually should be used or not on some particular platform is another thing that remains to be seen. But I think it should be buildable for all? Don't build the glew programs for non-desktop platforms. Build only static libraries when DISABLE_DYNLOADING. No AGL framework, and it's OpenGLES, not OpenGL, on iOS. Change-Id: Idf3aad341c4f270952db2039d5a5e421f39e728f
Diffstat (limited to 'external/glew')
-rw-r--r--external/glew/ExternalProject_glew.mk2
-rw-r--r--external/glew/Module_glew.mk4
-rw-r--r--external/glew/UnpackedTarball_glew.mk16
-rw-r--r--external/glew/glew-ios.patch.112
-rw-r--r--external/glew/glew-static-only.patch.112
5 files changed, 41 insertions, 5 deletions
diff --git a/external/glew/ExternalProject_glew.mk b/external/glew/ExternalProject_glew.mk
index 304363040b27..96026a1d1cf0 100644
--- a/external/glew/ExternalProject_glew.mk
+++ b/external/glew/ExternalProject_glew.mk
@@ -25,7 +25,7 @@ else
$(call gb_ExternalProject_get_state_target,glew,build) :
$(call gb_ExternalProject_run,glew,\
$(if $(filter TRUE,$(ENABLE_DEBUG)),STRIP=) LD="$(CC)" \
- $(MAKE) glew.lib $(if $(filter TRUE,$(ENABLE_DEBUG)),debug) \
+ $(MAKE) glew.lib $(if $(filter DESKTOP,$(BUILD_TYPE)),$(if $(filter TRUE,$(ENABLE_DEBUG)),debug)) \
)
endif
diff --git a/external/glew/Module_glew.mk b/external/glew/Module_glew.mk
index 6fcc9abe54a9..1d1b9a7154aa 100644
--- a/external/glew/Module_glew.mk
+++ b/external/glew/Module_glew.mk
@@ -9,14 +9,10 @@
$(eval $(call gb_Module_Module,glew))
-ifeq ($(CROSS_COMPILING),)
-
$(eval $(call gb_Module_add_targets,glew,\
ExternalProject_glew \
UnpackedTarball_glew \
ExternalPackage_glew \
))
-endif
-
# vim: set noet sw=4 ts=4:
diff --git a/external/glew/UnpackedTarball_glew.mk b/external/glew/UnpackedTarball_glew.mk
index 64544b9db075..c3124d881b1b 100644
--- a/external/glew/UnpackedTarball_glew.mk
+++ b/external/glew/UnpackedTarball_glew.mk
@@ -13,6 +13,10 @@ $(eval $(call gb_UnpackedTarball_set_tarball,glew,$(GLEW_TARBALL)))
$(eval $(call gb_UnpackedTarball_set_patchlevel,glew,0))
+$(eval $(call gb_UnpackedTarball_fix_end_of_line,glew,\
+ Makefile \
+))
+
ifeq ($(OS)$(COM),WNTMSC)
$(eval $(call gb_UnpackedTarball_set_patchflags,glew,--binary))
$(eval $(call gb_UnpackedTarball_add_patches,glew,\
@@ -31,4 +35,16 @@ $(eval $(call gb_UnpackedTarball_add_patches,glew,\
))
endif
+ifeq ($(OS),IOS)
+$(eval $(call gb_UnpackedTarball_add_patches,glew,\
+ external/glew/glew-ios.patch.1 \
+))
+endif
+
+ifeq ($(DISABLE_DYNLOADING),TRUE)
+$(eval $(call gb_UnpackedTarball_add_patches,glew,\
+ external/glew/glew-static-only.patch.1 \
+))
+endif
+
# vim: set noet sw=4 ts=4:
diff --git a/external/glew/glew-ios.patch.1 b/external/glew/glew-ios.patch.1
new file mode 100644
index 000000000000..05814f69cccc
--- /dev/null
+++ b/external/glew/glew-ios.patch.1
@@ -0,0 +1,12 @@
+-*- Mode:Diff -*-
+--- glew/config/Makefile.darwin
++++ glew/config/Makefile.darwin
+@@ -8,7 +8,7 @@
+ CFLAGS.EXTRA += -I/usr/X11R6/include -D'GLEW_APPLE_GLX'
+ LDFLAGS.GL = -L/usr/X11R6/lib -lGL -lX11
+ else
+-LDFLAGS.GL = -framework AGL -framework OpenGL
++LDFLAGS.GL = -framework OpenGLES
+ endif
+ LDFLAGS.STATIC =
+ LDFLAGS.DYNAMIC =
diff --git a/external/glew/glew-static-only.patch.1 b/external/glew/glew-static-only.patch.1
new file mode 100644
index 000000000000..14ccff23a6be
--- /dev/null
+++ b/external/glew/glew-static-only.patch.1
@@ -0,0 +1,12 @@
+-*- Mode:Diff -*-
+--- glew/Makefile
++++ glew/Makefile
+@@ -93,7 +93,7 @@
+ LIB.SOBJS.MX := $(addprefix tmp/$(SYSTEM)/mx/shared/,$(LIB.SRCS.NAMES))
+ LIB.SOBJS.MX := $(LIB.SOBJS.MX:.c=.o)
+
+-glew.lib: lib lib/$(LIB.SHARED) lib/$(LIB.STATIC) glew.pc
++glew.lib: lib lib/$(LIB.STATIC)
+
+ lib:
+ mkdir lib