1 # _GCC_PICFLAG(FLAG, DISPATCH)
2 # ----------------------------
3 # Store PIC flag corresponding to DISPATCH triplet in FLAG.
4 # Explit use of -fpic in CFLAGS corresponding to FLAG overrides default.
5 AC_DEFUN([_GCC_PICFLAG], [
8 # PIC is the default on some targets or must not be used.
10 # PIC is the default on this platform
11 # Common symbols not allowed in MH_DYLIB files
18 # PIC is the default for 64-bit PA HP-UX.
20 i[[34567]]86-*-cygwin* | i[[34567]]86-*-mingw* | x86_64-*-mingw*)
22 i[[34567]]86-*-interix3*)
23 # Interix 3.x gcc -fpic/-fPIC options generate broken code.
24 # Instead, we relocate shared libraries at runtime.
26 i[[34567]]86-*-nto-qnx*)
27 # QNX uses GNU C++, but need to define -shared option too, otherwise
31 i[[34567]]86-pc-msdosdjgpp*)
32 # DJGPP does not support shared libraries at all.
35 # On IA64 HP-UX, PIC is the default but the pic flag
36 # sets the default TLS model and affects inlining.
42 rs6000-ibm-aix* | powerpc-ibm-aix*)
43 # All AIX code is PIC.
46 # Some targets support both -fPIC and -fpic, but prefer the latter.
48 i[[34567]]86-*-* | x86_64-*-*)
57 # FIXME: Override -fPIC default in libgcc only?
58 sh-*-linux* | sh[[2346lbe]]*-*-linux*)
61 # FIXME: Simplify to sh*-*-netbsd*?
62 sh-*-netbsdelf* | shl*-*-netbsdelf* | sh5-*-netbsd* | sh5l*-*-netbsd* | \
63 sh64-*-netbsd* | sh64l*-*-netbsd*)
66 # Default to -fPIC unless specified otherwise.
72 # If the user explicitly uses -fpic/-fPIC, keep that.
73 case "${m4_bpatsubsts($1, PICFLAG, CFLAGS)}" in
85 # Store host PIC flag in PICFLAG.
86 AC_DEFUN([GCC_PICFLAG], [
87 AC_REQUIRE([AC_CANONICAL_HOST])
88 _GCC_PICFLAG([PICFLAG], [host])])
90 # GCC_PICFLAG_FOR_TARGET
91 # ----------------------
92 # Store target PIC flag in PICFLAG_FOR_TARGET.
93 AC_DEFUN([GCC_PICFLAG_FOR_TARGET], [
94 AC_REQUIRE([AC_CANONICAL_TARGET])
95 _GCC_PICFLAG([PICFLAG_FOR_TARGET], [target])])