* config/cpu/arm/cpu_limits.h: New file.
[official-gcc.git] / libstdc++-v3 / configure.target
blobb2bee8b95b4970ea4e90cb3f3b638a0fcc17b3ba
1 # configure.target
3 # This shell script handles all target based configuration for libstdc++.
4 # It sets various shell variables based on the the target 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 #   target                The configuration target (full CPU-vendor-OS triplet)
13 #   target_cpu            The configuration target CPU
14 #   target_os             The configuration target OS
17 # It sets the following shell variables:
19 #   cpu_include_dir        CPU-specific directory, defaults to cpu/generic
20 #                              if cpu/target_cpu doesn't exist.  This is
21 #                              used to set the next two:
22 #   ATOMICITYH             location of atomicity.h,
23 #                              defaults to cpu_include_dir
24 #   CPULIMITSH             location of cpu_limits.h,
25 #                              defaults to cpu_include_dir
27 #   os_include_dir         OS-specific directory, defaults to os/generic.
29 #   c_model                the model to use for "C" headers, defaults to c_std.
31 #   c_compatibility        if "C" compatibility headers are necessary,
32 #                              defaults to no.
34 #   abi_baseline_triplet   directory name for ABI compat testing,
35 #                              defaults to target (as per config.guess)
37 # It possibly modifies the following variables:
39 #   OPT_LDFLAGS            extra flags to pass when linking the library, of
40 #                              the form '-Wl,blah'
41 #                              (defaults to empty in acinclude.m4)
44 # If the defaults will not work for your platform, you need only change the
45 # variables that won't work, i.e., you do not need to explicitly set a
46 # working variable to its default.  Most targets only need to change the two
47 # *_include_dir variables.
50 # DEFAULTS
51 # Try to guess a default cpu_include_dir based on the name of the CPU.  We
52 # cannot do this for os_include_dir; there are too many portable operating
53 # systems out there.  :-)
54 if test -d ${glibcpp_srcdir}/config/cpu/${target_cpu}; then
55     cpu_include_dir="cpu/${target_cpu}"
56 else
57     cpu_include_dir="cpu/generic"
60 abi_baseline_triplet=${target}
62 c_model=c_std
63 c_compatibility=no
66 # TARGET-SPECIFIC OVERRIDES
67 # Set any CPU-dependent bits.
68 # Here we override defaults and catch more general cases due to naming
69 # conventions (e.g., chip_name* to catch all variants).
70 # THIS TABLE IS SORTED.  KEEP IT THAT WAY.
71 case "${target_cpu}" in
72   alpha*)
73     cpu_include_dir="cpu/alpha"
74     ;;
75   arm* | strongarm* | xscale* )
76     cpu_include_dir="cpu/arm"
77     ;;
78   i486 | i586 | i686 | i786)
79     # add athlons here maybe
80     cpu_include_dir="cpu/i486"
81     CPULIMITSH="cpu/i386"
82     ;;
83   m68k | m680[246]0)
84     cpu_include_dir="cpu/m68k"
85     ;;
86   mips*)
87     # MIPS chips are unreliable as to sc/ll support. By default
88     # don't use atomic instructions and override for the OS.
89     cpu_include_dir="cpu/generic"
90     ;;
91   mmix)
92     ATOMICITYH="cpu/generic"
93     ;;
94   powerpc* | rs6000)
95     cpu_include_dir="cpu/powerpc"
96     ;;
97   s390 | s390x)
98     cpu_include_dir="cpu/s390"
99     ;;
100   sparc64 | ultrasparc)
101     cpu_include_dir="cpu/sparc/sparc64"
102     ;;
103   sparc*)
104     cpu_include_dir="cpu/sparc/sparc32"
105     ;;
106   x86_64*)
107     cpu_include_dir="cpu/x86-64"
108     ;;
109 esac
112 # Now look for the two files usually tied to a CPU model, and make default
113 # choices for those if they haven't been explicitly set already.
114 _cpu_incdir_fullpath=${glibcpp_srcdir}/config/${cpu_include_dir}
115 if test x${ATOMICITYH+set} != xset; then
116   if test -f ${_cpu_incdir_fullpath}/atomicity.h; then
117     ATOMICITYH=$cpu_include_dir
118   else
119     ATOMICITYH="cpu/generic"
120   fi
122 if test x${CPULIMITSH+set} != xset; then
123   if test -f ${_cpu_incdir_fullpath}/cpu_limits.h; then
124     CPULIMITSH=$cpu_include_dir
125   else
126     CPULIMITSH="cpu/generic"
127   fi
129 unset _cpu_incdir_fullpath
132 # Set any OS-dependent bits.
133 # Set the os_include_dir.
134 # Set c_model, c_compatibility here.
135 # If atomic ops and/or numeric limits are OS-specific rather than
136 # CPU-specifc, set those here too.
137 # THIS TABLE IS SORTED.  KEEP IT THAT WAY.
138 case "${target_os}" in
139   aix4.[3456789]* | aix[56789]*)
140     # We set os_include_dir to os/aix only on AIX 4.3 and newer, but
141     # os/aix/atomicity.h works on earlier versions of AIX 4.*, so we
142     # explicitly duplicate the directory for 4.[<3].
143     os_include_dir="os/aix"
144     ATOMICITYH="os/aix"
145     OPT_LDFLAGS="-Wl,-G"
146     ;;
147   aix4.*)
148     ATOMICITYH="os/aix"
149     ;;
150   aix*)
151     ATOMICITYH="cpu/generic"
152     ;;
153   bsd* | freebsd* )
154     os_include_dir="os/bsd/freebsd"
155     ;;
156   cygwin*)
157     os_include_dir="os/newlib"
158     ;;
159   *djgpp*)      # leading * picks up "msdosdjgpp"
160     os_include_dir="os/djgpp"
161     ;;
162   gnu* | linux*)
163     os_include_dir="os/gnu-linux"
164     ;;
165   hpux*)
166     os_include_dir="os/hpux"
167     CPULIMITSH="os/hpux"
168     ;;
169   irix[1-6] | irix[1-5].* | irix6.[0-4]*)
170     # This is known to work on at least IRIX 5.2 and 6.3.
171     os_include_dir="os/irix/irix5.2"
172     ATOMICITYH=$os_include_dir
173     ;;
174   irix6.5*)
175     os_include_dir="os/irix/irix6.5"
176     ATOMICITYH=$os_include_dir
177     ;;
178   mingw32*)
179     os_include_dir="os/mingw32"
180     ;;
181   netbsd*)
182     os_include_dir="os/bsd/netbsd"
183     ;;
184   solaris2.5*)
185     os_include_dir="os/solaris/solaris2.5"
186     ;;
187   solaris2.6*)
188     os_include_dir="os/solaris/solaris2.6"
189     ;;
190   solaris2.[78]*)
191     os_include_dir="os/solaris/solaris2.7"
192     ;;
193   windiss*)
194     os_include_dir="os/windiss"
195     ;;
196   qnx6.[12]*)
197     os_include_dir="os/qnx/qnx6.1"
198     c_model=c
199     ;;
200   *)
201     os_include_dir="os/generic"
202     ;;
203 esac
206 # Set any OS-dependent and CPU-dependent bits.
207 # THIS TABLE IS SORTED.  KEEP IT THAT WAY.
208 case "${target}" in
209   alpha*-*-*osf5*)
210     CPULIMITSH="os/osf/osf5.0"
211     ;;
212   mips*-*-linux*)
213     ATOMICITYH="cpu/mips"
214     ;;
215 esac