diff --git a/Makefile b/Makefile index 6a9803c..3eb0ad5 100644 --- a/Makefile +++ b/Makefile @@ -104,7 +104,7 @@ lib: mkdir lib lib/$(LIB.STATIC): $(LIB.OBJS) - $(AR) cr $@ $^ + $(AR) $(LDFLAGS.STATIC) $@ $^ ifneq ($(STRIP),) $(STRIP) -x $@ endif @@ -148,7 +148,7 @@ glew.pc: glew.pc.in glew.lib.mx: lib lib/$(LIB.SHARED.MX) lib/$(LIB.STATIC.MX) glewmx.pc lib/$(LIB.STATIC.MX): $(LIB.OBJS.MX) - $(AR) cr $@ $^ + $(AR) $(LDFLAGS.STATIC) $@ $^ lib/$(LIB.SHARED.MX): $(LIB.SOBJS.MX) $(LD) $(LDFLAGS.SO.MX) -o $@ $^ $(LIB.LDFLAGS) $(LIB.LIBS) diff --git a/config/Makefile.cygming b/config/Makefile.cygming index a356c5c..21fdfe4 100644 --- a/config/Makefile.cygming +++ b/config/Makefile.cygming @@ -7,6 +7,7 @@ INCDIR = /usr/include/mingw/GL CC := gcc -mno-cygwin LD := gcc -mno-cygwin LN := +LDFLAGS.STATIC = cr LDFLAGS.GL = -lopengl32 -lgdi32 -luser32 -lkernel32 LDFLAGS.EXTRA = -L$(LIBDIR) WARN = -Wall -W diff --git a/config/Makefile.cygwin b/config/Makefile.cygwin index 8600fd0..ad8f6f0 100644 --- a/config/Makefile.cygwin +++ b/config/Makefile.cygwin @@ -7,7 +7,7 @@ LN := LDFLAGS.EXTRA = LIBDIR = $(GLEW_DEST)/lib LDFLAGS.GL = -lGL -lX11 -LDFLAGS.STATIC = -Wl,-Bstatic +LDFLAGS.STATIC = cr -Wl,-Bstatic LDFLAGS.DYNAMIC = -Wl,-Bdynamic WARN = -Wall -W POPT = -O2 diff --git a/config/Makefile.darwin b/config/Makefile.darwin index bf34a0e..9812907 100644 --- a/config/Makefile.darwin +++ b/config/Makefile.darwin @@ -10,7 +10,7 @@ LDFLAGS.GL = -L/usr/X11R6/lib -lGL -lX11 else LDFLAGS.GL = -framework AGL -framework OpenGL endif -LDFLAGS.STATIC = +LDFLAGS.STATIC = cr LDFLAGS.DYNAMIC = WARN = -Wall -W POPT = -O2 diff --git a/config/Makefile.darwin-ppc b/config/Makefile.darwin-ppc index 46c8b73..16dcfe8 100644 --- a/config/Makefile.darwin-ppc +++ b/config/Makefile.darwin-ppc @@ -10,7 +10,7 @@ LDFLAGS.GL = -L/usr/X11R6/lib -lGL -lX11 else LDFLAGS.GL = -framework AGL -framework OpenGL endif -LDFLAGS.STATIC = +LDFLAGS.STATIC = cr LDFLAGS.DYNAMIC = WARN = -Wall -W POPT = -O2 diff --git a/config/Makefile.darwin-universal b/config/Makefile.darwin-universal new file mode 100644 index 0000000..8bb00e1 --- /dev/null +++ b/config/Makefile.darwin-universal @@ -0,0 +1,31 @@ +NAME = $(GLEW_NAME) +CC = cc +LD = cc +AR = LIBTOOL +STRIP = +CFLAGS.EXTRA = -dynamic -fno-common +#CFLAGS.EXTRA += -no-cpp-precomp +CFLAGS.EXTRA += -arch i386 -arch x86_64 +LDFLAGS.EXTRA = -arch i386 -arch x86_64 +ifneq (undefined, $(origin GLEW_APPLE_GLX)) +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 +endif +LDFLAGS.STATIC = -static -o +LDFLAGS.DYNAMIC = +WARN = -Wall -W +POPT = -O2 +CFLAGS.EXTRA += -fPIC +BIN.SUFFIX = +LIB.SONAME = lib$(NAME).$(SO_MAJOR).dylib +LIB.DEVLNK = lib$(NAME).dylib +LIB.SHARED = lib$(NAME).$(SO_VERSION).dylib +LIB.STATIC = lib$(NAME).a +LDFLAGS.SO = -dynamiclib -install_name $(GLEW_DEST)/lib/$(LIB.SHARED) -current_version $(SO_VERSION) -compatibility_version $(SO_MAJOR) +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) -current_version $(SO_VERSION) -compatibility_version $(SO_MAJOR) diff --git a/config/Makefile.darwin-x86_64 b/config/Makefile.darwin-x86_64 index e6eb050..656ad2c 100644 --- a/config/Makefile.darwin-x86_64 +++ b/config/Makefile.darwin-x86_64 @@ -10,7 +10,7 @@ LDFLAGS.GL = -L/usr/X11R6/lib -lGL -lX11 else LDFLAGS.GL = -framework AGL -framework OpenGL endif -LDFLAGS.STATIC = +LDFLAGS.STATIC = cr LDFLAGS.DYNAMIC = WARN = -Wall -W POPT = -O2 diff --git a/config/Makefile.freebsd b/config/Makefile.freebsd index ca2771d..e60368a 100644 --- a/config/Makefile.freebsd +++ b/config/Makefile.freebsd @@ -3,7 +3,7 @@ CC = cc LD = ld LDFLAGS.EXTRA = -L/usr/X11R6/lib LDFLAGS.GL = -lGL -lX11 -LDFLAGS.STATIC = -Wl,-Bstatic +LDFLAGS.STATIC = cr -Wl,-Bstatic LDFLAGS.DYNAMIC = -Wl,-Bdynamic CFLAGS.EXTRA += -I/usr/X11R6/include -fPIC NAME = GLEW diff --git a/config/Makefile.gnu b/config/Makefile.gnu index b7c58be..f254ca5 100644 --- a/config/Makefile.gnu +++ b/config/Makefile.gnu @@ -3,7 +3,7 @@ CC = cc LD = cc LDFLAGS.EXTRA = -L/usr/X11R6/lib LDFLAGS.GL = -lGL -lX11 -LDFLAGS.STATIC = -Wl,-Bstatic +LDFLAGS.STATIC = cr -Wl,-Bstatic LDFLAGS.DYNAMIC = -Wl,-Bdynamic NAME = GLEW WARN = -Wall -W diff --git a/config/Makefile.haiku b/config/Makefile.haiku index ce832f9..0ab5a0a 100644 --- a/config/Makefile.haiku +++ b/config/Makefile.haiku @@ -6,7 +6,7 @@ ifneq (undefined, $(origin GLEW_MX)) endif LDFLAGS.GL = -lGL -LDFLAGS.STATIC = -Wl,-Bstatic +LDFLAGS.STATIC = cr -Wl,-Bstatic LDFLAGS.DYNAMIC = -Wl,-Bdynamic NAME = GLEW diff --git a/config/Makefile.irix b/config/Makefile.irix index a1be5ee..3ddfcf7 100644 --- a/config/Makefile.irix +++ b/config/Makefile.irix @@ -4,6 +4,7 @@ LD = ld ABI = -64# -n32 CC += $(ABI) LD += $(ABI) +LDFLAGS.STATIC = cr LDFLAGS.EXTRA = LDFLAGS.GL = -lGL -lXext -lX11 NAME = GLEW diff --git a/config/Makefile.kfreebsd b/config/Makefile.kfreebsd index faf1046..8bd089d 100644 --- a/config/Makefile.kfreebsd +++ b/config/Makefile.kfreebsd @@ -3,7 +3,7 @@ CC = cc LD = cc LDFLAGS.EXTRA = -L/usr/X11R6/lib LDFLAGS.GL = -lGL -lX11 -LDFLAGS.STATIC = -Wl,-Bstatic +LDFLAGS.STATIC = cr -Wl,-Bstatic LDFLAGS.DYNAMIC = -Wl,-Bdynamic NAME = GLEW WARN = -Wall -W diff --git a/config/Makefile.linux b/config/Makefile.linux index 55e4a23..5bbed66 100644 --- a/config/Makefile.linux +++ b/config/Makefile.linux @@ -17,7 +17,7 @@ else LIBDIR = $(GLEW_DEST)/lib endif LDFLAGS.GL = -lGL -lX11 -LDFLAGS.STATIC = -Wl,-Bstatic +LDFLAGS.STATIC = cr -Wl,-Bstatic LDFLAGS.DYNAMIC = -Wl,-Bdynamic NAME = GLEW WARN = -Wall -W diff --git a/config/Makefile.linux-mingw-w64 b/config/Makefile.linux-mingw-w64 index bedf166..d88a907 100644 --- a/config/Makefile.linux-mingw-w64 +++ b/config/Makefile.linux-mingw-w64 @@ -9,6 +9,7 @@ CC := i686-w64-mingw32-gcc LD := i686-w64-mingw32-ld LN := STRIP := +LDFLAGS.STATIC = cr LDFLAGS.GL = -lopengl32 -lgdi32 -luser32 -lkernel32 WARN = -Wall -W POPT = -O2 diff --git a/config/Makefile.linux-mingw32 b/config/Makefile.linux-mingw32 index fdb2239..6a1cfbb 100644 --- a/config/Makefile.linux-mingw32 +++ b/config/Makefile.linux-mingw32 @@ -10,6 +10,7 @@ CC := $(HOST)-gcc LD := $(HOST)-ld LN := STRIP := +LDFLAGS.STATIC = cr LDFLAGS.GL = -lopengl32 -lgdi32 -luser32 -lkernel32 WARN = -Wall -W POPT = -O2 diff --git a/config/Makefile.linux-mingw64 b/config/Makefile.linux-mingw64 index 0e19f6c..43840f7 100644 --- a/config/Makefile.linux-mingw64 +++ b/config/Makefile.linux-mingw64 @@ -10,6 +10,7 @@ CC := $(HOST)-gcc LD := $(HOST)-ld LN := STRIP := +LDFLAGS.STATIC = cr LDFLAGS.GL = -lopengl32 -lgdi32 -luser32 -lkernel32 WARN = -Wall -W POPT = -O2 diff --git a/config/Makefile.mingw b/config/Makefile.mingw index f1fb194..1bb3b0b 100644 --- a/config/Makefile.mingw +++ b/config/Makefile.mingw @@ -3,6 +3,7 @@ NAME = glew32 CC := gcc LD := gcc LN := +LDFLAGS.STATIC = cr LDFLAGS.GL = -lopengl32 -lgdi32 -luser32 -lkernel32 LDFLAGS.EXTRA = -L/mingw/lib WARN = -Wall -W diff --git a/config/Makefile.nacl-32 b/config/Makefile.nacl-32 index 2a5cec7..a5360f5 100644 --- a/config/Makefile.nacl-32 +++ b/config/Makefile.nacl-32 @@ -19,7 +19,7 @@ LDFLAGS.EXTRA += -melf_nacl LDFLAGS.GL = LDFLAGS.GLU = -lRegalGLU LDFLAGS.GLUT = -lRegalGLUT -LDFLAGS.STATIC = +LDFLAGS.STATIC = cr LDFLAGS.DYNAMIC = -shared WARN = -Wall -W -Wno-unused-parameter POPT = -O2 diff --git a/config/Makefile.nacl-64 b/config/Makefile.nacl-64 index 37cb6e9..16af8fd 100644 --- a/config/Makefile.nacl-64 +++ b/config/Makefile.nacl-64 @@ -19,7 +19,7 @@ LDFLAGS.EXTRA += -melf64_nacl LDFLAGS.GL = LDFLAGS.GLU = -lRegalGLU LDFLAGS.GLUT = -lRegalGLUT -LDFLAGS.STATIC = +LDFLAGS.STATIC = cr LDFLAGS.DYNAMIC = -shared WARN = -Wall -W -Wno-unused-parameter POPT = -O2 diff --git a/config/Makefile.netbsd b/config/Makefile.netbsd index 6da47b1..e03d029 100644 --- a/config/Makefile.netbsd +++ b/config/Makefile.netbsd @@ -3,7 +3,7 @@ CC = cc LD = ld LDFLAGS.EXTRA = -L/usr/X11R7/lib -R /usr/X11R7/lib LDFLAGS.GL = -lGL -lX11 -LDFLAGS.STATIC = -Wl,-Bstatic +LDFLAGS.STATIC = cr -Wl,-Bstatic LDFLAGS.DYNAMIC = -Wl,-Bdynamic CFLAGS.EXTRA += -I/usr/X11R7/include -fPIC NAME = GLEW diff --git a/config/Makefile.openbsd b/config/Makefile.openbsd index ade993e..fcd4eb0 100644 --- a/config/Makefile.openbsd +++ b/config/Makefile.openbsd @@ -3,7 +3,7 @@ CC = cc LD = ld LDFLAGS.EXTRA = -L/usr/X11R6/lib LDFLAGS.GL = -lGLU -lGL -lX11 -lm -LDFLAGS.STATIC = -Wl,-Bstatic +LDFLAGS.STATIC = cr -Wl,-Bstatic LDFLAGS.DYNAMIC = -Wl,-Bdynamic CFLAGS.EXTRA += -I/usr/X11R6/include NAME = GLEW diff --git a/config/Makefile.solaris b/config/Makefile.solaris index 96e6d1f..87a53b3 100644 --- a/config/Makefile.solaris +++ b/config/Makefile.solaris @@ -2,6 +2,7 @@ NAME = $(GLEW_NAME) CC = cc LD = ld CFLAGS.EXTRA = -I/usr/openwin/include -Kpic +LDFLAGS.STATIC = cr LDFLAGS.SO = -G LDFLAGS.EXTRA = -L/usr/openwin/lib LDFLAGS.GL = -lGL -lX11 diff --git a/config/Makefile.solaris-gcc b/config/Makefile.solaris-gcc index d66395b..8b92753 100644 --- a/config/Makefile.solaris-gcc +++ b/config/Makefile.solaris-gcc @@ -2,6 +2,7 @@ NAME = $(GLEW_NAME) CC = gcc LD = ld CFLAGS.EXTRA = -I/usr/openwin/include -fPIC +LDFLAGS.STATIC = cr LDFLAGS.SO = -G LDFLAGS.EXTRA = -L/usr/openwin/lib LDFLAGS.GL = -lGL -lX11