Regenerate .pot files.
[official-gcc.git] / libatomic / configure.tgt
blob49233a4f45ae5314d514266b9600539f404af61d
1 # -*- shell-script -*-
2 #  Copyright (C) 2012-2016 Free Software Foundation, Inc.
3 #  Contributed by Richard Henderson <rth@redhat.com>.
5 #  This file is part of the GNU Atomic Library (libatomic).
7 #  Libatomic is free software; you can redistribute it and/or modify it
8 #  under the terms of the GNU General Public License as published by
9 #  the Free Software Foundation; either version 3 of the License, or
10 #  (at your option) any later version.
12 #  Libatomic is distributed in the hope that it will be useful, but WITHOUT ANY
13 #  WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
14 #  FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
15 #  more details.
17 #  Under Section 7 of GPL version 3, you are granted additional
18 #  permissions described in the GCC Runtime Library Exception, version
19 #  3.1, as published by the Free Software Foundation.
21 #  You should have received a copy of the GNU General Public License and
22 #  a copy of the GCC Runtime Library Exception along with this program;
23 #  see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
24 #  <http://www.gnu.org/licenses/>.
26 # Map the target cpu to an ARCH sub-directory.  At the same time,
27 # work out any special compilation flags as necessary.
29 case "${target_cpu}" in
30   alpha*)
31         # fenv.c needs this option to generate inexact exceptions.
32         XCFLAGS="${XCFLAGS} -mfp-trap-mode=sui"
33         ARCH=alpha
34         ;;
35   rs6000 | powerpc*)    ARCH=powerpc ;;
36   sh*)                  ARCH=sh ;;
38   arm*)
39         ARCH=arm
40         case "${target}" in
41             arm*-*-freebsd*)
42                 ;;
43             *)
44                 # ??? Detect when -march=armv7 is already enabled.
45                 try_ifunc=yes
46                 ;;
47         esac
48         ;;
49   sparc)
50         case " ${CC} ${CFLAGS} " in
51           *" -m64 "*)
52             ;;
53           *)
54             if test -z "$with_cpu"; then
55               XCFLAGS="${XCFLAGS} -mcpu=v9"
56             fi
57         esac
58         ARCH=sparc
59         ;;
60   sparc64|sparcv9)
61         case " ${CC} ${CFLAGS} " in
62           *" -m32 "*)
63             XCFLAGS="${XCFLAGS} -mcpu=v9"
64             ;;
65         esac
66         ARCH=sparc
67         ;;
69   i[3456]86)
70         case " ${CC} ${CFLAGS} " in
71           *" -m64 "*|*" -mx32 "*)
72             ;;
73           *)
74             if test -z "$with_arch"; then
75               XCFLAGS="${XCFLAGS} -march=i486 -mtune=${target_cpu}"
76               XCFLAGS="${XCFLAGS} -fomit-frame-pointer"
77             fi
78         esac
79         ARCH=x86
80         # ??? Detect when -march=i686 is already enabled.
81         try_ifunc=yes
82         ;;
83   x86_64)
84         # x86_64 compiler passes -march=x86_64 by default when building
85         # 32bit target libraries.
86         ARCH=x86
87         # ??? Detect when -mcx16 is already enabled.
88         try_ifunc=yes
89         ;;
91   *)                    ARCH="${target_cpu}" ;;
92 esac
94 # The cpu configury is always most relevant.
95 if test -d ${srcdir}/config/$ARCH ; then
96   config_path="$ARCH"
99 # Other system configury
100 case "${target}" in
101   arm*-*-linux*)
102         # OS support for atomic primitives.
103         config_path="${config_path} linux/arm posix"
104         ;;
106   *-*-linux* | *-*-gnu* | *-*-k*bsd*-gnu \
107   | *-*-netbsd* | *-*-freebsd* | *-*-openbsd* | *-*-dragonfly* \
108   | *-*-solaris2* | *-*-sysv4* | *-*-irix6* | *-*-osf* | *-*-hpux11* \
109   | *-*-darwin* | *-*-aix* | *-*-cygwin*)
110         # POSIX system.  The OS is supported.
111         config_path="${config_path} posix"
112         ;;
114   *-*-mingw*)
115         # OS support for atomic primitives.
116         case ${target_thread_file} in
117           win32)
118             config_path="${config_path} mingw"
119             ;;
120           posix)
121             config_path="${config_path} posix"
122             ;;
123         esac
124         ;;
125   *-*-elf*)
126         # ??? No target OS.  We could be targeting bare-metal kernel-mode,
127         # or user-mode for some custom OS.  If the target supports TAS,
128         # we can build our own spinlocks, given there are no signals.
129         # If the target supports disabling interrupts, we can work in
130         # kernel-mode, given the system is not multi-processor.
131         UNSUPPORTED=1
132         ;;
134   *)
135         # Who are you?
136         UNSUPPORTED=1
137         ;;
138 esac