Merge branch 'master' of git://glew.git.sourceforge.net/gitroot/glew/glew

This commit is contained in:
Nigel Stewart 2011-04-23 13:23:52 -05:00
commit 5b0dde022c
25 changed files with 362 additions and 221 deletions

174
Makefile
View File

@ -45,6 +45,7 @@ BINDIR ?= $(GLEW_DEST)/bin
LIBDIR ?= $(GLEW_DEST)/lib LIBDIR ?= $(GLEW_DEST)/lib
INCDIR ?= $(GLEW_DEST)/include/GL INCDIR ?= $(GLEW_DEST)/include/GL
SHARED_OBJ_EXT ?= o SHARED_OBJ_EXT ?= o
TARDIR = ../glew-$(GLEW_VERSION) TARDIR = ../glew-$(GLEW_VERSION)
TARBALL = ../glew-$(GLEW_VERSION).tar.gz TARBALL = ../glew-$(GLEW_VERSION).tar.gz
@ -72,6 +73,9 @@ LIB.SOBJS = $(LIB.SRCS:.c=.$(SHARED_OBJ_EXT))
LIB.LDFLAGS = $(LDFLAGS.EXTRA) $(LDFLAGS.GL) LIB.LDFLAGS = $(LDFLAGS.EXTRA) $(LDFLAGS.GL)
LIB.LIBS = $(GL_LDFLAGS) LIB.LIBS = $(GL_LDFLAGS)
LIB.OBJS.MX = $(LIB.SRCS:.c=.mx.o)
LIB.SOBJS.MX = $(LIB.SRCS:.c=.mx.$(SHARED_OBJ_EXT))
GLEWINFO.BIN = glewinfo$(BIN.SUFFIX) GLEWINFO.BIN = glewinfo$(BIN.SUFFIX)
GLEWINFO.BIN.SRCS = src/glewinfo.c GLEWINFO.BIN.SRCS = src/glewinfo.c
GLEWINFO.BIN.OBJS = $(GLEWINFO.BIN.SRCS:.c=.o) GLEWINFO.BIN.OBJS = $(GLEWINFO.BIN.SRCS:.c=.o)
@ -80,14 +84,18 @@ VISUALINFO.BIN.SRCS = src/visualinfo.c
VISUALINFO.BIN.OBJS = $(VISUALINFO.BIN.SRCS:.c=.o) VISUALINFO.BIN.OBJS = $(VISUALINFO.BIN.SRCS:.c=.o)
BIN.LIBS = -Llib $(LDFLAGS.DYNAMIC) -l$(NAME) $(LDFLAGS.EXTRA) $(LDFLAGS.GL) BIN.LIBS = -Llib $(LDFLAGS.DYNAMIC) -l$(NAME) $(LDFLAGS.EXTRA) $(LDFLAGS.GL)
all debug: lib bin lib/$(LIB.SHARED) lib/$(LIB.STATIC) bin/$(GLEWINFO.BIN) bin/$(VISUALINFO.BIN) glew.pc all debug: glew.lib glew.lib.mx glew.bin
%.o: %.c
$(CC) -c $(CFLAGS) -o $@ $<
# GLEW libraries
glew.lib: lib lib/$(LIB.SHARED) lib/$(LIB.STATIC) glew.pc
lib: lib:
mkdir lib mkdir lib
bin:
mkdir bin
lib/$(LIB.STATIC): $(LIB.OBJS) lib/$(LIB.STATIC): $(LIB.OBJS)
$(AR) cr $@ $^ $(AR) cr $@ $^
@ -99,21 +107,6 @@ else
$(LN) $(LIB.SHARED) lib/$(LIB.DEVLNK) $(LN) $(LIB.SHARED) lib/$(LIB.DEVLNK)
endif endif
bin/$(GLEWINFO.BIN): $(GLEWINFO.BIN.OBJS) lib/$(LIB.SHARED)
$(CC) $(CFLAGS) -o $@ $(GLEWINFO.BIN.OBJS) $(BIN.LIBS)
bin/$(VISUALINFO.BIN): $(VISUALINFO.BIN.OBJS) lib/$(LIB.SHARED)
$(CC) $(CFLAGS) -o $@ $(VISUALINFO.BIN.OBJS) $(BIN.LIBS)
%.o: %.c
$(CC) -c $(CFLAGS) -o $@ $<
src/glew.o: src/glew.c include/GL/glew.h include/GL/wglew.h include/GL/glxew.h
$(CC) $(CFLAGS) $(CFLAGS.SO) -o $@ -c $<
src/glew.pic_o: src/glew.c include/GL/glew.h include/GL/wglew.h include/GL/glxew.h
$(CC) $(CFLAGS) $(PICFLAG) $(CFLAGS.SO) -o $@ -c $<
glew.pc: glew.pc.in glew.pc: glew.pc.in
sed \ sed \
-e "s|@prefix@|$(GLEW_DEST)|g" \ -e "s|@prefix@|$(GLEW_DEST)|g" \
@ -121,14 +114,71 @@ glew.pc: glew.pc.in
-e "s|@exec_prefix@|$(BINDIR)|g" \ -e "s|@exec_prefix@|$(BINDIR)|g" \
-e "s|@includedir@|$(INCDIR)|g" \ -e "s|@includedir@|$(INCDIR)|g" \
-e "s|@version@|$(GLEW_VERSION)|g" \ -e "s|@version@|$(GLEW_VERSION)|g" \
-e "s|@cflags@||g" \
-e "s|@libname@|GLEW|g" \
< $< > $@ < $< > $@
install: all src/glew.o: src/glew.c include/GL/glew.h include/GL/wglew.h include/GL/glxew.h
# directories $(CC) -DGLEW_NO_GLU $(CFLAGS) $(CFLAGS.SO) -o $@ -c $<
$(INSTALL) -d -m 0755 $(BINDIR)
$(INSTALL) -d -m 0755 $(INCDIR) src/glew.pic_o: src/glew.c include/GL/glew.h include/GL/wglew.h include/GL/glxew.h
$(CC) -DGLEW_NO_GLU $(CFLAGS) $(PICFLAG) $(CFLAGS.SO) -o $@ -c $<
# GLEW MX libraries
glew.lib.mx: lib lib/$(LIB.SHARED.MX) lib/$(LIB.STATIC.MX) glewmx.pc
lib/$(LIB.STATIC.MX): $(LIB.OBJS.MX)
$(AR) cr $@ $^
lib/$(LIB.SHARED.MX): $(LIB.SOBJS.MX)
$(LD) $(LDFLAGS.SO.MX) -o $@ $^ $(LIB.LDFLAGS) $(LIB.LIBS)
ifeq ($(filter-out mingw% cygwin,$(SYSTEM)),)
else
$(LN) $(LIB.SHARED.MX) lib/$(LIB.SONAME.MX)
$(LN) $(LIB.SHARED.MX) lib/$(LIB.DEVLNK.MX)
endif
glewmx.pc: glew.pc.in
sed \
-e "s|@prefix@|$(GLEW_DEST)|g" \
-e "s|@libdir@|$(LIBDIR)|g" \
-e "s|@exec_prefix@|$(BINDIR)|g" \
-e "s|@includedir@|$(INCDIR)|g" \
-e "s|@version@|$(GLEW_VERSION)|g" \
-e "s|@cflags@|-DGLEW_MX|g" \
-e "s|@libname@|GLEWmx|g" \
< $< > $@
src/glew.mx.o: src/glew.c include/GL/glew.h include/GL/wglew.h include/GL/glxew.h
$(CC) -DGLEW_NO_GLU -DGLEW_MX $(CFLAGS) $(CFLAGS.SO) -o $@ -c $<
src/glew.mx.pic_o: src/glew.c include/GL/glew.h include/GL/wglew.h include/GL/glxew.h
$(CC) -DGLEW_NO_GLU -DGLEW_MX $(CFLAGS) $(PICFLAG) $(CFLAGS.SO) -o $@ -c $<
# GLEW utilities
bin:
mkdir bin
glew.bin: glew.lib bin bin/$(GLEWINFO.BIN) bin/$(VISUALINFO.BIN)
bin/$(GLEWINFO.BIN): $(GLEWINFO.BIN.OBJS) lib/$(LIB.SHARED)
$(CC) $(CFLAGS) -o $@ $(GLEWINFO.BIN.OBJS) $(BIN.LIBS)
bin/$(VISUALINFO.BIN): $(VISUALINFO.BIN.OBJS) lib/$(LIB.SHARED)
$(CC) $(CFLAGS) -o $@ $(VISUALINFO.BIN.OBJS) $(BIN.LIBS)
# Install targets
install.all: install install.mx install.bin
install: install.include install.lib install.pkgconfig
install.mx: install.include install.lib.mx install.pkgconfig.mx
install.lib: glew.lib
$(INSTALL) -d -m 0755 $(LIBDIR) $(INSTALL) -d -m 0755 $(LIBDIR)
$(INSTALL) -d -m 0755 $(LIBDIR)/pkgconfig
# runtime # runtime
ifeq ($(filter-out mingw% cygwin,$(SYSTEM)),) ifeq ($(filter-out mingw% cygwin,$(SYSTEM)),)
$(STRIP) -x lib/$(LIB.SHARED) $(STRIP) -x lib/$(LIB.SHARED)
@ -139,10 +189,6 @@ else
$(LN) $(LIB.SHARED) $(LIBDIR)/$(LIB.SONAME) $(LN) $(LIB.SHARED) $(LIBDIR)/$(LIB.SONAME)
endif endif
# development files # 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)/
$(INSTALL) -m 0644 glew.pc $(LIBDIR)/pkgconfig/
ifeq ($(filter-out mingw% cygwin,$(SYSTEM)),) ifeq ($(filter-out mingw% cygwin,$(SYSTEM)),)
$(INSTALL) -m 0644 lib/$(LIB.DEVLNK) $(LIBDIR)/ $(INSTALL) -m 0644 lib/$(LIB.DEVLNK) $(LIBDIR)/
else else
@ -150,29 +196,68 @@ else
$(INSTALL) -m 0644 lib/$(LIB.STATIC) $(LIBDIR)/ $(INSTALL) -m 0644 lib/$(LIB.STATIC) $(LIBDIR)/
$(LN) $(LIB.SHARED) $(LIBDIR)/$(LIB.DEVLNK) $(LN) $(LIB.SHARED) $(LIBDIR)/$(LIB.DEVLNK)
endif endif
# utilities
install.lib.mx: glew.lib.mx
$(INSTALL) -d -m 0755 $(LIBDIR)
# runtime
ifeq ($(filter-out mingw% cygwin,$(SYSTEM)),)
$(STRIP) -x lib/$(LIB.SHARED.MX)
$(INSTALL) -m 0644 lib/$(LIB.SHARED.MX) $(BINDIR)/
else
$(STRIP) -x lib/$(LIB.SHARED.MX)
$(INSTALL) -m 0644 lib/$(LIB.SHARED.MX) $(LIBDIR)/
$(LN) $(LIB.SHARED.MX) $(LIBDIR)/$(LIB.SONAME.MX)
endif
# development files
ifeq ($(filter-out mingw% cygwin,$(SYSTEM)),)
$(INSTALL) -m 0644 lib/$(LIB.DEVLNK.MX) $(LIBDIR)/
else
$(STRIP) -x lib/$(LIB.STATIC.MX)
$(INSTALL) -m 0644 lib/$(LIB.STATIC.MX) $(LIBDIR)/
$(LN) $(LIB.SHARED.MX) $(LIBDIR)/$(LIB.DEVLNK.MX)
endif
install.bin: glew.bin
$(INSTALL) -d -m 0755 $(BINDIR)
$(INSTALL) -s -m 0755 bin/$(GLEWINFO.BIN) bin/$(VISUALINFO.BIN) $(BINDIR)/ $(INSTALL) -s -m 0755 bin/$(GLEWINFO.BIN) bin/$(VISUALINFO.BIN) $(BINDIR)/
install.include:
$(INSTALL) -d -m 0755 $(INCDIR)
$(INSTALL) -m 0644 include/GL/wglew.h $(INCDIR)/
$(INSTALL) -m 0644 include/GL/glew.h $(INCDIR)/
$(INSTALL) -m 0644 include/GL/glxew.h $(INCDIR)/
install.pkgconfig: glew.pc
$(INSTALL) -d -m 0755 $(LIBDIR)
$(INSTALL) -d -m 0755 $(LIBDIR)/pkgconfig
$(INSTALL) -m 0644 glew.pc $(LIBDIR)/pkgconfig/
install.pkgconfig.mx: glewmx.pc
$(INSTALL) -d -m 0755 $(LIBDIR)
$(INSTALL) -d -m 0755 $(LIBDIR)/pkgconfig
$(INSTALL) -m 0644 glewmx.pc $(LIBDIR)/pkgconfig/
uninstall: uninstall:
$(RM) $(INCDIR)/wglew.h $(RM) $(INCDIR)/wglew.h
$(RM) $(INCDIR)/glew.h $(RM) $(INCDIR)/glew.h
$(RM) $(INCDIR)/glxew.h $(RM) $(INCDIR)/glxew.h
$(RM) $(LIBDIR)/$(LIB.DEVLNK) $(RM) $(LIBDIR)/$(LIB.DEVLNK) $(LIBDIR)/$(LIB.DEVLNK.MX)
ifeq ($(filter-out mingw% cygwin,$(SYSTEM)),) ifeq ($(filter-out mingw% cygwin,$(SYSTEM)),)
$(RM) $(BINDIR)/$(LIB.SHARED) $(RM) $(BINDIR)/$(LIB.SHARED) $(BINDIR)/$(LIB.SHARED.MX)
else else
$(RM) $(LIBDIR)/$(LIB.SONAME) $(RM) $(LIBDIR)/$(LIB.SONAME) $(LIBDIR)/$(LIB.SONAME.MX)
$(RM) $(LIBDIR)/$(LIB.SHARED) $(RM) $(LIBDIR)/$(LIB.SHARED) $(LIBDIR)/$(LIB.SHARED.MX)
$(RM) $(LIBDIR)/$(LIB.STATIC) $(RM) $(LIBDIR)/$(LIB.STATIC) $(LIBDIR)/$(LIB.STATIC.MX)
endif endif
$(RM) $(BINDIR)/$(GLEWINFO.BIN) $(BINDIR)/$(VISUALINFO.BIN) $(RM) $(BINDIR)/$(GLEWINFO.BIN) $(BINDIR)/$(VISUALINFO.BIN)
clean: clean:
$(RM) $(LIB.OBJS) $(RM) $(LIB.OBJS) $(LIB.OBJS.MX)
$(RM) $(LIB.SOBJS) $(RM) $(LIB.SOBJS) $(LIB.SOBJS.MX)
$(RM) lib/$(LIB.STATIC) lib/$(LIB.SHARED) lib/$(LIB.DEVLNK) lib/$(LIB.SONAME) $(LIB.STATIC) $(RM) lib/$(LIB.STATIC) lib/$(LIB.SHARED) lib/$(LIB.DEVLNK) lib/$(LIB.SONAME) $(LIB.STATIC)
$(RM) lib/$(LIB.STATIC.MX) lib/$(LIB.SHARED.MX) lib/$(LIB.DEVLNK.MX) lib/$(LIB.SONAME.MX) $(LIB.STATIC.MX)
$(RM) $(GLEWINFO.BIN.OBJS) bin/$(GLEWINFO.BIN) $(VISUALINFO.BIN.OBJS) bin/$(VISUALINFO.BIN) $(RM) $(GLEWINFO.BIN.OBJS) bin/$(GLEWINFO.BIN) $(VISUALINFO.BIN.OBJS) bin/$(VISUALINFO.BIN)
$(RM) glew.pc $(RM) glew.pc glewmx.pc
# Compiler droppings # Compiler droppings
$(RM) so_locations $(RM) so_locations
$(RM) -r lib/ bin/ $(RM) -r lib/ bin/
@ -181,18 +266,7 @@ distclean: clean
find . -name \*~ | xargs $(RM) find . -name \*~ | xargs $(RM)
find . -name .\*.sw\? | xargs $(RM) find . -name .\*.sw\? | xargs $(RM)
tardist: # Distributions
$(RM) -r $(TARDIR)
mkdir $(TARDIR)
cp -a . $(TARDIR)
find $(TARDIR) -name CVS -o -name .cvsignore | xargs $(RM) -r
find $(TARDIR) -name .svn | xargs $(RM) -r
find $(TARDIR) -name "*.patch" | xargs $(RM) -r
$(MAKE) -C $(TARDIR) distclean
$(MAKE) -C $(TARDIR)
$(MAKE) -C $(TARDIR) distclean
$(RM) -r $(TARDIR)/auto/registry
env GZIP=-9 tar -C `dirname $(TARDIR)` -cvzf $(TARBALL) `basename $(TARDIR)`
dist-win32: dist-win32:
$(RM) -r $(TARDIR) $(RM) -r $(TARDIR)
@ -233,7 +307,9 @@ dist-src:
cp -a Makefile $(TARDIR) cp -a Makefile $(TARDIR)
cp -a glew.pc.in $(TARDIR) cp -a glew.pc.in $(TARDIR)
find $(TARDIR) -name '*.o' | xargs $(RM) -r find $(TARDIR) -name '*.o' | xargs $(RM) -r
find $(TARDIR) -name '*.mx.o' | xargs $(RM) -r
find $(TARDIR) -name '*.pic_o' | xargs $(RM) -r find $(TARDIR) -name '*.pic_o' | xargs $(RM) -r
find $(TARDIR) -name '*.mx.pic_o' | xargs $(RM) -r
find $(TARDIR) -name '*~' | xargs $(RM) -r find $(TARDIR) -name '*~' | xargs $(RM) -r
find $(TARDIR) -name CVS -o -name .cvsignore | xargs $(RM) -r find $(TARDIR) -name CVS -o -name .cvsignore | xargs $(RM) -r
find $(TARDIR) -name .svn | xargs $(RM) -r find $(TARDIR) -name .svn | xargs $(RM) -r

