[vlc-devel] commit: Contrib: add Glew for projectM (Jean-Baptiste Kempf )

git version control git at videolan.org
Fri Dec 4 07:21:48 CET 2009


vlc | branch: master | Jean-Baptiste Kempf <jb at videolan.org> | Thu Dec  3 22:33:13 2009 +0100| [9f432d3720ede6ca046482d5b6825012da19bc33] | committer: Jean-Baptiste Kempf 

Contrib: add Glew for projectM

This stupid library with only 1 file to compile has won, by far, to be awarded the MOST STUPID config/Makefile system... Seriously, autotools is bad, but if you do stuff like that, please go and stop using a computer

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=9f432d3720ede6ca046482d5b6825012da19bc33
---

 extras/contrib/src/Makefile                 |   19 +++++++
 extras/contrib/src/Patches/glew-win32.patch |   77 +++++++++++++++++++++++++++
 extras/contrib/src/packages.mak             |    2 +
 3 files changed, 98 insertions(+), 0 deletions(-)

diff --git a/extras/contrib/src/Makefile b/extras/contrib/src/Makefile
index 903e907..90fca42 100644
--- a/extras/contrib/src/Makefile
+++ b/extras/contrib/src/Makefile
@@ -2510,6 +2510,25 @@ CLEAN_PKG += gsm
 DISTCLEAN_PKG += gsm-$(GSM_VERSION).tar.gz
 
 # ***************************************************************************
+### GLEW 
+# ***************************************************************************
+glew-$(GLEW_VERSION)-src.tgz:
+	$(WGET) $(GLEW_URL)
+
+glew: glew-$(GLEW_VERSION)-src.tgz
+	$(EXTRACT_GZ)
+	(patch -p0 < Patches/glew-win32.patch)
+
+.glew: glew
+	(cd $<; $(HOSTCC) make && $(HOSTCC) GLEW_DEST=$(PREFIX) make install)
+	touch $@
+
+CLEAN_FILE += .glew
+CLEAN_PKG += glew
+DISTCLEAN_PKG += glew-$(GLEW_VERSION)-src.tgz
+
+
+# ***************************************************************************
 # projectM
 # ***************************************************************************
 libprojectM-$(LIBPROJECTM_VERSION)-Source.tar.gz:
