From 9a2c9a14b733a9aac07fcefdbd7d3d6899c4f049 Mon Sep 17 00:00:00 2001 From: Eonfge Date: Tue, 3 Mar 2020 22:14:20 +0100 Subject: [PATCH 1/3] Add a custom 32bit Flatpak makefile --- config/Makefile.flatpak-32 | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 config/Makefile.flatpak-32 diff --git a/config/Makefile.flatpak-32 b/config/Makefile.flatpak-32 new file mode 100644 index 0000000..2c106de --- /dev/null +++ b/config/Makefile.flatpak-32 @@ -0,0 +1,24 @@ +NAME = $(GLEW_NAME) +CC = /usr/lib/sdk/toolchain-i386/bin/i686-unknown-linux-gnu-gcc -m32 -L/lib/i386-linux-gnu +LD = /usr/lib/sdk/toolchain-i386/bin/i686-unknown-linux-gnu-gcc -m32 -L/lib/i386-linux-gnu +LDFLAGS.EXTRA += -m32 +LDFLAGS.EXTRA += -L/lib/i386-linux-gnu +LIBDIR = $(GLEW_DEST)/lib32 +LDFLAGS.GL = -lGL -lX11 +LDFLAGS.STATIC = -Wl,-Bstatic +LDFLAGS.DYNAMIC = -Wl,-Bdynamic +WARN += -Wall -W +WARN += -Wshadow +WARN += -pedantic +POPT = -O2 +CFLAGS.EXTRA += -m32 +CFLAGS.EXTRA += -fPIC +CFLAGS.EXTRA += -Wcast-qual +CFLAGS.EXTRA += -ansi -pedantic +CFLAGS.EXTRA += -fno-stack-protector +BIN.SUFFIX = +LIB.SONAME = lib$(NAME).so.$(SO_MAJOR) +LIB.DEVLNK = lib$(NAME).so +LIB.SHARED = lib$(NAME).so.$(SO_VERSION) +LIB.STATIC = lib$(NAME).a +LDFLAGS.SO = -m32 -shared -Wl,-soname=$(LIB.SONAME) From 882aef97616ed3f32427b36fa06184a78bf226c3 Mon Sep 17 00:00:00 2001 From: Jose Santiago Date: Thu, 20 Feb 2020 16:47:09 -0600 Subject: [PATCH 2/3] Do not put build artifacts in the source directory. --- build/cmake/CMakeLists.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/build/cmake/CMakeLists.txt b/build/cmake/CMakeLists.txt index 0310fcc..8f3e803 100644 --- a/build/cmake/CMakeLists.txt +++ b/build/cmake/CMakeLists.txt @@ -214,9 +214,9 @@ if (APPLE) set (requireslib) endif () -configure_file (${GLEW_DIR}/glew.pc.in ${GLEW_DIR}/glew.pc @ONLY) +configure_file (${GLEW_DIR}/glew.pc.in ${CMAKE_CURRENT_BINARY_DIR}/glew.pc @ONLY) -install(FILES ${GLEW_DIR}/glew.pc +install(FILES ${CMAKE_CURRENT_BINARY_DIR}/glew.pc DESTINATION ${CMAKE_INSTALL_LIBDIR}/pkgconfig ) From 5ea705737a7bef46ee800ccd4ef70184088df3d2 Mon Sep 17 00:00:00 2001 From: Jose Santiago Date: Fri, 21 Feb 2020 10:19:04 -0600 Subject: [PATCH 3/3] Link the UTILS to the static library if BUILD_SHARED_LIBS is disabled. --- build/cmake/CMakeLists.txt | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/build/cmake/CMakeLists.txt b/build/cmake/CMakeLists.txt index 8f3e803..419c243 100644 --- a/build/cmake/CMakeLists.txt +++ b/build/cmake/CMakeLists.txt @@ -181,7 +181,11 @@ if (BUILD_UTILS) list (APPEND GLEWINFO_SRC_FILES ${GLEW_DIR}/build/glewinfo.rc) endif () add_executable (glewinfo ${GLEWINFO_SRC_FILES}) - target_link_libraries (glewinfo glew) + if(NOT DEFINED BUILD_SHARED_LIBS OR BUILD_SHARED_LIBS) + target_link_libraries (glewinfo glew) + else() + target_link_libraries (glewinfo glew_s) + endif() if (NOT WIN32) target_link_libraries(glewinfo ${X11_LIBRARIES}) endif () @@ -191,7 +195,11 @@ if (BUILD_UTILS) list (APPEND VISUALINFO_SRC_FILES ${GLEW_DIR}/build/visualinfo.rc) endif () add_executable (visualinfo ${VISUALINFO_SRC_FILES}) - target_link_libraries (visualinfo glew) + if(NOT DEFINED BUILD_SHARED_LIBS OR BUILD_SHARED_LIBS) + target_link_libraries (visualinfo glew) + else() + target_link_libraries (visualinfo glew_s) + endif() if (NOT WIN32) target_link_libraries(visualinfo ${X11_LIBRARIES}) endif ()