OSDN Git Service

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