dump_printf: add "%C" for dumping cgraph_node *
[official-gcc.git] / libstdc++-v3 / configure.host
blob155a3cdea1bad297b3cd4c21ecd3c7307b5e6ac9
1 # configure.host
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.
8 # You should read docs/html/17_intro/porting.* to make sense of this file.
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
17 # It sets the following shell variables:
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.
23 #   os_include_dir         OS-specific directory, defaults to os/generic.
25 #   c_model                the "C" header model, defaults to c_global.
27 #   c_compatibility        if "C" compatibility headers are necessary,
28 #                          defaults to no.
30 #   abi_baseline_pair      directory name for ABI compat testing,
31 #                          defaults to host_cpu-host_os (as per config.guess)
33 #   abi_baseline_subdir_switch
34 #                          g++ switch to determine ABI baseline subdir for
35 #                          multilibbed targets,
36 #                          defaults to --print-multi-directory
38 #   abi_tweaks_dir         location of cxxabi_tweaks.h,
39 #                          defaults to cpu_include_dir
41 #   atomicity_dir          location of atomicity.h,
42 #                          defaults to cpu_include_dir
44 #   atomic_word_dir        location of atomic_word.h
45 #                          defaults to generic.
47 #   atomic_flags           extra flags to pass to use atomic instructions
48 #                          defaults to nothing.
50 #   cpu_defines_dir        location of cpu_defines.h
51 #                          defaults to generic.
53 #   cpu_opt_bits_random    path name of random.h containing CPU-specific
54 #                          optimizations
56 #   cpu_opt_ext_random     path name of random.h containing CPU-specific
57 #                          optimizations for extensions
59 #   error_constants_dir    location of error_constants.h
60 #                          defaults to os/generic.
62 # It possibly modifies the following variables:
64 #   OPT_LDFLAGS            extra flags to pass when linking the library, of
65 #                          the form '-Wl,blah'
66 #                          (defaults to empty in acinclude.m4)
68 #   port_specific_symbol_files
69 #                          whitespace-separated list of files containing
70 #                          additional symbols to export from the shared
71 #                          library, when symbol versioning is in use
74 # If the defaults will not work for your platform, you need only change the
75 # variables that won't work, i.e., you do not need to explicitly set a
76 # working variable to its default.  Most hosts only need to change the two
77 # *_include_dir variables.
80 # DEFAULTS
81 # Try to guess a default cpu_include_dir based on the name of the CPU.  We
82 # cannot do this for os_include_dir; there are too many portable operating
83 # systems out there.  :-)
84 c_model=c_global
85 c_compatibility=no
86 atomic_word_dir=cpu/generic
87 atomic_flags=""
88 atomicity_dir="cpu/generic"
89 cpu_defines_dir="cpu/generic"
90 try_cpu=generic
91 abi_baseline_subdir_switch=--print-multi-directory
92 abi_tweaks_dir="cpu/generic"
93 error_constants_dir="os/generic"
95 # HOST-SPECIFIC OVERRIDES
96 # Set any CPU-dependent bits.
98 # Provide a way to funnel exotic flavors and prefixed/postfixed chip
99 # variants into the established source config/cpu/* sub-directories.
100 # THIS TABLE IS SORTED.  KEEP IT THAT WAY.
101 case "${host_cpu}" in
102   alpha*)
103     try_cpu=alpha
104     ;;
105   arm*)
106     try_cpu=arm
107     ;;
108   crisv32)
109     try_cpu=cris
110     ;;
111   i[567]86 | x86_64)
112     try_cpu=i486
113     ;;
114   hppa*)
115     try_cpu=hppa
116     ;;
117   mips*)
118     try_cpu=mips
119     ;;
120   powerpc* | rs6000)
121     try_cpu=powerpc
122     ;;
123   sparc* | ultrasparc)
124     try_cpu=sparc
125     ;;
126   *)
127     if test -d ${glibcxx_srcdir}/config/cpu/${host_cpu}; then
128       try_cpu=${host_cpu}
129     fi
130 esac
133 # Now look for the file(s) usually tied to a CPU model, and make
134 # default choices for those if they haven't been explicitly set
135 # already.  
136 cpu_include_dir=cpu/${try_cpu}
139 # Set specific CPU overrides for cpu_defines_dir. Most can just use generic.
140 # THIS TABLE IS SORTED.  KEEP IT THAT WAY.
141 case "${host_cpu}" in
142   arm*)
143     cpu_defines_dir=cpu/arm
144     ;;
145   powerpc* | rs6000)
146     cpu_defines_dir=cpu/powerpc
147     ;;
148 esac
151 # Set specific CPU overrides for atomic_word_dir and atomic_flags. 
152 # Most can just use generic.
153 # THIS TABLE IS SORTED.  KEEP IT THAT WAY.
154 case "${host_cpu}" in
155   cris*)
156     atomic_word_dir=cpu/cris
157     ;;
158   i[4567]86 | x86_64)
159     atomic_flags="-march=native"
160     ;;
161   sparc* | ultrasparc)
162     atomic_word_dir=cpu/sparc
163     atomic_flags="-mcpu=v9"
164     ;;
165 esac
168 # Set specific CPU overrides for atomicity_dir.
169 # This can be over-ridden in GLIBCXX_ENABLE_ATOMIC_BUILTINS.
170 # THIS TABLE IS SORTED.  KEEP IT THAT WAY.
171 if test -f ${glibcxx_srcdir}/config/${cpu_include_dir}/atomicity.h ; then
172   atomicity_dir=$cpu_include_dir
176 if test -f ${glibcxx_srcdir}/config/${cpu_include_dir}/cxxabi_tweaks.h ; then
177   abi_tweaks_dir=$cpu_include_dir
181 # Set directory with CPU-specific optimization
182 cpu_opt_dir=${cpu_include_dir}/opt
183 test -d ${glibcxx_srcdir}/config/${cpu_include_dir}/opt ||
184 cpu_opt_dir=cpu/generic/opt
185 # For each header with CPU-specific optimizations check whether it
186 # exists in ${cpu_opt_dir}.  If not, point the variable at the
187 # appropriate file in the generic directory.
188 cpu_opt_ext_random=${cpu_opt_dir}/ext/opt_random.h
189 test -f ${glibcxx_srcdir}/config/${cpu_opt_ext_random} ||
190 cpu_opt_ext_random=cpu/generic/opt/ext/opt_random.h
192 cpu_opt_bits_random=${cpu_opt_dir}/bits/opt_random.h
193 test -f ${glibcxx_srcdir}/config/${cpu_opt_ext_random} ||
194 cpu_opt_ext_random=cpu/generic/opt/bits/opt_random.h
197 # Set any OS-dependent bits.
198 # Set the os_include_dir.
199 # Set the error_costants_dir.
200 # Set c_model, c_compatibility here.
201 # If atomic ops and/or numeric limits are OS-specific rather than
202 # CPU-specifc, set those here too.
203 # THIS TABLE IS SORTED.  KEEP IT THAT WAY.
204 case "${host_os}" in
205   aix[56789]*)
206     # Newer versions of AIX only support PowerPC architecture, so use
207     # atomic instructions directly.
208     os_include_dir="os/aix"
209     ;;
210   aix4.[3456789]*)
211     # We set os_include_dir to os/aix only on AIX 4.3 and newer, but
212     # os/aix/atomicity.h works on earlier versions of AIX 4.*, so we
213     # explicitly duplicate the directory for 4.[<3].
214     os_include_dir="os/aix"
215     atomicity_dir="os/aix"
216     ;;
217   aix4.*)
218     os_include_dir="os/generic"
219     atomicity_dir="os/aix"
220     ;;
221   aix*)
222     os_include_dir="os/generic"
223     atomicity_dir="cpu/generic"
224     ;;
225   bsd*)
226     # Plain BSD attempts to share FreeBSD files.
227     os_include_dir="os/bsd/freebsd"
228     ;;
229   cygwin*)
230     os_include_dir="os/newlib"
231     OPT_LDFLAGS="${OPT_LDFLAGS} \$(lt_host_flags)"
232     ;;
233   darwin[4-7] | darwin[4-7].*)
234     # For earlier Darwin, performance is improved if libstdc++ is
235     # single-module. Up to at least 10.3.7, -flat_namespace is required
236     # for proper treatment of coalesced symbols.
237     OPT_LDFLAGS="${OPT_LDFLAGS} -Wl,-single_module -Wl,-flat_namespace"
238     os_include_dir="os/bsd/darwin"
239     ;;
240   darwin8 | darwin8.* )
241     # For 8+ compatibility is better if not -flat_namespace.
242     OPT_LDFLAGS="${OPT_LDFLAGS} -Wl,-single_module"
243     case "${host_cpu}" in
244       i[34567]86 | x86_64)
245         OPTIMIZE_CXXFLAGS="${OPTIMIZE_CXXFLAGS} -fvisibility-inlines-hidden"
246         ;;
247     esac
248     os_include_dir="os/bsd/darwin"
249     ;;
250   darwin*)
251     # Post Darwin8, defaults should be sufficient.
252     os_include_dir="os/bsd/darwin"
253     ;;
254   *djgpp*)      # leading * picks up "msdosdjgpp"
255     os_include_dir="os/djgpp"
256     error_constants_dir="os/djgpp"
257     ;;
258   dragonfly*)
259     os_include_dir="os/bsd/dragonfly"
260     ;;
261   freebsd*)
262     os_include_dir="os/bsd/freebsd"
263     ;;
264   linux-musl*)
265     os_include_dir="os/generic"
266     ;;
267   gnu* | linux* | kfreebsd*-gnu)
268     if [ "$uclibc" = "yes" ]; then
269       os_include_dir="os/uclibc"
270     elif [ "$bionic" = "yes" ]; then
271       os_include_dir="os/bionic"
272     else
273       os_include_dir="os/gnu-linux"
274     fi
275     ;;
276   hpux*)
277     os_include_dir="os/hpux"
278     ;;
279   mingw32*)
280     case "$host" in
281       *-w64-*)
282         os_include_dir="os/mingw32-w64"
283         error_constants_dir="os/mingw32-w64"
284         ;;
285       *)
286         os_include_dir="os/mingw32"
287         error_constants_dir="os/mingw32"
288         ;;
289     esac
290     OPT_LDFLAGS="${OPT_LDFLAGS} \$(lt_host_flags)"
291     ;;
292   netbsd*)
293     os_include_dir="os/bsd/netbsd"
294     ;;
295   openbsd*)
296     os_include_dir="os/bsd/openbsd"
297     ;;
298   qnx6.[12]*)
299     os_include_dir="os/qnx/qnx6.1"
300     c_model=c
301     ;;
302   rtems*)
303     # Use libatomic if necessary and avoid libstdc++ specific atomicity support
304     atomicity_dir="cpu/generic/atomicity_builtins"
305     ;;
306   solaris2)
307     # This too-vague configuration does not provide enough information
308     # to select a ctype include, and thus os_include_dir is a crap shoot.
309     echo "Please specify the full version of Solaris, ie. solaris2.10 " 1>&2
310     exit 1
311     ;;
312   solaris2.1[0-9])
313     os_include_dir="os/solaris/solaris2.10"
314     ;;
315   tpf)
316     os_include_dir="os/tpf"
317     ;;
318   vxworks)
319     os_include_dir="os/vxworks"
320     ;;
321   *)
322     os_include_dir="os/generic"
323     ;;
324 esac
327 # Set any OS-dependent and CPU-dependent bits.
328 # THIS TABLE IS SORTED.  KEEP IT THAT WAY.
329 case "${host}" in
330   *-*-linux*)
331     case "${host_cpu}" in
332       i[567]86)
333         abi_baseline_pair=i486-linux-gnu
334         ;;
335       mips64*)
336         abi_baseline_pair=mips64-linux-gnu
337         ;;
338       powerpc64*)
339         abi_baseline_pair=powerpc64-linux-gnu
340         ;;
341       s390)
342         abi_baseline_pair=s390-linux-gnu
343         ;;
344       s390x)
345         abi_baseline_pair=s390x-linux-gnu
346         ;;
347       x86_64)
348         abi_baseline_pair=x86_64-linux-gnu
349         ;;
350       *)
351         if test $try_cpu = generic; then
352           try_abi_cpu=$host_cpu
353         else
354           try_abi_cpu=$try_cpu
355         fi
356         if test -d ${glibcxx_srcdir}/config/abi/post/${try_abi_cpu}-linux-gnu; then
357           abi_baseline_pair=${try_abi_cpu}-linux-gnu
358         fi
359     esac
360     case "${host}" in
361       arm*-*-linux-*)
362         port_specific_symbol_files="\$(srcdir)/../config/os/gnu-linux/arm-eabi-extra.ver"
363         ;;
364     esac
365     ;;
366   arm*-*-freebsd*)
367      port_specific_symbol_files="\$(srcdir)/../config/os/gnu-linux/arm-eabi-extra.ver"
368      ;;
369   powerpc*-*-darwin*)
370     port_specific_symbol_files="\$(srcdir)/../config/os/bsd/darwin/ppc-extra.ver"
371     ;;
372   *-*-solaris2.1[0-9])
373     # On Solaris 10 with Solaris ld, there's no COMDAT support.  GNU ld always
374     # provides it, as does Solaris ld since Solaris 11, leading to different
375     # baselines.
376     case "${host_os}:${with_gnu_ld}" in
377       # with_gnu_ld may either be unset (default) or no (with --without-gnu-ld).
378       solaris2.10: | solaris2.10:no)
379         abi_baseline_pair=solaris2.10
380         ;;
381       *)
382         abi_baseline_pair=solaris2.11
383         ;;
384     esac
385     case "${host_cpu}" in
386         i?86 | x86_64)
387             abi_baseline_pair=i386-${abi_baseline_pair}
388             ;;
389         sparc*)
390             abi_baseline_pair=sparc-${abi_baseline_pair}
391             ;;
392     esac
393     abi_baseline_subdir_switch=--print-multi-os-directory
394     ;;
395 esac