View File

@ -26,7 +26,7 @@ ifeq (custom,$(MAKECMDGOALS))
GL_EXT_SPEC := $(shell grep "^[ \t]*GL_" custom.txt | grep -v GL_VERSION | sed -e 's/\(.*\)/$(EXT)\/\1/g;') GL_EXT_SPEC := $(shell grep "^[ \t]*GL_" custom.txt | grep -v GL_VERSION | sed -e 's/\(.*\)/$(EXT)\/\1/g;')
WGL_EXT_SPEC := $(shell grep "^[ \t]*WGL_" custom.txt | sed -e 's/\(.*\)/$(EXT)\/\1/g;') WGL_EXT_SPEC := $(shell grep "^[ \t]*WGL_" custom.txt | sed -e 's/\(.*\)/$(EXT)\/\1/g;')
#GLX_CORE_SPEC := $(shell grep GLX_VERSION custom.txt | sed -e 's/\(.*\)/$(CORE)\/\1/g;') #GLX_CORE_SPEC := $(shell grep GLX_VERSION custom.txt | sed -e 's/\(.*\)/$(CORE)\/\1/g;')
GLX_EXT_SPEC := $(shell grep "^[ \t]*GLX_" custom.txt | grep -v GLX_VERSION | grep -v GLX_OML_sync_control | sed -e 's/\(.*\)/$(EXT)\/\1/g;') GLX_EXT_SPEC := $(shell grep "^[ \t]*GLX_" custom.txt | grep -v GLX_VERSION | sed -e 's/\(.*\)/$(EXT)\/\1/g;')
else else
GL_EXT_SPEC := $(EXT)/GL_* GL_EXT_SPEC := $(EXT)/GL_*
WGL_EXT_SPEC := $(EXT)/WGL_* WGL_EXT_SPEC := $(EXT)/WGL_*
@ -155,7 +155,6 @@ $(I.DEST)/glxew.h: $(EXT)/.dummy
echo -e "\n#ifdef GLEW_MX\n}; /* GLXEWContextStruct */\n#endif /* GLEW_MX */\n" >> $@ echo -e "\n#ifdef GLEW_MX\n}; /* GLXEWContextStruct */\n#endif /* GLEW_MX */\n" >> $@
perl -e 's/GLXEW_EXPORT GLboolean __GLXEW_VERSION_1_2;/GLXEW_EXPORT GLboolean __GLXEW_VERSION_1_0;\nGLXEW_EXPORT GLboolean __GLXEW_VERSION_1_1;\nGLXEW_EXPORT GLboolean __GLXEW_VERSION_1_2;/' -pi $@ perl -e 's/GLXEW_EXPORT GLboolean __GLXEW_VERSION_1_2;/GLXEW_EXPORT GLboolean __GLXEW_VERSION_1_0;\nGLXEW_EXPORT GLboolean __GLXEW_VERSION_1_1;\nGLXEW_EXPORT GLboolean __GLXEW_VERSION_1_2;/' -pi $@
cat $(SRC)/glxew_tail.h >> $@ cat $(SRC)/glxew_tail.h >> $@
$(BIN)/fix_OML_sync_control.sh $@
$(S.DEST)/glew.c: $(EXT)/.dummy $(S.DEST)/glew.c: $(EXT)/.dummy
@echo "--------------------------------------------------------------------" @echo "--------------------------------------------------------------------"
@ -217,7 +216,6 @@ $(S.DEST)/glew.c: $(EXT)/.dummy
perl -e "s/GLEW_VERSION_MICRO_STRING/$(GLEW_MICRO)/g" -pi $@ perl -e "s/GLEW_VERSION_MICRO_STRING/$(GLEW_MICRO)/g" -pi $@
perl -e "s/GLEW_ARB_vertex_shader = !_glewInit_GL_ARB_vertex_shader\(GLEW_CONTEXT_ARG_VAR_INIT\);/{ GLEW_ARB_vertex_shader = !_glewInit_GL_ARB_vertex_shader(GLEW_CONTEXT_ARG_VAR_INIT); _glewInit_GL_ARB_vertex_program(GLEW_CONTEXT_ARG_VAR_INIT); }/g" -pi $@ perl -e "s/GLEW_ARB_vertex_shader = !_glewInit_GL_ARB_vertex_shader\(GLEW_CONTEXT_ARG_VAR_INIT\);/{ GLEW_ARB_vertex_shader = !_glewInit_GL_ARB_vertex_shader(GLEW_CONTEXT_ARG_VAR_INIT); _glewInit_GL_ARB_vertex_program(GLEW_CONTEXT_ARG_VAR_INIT); }/g" -pi $@
perl -e "s/\(\(glColorSubTable = /((glBlendEquation = (PFNGLBLENDEQUATIONPROC)glewGetProcAddress((const GLubyte*)\"glBlendEquation\")) == NULL) || r;\n r = ((glColorSubTable = /g" -pi $@ perl -e "s/\(\(glColorSubTable = /((glBlendEquation = (PFNGLBLENDEQUATIONPROC)glewGetProcAddress((const GLubyte*)\"glBlendEquation\")) == NULL) || r;\n r = ((glColorSubTable = /g" -pi $@
$(BIN)/fix_OML_sync_control.sh $@
rm -f $@.bak rm -f $@.bak
$(S.DEST)/glew_def.c: $(EXT)/.dummy $(S.DEST)/glew_def.c: $(EXT)/.dummy
@ -273,7 +271,6 @@ $(S.DEST)/glew_init.c: $(EXT)/.dummy
perl -e "s/GLEW_VERSION_MICRO_STRING/$(GLEW_MICRO)/g" -pi $@ perl -e "s/GLEW_VERSION_MICRO_STRING/$(GLEW_MICRO)/g" -pi $@
perl -e "s/GLEW_ARB_vertex_shader = !_glewInit_GL_ARB_vertex_shader\(GLEW_CONTEXT_ARG_VAR_INIT\);/{ GLEW_ARB_vertex_shader = !_glewInit_GL_ARB_vertex_shader(GLEW_CONTEXT_ARG_VAR_INIT); _glewInit_GL_ARB_vertex_program(GLEW_CONTEXT_ARG_VAR_INIT); }/g" -pi $@ perl -e "s/GLEW_ARB_vertex_shader = !_glewInit_GL_ARB_vertex_shader\(GLEW_CONTEXT_ARG_VAR_INIT\);/{ GLEW_ARB_vertex_shader = !_glewInit_GL_ARB_vertex_shader(GLEW_CONTEXT_ARG_VAR_INIT); _glewInit_GL_ARB_vertex_program(GLEW_CONTEXT_ARG_VAR_INIT); }/g" -pi $@
perl -e "s/\(\(glBlendColor = /((glBlendEquation = (PFNGLBLENDEQUATIONPROC)glewGetProcAddress((const GLubyte*)\"glBlendEquation\")) == NULL) || r;\n r = ((glBlendColor = /g" -pi $@ perl -e "s/\(\(glBlendColor = /((glBlendEquation = (PFNGLBLENDEQUATIONPROC)glewGetProcAddress((const GLubyte*)\"glBlendEquation\")) == NULL) || r;\n r = ((glBlendColor = /g" -pi $@
$(BIN)/fix_OML_sync_control.sh $@
rm -f $@.bak rm -f $@.bak
$(S.DEST)/glew_str.c: $(EXT)/.dummy $(S.DEST)/glew_str.c: $(EXT)/.dummy
@ -286,7 +283,6 @@ $(S.DEST)/glew_str.c: $(EXT)/.dummy
cat $(SRC)/glew_str_glx.c >> $@ cat $(SRC)/glew_str_glx.c >> $@
$(BIN)/make_str.pl $(GLX_CORE_SPEC) $(GLX_EXT_SPEC) >> $@ $(BIN)/make_str.pl $(GLX_CORE_SPEC) $(GLX_EXT_SPEC) >> $@
cat $(SRC)/glew_str_tail.c >> $@ cat $(SRC)/glew_str_tail.c >> $@
# $(BIN)/fix_OML_sync_control.sh $@
# perl -e "s/GLEW_VERSION_STRING/$(GLEW_VERSION)/g" -pi $@ # perl -e "s/GLEW_VERSION_STRING/$(GLEW_VERSION)/g" -pi $@
# perl -e "s/GLEW_ARB_vertex_shader = !_glewInit_GL_ARB_vertex_shader\(GLEW_CONTEXT_ARG_VAR_INIT\);/{ GLEW_ARB_vertex_shader = !_glewInit_GL_ARB_vertex_shader(GLEW_CONTEXT_ARG_VAR_INIT); _glewInit_GL_ARB_vertex_program(GLEW_CONTEXT_ARG_VAR_INIT); }/g" -pi $@ # perl -e "s/GLEW_ARB_vertex_shader = !_glewInit_GL_ARB_vertex_shader\(GLEW_CONTEXT_ARG_VAR_INIT\);/{ GLEW_ARB_vertex_shader = !_glewInit_GL_ARB_vertex_shader(GLEW_CONTEXT_ARG_VAR_INIT); _glewInit_GL_ARB_vertex_program(GLEW_CONTEXT_ARG_VAR_INIT); }/g" -pi $@
rm -f $@.bak rm -f $@.bak
@ -315,7 +311,6 @@ $(S.DEST)/glewinfo.c: $(EXT)/.dummy
$(BIN)/make_info_list.pl $(GLX_CORE_SPEC) >> $@ $(BIN)/make_info_list.pl $(GLX_CORE_SPEC) >> $@
$(BIN)/make_info_list.pl $(GLX_EXT_SPEC) >> $@ $(BIN)/make_info_list.pl $(GLX_EXT_SPEC) >> $@
cat $(SRC)/glewinfo_tail.c >> $@ cat $(SRC)/glewinfo_tail.c >> $@
$(BIN)/fix_OML_sync_control.sh $@
perl -e 's/"glColorSubTable"/"glBlendEquation", glBlendEquation == NULL);\n glewInfoFunc("glColorSubTable"/g' -pi $@ perl -e 's/"glColorSubTable"/"glBlendEquation", glBlendEquation == NULL);\n glewInfoFunc("glColorSubTable"/g' -pi $@
rm -f $@.bak rm -f $@.bak

