From 5f7888db4f8969a927898a1888363417d59f992d Mon Sep 17 00:00:00 2001
From: Martin Reinecke <martin@mpa-garching.mpg.de>
Date: Wed, 19 Sep 2012 11:07:30 +0200
Subject: [PATCH] add option to enable position independent code generation

---
 configure.ac | 11 +++++++++++
 1 file changed, 11 insertions(+)

diff --git a/configure.ac b/configure.ac
index ee0283a..443e5bb 100644
--- a/configure.ac
+++ b/configure.ac
@@ -40,6 +40,13 @@ AC_ARG_ENABLE(debug,
      ENABLE_DEBUG=yes
    fi])
 
+ENABLE_PIC=no
+AC_ARG_ENABLE(pic,
+  [  --enable-pic            enable generation of position independent code],
+  [if test "$enableval" = yes; then
+     ENABLE_PIC=yes
+   fi])
+
 case $CCTYPE in
   gcc)
     CCFLAGS="-O3 -fno-tree-vectorize -ffast-math -fomit-frame-pointer -std=c99 -pedantic -Wextra -Wall -Wno-unknown-pragmas -Wshadow -Wmissing-prototypes -Wfatal-errors"
@@ -84,6 +91,10 @@ if test $ENABLE_DEBUG = yes; then
   CCFLAGS="$CCFLAGS -g"
 fi
 
+if test $ENABLE_PIC = yes; then
+  CCFLAGS="$CCFLAGS -fPIC"
+fi
+
 if test $ENABLE_MPI = yes; then
   CCFLAGS="$CCFLAGS -DUSE_MPI"
 fi
-- 
GitLab