diff mbox

odp add option to compile position independent lib

Message ID 1403091216-1935-1-git-send-email-maxim.uvarov@linaro.org
State Accepted
Commit eacddcf867f53cc7ebc2ede1faf83ec40f4ea9f7
Headers show

Commit Message

Maxim Uvarov June 18, 2014, 11:33 a.m. UTC
Signed-off-by: Maxim Uvarov <maxim.uvarov@linaro.org>
---
 README                            | 7 +++++++
 platform/linux-generic/Makefile   | 4 +++-
 platform/linux-keystone2/Makefile | 6 ++++++
 3 files changed, 16 insertions(+), 1 deletion(-)
diff mbox

Patch

diff --git a/README b/README
index dc6dfe3..36545dd 100644
--- a/README
+++ b/README
@@ -20,6 +20,13 @@  Main git repository:
     For cross compiling set up appropriate CC:
         make CC=armeb-linux-gnueabihf-gcc
 
+    Make command options:
+        ODP_RELOC compile library with position independent code;
+        VERBOSE turn on compilation debug;
+        ODP_DEBUG_PRINT (default is yes) more debug information;
+        DEBUG compile gdb friendly code;
+        ODP_HAVE_NETMAP (linux-generic only) turn on netmap packet i/o
+
 ODP patches for 3-rd party applications:
     git://git.linaro.org/lng/odp-apps.git
 
diff --git a/platform/linux-generic/Makefile b/platform/linux-generic/Makefile
index 00fb5b2..0737656 100644
--- a/platform/linux-generic/Makefile
+++ b/platform/linux-generic/Makefile
@@ -38,7 +38,9 @@  EXTRA_CFLAGS  += -I./include/api
 
 # Option for shared libraries.
 # Decreases performance with static libraries.
-# EXTRA_CFLAGS  += -fPIC
+ifeq ($(ODP_RELOC),yes)
+EXTRA_CFLAGS  += -fpic
+endif
 
 ifeq ($(ODP_HAVE_NETMAP),yes)
 EXTRA_CFLAGS  += -DODP_HAVE_NETMAP
diff --git a/platform/linux-keystone2/Makefile b/platform/linux-keystone2/Makefile
index 6620cb2..a0e2922 100644
--- a/platform/linux-keystone2/Makefile
+++ b/platform/linux-keystone2/Makefile
@@ -13,6 +13,12 @@  DOC_DIR  = ./doc
 
 LINUX_GENERIC_DIR = ../linux-generic
 
+# Option for shared libraries.
+# Decreases performance with static libraries.
+ifeq ($(ODP_RELOC),yes)
+EXTRA_CFLAGS  += -fpic
+endif
+
 MY_PLATFORM  = DEVICE_K2K
 
 PLAT_CFLAGS  = -D$(MY_PLATFORM)