]>
Commit | Line | Data |
---|---|---|
0a35513e | 1 | # -*- shell-script -*- |
f93608e6 | 2 | # Copyright (C) 2011-2014 Free Software Foundation, Inc. |
0a35513e AH |
3 | |
4 | # This program is free software; you can redistribute it and/or modify | |
5 | # it under the terms of the GNU General Public License as published by | |
6 | # the Free Software Foundation; either version 2 of the License, or | |
7 | # (at your option) any later version. | |
8 | # | |
9 | # This program is distributed in the hope that it will be useful, | |
10 | # but WITHOUT ANY WARRANTY; without even the implied warranty of | |
11 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
12 | # GNU General Public License for more details. | |
13 | # | |
14 | # You should have received a copy of the GNU General Public License | |
15 | # along with this program; if not, write to the Free Software | |
16 | # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. | |
17 | ||
18 | # This is the target specific configuration file. This is invoked by the | |
19 | # autoconf generated configure script. Putting it in a separate shell file | |
20 | # lets us skip running autoconf when modifying target specific information. | |
21 | ||
22 | # This file switches on the shell variable ${target}, and sets the | |
23 | # following shell variables: | |
24 | # config_path An ordered list of directories to search for | |
25 | # sources and headers. This is relative to the | |
26 | # config subdirectory of the source tree. | |
27 | # XCFLAGS Add extra compile flags to use. | |
28 | # XLDFLAGS Add extra link flags to use. | |
29 | ||
30 | # Optimize TLS usage by avoiding the overhead of dynamic allocation. | |
01f3428c | 31 | if test "$gcc_cv_have_tls" = yes ; then |
0a35513e AH |
32 | case "${target}" in |
33 | ||
34 | # For x86, we use slots in the TCB head for most of our TLS. | |
35 | # The setup of those slots in beginTransaction can afford to | |
36 | # use the global-dynamic model. | |
37 | i[456]86-*-linux* | x86_64-*-linux*) | |
38 | ;; | |
39 | ||
40 | *-*-linux*) | |
41 | XCFLAGS="${XCFLAGS} -ftls-model=initial-exec" | |
42 | ;; | |
43 | esac | |
44 | fi | |
45 | ||
46 | # Map the target cpu to an ARCH sub-directory. At the same time, | |
47 | # work out any special compilation flags as necessary. | |
48 | case "${target_cpu}" in | |
a32e5e93 | 49 | alpha*) ARCH=alpha ;; |
0258b6e4 PB |
50 | rs6000 | powerpc*) |
51 | XCFLAGS="${XCFLAGS} -mhtm" | |
52 | ARCH=powerpc | |
53 | ;; | |
0a35513e | 54 | |
aebac0ca RH |
55 | arm*) ARCH=arm ;; |
56 | ||
e28a3d8b | 57 | i[3456]86) |
0a35513e | 58 | case " ${CC} ${CFLAGS} " in |
b9c23a61 | 59 | *" -m64 "*|*" -mx32 "*) |
0a35513e AH |
60 | ;; |
61 | *) | |
62 | if test -z "$with_arch"; then | |
63 | XCFLAGS="${XCFLAGS} -march=i486 -mtune=${target_cpu}" | |
64 | XCFLAGS="${XCFLAGS} -fomit-frame-pointer" | |
65 | fi | |
66 | esac | |
64fbcc74 | 67 | XCFLAGS="${XCFLAGS} -mrtm" |
0a35513e AH |
68 | ARCH=x86 |
69 | ;; | |
70 | ||
cc163247 KK |
71 | sh*) ARCH=sh ;; |
72 | ||
f3f5e3c3 EB |
73 | sparc) |
74 | case " ${CC} ${CFLAGS} " in | |
75 | *" -m64 "*) | |
76 | ;; | |
77 | *) | |
78 | if test -z "$with_cpu"; then | |
79 | XCFLAGS="${XCFLAGS} -mcpu=v9" | |
80 | fi | |
81 | esac | |
82 | ARCH=sparc | |
83 | ;; | |
84 | ||
85 | sparc64|sparcv9) | |
86 | case " ${CC} ${CFLAGS} " in | |
87 | *" -m32 "*) | |
88 | XCFLAGS="${XCFLAGS} -mcpu=v9" | |
89 | ;; | |
90 | *" -m64 "*) | |
91 | ;; | |
92 | *) | |
93 | if test "x$with_cpu" = xv8; then | |
94 | XCFLAGS="${XCFLAGS} -mcpu=v9" | |
95 | fi | |
96 | ;; | |
97 | esac | |
98 | ARCH=sparc | |
99 | ;; | |
100 | ||
0a35513e AH |
101 | x86_64) |
102 | case " ${CC} ${CFLAGS} " in | |
103 | *" -m32 "*) | |
104 | XCFLAGS="${XCFLAGS} -march=i486 -mtune=i686" | |
105 | XCFLAGS="${XCFLAGS} -fomit-frame-pointer" | |
106 | ;; | |
107 | esac | |
64fbcc74 | 108 | XCFLAGS="${XCFLAGS} -mrtm" |
0a35513e AH |
109 | ARCH=x86 |
110 | ;; | |
aaec3fc8 | 111 | s390|s390x) |
1869217f | 112 | XCFLAGS="${XCFLAGS} -mzarch -mhtm" |
aaec3fc8 | 113 | ARCH=s390 |
aaec3fc8 | 114 | ;; |
0a35513e | 115 | |
0a35513e AH |
116 | *) |
117 | ARCH="${target_cpu}" | |
118 | ;; | |
119 | esac | |
01f3428c RH |
120 | |
121 | # For the benefit of top-level configure, determine if the cpu is supported. | |
3d3b05ff | 122 | test -d ${srcdir}/config/$ARCH || UNSUPPORTED=1 |
01f3428c | 123 | |
0a35513e AH |
124 | # Since we require POSIX threads, assume a POSIX system by default. |
125 | config_path="$ARCH posix generic" | |
126 | ||
127 | # Other system configury | |
128 | case "${target}" in | |
129 | *-*-linux*) | |
01f3428c | 130 | if test "$enable_linux_futex" = yes; then |
0a35513e AH |
131 | config_path="linux/$ARCH linux $config_path" |
132 | fi | |
133 | ;; | |
134 | ||
a32e5e93 RH |
135 | powerpc*-*-aix* | rs6000-*-aix*) |
136 | # The system ought to be supported, but sjlj.S has not been ported. | |
137 | UNSUPPORTED=1 | |
138 | ;; | |
139 | ||
01f3428c RH |
140 | *-*-gnu* | *-*-k*bsd*-gnu \ |
141 | | *-*-netbsd* | *-*-freebsd* | *-*-openbsd* \ | |
b24513a1 | 142 | | *-*-solaris2* | *-*-sysv4* | *-*-hpux11* \ |
01f3428c RH |
143 | | *-*-darwin* | *-*-aix*) |
144 | # POSIX system. The OS is supported. | |
0a35513e AH |
145 | ;; |
146 | ||
01f3428c RH |
147 | *) # Non-POSIX, or embedded system |
148 | UNSUPPORTED=1 | |
0a35513e AH |
149 | ;; |
150 | esac |