* sb.c, macro.c: Include string.h.
[deliverable/binutils-gdb.git] / cfg-ml-com.in
CommitLineData
9eb59e0b
DE
1# Configure fragment invoked in the common section for subdirs
2# wanting multilib support.
3#
4# The common section was chosen because xiberty clobbers $srcdir in the
5# common section of its configure.in.
6#
7# The intent is to keep as much of this in one place as possible (and out
8# of each subdirectory, eg: newlib, libio, etc.) until the right way to do
9# this (ha ha) is decided upon.
10#
11# This is where a target selects what multilib directories to build.
12# It is advisable to support a few --enable/--disable options to let the
13# user select which libraries s/he really wants.
14#
d9677195
DE
15# Subdirectories wishing to use multilib should put the following lines
16# in the initial ("common") section of configure.in:
17#
18#if [ -n "${with_multilib_top}" ]; then
19# . ${with_multilib_top}/../cfg-ml-com.in
20#else
21# . ${srcdir}/../cfg-ml-com.in
22#fi
23#
24# `with_multilib_top' exists to handle the case of configuring in the source
25# tree: ${srcdir} is not constant.
26#
27# The following should be added to the "post-target" section of configure.in:
28#
29#if [ -n "${with_multilib_top}" ]; then
30# . ${with_multilib_top}/../cfg-ml-pos.in
31#else
32# . ${srcdir}/../cfg-ml-pos.in
33#fi
34
9eb59e0b
DE
35# FIXME: Multilib is currently disabled by default for everything other than
36# newlib. It is up to each target to turn on multilib support for the other
37# libraries as desired.
38#
39# FIXME: It would be better if we could use the --print-multi-lib switch to
40# gcc to get the list of directories to build, but at this point the compiler
41# has not been built.
42
43# Only do this if --enable-multilib.
44# And only if at the top level, not a multilib subdirectory.
45
46if [ "${enable_multilib}" = yes -a -z "${with_multisubdir}" ]; then
47
48# Doing this in the common section means ${target} isn't set yet, so compute
49# a copy here. This is a bit kludgey, but again the current (short term) goal
50# is to be as unobtrusive (sp?) to the rest of the sources as possible.
51
52if result=`${config_shell} ${configsub} ${target_alias}` ; then
53 true
54else
55 echo "Unrecognized target system name ${target_alias}." 1>&2
56 exit 1
57fi
58target_cpu=`echo $result | sed 's/^\(.*\)-\(.*\)-\(.*\)$/\1/'`
59target_vendor=`echo $result | sed 's/^\(.*\)-\(.*\)-\(.*\)$/\2/'`
60target_os=`echo $result | sed 's/^\(.*\)-\(.*\)-\(.*\)$/\3/'`
61target=${target_cpu}-${target_vendor}-${target_os}
62
63# FIXME: Perhaps we can do something like the following instead.
64# Fetch from gcc the multilib directories to use if we can.
65# if [ -f ${srcdir}/../gcc/genmultilib -a -f ../gcc/Makefile ]; then
66# options=`grep "^MULTILIB_OPTIONS" ../gcc/Makefile | sed -e 's/^.*=//'`
67# multidirs=`${srcdir}/../gcc/genmultilib "$options" | \
68# sed -e 's/^#define.*//' -e 's/^[.].*//' -e 's/".*//' -e 's/ .*//'`
69# else
70# multidirs=""
71# fi
72
73case "${target}" in
74# start-sanitize-arc
75arc-sbp-elf*)
76 if [ x$enable_biendian = xyes ]
77 then
78 multidirs="be host graphics audio be/host be/graphics be/audio"
79 else
80 multidirs="host graphics audio"
81 fi
82 ;;
83arc-*-*)
84 multidirs="be"
85 ;;
86# end-sanitize-arc
87hppa*-*-*)
88 multidirs="soft-float"
89 ;;
d9677195 90m68*-*-aout* | m68*-*-coff* | m68*-*-elf* | m68*-*-vxworks*)
9eb59e0b
DE
91 multidirs="m68000 m68020 m68881 msoft-float m68000/m68881 m68000/msoft-float m68020/m68881 m68020/msoft-float"
92 ;;
93i960-*-*)
94 multidirs=float
95 ;;
96sparclite-*-* | sparclitefrw*-*-*)
97 multidirs="mfpu msoft-float mflat mno-flat mfpu/mflat mfpu/mno-flat msoft-float/mflat msoft-float/mno-flat"
98 ;;
99sparc-*-* | sparcfrw*-*-*)
100 multidirs="soft v8 soft/v8"
101 ;;
ca675824
SC
102z8k-*-coff)
103 multidirs="z8001 std z8001/std"
9eb59e0b
DE
104 ;;
105h8300-*-*)
106 multidirs=h8300h
107 ;;
108h8500-*-*)
109 multidirs="mbig msmall mcompact mmedium"
110 ;;
111sh-*-*)
112 multidirs="ml"
bc55a53f
C
113# start-sanitize-sh3e
114 multidirs="ml m3e"
115# end-sanitize-sh3e
9eb59e0b
DE
116 ;;
117mips*-*-*)
118 # Note that not all of these will be built for a particular
119 # target; what is build depends upon the output gcc
120 # --print-multi-lib. We configure them all, to make our life
121 # simpler here. If somebody cares about configuration
122 # efficiency, they will need to switch off on the various
123 # targets to configure just the directories needed for that
124 # target.
125 #
126 # In the long run, it would be better to configure based on
127 # the output of gcc --print-multi-lib, but, to do that, we
128 # would have to build gcc before configuring newlib.
129 #
130 # Default to including the single-float directories.
131 if [ x$enable_single_float = x ]; then
132 enable_single_float=yes
133 fi
134 if [ x$enable_single_float = xyes ]; then
135 multidirs="soft-float single el eb mips1 mips3 soft-float/el soft-float/eb soft-float/mips1 soft-float/mips3 soft-float/el/mips1 soft-float/el/mips3 soft-float/eb/mips1 soft-float/eb/mips3 single/el single/eb single/mips1 single/mips3 single/el/mips1 single/el/mips3 single/eb/mips1 single/eb/mips3 el/mips1 el/mips3 eb/mips1 eb/mips3"
136 else
137 multidirs="soft-float el eb mips1 mips3 soft-float/el soft-float/eb soft-float/mips1 soft-float/mips3 soft-float/el/mips1 soft-float/el/mips3 soft-float/eb/mips1 soft-float/eb/mips3 el/mips1 el/mips3 eb/mips1 eb/mips3"
138 fi
c2838adc
MM
139 if [ x$enable_biendian = xno ]
140 then
141 old_multidirs="${multidirs}"
142 multidirs=""
143 for x in ${old_multidirs}; do
144 case "$x" in
145 *endian* ) : ;;
146 *) if [ x"$multidirs" = x ]; then multidirs="$x"; else multidirs="${multidirs} ${x}"; fi ;;
147 esac
148 done
149 fi
150 if [ x$enable_softfloat = xno ]
151 then
152 old_multidirs="${multidirs}"
153 multidirs=""
154 for x in ${old_multidirs}; do
155 case "$x" in
156 *soft-float* ) : ;;
157 *) if [ x"$multidirs" = x ]; then multidirs="$x"; else multidirs="${multidirs} ${x}"; fi ;;
158 esac
159 done
160 fi
161 if [ x$enable_relocatable = xno ]
162 then
163 old_multidirs="${multidirs}"
164 multidirs=""
165 for x in ${old_multidirs}; do
166 case "$x" in
167 *relocatable* ) : ;;
168 *) if [ x"$multidirs" = x ]; then multidirs="$x"; else multidirs="${multidirs} ${x}"; fi ;;
169 esac
170 done
171 fi
172 if [ x$enable_sysv = xno ]
173 then
174 old_multidirs="${multidirs}"
175 multidirs=""
176 for x in ${old_multidirs}; do
177 case "$x" in
178 *sysv* ) : ;;
179 *) if [ x"$multidirs" = x ]; then multidirs="$x"; else multidirs="${multidirs} ${x}"; fi ;;
180 esac
181 done
182 fi
9eb59e0b
DE
183 ;;
184powerpc-*-eabiaix*)
e1d74f11 185 multidirs="soft-float relocatable little-endian call-sysv little-endian/call-sysv relocatable/little-endian relocatable/call-sysv relocatable/little-endian/call-sysv soft-float/relocatable soft-float/little-endian soft-float/call-sysv soft-float/little-endian/call-sysv soft-float/relocatable/little-endian soft-float/relocatable/call-sysv soft-float/relocatable/little-endian/call-sysv"
c568bde7
MM
186 if [ x$enable_biendian = xno ]
187 then
188 old_multidirs="${multidirs}"
189 multidirs=""
190 for x in ${old_multidirs}; do
191 case "$x" in
192 *endian* ) : ;;
193 *) if [ x"$multidirs" = x ]; then multidirs="$x"; else multidirs="${multidirs} ${x}"; fi ;;
194 esac
195 done
196 fi
197 if [ x$enable_softfloat = xno ]
198 then
199 old_multidirs="${multidirs}"
200 multidirs=""
201 for x in ${old_multidirs}; do
202 case "$x" in
203 *soft-float* ) : ;;
204 *) if [ x"$multidirs" = x ]; then multidirs="$x"; else multidirs="${multidirs} ${x}"; fi ;;
205 esac
206 done
207 fi
208 if [ x$enable_relocatable = xno ]
209 then
210 old_multidirs="${multidirs}"
211 multidirs=""
212 for x in ${old_multidirs}; do
213 case "$x" in
214 *relocatable* ) : ;;
215 *) if [ x"$multidirs" = x ]; then multidirs="$x"; else multidirs="${multidirs} ${x}"; fi ;;
216 esac
217 done
218 fi
219 if [ x$enable_sysv = xno ]
220 then
221 old_multidirs="${multidirs}"
222 multidirs=""
223 for x in ${old_multidirs}; do
224 case "$x" in
225 *sysv* ) : ;;
226 *) if [ x"$multidirs" = x ]; then multidirs="$x"; else multidirs="${multidirs} ${x}"; fi ;;
227 esac
228 done
229 fi
230 ;;
231powerpc*-*-eabisim*)
232 multidirs="little-endian big-endian mrelocatable little-endian/mrelocatable big-endian/mrelocatable"
233 if [ x$enable_biendian = xno ]
234 then
235 old_multidirs="${multidirs}"
236 multidirs=""
237 for x in ${old_multidirs}; do
238 case "$x" in
239 *endian* ) : ;;
240 *) if [ x"$multidirs" = x ]; then multidirs="$x"; else multidirs="${multidirs} ${x}"; fi ;;
241 esac
242 done
243 fi
244 if [ x$enable_relocatable = xno ]
245 then
246 old_multidirs="${multidirs}"
247 multidirs=""
248 for x in ${old_multidirs}; do
249 case "$x" in
250 *relocatable* ) : ;;
251 *) if [ x"$multidirs" = x ]; then multidirs="$x"; else multidirs="${multidirs} ${x}"; fi ;;
252 esac
253 done
254 fi
9eb59e0b
DE
255 ;;
256powerpc-*-eabi* | powerpc-*-elf* | powerpc-*-sysv4*)
e1d74f11 257 multidirs="soft-float relocatable little-endian call-aix little-endian/call-aix relocatable/little-endian relocatable/call-aix relocatable/little-endian/call-aix soft-float/relocatable soft-float/little-endian soft-float/call-aix soft-float/little-endian/call-aix soft-float/relocatable/little-endian soft-float/relocatable/call-aix soft-float/relocatable/little-endian/call-aix"
c2838adc
MM
258 if [ x$enable_biendian = xno ]
259 then
260 old_multidirs="${multidirs}"
261 multidirs=""
262 for x in ${old_multidirs}; do
263 case "$x" in
264 *endian* ) : ;;
265 *) if [ x"$multidirs" = x ]; then multidirs="$x"; else multidirs="${multidirs} ${x}"; fi ;;
266 esac
267 done
268 fi
269 if [ x$enable_softfloat = xno ]
270 then
271 old_multidirs="${multidirs}"
272 multidirs=""
273 for x in ${old_multidirs}; do
274 case "$x" in
275 *soft-float* ) : ;;
276 *) if [ x"$multidirs" = x ]; then multidirs="$x"; else multidirs="${multidirs} ${x}"; fi ;;
277 esac
278 done
279 fi
280 if [ x$enable_relocatable = xno ]
281 then
282 old_multidirs="${multidirs}"
283 multidirs=""
284 for x in ${old_multidirs}; do
285 case "$x" in
286 *relocatable* ) : ;;
287 *) if [ x"$multidirs" = x ]; then multidirs="$x"; else multidirs="${multidirs} ${x}"; fi ;;
288 esac
289 done
290 fi
291 if [ x$enable_aix = xno ]
292 then
293 old_multidirs="${multidirs}"
294 multidirs=""
295 for x in ${old_multidirs}; do
296 case "$x" in
297 *aix* ) : ;;
298 *) if [ x"$multidirs" = x ]; then multidirs="$x"; else multidirs="${multidirs} ${x}"; fi ;;
299 esac
300 done
301 fi
9eb59e0b
DE
302 ;;
303powerpcle-*-eabi* | powerpcle-*-elf* | powerpcle-*-sysv4*)
e1d74f11 304 multidirs="soft-float relocatable big-endian call-aix big-endian/call-aix relocatable/big-endian relocatable/call-aix relocatable/big-endian/call-aix soft-float/relocatable soft-float/big-endian soft-float/call-aix soft-float/big-endian/call-aix soft-float/relocatable/big-endian soft-float/relocatable/call-aix soft-float/relocatable/big-endian/call-aix"
c2838adc
MM
305 if [ x$enable_biendian = xno ]
306 then
307 old_multidirs="${multidirs}"
308 multidirs=""
309 for x in ${old_multidirs}; do
310 case "$x" in
311 *endian* ) : ;;
312 *) if [ x"$multidirs" = x ]; then multidirs="$x"; else multidirs="${multidirs} ${x}"; fi ;;
313 esac
314 done
315 fi
316 if [ x$enable_softfloat = xno ]
317 then
318 old_multidirs="${multidirs}"
319 multidirs=""
320 for x in ${old_multidirs}; do
321 case "$x" in
322 *soft-float* ) : ;;
323 *) if [ x"$multidirs" = x ]; then multidirs="$x"; else multidirs="${multidirs} ${x}"; fi ;;
324 esac
325 done
326 fi
327 if [ x$enable_relocatable = xno ]
328 then
329 old_multidirs="${multidirs}"
330 multidirs=""
331 for x in ${old_multidirs}; do
332 case "$x" in
333 *relocatable* ) : ;;
334 *) if [ x"$multidirs" = x ]; then multidirs="$x"; else multidirs="${multidirs} ${x}"; fi ;;
335 esac
336 done
337 fi
338 if [ x$enable_aix = xno ]
339 then
340 old_multidirs="${multidirs}"
341 multidirs=""
342 for x in ${old_multidirs}; do
343 case "$x" in
344 *aix* ) : ;;
345 *) if [ x"$multidirs" = x ]; then multidirs="$x"; else multidirs="${multidirs} ${x}"; fi ;;
346 esac
347 done
348 fi
9eb59e0b
DE
349 ;;
350*)
351 multidirs=
352 ;;
353esac
354
355# We must freshly configure each subdirectory. This bit of code is
356# actually partially stolen from the main configure script. FIXME.
357
358if [ -n "${multidirs}" ] && [ -z "${norecursion}" ]; then
359 for dir in ${multidirs}; do
360
361 if [ -d ${dir} ]; then true; else mkdir ${dir}; fi
362
363 dotdot=../`echo ${dir} | sed -e 's|[^/]||g' -e 's|/|../|g'`
364
365 case ${srcdir} in
366 ".")
367 echo Building symlink tree in `pwd`/${dir}
368 rm -f tmpconfig
369 cat >tmpconfig <<\EOF
370#!/bin/sh
371for f in `ls -a $1`; do
372 if [ -d $1$f ]; then
373 found=
374 for i in $2; do
375 if [ "$f" = "$i" ]; then
376 found=yes
377 fi
378 done
379 if [ -z "${found}" ]; then
380 if [ -d $f ]; then true; else mkdir $f; fi
381 (cd $f; ../$0 ../$1$f/ "$2")
382 fi
383 else
384 rm -f $f
385 ln -s $1$f .
386 fi
387done
388EOF
389 chmod +x tmpconfig
390 (cd ${dir};
391 ${dotdot}tmpconfig ${dotdot} ". .. CVS tmpconfig ${multidirs}")
392 rm -f tmpconfig
393 srcdiroption=
d9677195 394 multilib_top=${dotdot}
9eb59e0b
DE
395 ;;
396 *)
397 case "${srcdir}" in
398 /*) # absolute path
399 newsrcdir=${srcdir}/${configdir}
400 ;;
401 *) # otherwise relative
402 newsrcdir=${dotdot}${srcdir}/${configdir}
403 ;;
404 esac
405 srcdiroption="-srcdir=${newsrcdir}"
d9677195 406 multilib_top=${newsrcdir}
9eb59e0b
DE
407 ;;
408 esac
409
410 case "${progname}" in
411 /*) recprog=${progname} ;;
412 *) recprog=${dotdot}${progname} ;;
413 esac
414
415 POPDIR=${PWD=`pwd`}
416 cd ${dir}
417 if eval ${config_shell} ${recprog} ${verbose} \
d9677195 418 --with-multisubdir=${dir} --with-multilib-top=${multilib_top} \
9eb59e0b
DE
419 ${buildopt} --host=${host_alias} --target=${target_alias} \
420 ${prefixoption} ${tmpdiroption} ${exec_prefixoption} \
421 ${srcdiroption} ${program_prefixoption} ${program_suffixoption} \
422 ${program_transform_nameoption} ${site_option} ${withoptions} \
423 ${withoutoptions} ${enableoptions} ${disableoptions} \
424 ${cache_file_option} ${removing} ${other_options} ${redirect} ; then
425 true
426 else
427 exit 1
428 fi
429
430 cd ${POPDIR}
431
432 done
433fi
434
435fi # ${enable_multilib = yes -a -z ${with_multisubdir}
This page took 0.096903 seconds and 4 git commands to generate.