View File

@ -1,18 +0,0 @@
#!/bin/sh
##
## Copyright (C) 2002-2008, Marcelo E. Magallon <mmagallo[]debian org>
## Copyright (C) 2002-2008, Milan Ikits <milan ikits[]ieee org>
##
## This program is distributed under the terms and conditions of the GNU
## General Public License Version 2 as published by the Free Software
## Foundation or, at your option, any later version.
perl -e 's/#ifndef GLX_OML_sync_control/#if !defined(GLX_OML_sync_control) \&\& defined(__STDC_VERSION__) \&\& (__STDC_VERSION__ >= 199901L)\n#include <inttypes.h>/;' -pi $1
perl -e 's/#ifdef GLX_OML_sync_control/#if defined(GLX_OML_sync_control) \&\& defined(__STDC_VERSION__) \&\& (__STDC_VERSION__ >= 199901L)\n#include <inttypes.h>/;' -pi $1
perl -e 's/(extern PFNGLXGETMSCRATEOMLPROC __glewXGetMscRateOML;)/#ifdef GLX_OML_sync_control\n\1/' -pi $1
perl -e 's/(extern PFNGLXWAITFORSBCOMLPROC __glewXWaitForSbcOML;)/\1\n#endif/' -pi $1
perl -e 's/(extern GLboolean __GLXEW_OML_sync_control;)/#ifdef GLX_OML_sync_control\n\1\n#endif/' -pi $1
perl -e 's/(PFNGLXGETMSCRATEOMLPROC __glewXGetMscRateOML = NULL;)/#ifdef GLX_OML_sync_control\n\1/' -pi $1
perl -e 's/(PFNGLXWAITFORSBCOMLPROC __glewXWaitForSbcOML = NULL;)/\1\n#endif/' -pi $1
perl -e 's/(GLboolean __GLXEW_OML_sync_control = GL_FALSE;)/#ifdef GLX_OML_sync_control\n\1\n#endif/' -pi $1
rm -f $1.bak

