OSDN Git Service

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