From 765b219893416dd0535a7a5326ae7d26ed94ee78 Mon Sep 17 00:00:00 2001 From: Togo Nishigaki Date: Tue, 4 Nov 2014 09:37:00 +0900 Subject: [PATCH 01/18] improved config/Makefile.linux-mingw* to support any host easily --- config/Makefile.linux-mingw32 | 5 +++-- config/Makefile.linux-mingw64 | 5 +++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/config/Makefile.linux-mingw32 b/config/Makefile.linux-mingw32 index 510e2a9..fdb2239 100644 --- a/config/Makefile.linux-mingw32 +++ b/config/Makefile.linux-mingw32 @@ -5,8 +5,9 @@ # NAME := glew32 -CC := i586-mingw32msvc-gcc -LD := i586-mingw32msvc-ld +HOST := i586-mingw32msvc +CC := $(HOST)-gcc +LD := $(HOST)-ld LN := STRIP := LDFLAGS.GL = -lopengl32 -lgdi32 -luser32 -lkernel32 diff --git a/config/Makefile.linux-mingw64 b/config/Makefile.linux-mingw64 index 65c1949..0e19f6c 100644 --- a/config/Makefile.linux-mingw64 +++ b/config/Makefile.linux-mingw64 @@ -5,8 +5,9 @@ # NAME := glew32 -CC := i686-w64-mingw32-gcc -LD := i686-w64-mingw32-ld +HOST := i686-w64-mingw32 +CC := $(HOST)-gcc +LD := $(HOST)-ld LN := STRIP := LDFLAGS.GL = -lopengl32 -lgdi32 -luser32 -lkernel32 From 8b138bcd46a13b212f4121b2162d442842eec05f Mon Sep 17 00:00:00 2001 From: Togo Nishigaki Date: Sun, 9 Nov 2014 22:25:45 +0900 Subject: [PATCH 02/18] added CMakeLists.txt --- CMakeLists.txt | 59 ++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 59 insertions(+) create mode 100644 CMakeLists.txt diff --git a/CMakeLists.txt b/CMakeLists.txt new file mode 100644 index 0000000..e302989 --- /dev/null +++ b/CMakeLists.txt @@ -0,0 +1,59 @@ +project(GLEW) +cmake_minimum_required(VERSION 2.4) + +if(COMMAND cmake_policy) + cmake_policy(SET CMP0003 NEW) +endif(COMMAND cmake_policy) + + +set(GLEW_VERSION "1.11.0") + +if(${CMAKE_SYSTEM_NAME} MATCHES "Windows") + set(GLEW_LIB_NAME glew32) +else(${CMAKE_SYSTEM_NAME} MATCHES "Windows") + set(GLEW_LIB_NAME GLEW) + set(DLL_PREFIX lib) +endif(${CMAKE_SYSTEM_NAME} MATCHES "Windows") + +include(FindPkgConfig) +pkg_check_modules( OpenGL REQUIRED gl ) + +set(CMAKE_C_FLAGS "${CFLAGS} ${CMAKE_C_FLAGS} -DGLEW_BUILD -DGLEW_NO_GLU -O2 -Wall -W" ) + +include_directories( ${PROJECT_SOURCE_DIR}/include ) + +add_library(GLEW_static STATIC src/glew.c ) +add_library(GLEW_shared SHARED src/glew.c ) +set_target_properties(GLEW_static PROPERTIES OUTPUT_NAME ${GLEW_LIB_NAME} PREFIX lib) +set_target_properties(GLEW_shared PROPERTIES OUTPUT_NAME ${GLEW_LIB_NAME} PREFIX "${DLL_PREFIX}") +target_link_libraries(GLEW_shared ${OpenGL_LDFLAGS}) + +add_library(GLEW_MX_static STATIC src/glew.c ) +add_library(GLEW_MX_shared SHARED src/glew.c ) +set_target_properties(GLEW_MX_static PROPERTIES OUTPUT_NAME ${GLEW_LIB_NAME}mx COMPILE_FLAGS "-DGLEW_MX" PREFIX lib) +set_target_properties(GLEW_MX_shared PROPERTIES OUTPUT_NAME ${GLEW_LIB_NAME}mx COMPILE_FLAGS "-DGLEW_MX" PREFIX "${DLL_PREFIX}") +target_link_libraries(GLEW_MX_shared ${OpenGL_LDFLAGS}) + +add_executable(glewinfo src/glewinfo.c) +target_link_libraries(glewinfo GLEW_shared ${OpenGL_LDFLAGS}) + +add_executable(visualinfo src/visualinfo.c) +target_link_libraries(visualinfo GLEW_shared ${OpenGL_LDFLAGS}) + +install( + TARGETS + GLEW_static + GLEW_shared + GLEW_MX_static + GLEW_MX_shared + glewinfo + visualinfo + RUNTIME DESTINATION bin + LIBRARY DESTINATION lib + ARCHIVE DESTINATION lib +) + +install(CODE "execute_process( COMMAND bash -x -c \"sed -e 's%@prefix@%${CMAKE_INSTALL_PREFIX}%g' -e 's%@exec_prefix@%\\\${prefix}%g' -e 's%@libdir@%\\\${prefix}/lib%g' -e 's%@includedir@%\\\${prefix}/include%g' -e 's/\@version\@/${GLEW_VERSION}/g' -e 's/\@cflags\@//g' -e 's/\@libname\@/${GLEW_LIB_NAME}/g' -e 's|@requireslib@|glu|g' < ${CMAKE_SOURCE_DIR}/glew.pc.in > ${CMAKE_BINARY_DIR}/glew.pc\" )" ) +install(CODE "execute_process( COMMAND bash -x -c \"sed -e 's%@prefix@%${CMAKE_INSTALL_PREFIX}%g' -e 's%@exec_prefix@%\\\${prefix}%g' -e 's%@libdir@%\\\${prefix}/lib%g' -e 's%@includedir@%\\\${prefix}/include%g' -e 's/\@version\@/${GLEW_VERSION}/g' -e 's/\@cflags\@/-DGLEW_MX/g' -e 's/\@libname\@/${GLEW_LIB_NAME}mx/g' -e 's|@requireslib@|glu|g' < ${CMAKE_SOURCE_DIR}/glew.pc.in > ${CMAKE_BINARY_DIR}/glewmx.pc\" )" ) + +install(FILES ${CMAKE_BINARY_DIR}/glew.pc ${CMAKE_BINARY_DIR}/glewmx.pc DESTINATION lib/pkgconfig) From daf318d02febd1c73bd970cf89e492f9d0b4719c Mon Sep 17 00:00:00 2001 From: Matthias Goldhoorn Date: Wed, 12 Nov 2014 15:50:46 +0100 Subject: [PATCH 03/18] Corrected package_config file. On multiarch the librarys got installed in lib64. Therefore take the libpath from the makefile and not assuming the lib directory from the install dir --- glew.pc.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/glew.pc.in b/glew.pc.in index d7f30a6..256daab 100644 --- a/glew.pc.in +++ b/glew.pc.in @@ -1,6 +1,6 @@ prefix=@prefix@ exec_prefix=${prefix} -libdir=${exec_prefix}/lib +libdir=@libdir@ includedir=${prefix}/include/GL Name: glew From 404df2ee70b3664ac4e417682bbf7ec43a505f5e Mon Sep 17 00:00:00 2001 From: Nigel Stewart Date: Mon, 1 Dec 2014 20:13:15 +1000 Subject: [PATCH 04/18] cmake build on Linux needs to link X11 --- CMakeLists.txt | 25 ++++++++++++++++++++++++- 1 file changed, 24 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index e302989..b17b42a 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -5,9 +5,12 @@ if(COMMAND cmake_policy) cmake_policy(SET CMP0003 NEW) endif(COMMAND cmake_policy) - set(GLEW_VERSION "1.11.0") +set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib) +set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib) +set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin) + if(${CMAKE_SYSTEM_NAME} MATCHES "Windows") set(GLEW_LIB_NAME glew32) else(${CMAKE_SYSTEM_NAME} MATCHES "Windows") @@ -15,9 +18,21 @@ else(${CMAKE_SYSTEM_NAME} MATCHES "Windows") set(DLL_PREFIX lib) endif(${CMAKE_SYSTEM_NAME} MATCHES "Windows") +# +# All platforms need OpenGL +# + include(FindPkgConfig) pkg_check_modules( OpenGL REQUIRED gl ) +# +# Linux needs X11 +# + +if(${CMAKE_SYSTEM_NAME} MATCHES "Linux") + find_package(X11 REQUIRED) +endif(${CMAKE_SYSTEM_NAME} MATCHES "Linux") + set(CMAKE_C_FLAGS "${CFLAGS} ${CMAKE_C_FLAGS} -DGLEW_BUILD -DGLEW_NO_GLU -O2 -Wall -W" ) include_directories( ${PROJECT_SOURCE_DIR}/include ) @@ -37,9 +52,17 @@ target_link_libraries(GLEW_MX_shared ${OpenGL_LDFLAGS}) add_executable(glewinfo src/glewinfo.c) target_link_libraries(glewinfo GLEW_shared ${OpenGL_LDFLAGS}) +if(${CMAKE_SYSTEM_NAME} MATCHES "Linux") + target_link_libraries(glewinfo ${X11_LIBRARIES}) +endif(${CMAKE_SYSTEM_NAME} MATCHES "Linux") + add_executable(visualinfo src/visualinfo.c) target_link_libraries(visualinfo GLEW_shared ${OpenGL_LDFLAGS}) +if(${CMAKE_SYSTEM_NAME} MATCHES "Linux") + target_link_libraries(visualinfo ${X11_LIBRARIES}) +endif(${CMAKE_SYSTEM_NAME} MATCHES "Linux") + install( TARGETS GLEW_static From f1eae16bb89f54b60d8c25ba5578f4026f42785d Mon Sep 17 00:00:00 2001 From: Nigel Stewart Date: Thu, 11 Dec 2014 19:34:52 +1000 Subject: [PATCH 05/18] Sourceforge bug 260 Missing defines: GL_COPY_{READ|WRITE}_BUFFER_BINDING --- auto/core/gl/GL_VERSION_4_2 | 2 ++ 1 file changed, 2 insertions(+) diff --git a/auto/core/gl/GL_VERSION_4_2 b/auto/core/gl/GL_VERSION_4_2 index fa75117..c94737a 100644 --- a/auto/core/gl/GL_VERSION_4_2 +++ b/auto/core/gl/GL_VERSION_4_2 @@ -1,6 +1,8 @@ GL_VERSION_4_2 https://www.opengl.org/registry/doc/glspec42.compatibility.20120427.pdf + GL_COPY_READ_BUFFER_BINDING 0x8F36 + GL_COPY_WRITE_BUFFER_BINDING 0x8F37 GL_COMPRESSED_RGBA_BPTC_UNORM 0x8E8C GL_COMPRESSED_SRGB_ALPHA_BPTC_UNORM 0x8E8D GL_COMPRESSED_RGB_BPTC_SIGNED_FLOAT 0x8E8E From 5eaf283c705daefb5bb0b9e8386346e07f8b802b Mon Sep 17 00:00:00 2001 From: Nigel Stewart Date: Wed, 7 Jan 2015 19:43:34 +1000 Subject: [PATCH 06/18] #264 FreeBSD: missing -fPIC when linking libglew --- config/Makefile.freebsd | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config/Makefile.freebsd b/config/Makefile.freebsd index bb66fcc..ca2771d 100644 --- a/config/Makefile.freebsd +++ b/config/Makefile.freebsd @@ -5,7 +5,7 @@ LDFLAGS.EXTRA = -L/usr/X11R6/lib LDFLAGS.GL = -lGL -lX11 LDFLAGS.STATIC = -Wl,-Bstatic LDFLAGS.DYNAMIC = -Wl,-Bdynamic -CFLAGS.EXTRA += -I/usr/X11R6/include +CFLAGS.EXTRA += -I/usr/X11R6/include -fPIC NAME = GLEW WARN = -Wall -W POPT = -O2 From e6a117de9bd0761ab61ba84c1f4d9db2ec8ba613 Mon Sep 17 00:00:00 2001 From: Carsten Neumann Date: Mon, 29 Dec 2014 13:34:43 -0600 Subject: [PATCH 07/18] add missing glGetGraphicsResetStatus function to VERSION_4_5 This function is in OpenGL 4.5, but not part of GL_KHR_robustness extension - it is in GL_ARB_robustness, but there it has the ARB suffix. --- auto/core/gl/GL_VERSION_4_5 | 2 ++ 1 file changed, 2 insertions(+) diff --git a/auto/core/gl/GL_VERSION_4_5 b/auto/core/gl/GL_VERSION_4_5 index c51e936..341abfd 100644 --- a/auto/core/gl/GL_VERSION_4_5 +++ b/auto/core/gl/GL_VERSION_4_5 @@ -1,2 +1,4 @@ GL_VERSION_4_5 https://www.opengl.org/registry/doc/glspec45.compatibility.pdf + + GLenum glGetGraphicsResetStatus (void) From e37f6728fedbfed48846371bed19918e653d1263 Mon Sep 17 00:00:00 2001 From: Nigel Stewart Date: Sat, 24 Jan 2015 17:03:51 +1000 Subject: [PATCH 08/18] Sourceforge Bug 263 - Fixed include path for pkg-config --- glew.pc.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/glew.pc.in b/glew.pc.in index 256daab..6d3d070 100644 --- a/glew.pc.in +++ b/glew.pc.in @@ -1,7 +1,7 @@ prefix=@prefix@ exec_prefix=${prefix} libdir=@libdir@ -includedir=${prefix}/include/GL +includedir=${prefix}/include Name: glew Description: The OpenGL Extension Wrangler library From c3e6ce6b61f31412755b8937d0397fc5970fae4f Mon Sep 17 00:00:00 2001 From: Nigel Stewart Date: Sat, 24 Jan 2015 17:08:19 +1000 Subject: [PATCH 09/18] Sourceforge Bug 253 - CFLAGS for Solaris need PIC specified --- config/Makefile.solaris | 2 +- config/Makefile.solaris-gcc | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/config/Makefile.solaris b/config/Makefile.solaris index fe78ca1..96e6d1f 100644 --- a/config/Makefile.solaris +++ b/config/Makefile.solaris @@ -1,7 +1,7 @@ NAME = $(GLEW_NAME) CC = cc LD = ld -CFLAGS.EXTRA = -I/usr/openwin/include +CFLAGS.EXTRA = -I/usr/openwin/include -Kpic 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 e00a95b..d66395b 100644 --- a/config/Makefile.solaris-gcc +++ b/config/Makefile.solaris-gcc @@ -1,7 +1,7 @@ NAME = $(GLEW_NAME) CC = gcc LD = ld -CFLAGS.EXTRA = -I/usr/openwin/include +CFLAGS.EXTRA = -I/usr/openwin/include -fPIC LDFLAGS.SO = -G LDFLAGS.EXTRA = -L/usr/openwin/lib LDFLAGS.GL = -lGL -lX11 From b52fa4654db22d0208643d1052bae8cdd5ba29aa Mon Sep 17 00:00:00 2001 From: Nigel Stewart Date: Sat, 24 Jan 2015 17:21:59 +1000 Subject: [PATCH 10/18] Bump copyright year to 2015 --- auto/src/glew_license.h | 2 +- auto/src/header.html | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/auto/src/glew_license.h b/auto/src/glew_license.h index 658b307..82a002c 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-2014, Nigel Stewart +** Copyright (C) 2008-2015, Nigel Stewart ** Copyright (C) 2002-2008, Milan Ikits ** Copyright (C) 2002-2008, Marcelo E. Magallon ** Copyright (C) 2002, Lev Povalahev diff --git a/auto/src/header.html b/auto/src/header.html index 2774ce5..771df3f 100644 --- a/auto/src/header.html +++ b/auto/src/header.html @@ -1,7 +1,7 @@ diff --git a/doc/credits.html b/doc/credits.html index fbd3d3e..05e1534 100644 --- a/doc/credits.html +++ b/doc/credits.html @@ -1,7 +1,7 @@ diff --git a/doc/glxew.html b/doc/glxew.html index d7df9c6..1ab8aee 100644 --- a/doc/glxew.html +++ b/doc/glxew.html @@ -1,7 +1,7 @@ diff --git a/doc/install.html b/doc/install.html index 893820b..9e575e4 100644 --- a/doc/install.html +++ b/doc/install.html @@ -1,7 +1,7 @@