View File

@ -19,7 +19,7 @@ my %regex = (
sub prefixname($) sub prefixname($)
{ {
my $name = $_[0]; my $name = $_[0];
$name =~ s/^(.*)gl/__$1glew/; $name =~ s/^(.*?)gl/__$1glew/;
return $name; return $name;
} }
@ -27,7 +27,7 @@ sub prefixname($)
sub prefix_varname($) sub prefix_varname($)
{ {
my $name = $_[0]; my $name = $_[0];
$name =~ s/^(.*)GL(X*)EW/__$1GL$2EW/; $name =~ s/^(.*?)GL(X*?)EW/__$1GL$2EW/;
return $name; return $name;
} }

View File

@ -44,10 +44,10 @@ if (@ARGV)
print "#ifdef $extname\n"; print "#ifdef $extname\n";
if (length($extstring)) if (length($extstring))
{ {
print " CONST_CAST(" . $extvar . ") = " . $extpre . "GetExtension(\"$extstring\");\n"; print " CONST_CAST(" . $extvar . ") = _glewSearchExtension(\"$extstring\", extStart, extEnd);\n";
} }
if (keys %$functions) if (keys %$functions)
{ {

View File

@ -42,6 +42,30 @@ if [ ! -d $1 ] ; then
grep -v glGetIntegerIndexedvEXT $1/GL_EXT_transform_feedback > tmp grep -v glGetIntegerIndexedvEXT $1/GL_EXT_transform_feedback > tmp
mv tmp $1/GL_EXT_transform_feedback mv tmp $1/GL_EXT_transform_feedback
# remove duplicates from GL_NV_video_capture and GLX_NV_video_capture
grep -v glX $1/GL_NV_video_capture > tmp
mv tmp $1/GL_NV_video_capture
# add missing functions to GL_NV_video_capture
cat >> $1/GL_NV_video_capture <<EOT
void glGetVideoCaptureStreamivNV (GLuint video_capture_slot, GLuint stream, GLenum pname, GLint* params)
void glGetVideoCaptureStreamfvNV (GLuint video_capture_slot, GLuint stream, GLenum pname, GLfloat* params)
void glGetVideoCaptureStreamdvNV (GLuint video_capture_slot, GLuint stream, GLenum pname, GLdouble* params)
void glVideoCaptureStreamParameterivNV (GLuint video_capture_slot, GLuint stream, GLenum pname, const GLint* params)
void glVideoCaptureStreamParameterfvNV (GLuint video_capture_slot, GLuint stream, GLenum pname, const GLfloat* params)
void glVideoCaptureStreamParameterdvNV (GLuint video_capture_slot, GLuint stream, GLenum pname, const GLdouble* params)
EOT
# fix WGL_NV_video_capture
cat >> $1/WGL_NV_video_capture <<EOT
DECLARE_HANDLE(HVIDEOINPUTDEVICENV);
EOT
# fix GLX_NV_video_capture
cat >> $1/GLX_NV_video_capture <<EOT
typedef XID GLXVideoCaptureDeviceNV
EOT
# remove duplicates from GL_NV_present_video and GLX_NV_present_video # remove duplicates from GL_NV_present_video and GLX_NV_present_video
grep -v -F -f $1/GLX_NV_present_video $1/GL_NV_present_video > tmp grep -v -F -f $1/GLX_NV_present_video $1/GL_NV_present_video > tmp
mv tmp $1/GL_NV_present_video mv tmp $1/GL_NV_present_video

View File

@ -12,4 +12,3 @@ SGIX/video_source.txt
SGIX/hyperpipe_group.txt SGIX/hyperpipe_group.txt
OES/OES_fixed_point.txt OES/OES_fixed_point.txt
OES/OES_query_matrix.txt OES/OES_query_matrix.txt
NV/video_capture.txt

View File

@ -217,3 +217,23 @@ static GLboolean _glewStrSame3 (GLubyte** a, GLuint* na, const GLubyte* b, GLuin
} }
return GL_FALSE; return GL_FALSE;
} }
/*
* Search for name in the extensions string. Use of strstr()
* is not sufficient because extension names can be prefixes of
* other extension names. Could use strtok() but the constant
* string returned by glGetString might be in read-only memory.
*/
static GLboolean _glewSearchExtension (const char* name, const GLubyte *start, const GLubyte *end)
{
const GLubyte* p;
GLuint len = _glewStrLen((const GLubyte*)name);
p = start;
while (p < end)
{
GLuint n = _glewStrCLen(p, ' ');
if (len == n && _glewStrSame((const GLubyte*)name, p, n)) return GL_TRUE;
p += n+1;
}
return GL_FALSE;
}

View File

