From 0c9ab41431e0a9118ccba7fc9c4ef7eca7f67a8a Mon Sep 17 00:00:00 2001 From: BastiaanOlij Date: Sun, 15 Mar 2015 18:55:29 +1100 Subject: [PATCH 1/3] Changing over makefiles so LDFLAGS.STATIC is used. Also added makefile.darwin-universal for creating a universal static library that can be used properly. --- Makefile | 4 ++-- config/Makefile.cygming | 1 + config/Makefile.cygwin | 2 +- config/Makefile.darwin | 2 +- config/Makefile.darwin-ppc | 2 +- config/Makefile.darwin-universal | 31 +++++++++++++++++++++++++++++++ config/Makefile.darwin-x86_64 | 2 +- config/Makefile.freebsd | 2 +- config/Makefile.gnu | 2 +- config/Makefile.haiku | 2 +- config/Makefile.irix | 1 + config/Makefile.kfreebsd | 2 +- config/Makefile.linux | 2 +- config/Makefile.linux-mingw-w64 | 1 + config/Makefile.linux-mingw32 | 1 + config/Makefile.linux-mingw64 | 1 + config/Makefile.mingw | 1 + config/Makefile.nacl-32 | 2 +- config/Makefile.nacl-64 | 2 +- config/Makefile.netbsd | 2 +- config/Makefile.openbsd | 2 +- config/Makefile.solaris | 1 + config/Makefile.solaris-gcc | 1 + 23 files changed, 54 insertions(+), 15 deletions(-) create mode 100644 config/Makefile.darwin-universal 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 From 69cbc3532f954506e223d3765cb71f7f9e8dea4e Mon Sep 17 00:00:00 2001 From: BastiaanOlij Date: Mon, 23 Mar 2015 21:16:49 +1100 Subject: [PATCH 2/3] Changed approach to be slightly more resilient to regression issues --- Makefile | 5 +++-- config/Makefile.cygming | 1 - config/Makefile.cygwin | 2 +- config/Makefile.darwin | 2 +- config/Makefile.darwin-ppc | 2 +- config/Makefile.darwin-universal | 2 +- config/Makefile.darwin-x86_64 | 2 +- config/Makefile.freebsd | 2 +- config/Makefile.gnu | 2 +- config/Makefile.haiku | 2 +- config/Makefile.irix | 1 - config/Makefile.kfreebsd | 2 +- config/Makefile.linux | 2 +- config/Makefile.linux-mingw-w64 | 1 - config/Makefile.linux-mingw32 | 1 - config/Makefile.linux-mingw64 | 1 - config/Makefile.mingw | 1 - config/Makefile.nacl-32 | 2 +- config/Makefile.nacl-64 | 2 +- config/Makefile.netbsd | 2 +- config/Makefile.openbsd | 2 +- config/Makefile.solaris | 1 - config/Makefile.solaris-gcc | 1 - 23 files changed, 17 insertions(+), 24 deletions(-) diff --git a/Makefile b/Makefile index 3eb0ad5..3947b29 100644 --- a/Makefile +++ b/Makefile @@ -65,6 +65,7 @@ DIST_DIR := $(shell mktemp -d /tmp/glew.XXXXXX)/$(DIST_NAME) # - use LN= on gmake command-line AR ?= ar +ARFLAGS.STATIC ?= cr INSTALL ?= install STRIP ?= strip RM ?= rm -f @@ -104,7 +105,7 @@ lib: mkdir lib lib/$(LIB.STATIC): $(LIB.OBJS) - $(AR) $(LDFLAGS.STATIC) $@ $^ + $(AR) $(ARFLAGS.STATIC) $@ $^ ifneq ($(STRIP),) $(STRIP) -x $@ endif @@ -148,7 +149,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) $(LDFLAGS.STATIC) $@ $^ + $(AR) $(ARFLAGS.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 21fdfe4..a356c5c 100644 --- a/config/Makefile.cygming +++ b/config/Makefile.cygming @@ -7,7 +7,6 @@ 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 ad8f6f0..8600fd0 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 = cr -Wl,-Bstatic +LDFLAGS.STATIC = -Wl,-Bstatic LDFLAGS.DYNAMIC = -Wl,-Bdynamic WARN = -Wall -W POPT = -O2 diff --git a/config/Makefile.darwin b/config/Makefile.darwin index 9812907..bf34a0e 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 = cr +LDFLAGS.STATIC = LDFLAGS.DYNAMIC = WARN = -Wall -W POPT = -O2 diff --git a/config/Makefile.darwin-ppc b/config/Makefile.darwin-ppc index 16dcfe8..46c8b73 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 = cr +LDFLAGS.STATIC = LDFLAGS.DYNAMIC = WARN = -Wall -W POPT = -O2 diff --git a/config/Makefile.darwin-universal b/config/Makefile.darwin-universal index 8bb00e1..17e7e4a 100644 --- a/config/Makefile.darwin-universal +++ b/config/Makefile.darwin-universal @@ -13,7 +13,7 @@ LDFLAGS.GL = -L/usr/X11R6/lib -lGL -lX11 else LDFLAGS.GL = -framework AGL -framework OpenGL endif -LDFLAGS.STATIC = -static -o +ARFLAGS.STATIC = -static -o LDFLAGS.DYNAMIC = WARN = -Wall -W POPT = -O2 diff --git a/config/Makefile.darwin-x86_64 b/config/Makefile.darwin-x86_64 index 656ad2c..e6eb050 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 = cr +LDFLAGS.STATIC = LDFLAGS.DYNAMIC = WARN = -Wall -W POPT = -O2 diff --git a/config/Makefile.freebsd b/config/Makefile.freebsd index e60368a..ca2771d 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 = cr -Wl,-Bstatic +LDFLAGS.STATIC = -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 f254ca5..b7c58be 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 = cr -Wl,-Bstatic +LDFLAGS.STATIC = -Wl,-Bstatic LDFLAGS.DYNAMIC = -Wl,-Bdynamic NAME = GLEW WARN = -Wall -W diff --git a/config/Makefile.haiku b/config/Makefile.haiku index 0ab5a0a..ce832f9 100644 --- a/config/Makefile.haiku +++ b/config/Makefile.haiku @@ -6,7 +6,7 @@ ifneq (undefined, $(origin GLEW_MX)) endif LDFLAGS.GL = -lGL -LDFLAGS.STATIC = cr -Wl,-Bstatic +LDFLAGS.STATIC = -Wl,-Bstatic LDFLAGS.DYNAMIC = -Wl,-Bdynamic NAME = GLEW diff --git a/config/Makefile.irix b/config/Makefile.irix index 3ddfcf7..a1be5ee 100644 --- a/config/Makefile.irix +++ b/config/Makefile.irix @@ -4,7 +4,6 @@ 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 8bd089d..faf1046 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 = cr -Wl,-Bstatic +LDFLAGS.STATIC = -Wl,-Bstatic LDFLAGS.DYNAMIC = -Wl,-Bdynamic NAME = GLEW WARN = -Wall -W diff --git a/config/Makefile.linux b/config/Makefile.linux index 5bbed66..55e4a23 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 = cr -Wl,-Bstatic +LDFLAGS.STATIC = -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 d88a907..bedf166 100644 --- a/config/Makefile.linux-mingw-w64 +++ b/config/Makefile.linux-mingw-w64 @@ -9,7 +9,6 @@ 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 6a1cfbb..fdb2239 100644 --- a/config/Makefile.linux-mingw32 +++ b/config/Makefile.linux-mingw32 @@ -10,7 +10,6 @@ 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 43840f7..0e19f6c 100644 --- a/config/Makefile.linux-mingw64 +++ b/config/Makefile.linux-mingw64 @@ -10,7 +10,6 @@ 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 1bb3b0b..f1fb194 100644 --- a/config/Makefile.mingw +++ b/config/Makefile.mingw @@ -3,7 +3,6 @@ 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 a5360f5..2a5cec7 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 = cr +LDFLAGS.STATIC = LDFLAGS.DYNAMIC = -shared WARN = -Wall -W -Wno-unused-parameter POPT = -O2 diff --git a/config/Makefile.nacl-64 b/config/Makefile.nacl-64 index 16af8fd..37cb6e9 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 = cr +LDFLAGS.STATIC = LDFLAGS.DYNAMIC = -shared WARN = -Wall -W -Wno-unused-parameter POPT = -O2 diff --git a/config/Makefile.netbsd b/config/Makefile.netbsd index e03d029..6da47b1 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 = cr -Wl,-Bstatic +LDFLAGS.STATIC = -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 fcd4eb0..ade993e 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 = cr -Wl,-Bstatic +LDFLAGS.STATIC = -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 87a53b3..96e6d1f 100644 --- a/config/Makefile.solaris +++ b/config/Makefile.solaris @@ -2,7 +2,6 @@ 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 8b92753..d66395b 100644 --- a/config/Makefile.solaris-gcc +++ b/config/Makefile.solaris-gcc @@ -2,7 +2,6 @@ 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 From aee8b6ff6945074e5b2f3b495332cd627c3ed2c3 Mon Sep 17 00:00:00 2001 From: BastiaanOlij Date: Thu, 26 Mar 2015 13:24:03 +1100 Subject: [PATCH 3/3] Renamed ARFLAGS.STATIC to simply ARFLAGS --- Makefile | 6 +++--- config/Makefile.darwin-universal | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Makefile b/Makefile index 3947b29..45bc9a4 100644 --- a/Makefile +++ b/Makefile @@ -65,7 +65,7 @@ DIST_DIR := $(shell mktemp -d /tmp/glew.XXXXXX)/$(DIST_NAME) # - use LN= on gmake command-line AR ?= ar -ARFLAGS.STATIC ?= cr +ARFLAGS ?= cr INSTALL ?= install STRIP ?= strip RM ?= rm -f @@ -105,7 +105,7 @@ lib: mkdir lib lib/$(LIB.STATIC): $(LIB.OBJS) - $(AR) $(ARFLAGS.STATIC) $@ $^ + $(AR) $(ARFLAGS) $@ $^ ifneq ($(STRIP),) $(STRIP) -x $@ endif @@ -149,7 +149,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) $(ARFLAGS.STATIC) $@ $^ + $(AR) $(ARFLAGS) $@ $^ lib/$(LIB.SHARED.MX): $(LIB.SOBJS.MX) $(LD) $(LDFLAGS.SO.MX) -o $@ $^ $(LIB.LDFLAGS) $(LIB.LIBS) diff --git a/config/Makefile.darwin-universal b/config/Makefile.darwin-universal index 17e7e4a..b2ba4af 100644 --- a/config/Makefile.darwin-universal +++ b/config/Makefile.darwin-universal @@ -2,6 +2,7 @@ NAME = $(GLEW_NAME) CC = cc LD = cc AR = LIBTOOL +ARFLAGS = -static -o STRIP = CFLAGS.EXTRA = -dynamic -fno-common #CFLAGS.EXTRA += -no-cpp-precomp @@ -13,7 +14,6 @@ LDFLAGS.GL = -L/usr/X11R6/lib -lGL -lX11 else LDFLAGS.GL = -framework AGL -framework OpenGL endif -ARFLAGS.STATIC = -static -o LDFLAGS.DYNAMIC = WARN = -Wall -W POPT = -O2