From 51bd94fccacce37259256b9a70010d928a9bac62 Mon Sep 17 00:00:00 2001 From: Nigel Stewart Date: Sun, 25 Dec 2016 00:48:21 +1000 Subject: [PATCH 1/3] Add Mac gcc6 build configuration (gcc via brew) --- config/Makefile.darwin-gcc6 | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 config/Makefile.darwin-gcc6 diff --git a/config/Makefile.darwin-gcc6 b/config/Makefile.darwin-gcc6 new file mode 100644 index 0000000..3a04101 --- /dev/null +++ b/config/Makefile.darwin-gcc6 @@ -0,0 +1,30 @@ +# For building with Brew gcc: +# $ brew install gcc +GLEW_DEST = /usr/local +NAME = $(GLEW_NAME) +CC = gcc-6 +LD = gcc-6 +CFLAGS.EXTRA = -dynamic -fno-common +CFLAGS.EXTRA += -std=c89 +# Lots of warnings with -pedantic +# warning: ISO C forbids conversion of object pointer to function pointer type +#CFLAGS.EXTRA += -pedantic +#CFLAGS.EXTRA += -no-cpp-precomp +LDFLAGS.EXTRA = +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 OpenGL +endif +LDFLAGS.STATIC = +LDFLAGS.DYNAMIC = +WARN = -Wall -W +POPT = -Os +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) From f426fcee41a89abb9aea55a9ddb54f4f2ee4dbd9 Mon Sep 17 00:00:00 2001 From: Nigel Stewart Date: Sun, 25 Dec 2016 00:49:20 +1000 Subject: [PATCH 2/3] Tidy up use of unsued parameter attribute for Mac gcc builds --- src/visualinfo.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/visualinfo.c b/src/visualinfo.c index d089207..99e8c63 100644 --- a/src/visualinfo.c +++ b/src/visualinfo.c @@ -617,7 +617,7 @@ VisualInfo (GLContext* ctx) #elif defined(__APPLE__) && !defined(GLEW_APPLE_GLX) void -VisualInfo (GLContext* __attribute__((__unused__)) ctx) +VisualInfo (__attribute__((unused)) GLContext* ctx) { /* int attrib[] = { AGL_RGBA, AGL_NONE }; From 5766d27018b84b7bc2b536c8c036112b3767269f Mon Sep 17 00:00:00 2001 From: Nigel Stewart Date: Sun, 25 Dec 2016 00:50:42 +1000 Subject: [PATCH 3/3] Note that clang is needed for SYSTEM=darwin-universal (not supported for gcc) --- config/Makefile.darwin-universal | 3 +++ 1 file changed, 3 insertions(+) diff --git a/config/Makefile.darwin-universal b/config/Makefile.darwin-universal index 9518f71..7bc4c4c 100644 --- a/config/Makefile.darwin-universal +++ b/config/Makefile.darwin-universal @@ -1,3 +1,6 @@ +# +# Needs to be clang toolchain for universal: -arch i386 -arch x86_64 +# GLEW_DEST = /usr/local NAME = $(GLEW_NAME) CC = cc