@ -1,26 +1,14 @@
/* ------------------------------------------------------------------------- */ /* ------------------------------------------------------------------------- */
/*
* Search for name in the extensions string. Use of strstr()
* is not sufficient because extension names can be prefixes of
* other extension names. Could use strtok() but the constant
* string returned by glGetString might be in read-only memory.
*/
GLboolean glewGetExtension (const char* name) GLboolean glewGetExtension (const char* name)
{ {
GLubyte* p; const GLubyte* start;
GLubyte* end; const GLubyte* end;
GLuint len = _glewStrLen((const GLubyte*)name); start = (const GLubyte*)glGetString(GL_EXTENSIONS);
p = (GLubyte*)glGetString(GL_EXTENSIONS); if (start == 0)
if (0 == p) return GL_FALSE; return GL_FALSE;
end = p + _glewStrLen(p); end = start + _glewStrLen(start);
while (p < end) return _glewSearchExtension(name, start, end);
{
GLuint n = _glewStrCLen(p, ' ');
if (len == n && _glewStrSame((const GLubyte*)name, p, n)) return GL_TRUE;
p += n+1;
}
return GL_FALSE;
} }
/* ------------------------------------------------------------------------- */ /* ------------------------------------------------------------------------- */
@ -33,6 +21,8 @@ GLenum glewContextInit (GLEW_CONTEXT_ARG_DEF_LIST)
const GLubyte* s; const GLubyte* s;
GLuint dot; GLuint dot;
GLint major, minor; GLint major, minor;
const GLubyte* extStart;
const GLubyte* extEnd;
/* query opengl version */ /* query opengl version */
s = glGetString(GL_VERSION); s = glGetString(GL_VERSION);
dot = _glewStrCLen(s, '.'); dot = _glewStrCLen(s, '.');
@ -69,4 +59,11 @@ GLenum glewContextInit (GLEW_CONTEXT_ARG_DEF_LIST)
CONST_CAST(GLEW_VERSION_1_2) = GLEW_VERSION_1_2_1 == GL_TRUE || ( major == 1 && minor >= 2 ) ? GL_TRUE : GL_FALSE; CONST_CAST(GLEW_VERSION_1_2) = GLEW_VERSION_1_2_1 == GL_TRUE || ( major == 1 && minor >= 2 ) ? GL_TRUE : GL_FALSE;
CONST_CAST(GLEW_VERSION_1_1) = GLEW_VERSION_1_2 == GL_TRUE || ( major == 1 && minor >= 1 ) ? GL_TRUE : GL_FALSE; CONST_CAST(GLEW_VERSION_1_1) = GLEW_VERSION_1_2 == GL_TRUE || ( major == 1 && minor >= 1 ) ? GL_TRUE : GL_FALSE;
} }
/* query opengl extensions string */
extStart = glGetString(GL_EXTENSIONS);
if (extStart == 0)
extStart = (const GLubyte*)"";
extEnd = extStart + _glewStrLen(extStart);
/* initialize extensions */ /* initialize extensions */

View File

@ -2,27 +2,21 @@
GLboolean glxewGetExtension (const char* name) GLboolean glxewGetExtension (const char* name)
{ {
GLubyte* p; const GLubyte* start;
GLubyte* end; const GLubyte* end;
GLuint len;
if (glXGetCurrentDisplay == NULL) return GL_FALSE; if (glXGetCurrentDisplay == NULL) return GL_FALSE;
len = _glewStrLen((const GLubyte*)name); start = (const GLubyte*)glXGetClientString(glXGetCurrentDisplay(), GLX_EXTENSIONS);
p = (GLubyte*)glXGetClientString(glXGetCurrentDisplay(), GLX_EXTENSIONS); if (0 == start) return GL_FALSE;
if (0 == p) return GL_FALSE; end = start + _glewStrLen(start);
end = p + _glewStrLen(p); return _glewSearchExtension(name, start, end);
while (p < end)
{
GLuint n = _glewStrCLen(p, ' ');
if (len == n && _glewStrSame((const GLubyte*)name, p, n)) return GL_TRUE;
p += n+1;
}
return GL_FALSE;
} }
GLenum glxewContextInit (GLXEW_CONTEXT_ARG_DEF_LIST) GLenum glxewContextInit (GLXEW_CONTEXT_ARG_DEF_LIST)
{ {
int major, minor; int major, minor;
const GLubyte* extStart;
const GLubyte* extEnd;
/* initialize core GLX 1.2 */ /* initialize core GLX 1.2 */
if (_glewInit_GLX_VERSION_1_2(GLEW_CONTEXT_ARG_VAR_INIT)) return GLEW_ERROR_GLX_VERSION_11_ONLY; if (_glewInit_GLX_VERSION_1_2(GLEW_CONTEXT_ARG_VAR_INIT)) return GLEW_ERROR_GLX_VERSION_11_ONLY;
/* initialize flags */ /* initialize flags */
@ -49,4 +43,11 @@ GLenum glxewContextInit (GLXEW_CONTEXT_ARG_DEF_LIST)
break; break;
} }
} }
/* query GLX extension string */
extStart = 0;
if (glXGetCurrentDisplay != NULL)
extStart = (const GLubyte*)glXGetClientString(glXGetCurrentDisplay(), GLX_EXTENSIONS);
if (extStart == 0)
extStart = (const GLubyte *)"";
extEnd = extStart + _glewStrLen(extStart);
/* initialize extensions */ /* initialize extensions */

View File

