OLD | NEW |
1 # _GCC_PICFLAG(FLAG, DISPATCH) | 1 # _GCC_PICFLAG(FLAG, DISPATCH) |
2 # ---------------------------- | 2 # ---------------------------- |
3 # Store PIC flag corresponding to DISPATCH triplet in FLAG. | 3 # Store PIC flag corresponding to DISPATCH triplet in FLAG. |
4 # Explit use of -fpic in CFLAGS corresponding to FLAG overrides default. | 4 # Explit use of -fpic in CFLAGS corresponding to FLAG overrides default. |
5 AC_DEFUN([_GCC_PICFLAG], [ | 5 AC_DEFUN([_GCC_PICFLAG], [ |
6 | 6 |
7 case "${$2}" in | 7 case "${$2}" in |
8 # PIC is the default on some targets or must not be used. | 8 # PIC is the default on some targets or must not be used. |
9 *-*-darwin*) | 9 *-*-darwin*) |
10 # PIC is the default on this platform | 10 # PIC is the default on this platform |
11 # Common symbols not allowed in MH_DYLIB files | 11 # Common symbols not allowed in MH_DYLIB files |
12 $1=-fno-common | 12 $1=-fno-common |
13 ;; | 13 ;; |
14 alpha*-dec-osf5*) | 14 alpha*-dec-osf5*) |
15 # PIC is the default. | 15 # PIC is the default. |
16 ;; | 16 ;; |
17 hppa*64*-*-hpux*) | 17 hppa*64*-*-hpux*) |
18 # PIC is the default for 64-bit PA HP-UX. | 18 # PIC is the default for 64-bit PA HP-UX. |
19 ;; | 19 ;; |
20 i[[34567]]86-*-cygwin* | i[[34567]]86-*-mingw* | x86_64-*-mingw*) | 20 i[[34567]]86-*-cygwin* | i[[34567]]86-*-mingw* | x86_64-*-mingw*) |
21 ;; | 21 ;; |
22 i[[34567]]86-*-interix3*) | 22 i[[34567]]86-*-interix[[3-9]]*) |
23 # Interix 3.x gcc -fpic/-fPIC options generate broken code. | 23 # Interix 3.x gcc -fpic/-fPIC options generate broken code. |
24 # Instead, we relocate shared libraries at runtime. | 24 # Instead, we relocate shared libraries at runtime. |
25 ;; | 25 ;; |
26 i[[34567]]86-*-nto-qnx*) | 26 i[[34567]]86-*-nto-qnx*) |
27 # QNX uses GNU C++, but need to define -shared option too, otherwise | 27 # QNX uses GNU C++, but need to define -shared option too, otherwise |
28 # it will coredump. | 28 # it will coredump. |
29 $1='-fPIC -shared' | 29 $1='-fPIC -shared' |
30 ;; | 30 ;; |
31 i[[34567]]86-pc-msdosdjgpp*) | 31 i[[34567]]86-pc-msdosdjgpp*) |
32 # DJGPP does not support shared libraries at all. | 32 # DJGPP does not support shared libraries at all. |
(...skipping 11 matching lines...) Expand all Loading... |
44 ;; | 44 ;; |
45 | 45 |
46 # Some targets support both -fPIC and -fpic, but prefer the latter. | 46 # Some targets support both -fPIC and -fpic, but prefer the latter. |
47 # FIXME: Why? | 47 # FIXME: Why? |
48 i[[34567]]86-*-* | x86_64-*-*) | 48 i[[34567]]86-*-* | x86_64-*-*) |
49 $1=-fpic | 49 $1=-fpic |
50 ;; | 50 ;; |
51 m68k-*-*) | 51 m68k-*-*) |
52 $1=-fpic | 52 $1=-fpic |
53 ;; | 53 ;; |
54 s390*-*-*) | |
55 $1=-fpic | |
56 ;; | |
57 # FIXME: Override -fPIC default in libgcc only? | 54 # FIXME: Override -fPIC default in libgcc only? |
58 sh-*-linux* | sh[[2346lbe]]*-*-linux*) | 55 sh-*-linux* | sh[[2346lbe]]*-*-linux*) |
59 $1=-fpic | 56 $1=-fpic |
60 ;; | 57 ;; |
61 # FIXME: Simplify to sh*-*-netbsd*? | 58 # FIXME: Simplify to sh*-*-netbsd*? |
62 sh-*-netbsdelf* | shl*-*-netbsdelf* | sh5-*-netbsd* | sh5l*-*-netbsd* | \ | 59 sh-*-netbsdelf* | shl*-*-netbsdelf* | sh5-*-netbsd* | sh5l*-*-netbsd* | \ |
63 sh64-*-netbsd* | sh64l*-*-netbsd*) | 60 sh64-*-netbsd* | sh64l*-*-netbsd*) |
64 $1=-fpic | 61 $1=-fpic |
65 ;; | 62 ;; |
66 # Default to -fPIC unless specified otherwise. | 63 # Default to -fPIC unless specified otherwise. |
(...skipping 19 matching lines...) Expand all Loading... |
86 AC_DEFUN([GCC_PICFLAG], [ | 83 AC_DEFUN([GCC_PICFLAG], [ |
87 AC_REQUIRE([AC_CANONICAL_HOST]) | 84 AC_REQUIRE([AC_CANONICAL_HOST]) |
88 _GCC_PICFLAG([PICFLAG], [host])]) | 85 _GCC_PICFLAG([PICFLAG], [host])]) |
89 | 86 |
90 # GCC_PICFLAG_FOR_TARGET | 87 # GCC_PICFLAG_FOR_TARGET |
91 # ---------------------- | 88 # ---------------------- |
92 # Store target PIC flag in PICFLAG_FOR_TARGET. | 89 # Store target PIC flag in PICFLAG_FOR_TARGET. |
93 AC_DEFUN([GCC_PICFLAG_FOR_TARGET], [ | 90 AC_DEFUN([GCC_PICFLAG_FOR_TARGET], [ |
94 AC_REQUIRE([AC_CANONICAL_TARGET]) | 91 AC_REQUIRE([AC_CANONICAL_TARGET]) |
95 _GCC_PICFLAG([PICFLAG_FOR_TARGET], [target])]) | 92 _GCC_PICFLAG([PICFLAG_FOR_TARGET], [target])]) |
OLD | NEW |