OSDN Git Service

ChangeLog for last change.
[pf3gnuchains/gcc-fork.git] / libitm / configure.tgt
1 # -*- shell-script -*-
2 #   Copyright (C) 2011 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     # 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
49   alpha*)       ARCH=alpha ;;
50   ia64*)        ARCH=ia64 ;;
51   mips*)        ARCH=mips ;;
52   powerpc*)     ARCH=powerpc ;;
53   s390*)        ARCH=s390 ;;
54
55   i[3456]86)
56         case " ${CC} ${CFLAGS} " in
57           *" -m64 "*)
58             ;;
59           *)
60             if test -z "$with_arch"; then
61               XCFLAGS="${XCFLAGS} -march=i486 -mtune=${target_cpu}"
62               XCFLAGS="${XCFLAGS} -fomit-frame-pointer"
63             fi
64         esac
65         ARCH=x86
66         ;;
67
68   x86_64)
69         case " ${CC} ${CFLAGS} " in
70           *" -m32 "*)
71             XCFLAGS="${XCFLAGS} -march=i486 -mtune=i686"
72             XCFLAGS="${XCFLAGS} -fomit-frame-pointer"
73             ;;
74         esac
75         ARCH=x86
76         ;;
77
78   sparcv9 | sparc64)
79         # Note that sparcv7 and sparcv8 is not included here.  We need cas.
80         echo "int i;" > conftestx.c
81         if ${CC} ${CFLAGS} -c -o conftestx.o conftestx.c > /dev/null 2>&1; then
82           case "`/usr/bin/file conftestx.o`" in
83             *32-bit*)
84               case " ${CC} ${CFLAGS}" in
85                 *" -mcpu=ultrasparc"*)
86                   ;;
87                 *)
88                   XCFLAGS="${XCFLAGS} -mcpu=v9"
89                   ;;
90               esac
91               ;;
92           esac
93         fi
94         rm -f conftestx.c conftestx.o
95         ARCH=sparc
96         ;;
97
98   *)
99         ARCH="${target_cpu}"
100         ;;
101 esac
102   
103 # Since we require POSIX threads, assume a POSIX system by default.
104 config_path="$ARCH posix generic"
105
106 # Other system configury
107 case "${target}" in
108   *-*-linux*)
109         if test $enable_linux_futex = yes; then
110           config_path="linux/$ARCH linux $config_path"
111         fi
112         ;;
113
114   *-*-hpux11*)
115         # HPUX v11.x requires -lrt to resolve sem_init in libgomp.la
116         XLDFLAGS="${XLDFLAGS} -lrt"
117         ;;
118
119   *-*-mingw32*)
120         config_path="$ARCH mingw32 posix generic"
121         ;;
122
123   *-*-solaris2.[56]*)
124         config_path="$ARCH posix95 posix generic"
125         XLDFLAGS="${XLDFLAGS} -lposix4"
126         ;;
127
128   *-*-darwin*)
129         config_path="$ARCH bsd posix generic"
130         ;;
131 esac