Fix up testcase.
[gcc.git] / libitm / configure.tgt
1 # -*- shell-script -*-
2 # Copyright (C) 2011-2020 Free Software Foundation, Inc.
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.
31 if test "$gcc_cv_have_tls" = yes ; then
32 case "${target}" in
33
34 *-*-musl*)
35 ;;
36
37 # For x86, we use slots in the TCB head for most of our TLS.
38 # The setup of those slots in beginTransaction can afford to
39 # use the global-dynamic model.
40 i[456]86-*-linux* | x86_64-*-linux*)
41 ;;
42
43 *-*-linux*)
44 XCFLAGS="${XCFLAGS} -ftls-model=initial-exec"
45 ;;
46
47 esac
48 fi
49
50 # Map the target cpu to an ARCH sub-directory. At the same time,
51 # work out any special compilation flags as necessary.
52 case "${target_cpu}" in
53 aarch64*) ARCH=aarch64 ;;
54 alpha*) ARCH=alpha ;;
55 rs6000 | powerpc*)
56 XCFLAGS="${XCFLAGS} -mhtm"
57 ARCH=powerpc
58 ;;
59
60 arm*) ARCH=arm ;;
61
62 i[3456]86)
63 case " ${CC} ${CFLAGS} " in
64 *" -m64 "*|*" -mx32 "*)
65 ;;
66 *)
67 if test -z "$with_arch"; then
68 XCFLAGS="${XCFLAGS} -march=i486 -mtune=${target_cpu}"
69 XCFLAGS="${XCFLAGS} -fomit-frame-pointer"
70 fi
71 esac
72 XCFLAGS="${XCFLAGS} -mrtm"
73 ARCH=x86
74 ;;
75
76 sh*) ARCH=sh ;;
77
78 sparc)
79 case " ${CC} ${CFLAGS} " in
80 *" -m64 "*)
81 ;;
82 *)
83 if test -z "$with_cpu"; then
84 XCFLAGS="${XCFLAGS} -mcpu=v9"
85 fi
86 esac
87 ARCH=sparc
88 ;;
89
90 sparc64|sparcv9)
91 case " ${CC} ${CFLAGS} " in
92 *" -m32 "*)
93 XCFLAGS="${XCFLAGS} -mcpu=v9"
94 ;;
95 *" -m64 "*)
96 ;;
97 *)
98 if test "x$with_cpu" = xv8; then
99 XCFLAGS="${XCFLAGS} -mcpu=v9"
100 fi
101 ;;
102 esac
103 ARCH=sparc
104 ;;
105
106 x86_64)
107 case " ${CC} ${CFLAGS} " in
108 *" -m32 "*)
109 XCFLAGS="${XCFLAGS} -march=i486 -mtune=generic"
110 XCFLAGS="${XCFLAGS} -fomit-frame-pointer"
111 ;;
112 esac
113 XCFLAGS="${XCFLAGS} -mrtm"
114 ARCH=x86
115 ;;
116 s390|s390x)
117 XCFLAGS="${XCFLAGS} -mzarch -mhtm"
118 ARCH=s390
119 ;;
120
121 *)
122 ARCH="${target_cpu}"
123 ;;
124 esac
125
126 # For the benefit of top-level configure, determine if the cpu is supported.
127 test -d ${srcdir}/config/$ARCH || UNSUPPORTED=1
128
129 # Since we require POSIX threads, assume a POSIX system by default.
130 config_path="$ARCH posix generic"
131
132 # Other system configury
133 case "${target}" in
134 *-*-linux* | *-*-uclinux*)
135 if test "$enable_linux_futex" = yes; then
136 config_path="linux/$ARCH linux $config_path"
137 fi
138 ;;
139
140 powerpc*-*-aix* | rs6000-*-aix*)
141 # The system ought to be supported, but sjlj.S has not been ported.
142 UNSUPPORTED=1
143 ;;
144
145 *-*-gnu* | *-*-k*bsd*-gnu \
146 | *-*-netbsd* | *-*-freebsd* | *-*-openbsd* \
147 | *-*-solaris2* | *-*-sysv4* | *-*-hpux11* \
148 | *-*-aix* | *-*-dragonfly*)
149 # POSIX system. The OS is supported.
150 ;;
151
152 *-*-darwin*)
153 # The OS is supported, but we need dynamic lookup to support undefined
154 # weak symbols at link-time.
155 XLDFLAGS="${XLDFLAGS} -Wl,-undefined,dynamic_lookup"
156 ;;
157
158 *) # Non-POSIX, or embedded system
159 UNSUPPORTED=1
160 ;;
161 esac