OSDN Git Service

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