@ -5,32 +5,37 @@ static PFNWGLGETEXTENSIONSSTRINGEXTPROC _wglewGetExtensionsStringEXT = NULL;
GLboolean wglewGetExtension (const char* name) GLboolean wglewGetExtension (const char* name)
{ {
GLubyte* p; const GLubyte* start;
GLubyte* end; const GLubyte* end;
GLuint len = _glewStrLen((const GLubyte*)name);
if (_wglewGetExtensionsStringARB == NULL) if (_wglewGetExtensionsStringARB == NULL)
if (_wglewGetExtensionsStringEXT == NULL) if (_wglewGetExtensionsStringEXT == NULL)
return GL_FALSE; return GL_FALSE;
else else
p = (GLubyte*)_wglewGetExtensionsStringEXT(); start = (const GLubyte*)_wglewGetExtensionsStringEXT();
else else
p = (GLubyte*)_wglewGetExtensionsStringARB(wglGetCurrentDC()); start = (const GLubyte*)_wglewGetExtensionsStringARB(wglGetCurrentDC());
if (0 == p) return GL_FALSE; if (start == 0)
end = p + _glewStrLen(p); return GL_FALSE;
while (p < end) end = start + _glewStrLen(start);
{ return _glewSearchExtension(name, start, end);
GLuint n = _glewStrCLen(p, ' ');
if (len == n && _glewStrSame((const GLubyte*)name, p, n)) return GL_TRUE;
p += n+1;
}
return GL_FALSE;
} }
GLenum wglewContextInit (WGLEW_CONTEXT_ARG_DEF_LIST) GLenum wglewContextInit (WGLEW_CONTEXT_ARG_DEF_LIST)
{ {
GLboolean crippled; GLboolean crippled;
const GLubyte* extStart;
const GLubyte* extEnd;
/* find wgl extension string query functions */ /* find wgl extension string query functions */
_wglewGetExtensionsStringARB = (PFNWGLGETEXTENSIONSSTRINGARBPROC)glewGetProcAddress((const GLubyte*)"wglGetExtensionsStringARB"); _wglewGetExtensionsStringARB = (PFNWGLGETEXTENSIONSSTRINGARBPROC)glewGetProcAddress((const GLubyte*)"wglGetExtensionsStringARB");
_wglewGetExtensionsStringEXT = (PFNWGLGETEXTENSIONSSTRINGEXTPROC)glewGetProcAddress((const GLubyte*)"wglGetExtensionsStringEXT"); _wglewGetExtensionsStringEXT = (PFNWGLGETEXTENSIONSSTRINGEXTPROC)glewGetProcAddress((const GLubyte*)"wglGetExtensionsStringEXT");
/* query wgl extension string */
if (_wglewGetExtensionsStringARB == NULL)
if (_wglewGetExtensionsStringEXT == NULL)
extStart = (const GLubyte*)"";
else
extStart = (const GLubyte*)_wglewGetExtensionsStringEXT();
else
extStart = (const GLubyte*)_wglewGetExtensionsStringARB(wglGetCurrentDC());
extEnd = extStart + _glewStrLen(extStart);
/* initialize extensions */ /* initialize extensions */
crippled = _wglewGetExtensionsStringARB == NULL && _wglewGetExtensionsStringEXT == NULL; crippled = _wglewGetExtensionsStringARB == NULL && _wglewGetExtensionsStringEXT == NULL;

View File

@ -6,17 +6,19 @@ INCDIR = /usr/include/mingw/GL
CC = gcc -mno-cygwin CC = gcc -mno-cygwin
# use gcc for linking, with ld it does not work # use gcc for linking, with ld it does not work
LD = gcc -mno-cygwin LD = gcc -mno-cygwin
ifneq (undefined, $(origin GLEW_MX))
CFLAGS.EXTRA = -DGLEW_MX
endif
CFLAGS.SO = -DGLEW_BUILD CFLAGS.SO = -DGLEW_BUILD
LDFLAGS.SO = -shared -Wl,-soname,$(LIB.SONAME) -Wl,--out-implib,lib/$(LIB.DEVLNK)
LDFLAGS.GL = -lglu32 -lopengl32 -lgdi32 -luser32 -lkernel32 LDFLAGS.GL = -lglu32 -lopengl32 -lgdi32 -luser32 -lkernel32
LDFLAGS.EXTRA = -L$(LIBDIR) LDFLAGS.EXTRA = -L$(LIBDIR)
WARN = -Wall -W WARN = -Wall -W
POPT = -O2 POPT = -O2
BIN.SUFFIX = .exe BIN.SUFFIX = .exe
LIB.SONAME = lib$(NAME).dll LIB.SONAME = lib$(NAME).dll
LIB.DEVLNK = lib$(NAME).dll.a # for mingw this is the dll import lib LIB.DEVLNK = lib$(NAME).dll.a # for mingw this is the dll import lib
LIB.SHARED = $(NAME).dll LIB.SHARED = $(NAME).dll
LIB.STATIC = lib$(NAME).a # the static lib will be broken (see CFLAGS.SO) LIB.STATIC = lib$(NAME).a # the static lib will be broken (see CFLAGS.SO)
LDFLAGS.SO = -shared -Wl,-soname,$(LIB.SONAME) -Wl,--out-implib,lib/$(LIB.DEVLNK)
LIB.SONAME.MX = lib$(NAME)mx.dll
LIB.DEVLNK.MX = lib$(NAME)mx.dll.a # for mingw this is the dll import lib
LIB.SHARED.MX = $(NAME)mx.dll
LIB.STATIC.MX = lib$(NAME)mx.a # the static lib will be broken (see CFLAGS.SO)
LDFLAGS.SO.MX = -shared -Wl,-soname,$(LIB.SONAME.MX) -Wl,--out-implib,lib/$(LIB.DEVLNK.MX)

View File

@ -3,10 +3,6 @@ GLEW_DEST ?= /usr/X11R6
CC = cc CC = cc
# use gcc for linking, with ld it does not work # use gcc for linking, with ld it does not work
LD = cc LD = cc
ifneq (undefined, $(origin GLEW_MX))
CFLAGS.EXTRA = -DGLEW_MX
endif
LDFLAGS.SO = -shared -Wl,--out-implib,lib/$(LIB.DEVLNK)
LDFLAGS.EXTRA = -L/usr/X11R6/lib LDFLAGS.EXTRA = -L/usr/X11R6/lib
LIBDIR = $(GLEW_DEST)/lib LIBDIR = $(GLEW_DEST)/lib
LDFLAGS.GL = -lXmu -lXi -lGLU -lGL -lXext -lX11 LDFLAGS.GL = -lXmu -lXi -lGLU -lGL -lXext -lX11
@ -15,7 +11,13 @@ LDFLAGS.DYNAMIC = -Wl,-Bdynamic
WARN = -Wall -W WARN = -Wall -W
POPT = -O2 POPT = -O2
BIN.SUFFIX = .exe BIN.SUFFIX = .exe
LIB.SONAME = cyg$(NAME)-$(SO_MAJOR).dll LIB.SONAME = cyg$(NAME)-$(SO_MAJOR).dll
LIB.DEVLNK = lib$(NAME).dll.a LIB.DEVLNK = lib$(NAME).dll.a
LIB.SHARED = cyg$(NAME)-$(SO_MAJOR).dll LIB.SHARED = cyg$(NAME)-$(SO_MAJOR).dll
LIB.STATIC = lib$(NAME).a LIB.STATIC = lib$(NAME).a
LDFLAGS.SO = -shared -Wl,--out-implib,lib/$(LIB.DEVLNK)
LIB.SONAME.MX = cyg$(NAME)mx-$(SO_MAJOR).dll
LIB.DEVLNK.MX = lib$(NAME)mx.dll.a
LIB.SHARED.MX = cyg$(NAME)mx-$(SO_MAJOR).dll
LIB.STATIC.MX = lib$(NAME)mx.a
LDFLAGS.SO.MX = -shared -Wl,--out-implib,lib/$(LIB.DEVLNK.MX)

View File

@ -2,11 +2,7 @@ NAME = $(GLEW_NAME)
CC = cc CC = cc
LD = cc LD = cc
CFLAGS.EXTRA = -no-cpp-precomp -dynamic -fno-common CFLAGS.EXTRA = -no-cpp-precomp -dynamic -fno-common
ifneq (undefined, $(origin GLEW_MX))
CFLAGS.EXTRA += -DGLEW_MX
endif
PICFLAG = -fPIC PICFLAG = -fPIC
LDFLAGS.SO = -dynamiclib -install_name $(GLEW_DEST)/lib/$(LIB.SHARED)
LDFLAGS.EXTRA = LDFLAGS.EXTRA =
ifneq (undefined, $(origin GLEW_APPLE_GLX)) ifneq (undefined, $(origin GLEW_APPLE_GLX))
CFLAGS.EXTRA += -I/usr/X11R6/include -D'GLEW_APPLE_GLX' CFLAGS.EXTRA += -I/usr/X11R6/include -D'GLEW_APPLE_GLX'
@ -19,8 +15,14 @@ LDFLAGS.DYNAMIC =
WARN = -Wall -W WARN = -Wall -W
POPT = -O2 POPT = -O2
BIN.SUFFIX = BIN.SUFFIX =
LIB.SONAME = lib$(NAME).$(SO_MAJOR).dylib LIB.SONAME = lib$(NAME).$(SO_MAJOR).dylib
LIB.DEVLNK = lib$(NAME).dylib LIB.DEVLNK = lib$(NAME).dylib
LIB.SHARED = lib$(NAME).$(SO_VERSION).dylib LIB.SHARED = lib$(NAME).$(SO_VERSION).dylib
LIB.STATIC = lib$(NAME).a LIB.STATIC = lib$(NAME).a
LDFLAGS.SO = -dynamiclib -install_name $(GLEW_DEST)/lib/$(LIB.SHARED)
LIB.SONAME.MX = lib$(NAME)mx.$(SO_MAJOR).dylib
LIB.DEVLNK.MX = lib$(NAME)mx.dylib
LIB.SHARED.MX = lib$(NAME)mx.$(SO_VERSION).dylib
LIB.STATIC.MX = lib$(NAME)mx.a
LDFLAGS.SO.MX = -dynamiclib -install_name $(GLEW_DEST)/lib/$(LIB.SHARED.MX)
SHARED_OBJ_EXT = pic_o SHARED_OBJ_EXT = pic_o

View File

@ -1,10 +1,6 @@
NAME = $(GLEW_NAME) NAME = $(GLEW_NAME)
CC = cc CC = cc
LD = ld LD = ld
ifneq (undefined, $(origin GLEW_MX))
CFLAGS.EXTRA = -DGLEW_MX
endif
LDFLAGS.SO = -shared -soname $(LIB.SONAME)
LDFLAGS.EXTRA = -L/usr/X11R6/lib LDFLAGS.EXTRA = -L/usr/X11R6/lib
LDFLAGS.GL = -lXmu -lXi -lGLU -lGL -lXext -lX11 LDFLAGS.GL = -lXmu -lXi -lGLU -lGL -lXext -lX11
LDFLAGS.STATIC = -Wl,-Bstatic LDFLAGS.STATIC = -Wl,-Bstatic
@ -14,7 +10,13 @@ NAME = GLEW
WARN = -Wall -W WARN = -Wall -W
POPT = -O2 POPT = -O2
BIN.SUFFIX = BIN.SUFFIX =
LIB.SONAME = lib$(NAME).so.$(SO_MAJOR) LIB.SONAME = lib$(NAME).so.$(SO_MAJOR)
LIB.DEVLNK = lib$(NAME).so LIB.DEVLNK = lib$(NAME).so
LIB.SHARED = lib$(NAME).so.$(SO_VERSION) LIB.SHARED = lib$(NAME).so.$(SO_VERSION)
LIB.STATIC = lib$(NAME).a LIB.STATIC = lib$(NAME).a
LDFLAGS.SO = -shared -soname $(LIB.SONAME)
LIB.SONAME.MX = lib$(NAME)mx.so.$(SO_MAJOR)
LIB.DEVLNK.MX = lib$(NAME)mx.so
LIB.SHARED.MX = lib$(NAME)mx.so.$(SO_VERSION)
LIB.STATIC.MX = lib$(NAME)mx.a
LDFLAGS.SO.MX = -shared -soname $(LIB.SONAME.MX)

View File

@ -1,11 +1,7 @@
NAME = $(GLEW_NAME) NAME = $(GLEW_NAME)
CC = cc CC = cc
LD = cc LD = cc
ifneq (undefined, $(origin GLEW_MX))
CFLAGS.EXTRA = -DGLEW_MX
endif
PICFLAG = -fPIC PICFLAG = -fPIC
LDFLAGS.SO = -shared -Wl,-soname=$(LIB.SONAME)
LDFLAGS.EXTRA = -L/usr/X11R6/lib LDFLAGS.EXTRA = -L/usr/X11R6/lib
LDFLAGS.GL = -lXmu -lXi -lGLU -lGL -lXext -lX11 LDFLAGS.GL = -lXmu -lXi -lGLU -lGL -lXext -lX11
LDFLAGS.STATIC = -Wl,-Bstatic LDFLAGS.STATIC = -Wl,-Bstatic
@ -14,8 +10,14 @@ NAME = GLEW
WARN = -Wall -W WARN = -Wall -W
POPT = -O2 POPT = -O2
BIN.SUFFIX = BIN.SUFFIX =
LIB.SONAME = lib$(NAME).so.$(SO_MAJOR) LIB.SONAME = lib$(NAME).so.$(SO_MAJOR)
LIB.DEVLNK = lib$(NAME).so LIB.DEVLNK = lib$(NAME).so
LIB.SHARED = lib$(NAME).so.$(SO_VERSION) LIB.SHARED = lib$(NAME).so.$(SO_VERSION)
LIB.STATIC = lib$(NAME).a LIB.STATIC = lib$(NAME).a
LDFLAGS.SO = -shared -Wl,-soname=$(LIB.SONAME)
LIB.SONAME.MX = lib$(NAME)mx.so.$(SO_MAJOR)
LIB.DEVLNK.MX = lib$(NAME)mx.so
LIB.SHARED.MX = lib$(NAME)mx.so.$(SO_VERSION)
LIB.STATIC.MX = lib$(NAME)mx.a
LDFLAGS.SO.MX = -shared -Wl,-soname=$(LIB.SONAME.MX)
SHARED_OBJ_EXT = pic_o SHARED_OBJ_EXT = pic_o

View File

@ -4,17 +4,19 @@ LD = ld
ABI = -64# -n32 ABI = -64# -n32
CC += $(ABI) CC += $(ABI)
LD += $(ABI) LD += $(ABI)
ifneq (undefined, $(origin GLEW_MX))
CFLAGS.EXTRA = -DGLEW_MX
endif
LDFLAGS.SO = -shared -soname $(LIB.SONAME)
LDFLAGS.EXTRA = LDFLAGS.EXTRA =
LDFLAGS.GL = -lGLU -lGL -lXext -lX11 LDFLAGS.GL = -lGLU -lGL -lXext -lX11
NAME = GLEW NAME = GLEW
WARN = -fullwarn -woff 1110,1498 WARN = -fullwarn -woff 1110,1498
POPT = -O2 -OPT:Olimit=0 POPT = -O2 -OPT:Olimit=0
BIN.SUFFIX = BIN.SUFFIX =
LIB.SONAME = lib$(NAME).so.$(SO_MAJOR) LIB.SONAME = lib$(NAME).so.$(SO_MAJOR)
LIB.DEVLNK = lib$(NAME).so LIB.DEVLNK = lib$(NAME).so
LIB.SHARED = lib$(NAME).so.$(SO_VERSION) LIB.SHARED = lib$(NAME).so.$(SO_VERSION)
LIB.STATIC = lib$(NAME).a LIB.STATIC = lib$(NAME).a
LDFLAGS.SO = -shared -soname $(LIB.SONAME)
LIB.SONAME.MX = lib$(NAME)mx.so.$(SO_MAJOR)
LIB.DEVLNK.MX = lib$(NAME)mx.so
LIB.SHARED.MX = lib$(NAME)mx.so.$(SO_VERSION)
LIB.STATIC.MX = lib$(NAME)mx.a
LDFLAGS.SO.MX = -shared -soname $(LIB.SONAME.MX)

View File

@ -1,11 +1,7 @@
NAME = $(GLEW_NAME) NAME = $(GLEW_NAME)
CC = cc CC = cc
LD = cc LD = cc
ifneq (undefined, $(origin GLEW_MX))
CFLAGS.EXTRA = -DGLEW_MX
endif
PICFLAG = -fPIC PICFLAG = -fPIC
LDFLAGS.SO = -shared -Wl,-soname $(LIB.SONAME)
LDFLAGS.EXTRA = -L/usr/X11R6/lib LDFLAGS.EXTRA = -L/usr/X11R6/lib
LDFLAGS.GL = -lXmu -lXi -lGLU -lGL -lXext -lX11 LDFLAGS.GL = -lXmu -lXi -lGLU -lGL -lXext -lX11
LDFLAGS.STATIC = -Wl,-Bstatic LDFLAGS.STATIC = -Wl,-Bstatic
@ -14,8 +10,14 @@ NAME = GLEW
WARN = -Wall -W WARN = -Wall -W
POPT = -O2 POPT = -O2
BIN.SUFFIX = BIN.SUFFIX =
LIB.SONAME = lib$(NAME).so.$(SO_MAJOR) LIB.SONAME = lib$(NAME).so.$(SO_MAJOR)
LIB.DEVLNK = lib$(NAME).so LIB.DEVLNK = lib$(NAME).so
LIB.SHARED = lib$(NAME).so.$(SO_VERSION) LIB.SHARED = lib$(NAME).so.$(SO_VERSION)
LIB.STATIC = lib$(NAME).a LIB.STATIC = lib$(NAME).a
LDFLAGS.SO = -shared -Wl,-soname $(LIB.SONAME)
LIB.SONAME.MX = lib$(NAME)mx.so.$(SO_MAJOR)
LIB.DEVLNK.MX = lib$(NAME)mx.so
LIB.SHARED.MX = lib$(NAME)mx.so.$(SO_VERSION)
LIB.STATIC.MX = lib$(NAME)mx.a
LDFLAGS.SO.MX = -shared -Wl,-soname $(LIB.SONAME.MX)
SHARED_OBJ_EXT = pic_o SHARED_OBJ_EXT = pic_o

View File

@ -1,11 +1,7 @@
NAME = $(GLEW_NAME) NAME = $(GLEW_NAME)
CC = cc CC = cc
LD = cc LD = cc
ifneq (undefined, $(origin GLEW_MX))
CFLAGS.EXTRA = -DGLEW_MX
endif
PICFLAG = -fPIC PICFLAG = -fPIC
LDFLAGS.SO = -shared -Wl,-soname=$(LIB.SONAME)
M_ARCH ?= $(shell uname -m) M_ARCH ?= $(shell uname -m)
ifeq (x86_64,${M_ARCH}) ifeq (x86_64,${M_ARCH})
LDFLAGS.EXTRA = -L/usr/X11R6/lib64 LDFLAGS.EXTRA = -L/usr/X11R6/lib64
@ -25,4 +21,10 @@ LIB.SONAME = lib$(NAME).so.$(SO_MAJOR)
LIB.DEVLNK = lib$(NAME).so LIB.DEVLNK = lib$(NAME).so
LIB.SHARED = lib$(NAME).so.$(SO_VERSION) LIB.SHARED = lib$(NAME).so.$(SO_VERSION)
LIB.STATIC = lib$(NAME).a LIB.STATIC = lib$(NAME).a
LDFLAGS.SO = -shared -Wl,-soname=$(LIB.SONAME)
LIB.SONAME.MX = lib$(NAME)mx.so.$(SO_MAJOR)
LIB.DEVLNK.MX = lib$(NAME)mx.so
LIB.SHARED.MX = lib$(NAME)mx.so.$(SO_VERSION)
LIB.STATIC.MX = lib$(NAME)mx.a
LDFLAGS.SO.MX = -shared -Wl,-soname=$(LIB.SONAME.MX)
SHARED_OBJ_EXT = pic_o SHARED_OBJ_EXT = pic_o

View File

@ -7,16 +7,18 @@
NAME = glew32 NAME = glew32
CC = i586-mingw32msvc-gcc CC = i586-mingw32msvc-gcc
LD = i586-mingw32msvc-ld LD = i586-mingw32msvc-ld
ifneq (undefined, $(origin GLEW_MX))
CFLAGS.EXTRA = -DGLEW_MX
endif
CFLAGS.SO = -DGLEW_BUILD CFLAGS.SO = -DGLEW_BUILD
LDFLAGS.SO = -shared -soname $(LIB.SONAME) --out-implib lib/$(LIB.DEVLNK)
LDFLAGS.GL = -lglu32 -lopengl32 -lgdi32 -luser32 -lkernel32 LDFLAGS.GL = -lglu32 -lopengl32 -lgdi32 -luser32 -lkernel32
WARN = -Wall -W WARN = -Wall -W
POPT = -O2 POPT = -O2
BIN.SUFFIX = .exe BIN.SUFFIX = .exe
LIB.SONAME = lib$(NAME).dll LIB.SONAME = lib$(NAME).dll
LIB.DEVLNK = lib$(NAME).dll.a # for mingw this is the dll import lib LIB.DEVLNK = lib$(NAME).dll.a # for mingw this is the dll import lib
LIB.SHARED = $(NAME).dll LIB.SHARED = $(NAME).dll
LIB.STATIC = lib$(NAME).a # the static lib will be broken (see CFLAGS.SO) LIB.STATIC = lib$(NAME).a # the static lib will be broken (see CFLAGS.SO)
LDFLAGS.SO = -shared -soname $(LIB.SONAME) --out-implib lib/$(LIB.DEVLNK)
LIB.SONAME.MX = lib$(NAME)mx.dll
LIB.DEVLNK.MX = lib$(NAME)mx.dll.a # for mingw this is the dll import lib
LIB.SHARED.MX = $(NAME)mx.dll
LIB.STATIC.MX = lib$(NAME)mx.a # the static lib will be broken (see CFLAGS.SO)
LDFLAGS.SO.MX = -shared -soname $(LIB.SONAME.MX) --out-implib lib/$(LIB.DEVLNK.MX)

View File

@ -7,16 +7,18 @@
NAME = glew32 NAME = glew32
CC = amd64-mingw32msvc-gcc CC = amd64-mingw32msvc-gcc
LD = amd64-mingw32msvc-ld LD = amd64-mingw32msvc-ld
ifneq (undefined, $(origin GLEW_MX))
CFLAGS.EXTRA = -DGLEW_MX
endif
CFLAGS.SO = -DGLEW_BUILD CFLAGS.SO = -DGLEW_BUILD
LDFLAGS.SO = -shared -soname $(LIB.SONAME) --out-implib lib/$(LIB.DEVLNK)
LDFLAGS.GL = -lglu32 -lopengl32 -lgdi32 -luser32 -lkernel32 LDFLAGS.GL = -lglu32 -lopengl32 -lgdi32 -luser32 -lkernel32
WARN = -Wall -W WARN = -Wall -W
POPT = -O2 POPT = -O2
BIN.SUFFIX = .exe BIN.SUFFIX = .exe
LIB.SONAME = lib$(NAME).dll LIB.SONAME = lib$(NAME).dll
LIB.DEVLNK = lib$(NAME).dll.a # for mingw this is the dll import lib LIB.DEVLNK = lib$(NAME).dll.a # for mingw this is the dll import lib
LIB.SHARED = $(NAME).dll LIB.SHARED = $(NAME).dll
LIB.STATIC = lib$(NAME).a # the static lib will be broken (see CFLAGS.SO) LIB.STATIC = lib$(NAME).a # the static lib will be broken (see CFLAGS.SO)
LDFLAGS.SO = -shared -soname $(LIB.SONAME) --out-implib lib/$(LIB.DEVLNK)
LIB.SONAME.MX = lib$(NAME)mx.dll
LIB.DEVLNK.MX = lib$(NAME)mx.dll.a # for mingw this is the dll import lib
LIB.SHARED.MX = $(NAME)mx.dll
LIB.STATIC.MX = lib$(NAME)mx.a # the static lib will be broken (see CFLAGS.SO)
LDFLAGS.SO.MX = -shared -soname $(LIB.SONAME.MX) --out-implib lib/$(LIB.DEVLNK.MX)

View File

@ -2,18 +2,19 @@ NAME = glew32
CC = gcc CC = gcc
# use gcc for linking, with ld it does not work # use gcc for linking, with ld it does not work
LD = gcc LD = gcc
ifneq (undefined, $(origin GLEW_MX))
CFLAGS.EXTRA = -DGLEW_MX
endif
CFLAGS.SO = -DGLEW_BUILD CFLAGS.SO = -DGLEW_BUILD
#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.GL = -lglu32 -lopengl32 -lgdi32 -luser32 -lkernel32 LDFLAGS.GL = -lglu32 -lopengl32 -lgdi32 -luser32 -lkernel32
LDFLAGS.EXTRA = -L/mingw/lib LDFLAGS.EXTRA = -L/mingw/lib
WARN = -Wall -W WARN = -Wall -W
POPT = -O2 POPT = -O2
BIN.SUFFIX = .exe BIN.SUFFIX = .exe
LIB.SONAME = lib$(NAME).dll LIB.SONAME = lib$(NAME).dll
LIB.DEVLNK = lib$(NAME).dll.a # for mingw this is the dll import lib LIB.DEVLNK = lib$(NAME).dll.a # for mingw this is the dll import lib
LIB.SHARED = $(NAME).dll LIB.SHARED = $(NAME).dll
LIB.STATIC = lib$(NAME).a # the static lib will be broken (see CFLAGS.SO) LIB.STATIC = lib$(NAME).a # the static lib will be broken (see CFLAGS.SO)
LDFLAGS.SO = -shared -Wl,-soname,$(LIB.SONAME) -Wl,--out-implib,lib/$(LIB.DEVLNK)
LIB.SONAME.MX = lib$(NAME)mx.dll
LIB.DEVLNK.MX = lib$(NAME)mx.dll.a # for mingw this is the dll import lib
LIB.SHARED.MX = $(NAME)mx.dll
LIB.STATIC.MX = lib$(NAME)mx.a # the static lib will be broken (see CFLAGS.SO)
LDFLAGS.SO.MX = -shared -Wl,-soname,$(LIB.SONAME.MX) -Wl,--out-implib,lib/$(LIB.DEVLNK.MX)

View File

@ -2,16 +2,17 @@ NAME = $(GLEW_NAME)
CC = cc CC = cc
LD = ld LD = ld
CFLAGS.EXTRA = -I/usr/openwin/include CFLAGS.EXTRA = -I/usr/openwin/include
ifneq (undefined, $(origin GLEW_MX))
CFLAGS.EXTRA += -DGLEW_MX
endif
LDFLAGS.SO = -G LDFLAGS.SO = -G
LDFLAGS.EXTRA = -L/usr/openwin/lib LDFLAGS.EXTRA = -L/usr/openwin/lib
LDFLAGS.GL = -lXmu -lXi -lGLU -lGL -lXext -lX11 LDFLAGS.GL = -lXmu -lXi -lGLU -lGL -lXext -lX11
NAME = GLEW NAME = GLEW
BIN.SUFFIX = BIN.SUFFIX =
POPT = -xO2 POPT = -xO2
LIB.SONAME = lib$(NAME).so.$(SO_MAJOR) LIB.SONAME = lib$(NAME).so.$(SO_MAJOR)
LIB.DEVLNK = lib$(NAME).so LIB.DEVLNK = lib$(NAME).so
LIB.SHARED = lib$(NAME).so.$(SO_VERSION) LIB.SHARED = lib$(NAME).so.$(SO_VERSION)
LIB.STATIC = lib$(NAME).a LIB.STATIC = lib$(NAME).a
LIB.SONAME.MX = lib$(NAME)mx.so.$(SO_MAJOR)
LIB.DEVLNK.MX = lib$(NAME)mx.so
LIB.SHARED.MX = lib$(NAME)mx.so.$(SO_VERSION)
LIB.STATIC.MX = lib$(NAME)mx.a

View File

@ -0,0 +1,20 @@
NAME = $(GLEW_NAME)
CC = gcc
LD = ld
CFLAGS.EXTRA = -I/usr/openwin/include
LDFLAGS.SO = -G
LDFLAGS.EXTRA = -L/usr/openwin/lib
LDFLAGS.GL = -lXmu -lXi -lGLU -lGL -lXext -lX11
NAME = GLEW
BIN.SUFFIX =
POPT = -O2
LIB.SONAME = lib$(NAME).so.$(SO_MAJOR)
LIB.DEVLNK = lib$(NAME).so
LIB.SHARED = lib$(NAME).so.$(SO_VERSION)
LIB.STATIC = lib$(NAME).a
LDFLAGS.SO = -shared -Wl,-soname=$(LIB.SONAME)
LIB.SONAME.MX = lib$(NAME)mx.so.$(SO_MAJOR)
LIB.DEVLNK.MX = lib$(NAME)mx.so
LIB.SHARED.MX = lib$(NAME)mx.so.$(SO_VERSION)
LIB.STATIC.MX = lib$(NAME)mx.a
LDFLAGS.SO.MX = -shared -Wl,-soname=$(LIB.SONAME.MX)

View File

@ -6,5 +6,5 @@ includedir=@includedir@
Name: glew Name: glew
Description: The OpenGL Extension Wrangler library Description: The OpenGL Extension Wrangler library
Version: @version@ Version: @version@
Cflags: -I${includedir} Cflags: -I${includedir} @cflags@
Libs: -L${libdir} -lGLEW Libs: -L${libdir} -l@libname@