OSDN Git Service

f6492b29e5ef381ab7126ffd4c8d510b4f746c38
[pf3gnuchains/gcc-fork.git] / libstdc++-v3 / configure.host
1 # configure.host
2 #
3 # This shell script handles all host based configuration for libstdc++.
4 # It sets various shell variables based on the the host and the
5 # configuration options.  You can modify this shell script without needing
6 # to rerun autoconf/aclocal/etc.  This file is "sourced" not executed.
7 #
8 # You should read docs/html/17_intro/porting.* to make sense of this file.
9 #
10 #
11 # It uses the following shell variables as set by config.guess:
12 #   host                The configuration host (full CPU-vendor-OS triplet)
13 #   host_cpu            The configuration host CPU
14 #   host_os             The configuration host OS
15 #
16 #
17 # It sets the following shell variables:
18 #
19 #   cpu_include_dir        CPU-specific directory, defaults to cpu/generic
20 #                          if cpu/host_cpu doesn't exist.  This is
21 #                          used to set atomicity_include_dir.
22 #
23 #   os_include_dir         OS-specific directory, defaults to os/generic.
24 #
25 #   c_model                the "C" header model, defaults to c_std.
26 #
27 #   c_compatibility        if "C" compatibility headers are necessary,
28 #                          defaults to no.
29 #
30 #   abi_baseline_pair      directory name for ABI compat testing,
31 #                          defaults to host_cpu-host_os (as per config.guess)
32 #
33 #   atomicity_dir          location of atomicity.h,
34 #                          defaults to cpu_include_dir
35 #
36 #   atomic_word_dir        location of atomic_word.h
37 #                          defaults to generic.
38 #
39 # It possibly modifies the following variables:
40 #
41 #   OPT_LDFLAGS            extra flags to pass when linking the library, of
42 #                          the form '-Wl,blah'
43 #                          (defaults to empty in acinclude.m4)
44 #
45 #   port_specific_symbol_files
46 #                          whitespace-seperated list of files containing
47 #                          additional symbols to export from the shared
48 #                          library, when symbol versioning is in use
49 #
50 #
51 # If the defaults will not work for your platform, you need only change the
52 # variables that won't work, i.e., you do not need to explicitly set a
53 # working variable to its default.  Most hosts only need to change the two
54 # *_include_dir variables.
55
56
57 # DEFAULTS
58 # Try to guess a default cpu_include_dir based on the name of the CPU.  We
59 # cannot do this for os_include_dir; there are too many portable operating
60 # systems out there.  :-)
61 c_model=c_std
62 c_compatibility=no
63 atomic_word_dir=cpu/generic
64
65 # HOST-SPECIFIC OVERRIDES
66 # Set any CPU-dependent bits.
67 # Here we override defaults and catch more general cases due to naming
68 # conventions (e.g., chip_name* to catch all variants).
69
70 # THIS TABLE IS SORTED.  KEEP IT THAT WAY.
71 case "${host_cpu}" in
72   alpha*)
73     try_cpu=alpha
74     ;;
75   i[567]86 | x86_64)
76     try_cpu=i486
77     ;;
78   hppa*)
79     try_cpu=hppa
80     ;;
81   mips*)
82     # NB: cpu/mips/atomicity.h needs MIPS II or above.  
83     # Of course, there is no sane way to test for this, no ABI macro,
84     # and no consistent host_cpu name differentiation. Therefore, only
85     # use it where it is known to be safe, ie it runs linux (see below).
86     try_cpu=generic
87     ;;
88   m680[246]0)
89     try_cpu=m68k
90     ;;
91   powerpc* | rs6000)
92     try_cpu=powerpc
93     ;;
94   s390x)
95     try_cpu=s390
96     ;;
97   sparc* | ultrasparc)
98     try_cpu=sparc
99     ;;
100   *)
101     if test -f ${glibcxx_srcdir}/config/cpu/${host_cpu}/atomicity.h; then
102       try_cpu=${host_cpu}
103     else
104       try_cpu=generic
105     fi
106     ;;
107 esac
108
109 # Set specific CPU overrides for atomic_word_dir. Most can just use generic.
110 # THIS TABLE IS SORTED.  KEEP IT THAT WAY.
111 case "${host_cpu}" in
112   cris*)
113     atomic_word_dir=cpu/cris
114     ;;
115   sparc* | ultrasparc)
116     atomic_word_dir=cpu/sparc
117     ;;
118 esac
119
120 # Now look for the file(s) usually tied to a CPU model, and make
121 # default choices for those if they haven't been explicitly set
122 # already.  
123 cpu_include_dir="cpu/${try_cpu}"
124 atomicity_dir=$cpu_include_dir
125 abi_baseline_pair=${try_cpu}-${host_os}
126
127
128 # Set any OS-dependent bits.
129 # Set the os_include_dir.
130 # Set c_model, c_compatibility here.
131 # If atomic ops and/or numeric limits are OS-specific rather than
132 # CPU-specifc, set those here too.
133 # THIS TABLE IS SORTED.  KEEP IT THAT WAY.
134 case "${host_os}" in
135   aix4.[3456789]* | aix[56789]*)
136     # We set os_include_dir to os/aix only on AIX 4.3 and newer, but
137     # os/aix/atomicity.h works on earlier versions of AIX 4.*, so we
138     # explicitly duplicate the directory for 4.[<3].
139     os_include_dir="os/aix"
140     atomicity_dir="os/aix"
141     OPT_LDFLAGS="-Wl,-G"
142     ;;
143   aix4.*)
144     os_include_dir="os/generic"
145     atomicity_dir="os/aix"
146     ;;
147   aix*)
148     os_include_dir="os/generic"
149     atomicity_dir="cpu/generic"
150     ;;
151   bsd*)
152     # Plain BSD attempts to share FreeBSD files.
153     os_include_dir="os/bsd/freebsd"
154     ;;
155   cygwin*)
156     os_include_dir="os/newlib"
157     ;;
158   *djgpp*)      # leading * picks up "msdosdjgpp"
159     os_include_dir="os/djgpp"
160     ;;
161   freebsd*)
162     os_include_dir="os/bsd/freebsd"
163     ;;
164   gnu* | linux* | kfreebsd*-gnu | knetbsd*-gnu)
165     os_include_dir="os/gnu-linux"
166     ;;
167   hpux*)
168     os_include_dir="os/hpux"
169     ;;
170   irix[1-6] | irix[1-5].* | irix6.[0-4]*)
171     # This is known to work on at least IRIX 5.2 and 6.3.
172     os_include_dir="os/irix/irix5.2"
173     atomicity_dir=$os_include_dir
174     ;;
175   irix6.5*)
176     os_include_dir="os/irix/irix6.5"
177     atomicity_dir=$os_include_dir
178     ;;
179   mingw32*)
180     os_include_dir="os/mingw32"
181     ;;
182   netbsd*)
183     os_include_dir="os/bsd/netbsd"
184     ;;
185   qnx6.[12]*)
186     os_include_dir="os/qnx/qnx6.1"
187     c_model=c
188     ;;
189   solaris2)
190     # This too-vague configuration does not provide enough information
191     # to select a ctype include, and thus os_include_dir is a crap shoot.
192     echo "Please specify the full version of Solaris, ie. solaris2.9 " 1>&2
193     exit 1;
194     ;;
195   solaris2.5 | solaris2.5.[0-9])
196     os_include_dir="os/solaris/solaris2.5"
197     ;;
198   solaris2.6)
199     os_include_dir="os/solaris/solaris2.6"
200     ;;
201   solaris2.[789] | solaris2.1[0-9])
202     os_include_dir="os/solaris/solaris2.7"
203     ;;
204   tpf)
205     os_include_dir="os/tpf"
206     ;;
207   vxworks)
208     os_include_dir="os/vxworks"
209     ;;
210   windiss*)
211     os_include_dir="os/windiss"
212     ;;
213   *)
214     os_include_dir="os/generic"
215     ;;
216 esac
217
218
219 # Set any OS-dependent and CPU-dependent bits.
220 # THIS TABLE IS SORTED.  KEEP IT THAT WAY.
221 case "${host}" in
222   mips*-*-linux*)
223     atomicity_dir="cpu/mips"
224     ;;
225   x86_64-*-linux*)
226     abi_baseline_pair="x86_64-linux-gnu"
227     ;;
228   alpha*-*-freebsd5*)
229     abi_baseline_pair="alpha-freebsd5"
230     ;;
231   i*86-*-freebsd4*)
232     abi_baseline_pair="i386-freebsd4"
233     ;;
234   i*86-*-freebsd5*)
235     abi_baseline_pair="i386-freebsd5"
236     ;;
237   sparc*-*-freebsd5*)
238     abi_baseline_pair="sparc-freebsd5"
239     ;;
240 esac