Daily bump.
[official-gcc.git] / libgomp / configure.tgt
blobe8cd14b1681c30499ea02c18bc4439ab5eae4eaa
1 # This is the target specific configuration file.  This is invoked by the
2 # autoconf generated configure script.  Putting it in a separate shell file
3 # lets us skip running autoconf when modifying target specific information.
5 # This file switches on the shell variable ${target}, and sets the
6 # following shell variables:
7 #  config_path          An ordered list of directories to search for
8 #                       sources and headers.  This is relative to the
9 #                       config subdirectory of the source tree.
10 #  XCFLAGS              Add extra compile flags to use.
11 #  XLDFLAGS             Add extra link flags to use.
13 # Optimize TLS usage by avoiding the overhead of dynamic allocation.
14 if test $gcc_cv_have_tls = yes ; then
15   case "${target}" in
17     *-*-k*bsd*-gnu*)
18         ;;
20     *-*-linux* | *-*-gnu*)
21         XCFLAGS="${XCFLAGS} -ftls-model=initial-exec"
22         ;;
24     *-*-rtems*)
25         XCFLAGS="${XCFLAGS} -ftls-model=local-exec"
26         ;;
27   esac
30 # Since we require POSIX threads, assume a POSIX system by default.
31 config_path="posix"
33 # Check for futex enabled all at once.
34 if test $enable_linux_futex = yes; then
35   case "${target}" in
37     aarch64*-*-linux*)
38         config_path="linux posix"
39         ;;
41     alpha*-*-linux*)
42         config_path="linux/alpha linux posix"
43         ;;
45     arm*-*-linux*)
46         config_path="linux posix"
47         ;;
49     ia64*-*-linux*)
50         config_path="linux/ia64 linux posix"
51         ;;
53     mips*-*-linux*)
54         config_path="linux/mips linux posix"
55         ;;
57     powerpc*-*-linux*)
58         config_path="linux/powerpc linux posix"
59         ;;
61     s390*-*-linux*)
62         config_path="linux/s390 linux posix"
63         ;;
65     tile*-*-linux*)
66         config_path="linux/tile linux posix"
67         ;;
69     # Note that bare i386 is not included here.  We need cmpxchg.
70     i[456]86-*-linux*)
71         config_path="linux/x86 linux posix"
72         case " ${CC} ${CFLAGS} " in
73           *" -m64 "*|*" -mx32 "*)
74             ;;
75           *)
76             if test -z "$with_arch"; then
77               XCFLAGS="${XCFLAGS} -march=i486 -mtune=${target_cpu}"
78             fi
79         esac
80         ;;
82     # Similar jiggery-pokery for x86_64 multilibs, except here we
83     # can't rely on the --with-arch configure option, since that
84     # applies to the 64-bit side.
85     x86_64-*-linux*)
86         config_path="linux/x86 linux posix"
87         case " ${CC} ${CFLAGS} " in
88           *" -m32 "*)
89             XCFLAGS="${XCFLAGS} -march=i486 -mtune=generic"
90             ;;
91         esac
92         ;;
94     # Note that sparcv7 and sparcv8 is not included here.  We need cas.
95     sparcv9-*-linux* | sparc64-*-linux*)
96         echo "int i;" > conftestx.c
97         if ${CC} ${CFLAGS} -c -o conftestx.o conftestx.c > /dev/null 2>&1; then
98           config_path="linux/sparc linux posix"
99           case "`/usr/bin/file conftestx.o`" in
100             *32-bit*)
101               case " ${CC} ${CFLAGS}" in
102                 *" -mcpu=ultrasparc"*)
103                   ;;
104                 *)
105                   XCFLAGS="${XCFLAGS} -mcpu=v9"
106                   ;;
107               esac
108               ;;
109           esac
110         fi
111         rm -f conftestx.c conftestx.o
112         ;;
113   esac
116 # Other system configury
117 case "${target}" in
119   *-*-hpux*)
120         case "${target}" in
121           *-*-hpux11*)
122              # HPUX v11.x requires -lrt to resolve sem_init in libgomp.la
123              XLDFLAGS="${XLDFLAGS} -lrt"
124              ;;
125         esac
126         case "${target}" in
127           hppa[12]*-*-hpux*)
128             # PA 32 HP-UX needs -frandom-seed for bootstrap compare.
129             XCFLAGS="${XCFLAGS} -frandom-seed=fixed-seed"
130             ;;
131         esac
132         ;;
134   *-*-mingw32*)
135         config_path="mingw32 posix"
136         ;;
138   *-*-darwin*)
139         config_path="bsd posix"
140         ;;
142   *-*-freebsd*)
143         # Need to link with -lpthread so libgomp.so is self-contained.
144         XLDFLAGS="${XLDFLAGS} -lpthread"
145         ;;
147   *)
148         ;;
150 esac