OSDN Git Service

Fix for Homebrew. I don't care about another environments. This may be reverted and...
[pf3gnuchains/gcc-fork.git] / libgomp / configure.tgt
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.
4
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.
12
13 # Optimize TLS usage by avoiding the overhead of dynamic allocation.
14 if test $gcc_cv_have_tls = yes ; then
15   case "${target}" in
16
17     *-*-linux*)
18         XCFLAGS="${XCFLAGS} -ftls-model=initial-exec"
19         ;;
20   esac
21 fi
22
23 # Since we require POSIX threads, assume a POSIX system by default.
24 config_path="posix"
25
26 # Check for futex enabled all at once.
27 if test $enable_linux_futex = yes; then
28   case "${target}" in
29
30     alpha*-*-linux*)
31         config_path="linux/alpha linux posix"
32         ;;
33
34     arm*-*-linux*)
35         config_path="linux/arm linux posix"
36         ;;
37
38     ia64*-*-linux*)
39         config_path="linux/ia64 linux posix"
40         ;;
41
42     mips*-*-linux*)
43         config_path="linux/mips linux posix"
44         ;;
45
46     powerpc*-*-linux*)
47         config_path="linux/powerpc linux posix"
48         ;;
49
50     s390*-*-linux*)
51         config_path="linux/s390 linux posix"
52         ;;
53
54     # Note that bare i386 is not included here.  We need cmpxchg.
55     i[456]86-*-linux*)
56         config_path="linux/x86 linux posix"
57         case " ${CC} ${CFLAGS} " in
58           *" -m64 "*)
59             ;;
60           *)
61             if test -z "$with_arch"; then
62               XCFLAGS="${XCFLAGS} -march=i486 -mtune=${target_cpu}"
63             fi
64         esac
65         ;;
66
67     # Similar jiggery-pokery for x86_64 multilibs, except here we
68     # can't rely on the --with-arch configure option, since that
69     # applies to the 64-bit side.
70     x86_64-*-linux*)
71         config_path="linux/x86 linux posix"
72         case " ${CC} ${CFLAGS} " in
73           *" -m32 "*)
74             XCFLAGS="${XCFLAGS} -march=i486 -mtune=i686"
75             ;;
76         esac
77         ;;
78
79     # Note that sparcv7 and sparcv8 is not included here.  We need cas.
80     sparcv9-*-linux* | sparc64-*-linux*)
81         echo "int i;" > conftestx.c
82         if ${CC} ${CFLAGS} -c -o conftestx.o conftestx.c > /dev/null 2>&1; then
83           config_path="linux/sparc linux posix"
84           case "`/usr/bin/file conftestx.o`" in
85             *32-bit*)
86               case " ${CC} ${CFLAGS}" in
87                 *" -mcpu=ultrasparc"*)
88                   ;;
89                 *)
90                   XCFLAGS="${XCFLAGS} -mcpu=v9"
91                   ;;
92               esac
93               ;;
94           esac
95         fi
96         rm -f conftestx.c conftestx.o
97         ;;
98   esac
99 fi
100
101 # Other system configury
102 case "${target}" in
103
104   *-*-hpux*)
105         case "${target}" in
106           *-*-hpux11*)
107              # HPUX v11.x requires -lrt to resolve sem_init in libgomp.la
108              XLDFLAGS="${XLDFLAGS} -lrt"
109              ;;
110         esac
111         case "${target}" in
112           hppa[12]*-*-hpux*)
113             # PA 32 HP-UX needs -frandom-seed for bootstrap compare.
114             XCFLAGS="${XCFLAGS} -frandom-seed=fixed-seed"
115             ;;
116         esac
117         ;;
118
119   *-*-mingw32*)
120         config_path="mingw32 posix"
121         ;;
122
123   *-*-darwin*)
124         config_path="bsd posix"
125         ;;
126
127   *-*-freebsd*)
128         # Need to link with -lpthread so libgomp.so is self-contained.
129         XLDFLAGS="${XLDFLAGS} -lpthread"
130         ;;
131
132   mips-sgi-irix6*)
133         # Need to link with -lpthread so libgomp.so is self-contained.
134         XLDFLAGS="${XLDFLAGS} -lpthread"
135         ;;
136   *)
137         ;;
138
139 esac