Browse Source

Make PIC a config option

Eric Andersen 23 years ago
parent
commit
c5207a5547

+ 5 - 1
Rules.mak

@@ -45,7 +45,7 @@ endif
 
 ARFLAGS=r
 
-CCFLAGS=$(WARNINGS) $(OPTIMIZATION) -fPIC -fno-builtin -nostdinc $(CPUFLAGS) -I$(TOPDIR)include -I$(GCCINCDIR) -I. -D_LIBC
+CCFLAGS=$(WARNINGS) $(OPTIMIZATION) -fno-builtin -nostdinc $(CPUFLAGS) -I$(TOPDIR)include -I$(GCCINCDIR) -I. -D_LIBC
 TARGET_CCFLAGS=--uclibc-use-build-dir $(WARNINGS) $(OPTIMIZATION) $(CPUFLAGS)
 
 CFLAGS=$(ARCH_CFLAGS) $(CCFLAGS) $(DEFS) $(ARCH_CFLAGS2)
@@ -64,6 +64,10 @@ else
     LDFLAGS  = -s -nostdlib -Wl,-warn-common
     TARGET_LDFLAGS = --uclibc-use-build-dir -s -Wl,-warn-common
 endif
+ifeq ($(strip $(DOPIC)),true)
+    CFLAGS += -fPIC -D__PIC__
+endif
+
 
 ifndef $(PREFIX)
     PREFIX = `pwd`/_install

+ 3 - 0
extra/Configs/Config.arm

@@ -132,6 +132,9 @@ DOLFS = false
 # disabled.  This is off by default.
 INCLUDE_RPC = false
 
+# If you want to compile the library as PIC code, turn this on.
+DOPIC = false
+
 # ROOT_DIR is the base directory which will be compiled into the uClibc 
 # runtime environment.  When compiled as a shared library, the shared
 # library loader will look in <ROOT_DIR>/lib and <ROOT_DIR>/usr/lib

+ 3 - 0
extra/Configs/Config.i386

@@ -132,6 +132,9 @@ DOLFS = false
 # disabled.  This is off by default.
 INCLUDE_RPC = false
 
+# If you want to compile the library as PIC code, turn this on.
+DOPIC = false
+
 # ROOT_DIR is the base directory which will be compiled into the uClibc 
 # runtime environment.  When compiled as a shared library, the shared
 # library loader will look in <ROOT_DIR>/lib and <ROOT_DIR>/usr/lib

+ 3 - 0
extra/Configs/Config.m68k

@@ -132,6 +132,9 @@ DOLFS = false
 # disabled.  This is off by default.
 INCLUDE_RPC = true
 
+# If you want to compile the library as PIC code, turn this on.
+DOPIC = false
+
 # ROOT_DIR is the base directory which will be compiled into the uClibc 
 # runtime environment.  When compiled as a shared library, the shared
 # library loader will look in <ROOT_DIR>/lib and <ROOT_DIR>/usr/lib

+ 3 - 0
extra/Configs/Config.m68k.coff

@@ -132,6 +132,9 @@ DOLFS = false
 # disabled.  This is off by default.
 INCLUDE_RPC = true
 
+# If you want to compile the library as PIC code, turn this on.
+DOPIC = false
+
 # ROOT_DIR is the base directory which will be compiled into the uClibc 
 # runtime environment.  When compiled as a shared library, the shared
 # library loader will look in <ROOT_DIR>/lib and <ROOT_DIR>/usr/lib

+ 3 - 0
extra/Configs/Config.mips

@@ -132,6 +132,9 @@ DOLFS = false
 # disabled.  This is off by default.
 INCLUDE_RPC = false
 
+# If you want to compile the library as PIC code, turn this on.
+DOPIC = false
+
 # ROOT_DIR is the base directory which will be compiled into the uClibc 
 # runtime environment.  When compiled as a shared library, the shared
 # library loader will look in <ROOT_DIR>/lib and <ROOT_DIR>/usr/lib

+ 3 - 0
extra/Configs/Config.mipsel

@@ -132,6 +132,9 @@ DOLFS = false
 # disabled.  This is off by default.
 INCLUDE_RPC = false
 
+# If you want to compile the library as PIC code, turn this on.
+DOPIC = false
+
 # ROOT_DIR is the base directory which will be compiled into the uClibc 
 # runtime environment.  When compiled as a shared library, the shared
 # library loader will look in <ROOT_DIR>/lib and <ROOT_DIR>/usr/lib

+ 3 - 0
extra/Configs/Config.powerpc

@@ -132,6 +132,9 @@ DOLFS = false
 # disabled.  This is off by default.
 INCLUDE_RPC = false
 
+# If you want to compile the library as PIC code, turn this on.
+DOPIC = false
+
 # ROOT_DIR is the base directory which will be compiled into the uClibc 
 # runtime environment.  When compiled as a shared library, the shared
 # library loader will look in <ROOT_DIR>/lib and <ROOT_DIR>/usr/lib

+ 3 - 0
extra/Configs/Config.sh

@@ -153,6 +153,9 @@ DOLFS = false
 # disabled.  This is off by default.
 INCLUDE_RPC = false
 
+# If you want to compile the library as PIC code, turn this on.
+DOPIC = false
+
 # ROOT_DIR is the base directory which will be compiled into the uClibc 
 # runtime environment.  When compiled as a shared library, the shared
 # library loader will look in <ROOT_DIR>/lib and <ROOT_DIR>/usr/lib

+ 3 - 0
extra/Configs/Config.x86

@@ -132,6 +132,9 @@ DOLFS = false
 # disabled.  This is off by default.
 INCLUDE_RPC = false
 
+# If you want to compile the library as PIC code, turn this on.
+DOPIC = false
+
 # ROOT_DIR is the base directory which will be compiled into the uClibc 
 # runtime environment.  When compiled as a shared library, the shared
 # library loader will look in <ROOT_DIR>/lib and <ROOT_DIR>/usr/lib