From 98c18a6a4bf6f364fb46503a331e1c520b1b1004 Mon Sep 17 00:00:00 2001 From: "A. Breust" Date: Wed, 3 May 2017 09:39:13 +0200 Subject: [PATCH 1/2] Enabled PIC Added PIC (Position Independent Code) to the generation of the library so that it can be included in others. --- premake5.lua | 1 + 1 file changed, 1 insertion(+) diff --git a/premake5.lua b/premake5.lua index 1a109d7a..993bbcbe 100644 --- a/premake5.lua +++ b/premake5.lua @@ -24,6 +24,7 @@ workspace "guetzli" project "guetzli_static" kind "StaticLib" + pic "On" files { "guetzli/*.cc", From c4ca3a7272d9c6ca28987c4aefb8e8801266935a Mon Sep 17 00:00:00 2001 From: Alexis Breust Date: Wed, 3 May 2017 10:13:48 +0200 Subject: [PATCH 2/2] Regenerated Makefile with new option --- guetzli_static.make | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/guetzli_static.make b/guetzli_static.make index d20fb77d..683eb8c2 100644 --- a/guetzli_static.make +++ b/guetzli_static.make @@ -19,8 +19,8 @@ ifeq ($(config),release) INCLUDES += -I. -Ithird_party/butteraugli FORCE_INCLUDE += ALL_CPPFLAGS += $(CPPFLAGS) -MMD -MP $(DEFINES) $(INCLUDES) - ALL_CFLAGS += $(CFLAGS) $(ALL_CPPFLAGS) -O3 -g `pkg-config --static --cflags libpng || libpng-config --static --cflags` - ALL_CXXFLAGS += $(CXXFLAGS) $(ALL_CPPFLAGS) -O3 -g -std=c++11 `pkg-config --static --cflags libpng || libpng-config --static --cflags` + ALL_CFLAGS += $(CFLAGS) $(ALL_CPPFLAGS) -O3 -fPIC -g `pkg-config --static --cflags libpng || libpng-config --static --cflags` + ALL_CXXFLAGS += $(CXXFLAGS) $(ALL_CPPFLAGS) -O3 -fPIC -g -std=c++11 `pkg-config --static --cflags libpng || libpng-config --static --cflags` ALL_RESFLAGS += $(RESFLAGS) $(DEFINES) $(INCLUDES) LIBS += LDDEPS += @@ -46,8 +46,8 @@ ifeq ($(config),debug) INCLUDES += -I. -Ithird_party/butteraugli FORCE_INCLUDE += ALL_CPPFLAGS += $(CPPFLAGS) -MMD -MP $(DEFINES) $(INCLUDES) - ALL_CFLAGS += $(CFLAGS) $(ALL_CPPFLAGS) -g `pkg-config --static --cflags libpng || libpng-config --static --cflags` - ALL_CXXFLAGS += $(CXXFLAGS) $(ALL_CPPFLAGS) -g -std=c++11 `pkg-config --static --cflags libpng || libpng-config --static --cflags` + ALL_CFLAGS += $(CFLAGS) $(ALL_CPPFLAGS) -fPIC -g `pkg-config --static --cflags libpng || libpng-config --static --cflags` + ALL_CXXFLAGS += $(CXXFLAGS) $(ALL_CPPFLAGS) -fPIC -g -std=c++11 `pkg-config --static --cflags libpng || libpng-config --static --cflags` ALL_RESFLAGS += $(RESFLAGS) $(DEFINES) $(INCLUDES) LIBS += LDDEPS +=