about summary refs log tree commit diff
path: root/Makefile
diff options
context:
space:
mode:
authorLaurent Bercot <ska-skaware@skarnet.org>2017-10-30 10:37:05 +0000
committerLaurent Bercot <ska-skaware@skarnet.org>2017-10-30 10:37:05 +0000
commitf65cd7e93eeb39d7ebb4066793345dd45051abe2 (patch)
tree4993379e0551f92c46252442cb5f705c620fd9b3 /Makefile
parent88805f471a66064c778ea49ef22287fcd37deb93 (diff)
downloadskalibs-f65cd7e93eeb39d7ebb4066793345dd45051abe2.tar.gz
skalibs-f65cd7e93eeb39d7ebb4066793345dd45051abe2.tar.xz
skalibs-f65cd7e93eeb39d7ebb4066793345dd45051abe2.zip
Make all-pic a user option
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile5
1 files changed, 3 insertions, 2 deletions
diff --git a/Makefile b/Makefile
index 65b9619..f40335b 100644
--- a/Makefile
+++ b/Makefile
@@ -22,7 +22,6 @@ version_M := $(basename $(version_m))
 version_l := $(basename $(version_M))
 CPPFLAGS_ALL := $(CPPFLAGS_AUTO) $(CPPFLAGS)
 CFLAGS_ALL := $(CFLAGS_AUTO) $(CFLAGS)
-CFLAGS_SHARED := -fPIC
 LDFLAGS_ALL := $(LDFLAGS_AUTO) $(LDFLAGS)
 LDLIBS_ALL := $(LDLIBS_AUTO) $(LDLIBS)
 REALCC = $(CROSS_COMPILE)$(CC)
@@ -35,10 +34,12 @@ TYPES := size uid gid pid time dev ino
 
 ALL_SRCS := $(wildcard src/lib*/*.c)
 ALL_DOBJS := $(ALL_SRCS:%.c=%.lo)
-ifeq ($(strip $(DEFAULT_PIE)),)
+ifeq ($(strip $(STATIC_LIBS_ARE_PIC)),)
 ALL_SOBJS := $(ALL_SRCS:%.c=%.o)
+CFLAGS_SHARED := -fPIC
 else
 ALL_SOBJS := $(ALL_DOBJS)
+CFLAGS_SHARED :=
 endif
 ALL_LIBS := $(SHARED_LIBS) $(STATIC_LIBS)
 BUILT_INCLUDES := \