OSDN Git Service

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