summaryrefslogtreecommitdiff
path: root/libada/configure
diff options
context:
space:
mode:
authorRainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>2011-08-22 16:54:02 +0000
committerRainer Orth <ro@gcc.gnu.org>2011-08-22 16:54:02 +0000
commite3aa9ebaf76b9076897762e8ec28e7542338c3f9 (patch)
tree9d2d55b0c248cd5196e2b1e53daa710fc4f00e33 /libada/configure
parenteb3e9f604784afbcd4fd641ad913e92b25effd0b (diff)
downloadgcc-e3aa9ebaf76b9076897762e8ec28e7542338c3f9.tar.gz
Centralize PICFLAG configuration
config: * picflag.m4: New file. gcc: * configure.ac (GCC_PICFLAG_FOR_TARGET): Call it. (PICFLAG_FOR_TARGET): Substitute. * aclocal.m4: Regenerate. * configure: Regenerate. gcc/ada: * gcc-interface/Makefile.in (PICFLAG_FOR_TARGET): New. (GNATLIBCFLAGS_FOR_C): Replace TARGET_LIBGCC2_CFLAGS by PICFLAG_FOR_TARGET. (gnatlib-shared-default, gnatlib-shared-dual-win32) (gnatlib-shared-win32, gnatlib-shared-darwin, gnatlib-shared) (gnatlib-sjlj, gnatlib-zcx): Likewise. libada: * configure.ac: Include ../config/picflag.m4. (GCC_PICFLAG): Call it. Substitute. * configure: Regenerate. * Makefile.in (TARGET_LIBGCC2_CFLAGS): Replace by PICFLAG. (GNATLIBCFLAGS_FOR_C): Replace TARGET_LIBGCC2_CFLAGS by PICFLAG. (LIBADA_FLAGS_TO_PASS): Pass PICFLAG as PICFLAG_FOR_TARGET. Don't include $(GCC_DIR)/libgcc.mvars. libiberty: * aclocal.m4: Include ../config/picflag.m4. * configure.ac (GCC_PICFLAG): Call it. (enable_shared): Clear PICFLAG unless shared. * configure: Regenerate. From-SVN: r177967
Diffstat (limited to 'libada/configure')
-rwxr-xr-xlibada/configure82
1 files changed, 82 insertions, 0 deletions
diff --git a/libada/configure b/libada/configure
index 4137364df21..c0a294fdd0c 100755
--- a/libada/configure
+++ b/libada/configure
@@ -558,6 +558,7 @@ have_getipinfo
default_gnatlib_target
LN_S
AWK
+PICFLAG
enable_shared
OBJEXT
EXEEXT
@@ -2817,6 +2818,87 @@ fi
+
+
+
+
+case "${host}" in
+ # PIC is the default on some targets or must not be used.
+ *-*-darwin*)
+ # PIC is the default on this platform
+ # Common symbols not allowed in MH_DYLIB files
+ PICFLAG=-fno-common
+ ;;
+ alpha*-dec-osf5*)
+ # PIC is the default.
+ ;;
+ hppa*64*-*-hpux*)
+ # PIC is the default for 64-bit PA HP-UX.
+ ;;
+ i[34567]86-*-cygwin* | i[34567]86-*-mingw* | x86_64-*-mingw*)
+ ;;
+ i[34567]86-*-interix3*)
+ # Interix 3.x gcc -fpic/-fPIC options generate broken code.
+ # Instead, we relocate shared libraries at runtime.
+ ;;
+ i[34567]86-*-nto-qnx*)
+ # QNX uses GNU C++, but need to define -shared option too, otherwise
+ # it will coredump.
+ PICFLAG='-fPIC -shared'
+ ;;
+ i[34567]86-pc-msdosdjgpp*)
+ # DJGPP does not support shared libraries at all.
+ ;;
+ ia64*-*-hpux*)
+ # On IA64 HP-UX, PIC is the default but the pic flag
+ # sets the default TLS model and affects inlining.
+ PICFLAG=-fPIC
+ ;;
+ mips-sgi-irix6*)
+ # PIC is the default.
+ ;;
+ rs6000-ibm-aix* | powerpc-ibm-aix*)
+ # All AIX code is PIC.
+ ;;
+
+ # Some targets support both -fPIC and -fpic, but prefer the latter.
+ # FIXME: Why?
+ i[34567]86-*-* | x86_64-*-*)
+ PICFLAG=-fpic
+ ;;
+ m68k-*-*)
+ PICFLAG=-fpic
+ ;;
+ s390*-*-*)
+ PICFLAG=-fpic
+ ;;
+ # FIXME: Override -fPIC default in libgcc only?
+ sh-*-linux* | sh[2346lbe]*-*-linux*)
+ PICFLAG=-fpic
+ ;;
+ # FIXME: Simplify to sh*-*-netbsd*?
+ sh-*-netbsdelf* | shl*-*-netbsdelf* | sh5-*-netbsd* | sh5l*-*-netbsd* | \
+ sh64-*-netbsd* | sh64l*-*-netbsd*)
+ PICFLAG=-fpic
+ ;;
+ # Default to -fPIC unless specified otherwise.
+ *)
+ PICFLAG=-fPIC
+ ;;
+esac
+
+# If the user explicitly uses -fpic/-fPIC, keep that.
+case "${CFLAGS}" in
+ *-fpic*)
+ PICFLAG=-fpic
+ ;;
+ *-fPIC*)
+ PICFLAG=-fPIC
+ ;;
+esac
+
+
+
# These must be passed down, or are needed by gcc/libgcc.mvars
for ac_prog in gawk mawk nawk awk
do