From 7f92f9adf730cdb31c848f36112b147e3b061092 Mon Sep 17 00:00:00 2001 From: Nigel Stewart Date: Sun, 13 Nov 2016 11:57:00 +1000 Subject: [PATCH 1/4] Update Mac OSX builds to use -std=c89 rather than -ansi --- config/Makefile.darwin | 2 +- config/Makefile.darwin-ppc | 2 ++ config/Makefile.darwin-universal | 1 + config/Makefile.darwin-x86_64 | 1 + 4 files changed, 5 insertions(+), 1 deletion(-) diff --git a/config/Makefile.darwin b/config/Makefile.darwin index 031356d..945e062 100644 --- a/config/Makefile.darwin +++ b/config/Makefile.darwin @@ -3,7 +3,7 @@ NAME = $(GLEW_NAME) CC = cc LD = cc CFLAGS.EXTRA = -dynamic -fno-common -CFLAGS.EXTRA += -ansi -pedantic +CFLAGS.EXTRA += -std=c89 -pedantic #CFLAGS.EXTRA += -no-cpp-precomp LDFLAGS.EXTRA = ifneq (undefined, $(origin GLEW_APPLE_GLX)) diff --git a/config/Makefile.darwin-ppc b/config/Makefile.darwin-ppc index a221ede..d511585 100644 --- a/config/Makefile.darwin-ppc +++ b/config/Makefile.darwin-ppc @@ -1,3 +1,5 @@ +# Note: PPC is no longer actively maintained for GLEW, but this configuration +# is here for reference. GLEW_DEST = /usr/local NAME = $(GLEW_NAME) CC = cc diff --git a/config/Makefile.darwin-universal b/config/Makefile.darwin-universal index c485b9f..9518f71 100644 --- a/config/Makefile.darwin-universal +++ b/config/Makefile.darwin-universal @@ -6,6 +6,7 @@ AR = LIBTOOL = libtool -static -o STRIP = CFLAGS.EXTRA = -dynamic -fno-common +CFLAGS.EXTRA += -std=c89 -pedantic #CFLAGS.EXTRA += -no-cpp-precomp CFLAGS.EXTRA += -arch i386 -arch x86_64 LDFLAGS.EXTRA = -arch i386 -arch x86_64 diff --git a/config/Makefile.darwin-x86_64 b/config/Makefile.darwin-x86_64 index e5896a1..1833438 100644 --- a/config/Makefile.darwin-x86_64 +++ b/config/Makefile.darwin-x86_64 @@ -3,6 +3,7 @@ NAME = $(GLEW_NAME) CC = cc LD = cc CFLAGS.EXTRA = -arch x86_64 -dynamic -fno-common +CFLAGS.EXTRA += -std=c89 -pedantic #CFLAGS.EXTRA += -no-cpp-precomp LDFLAGS.EXTRA = -arch x86_64 ifneq (undefined, $(origin GLEW_APPLE_GLX)) From 2c6ad763afa63e3326eef043eb0b2a87854cce9f Mon Sep 17 00:00:00 2001 From: Nigel Stewart Date: Sun, 13 Nov 2016 12:08:32 +1000 Subject: [PATCH 2/4] glxewInit check for current X11 display rather than crashing --- auto/src/glew_init_glx.c | 8 ++++++-- auto/src/glew_tail.h | 1 + 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/auto/src/glew_init_glx.c b/auto/src/glew_init_glx.c index 159e45d..8c4596e 100644 --- a/auto/src/glew_init_glx.c +++ b/auto/src/glew_init_glx.c @@ -14,9 +14,13 @@ GLboolean glxewGetExtension (const char* name) GLenum glxewInit () { + Display* display; int major, minor; const GLubyte* extStart; const GLubyte* extEnd; + /* check for a display */ + display = glXGetCurrentDisplay(); + if (display == NULL) return GLEW_ERROR_NO_GLX_DISPLAY; /* initialize core GLX 1.2 */ if (_glewInit_GLX_VERSION_1_2()) return GLEW_ERROR_GLX_VERSION_11_ONLY; /* initialize flags */ @@ -26,7 +30,7 @@ GLenum glxewInit () GLXEW_VERSION_1_3 = GL_TRUE; GLXEW_VERSION_1_4 = GL_TRUE; /* query GLX version */ - glXQueryVersion(glXGetCurrentDisplay(), &major, &minor); + glXQueryVersion(display, &major, &minor); if (major == 1 && minor <= 3) { switch (minor) @@ -46,7 +50,7 @@ GLenum glxewInit () /* query GLX extension string */ extStart = 0; if (glXGetCurrentDisplay != NULL) - extStart = (const GLubyte*)glXGetClientString(glXGetCurrentDisplay(), GLX_EXTENSIONS); + extStart = (const GLubyte*)glXGetClientString(display, GLX_EXTENSIONS); if (extStart == 0) extStart = (const GLubyte *)""; extEnd = extStart + _glewStrLen(extStart); diff --git a/auto/src/glew_tail.h b/auto/src/glew_tail.h index ce7ff3c..09daade 100644 --- a/auto/src/glew_tail.h +++ b/auto/src/glew_tail.h @@ -6,6 +6,7 @@ #define GLEW_ERROR_NO_GL_VERSION 1 /* missing GL version */ #define GLEW_ERROR_GL_VERSION_10_ONLY 2 /* Need at least OpenGL 1.1 */ #define GLEW_ERROR_GLX_VERSION_11_ONLY 3 /* Need at least GLX 1.2 */ +#define GLEW_ERROR_NO_GLX_DISPLAY 4 /* Need GLX display for GLX support */ /* string codes */ #define GLEW_VERSION 1 From b79702c6b7b3ac11b4bb9403a0f3f7f72db5d001 Mon Sep 17 00:00:00 2001 From: Nigel Stewart Date: Sun, 13 Nov 2016 14:33:55 +1000 Subject: [PATCH 3/4] Bump the copyright notice to 2016 --- auto/src/glew_license.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/auto/src/glew_license.h b/auto/src/glew_license.h index 82a002c..77e2b29 100644 --- a/auto/src/glew_license.h +++ b/auto/src/glew_license.h @@ -1,6 +1,6 @@ /* ** The OpenGL Extension Wrangler Library -** Copyright (C) 2008-2015, Nigel Stewart +** Copyright (C) 2008-2016, Nigel Stewart ** Copyright (C) 2002-2008, Milan Ikits ** Copyright (C) 2002-2008, Marcelo E. Magallon ** Copyright (C) 2002, Lev Povalahev From a42be263acc446a3e0add154f3f682a5c4bd8de9 Mon Sep 17 00:00:00 2001 From: Nigel Stewart Date: Sun, 13 Nov 2016 14:44:44 +1000 Subject: [PATCH 4/4] README updates --- README.md | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/README.md b/README.md index 36e9333..a99e2ce 100644 --- a/README.md +++ b/README.md @@ -28,12 +28,11 @@ Snapshots may contain new features, bug-fixes or new OpenGL extensions ahead of [glew-20160708.tgz](http://sourceforge.net/projects/glew/files/glew/snapshots/glew-20160708.tgz/download) *GLEW 2.0.0 RC: Core context, EGL support, no MX* -[glew-20160402.tgz](http://sourceforge.net/projects/glew/files/glew/snapshots/glew-20160402.tgz/download) -*GLEW 2.0.0 RC: Core context, EGL support, no MX* - ## Build -From a downloaded tarball or zip archive: +It is highly recommended to build from a tgz or zip release snapshot. +The code generation workflow is a complex brew of gnu make, perl and python, that works best on Linux or Mac. +For most end-users of GLEW the official releases are the best choice, with first class support. ### Linux and Mac @@ -41,9 +40,9 @@ From a downloaded tarball or zip archive: ##### Install build tools -Debian/Ubuntu/Mint: `$ sudo apt-get install build-essential libxmu-dev libxi-dev libgl-dev libosmesa-dev git` +Debian/Ubuntu/Mint: `$ sudo apt-get install build-essential libxmu-dev libxi-dev libgl-dev libosmesa-dev` -RedHat/CentOS/Fedora: `$ sudo yum install libXmu-devel libXi-devel libGL-devel git` +RedHat/CentOS/Fedora: `$ sudo yum install libXmu-devel libXi-devel libGL-devel` ##### Build @@ -61,9 +60,9 @@ Variables: `SYSTEM=linux-clang, GLEW_DEST=/usr/local, STRIP=` ##### Install build tools -Debian/Ubuntu/Mint: `$ sudo apt-get install build-essential libXmu-dev libXi-dev libgl-dev git cmake` +Debian/Ubuntu/Mint: `$ sudo apt-get install build-essential libXmu-dev libXi-dev libgl-dev cmake` -RedHat/CentOS/Fedora: `$ sudo yum install libXmu-devel libXi-devel libGL-devel git cmake` +RedHat/CentOS/Fedora: `$ sudo yum install libXmu-devel libXi-devel libGL-devel cmake` ##### Build