diff --git a/extras/contrib/src/Patches/glew-win32.patch b/extras/contrib/src/Patches/glew-win32.patch
new file mode 100644
index 0000000..86409c1
--- /dev/null
+++ b/extras/contrib/src/Patches/glew-win32.patch
@@ -0,0 +1,77 @@
+--- glew/Makefile	2008-11-03 07:25:21.000000000 +0100
++++ glew.new/Makefile	2009-12-03 22:30:47.000000000 +0100
+@@ -31,7 +31,7 @@
+ include config/version
+ 
+ SHELL = /bin/sh
+-SYSTEM = $(shell config/config.guess | cut -d - -f 3 | sed -e 's/[0-9\.]//g;')
++SYSTEM = mingw
+ SYSTEM.SUPPORTED = $(shell test -f config/Makefile.$(SYSTEM) && echo 1)
+ 
+ ifeq ($(SYSTEM.SUPPORTED), 1)
+@@ -48,9 +48,7 @@
+ TARDIR = ../glew-$(GLEW_VERSION)
+ TARBALL = ../glew_$(GLEW_VERSION).tar.gz
+ 
+-AR = ar
+ INSTALL = install
+-STRIP = strip
+ RM = rm -f
+ LN = ln -sf
+ ifeq ($(MAKECMDGOALS), debug)
+@@ -75,7 +73,7 @@
+ VISUALINFO.BIN.OBJS = $(VISUALINFO_BIN.SRCS:.c=.o)
+ BIN.LIBS = -Llib $(LDFLAGS.DYNAMIC) -l$(NAME) $(LDFLAGS.EXTRA) $(LDFLAGS.GL)
+ 
+-all debug: lib/$(LIB.SHARED) lib/$(LIB.STATIC) bin/$(GLEWINFO.BIN) bin/$(VISUALINFO.BIN)
++all debug: lib/$(LIB.SHARED) lib/$(LIB.STATIC)
+ 
+ lib:
+ 	mkdir lib
+@@ -112,27 +110,17 @@
+ 	$(INSTALL) -d -m 0755 $(INCDIR)
+ 	$(INSTALL) -d -m 0755 $(LIBDIR)
+ # runtime
+-ifeq ($(patsubst mingw%,mingw,$(SYSTEM)), mingw)
+-	$(STRIP) -x lib/$(LIB.SHARED)
+-	$(INSTALL) -m 0644 lib/$(LIB.SHARED) $(BINDIR)/
+-else
+ 	$(STRIP) -x lib/$(LIB.SHARED)
+ 	$(INSTALL) -m 0644 lib/$(LIB.SHARED) $(LIBDIR)/
+ 	$(LN) $(LIB.SHARED) $(LIBDIR)/$(LIB.SONAME)
+-endif
+ # development files
+ 	$(INSTALL) -m 0644 include/GL/wglew.h $(INCDIR)/
+ 	$(INSTALL) -m 0644 include/GL/glew.h $(INCDIR)/
+ 	$(INSTALL) -m 0644 include/GL/glxew.h $(INCDIR)/
+-ifeq ($(patsubst mingw%,mingw,$(SYSTEM)), mingw)
+-	$(INSTALL) -m 0644 lib/$(LIB.DEVLNK) $(LIBDIR)/
+-else
+-	strip -x lib/$(LIB.STATIC)
++	$(STRIP) -x lib/$(LIB.STATIC)
+ 	$(INSTALL) -m 0644 lib/$(LIB.STATIC) $(LIBDIR)/
+ 	$(LN) $(LIB.SHARED) $(LIBDIR)/$(LIB.DEVLNK)
+-endif
+ # utilities
+-	$(INSTALL) -s -m 0755 bin/$(GLEWINFO.BIN) bin/$(VISUALINFO.BIN) $(BINDIR)/
+ 
+ uninstall:
+ 	$(RM) $(INCDIR)/wglew.h
+--- glew/config/Makefile.mingw	2008-11-03 07:25:20.000000000 +0100
++++ glew.new/config/Makefile.mingw	2009-12-03 22:18:32.000000000 +0100
+@@ -1,13 +1,11 @@
+ NAME = glew32
+-CC = gcc
+ # use gcc for linking, with ld it does not work
+-LD = gcc
+ ifneq (undefined, $(origin GLEW_MX))
+ CFLAGS.EXTRA = -DGLEW_MX
+ endif
+-CFLAGS.SO = -DGLEW_BUILD
++CFLAGS.SO = -DGLEW_BUILD -DSTATIC
+ #LDFLAGS.SO = -shared -soname $(LIB.SONAME) --out-implib lib/$(LIB.DEVLNK)
+-LDFLAGS.SO = -shared -Wl,-soname,$(LIB.SONAME) -Wl,--out-implib,lib/$(LIB.DEVLNK)
++#LDFLAGS.SO = -shared -Wl,-soname,$(LIB.SONAME) -Wl,--out-implib,lib/$(LIB.DEVLNK)
+ LDFLAGS.GL = -lglu32 -lopengl32 -lgdi32 -luser32 -lkernel32
+ LDFLAGS.EXTRA = -L/mingw/lib
+ WARN = -Wall -W
diff --git a/extras/contrib/src/packages.mak b/extras/contrib/src/packages.mak
index c6be891..bd99eca 100644
--- a/extras/contrib/src/packages.mak
+++ b/extras/contrib/src/packages.mak
@@ -241,6 +241,8 @@ XCB_VERSION=1.2
 XCB_URL=http://xcb.freedesktop.org/dist/
 XCB_UTIL_VERSION=0.2
 XCB_UTIL_URL=$(XCB_URL)
+GLEW_VERSION=1.5.1
+GLEW_URL=$(SF)/glew/glew/$(GLEW_VERSION)/glew-$(GLEW_VERSION)-src.tgz
 LIBPROJECTM_VERSION=2.0.0
 LIBPROJECTM_URL=$(SF)/projectm/libprojectM/libprojectM-$(LIBPROJECTM_VERSION)/libprojectM-$(LIBPROJECTM_VERSION)-Source.tar.gz
 LIBPROJECTM_SVN=https://projectm.svn.sourceforge.net/svnroot/projectm/trunk




More information about the vlc-devel mailing list