1 # Configure fragment invoked in the common section for subdirs
2 # wanting multilib support.
4 # The common section was chosen because xiberty clobbers $srcdir in the
5 # common section of its configure.in.
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.
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.
15 # Subdirectories wishing to use multilib should put the following lines
16 # in the initial ("common") section of configure.in:
18 #if [ -n "${with_multilib_top}" ]; then
19 # . ${with_multilib_top}/../cfg-ml-com.in
21 # . ${srcdir}/../cfg-ml-com.in
24 # `with_multilib_top' exists to handle the case of configuring in the source
25 # tree: ${srcdir} is not constant.
27 # The following should be added to the "post-target" section of configure.in:
29 #if [ -n "${with_multilib_top}" ]; then
30 # . ${with_multilib_top}/../cfg-ml-pos.in
32 # . ${srcdir}/../cfg-ml-pos.in
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.
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
43 # Only do this if --enable-multilib.
44 # And only if at the top level, not a multilib subdirectory.
46 if [ "${enable_multilib}" = yes -a -z "${with_multisubdir}" ]; then
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.
52 if result=`${config_shell} ${configsub} ${target_alias}` ; then
55 echo "Unrecognized target system name ${target_alias}." 1>&2
58 target_cpu=`echo $result | sed 's/^\(.*\)-\(.*\)-\(.*\)$/\1/'`
59 target_vendor=`echo $result | sed 's/^\(.*\)-\(.*\)-\(.*\)$/\2/'`
60 target_os=`echo $result | sed 's/^\(.*\)-\(.*\)-\(.*\)$/\3/'`
61 target=${target_cpu}-${target_vendor}-${target_os}
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/ .*//'`
76 if [ x$enable_biendian = xyes ]
78 multidirs="be host graphics audio be/host be/graphics be/audio"
80 multidirs="host graphics audio"
88 multidirs="soft-float"
90 m68*-*-aout* | m68*-*-coff* | m68*-*-elf* | m68*-*-vxworks*)
91 multidirs="m68000 m68020 m68881 msoft-float m68000/m68881 m68000/msoft-float m68020/m68881 m68020/msoft-float"
96 sparclite-*-* | sparclitefrw*-*-*)
97 multidirs="mfpu msoft-float mflat mno-flat mfpu/mflat mfpu/mno-flat msoft-float/mflat msoft-float/mno-flat"
99 sparc-*-* | sparcfrw*-*-*)
100 multidirs="soft v8 soft/v8"
103 multidirs="z8001 std z8001/std"
109 multidirs="mbig msmall mcompact mmedium"
113 # start-sanitize-sh3e
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
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.
130 # Default to including the single-float directories.
131 if [ x$enable_single_float = x ]; then
132 enable_single_float=yes
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"
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"
139 if [ x$enable_biendian = xno ]
141 old_multidirs="${multidirs}"
143 for x in ${old_multidirs}; do
146 *) if [ x"$multidirs" = x ]; then multidirs="$x"; else multidirs="${multidirs} ${x}"; fi ;;
150 if [ x$enable_softfloat = xno ]
152 old_multidirs="${multidirs}"
154 for x in ${old_multidirs}; do
157 *) if [ x"$multidirs" = x ]; then multidirs="$x"; else multidirs="${multidirs} ${x}"; fi ;;
161 if [ x$enable_relocatable = xno ]
163 old_multidirs="${multidirs}"
165 for x in ${old_multidirs}; do
168 *) if [ x"$multidirs" = x ]; then multidirs="$x"; else multidirs="${multidirs} ${x}"; fi ;;
172 if [ x$enable_sysv = xno ]
174 old_multidirs="${multidirs}"
176 for x in ${old_multidirs}; do
179 *) if [ x"$multidirs" = x ]; then multidirs="$x"; else multidirs="${multidirs} ${x}"; fi ;;
184 powerpc-ibm-aix* | rs6000-ibm-aix*)
185 multidirs="soft-float common soft-float/common"
186 if [ x$enable_softfloat = xno ]
188 old_multidirs="${multidirs}"
190 for x in ${old_multidirs}; do
193 *) if [ x"$multidirs" = x ]; then multidirs="$x"; else multidirs="${multidirs} ${x}"; fi ;;
197 if [ x$enable_commoncpu = xno ]
199 old_multidirs="${multidirs}"
201 for x in ${old_multidirs}; do
204 *) if [ x"$multidirs" = x ]; then multidirs="$x"; else multidirs="${multidirs} ${x}"; fi ;;
210 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"
211 if [ x$enable_biendian = xno ]
213 old_multidirs="${multidirs}"
215 for x in ${old_multidirs}; do
218 *) if [ x"$multidirs" = x ]; then multidirs="$x"; else multidirs="${multidirs} ${x}"; fi ;;
222 if [ x$enable_softfloat = xno ]
224 old_multidirs="${multidirs}"
226 for x in ${old_multidirs}; do
229 *) if [ x"$multidirs" = x ]; then multidirs="$x"; else multidirs="${multidirs} ${x}"; fi ;;
233 if [ x$enable_relocatable = xno ]
235 old_multidirs="${multidirs}"
237 for x in ${old_multidirs}; do
240 *) if [ x"$multidirs" = x ]; then multidirs="$x"; else multidirs="${multidirs} ${x}"; fi ;;
244 if [ x$enable_sysv = xno ]
246 old_multidirs="${multidirs}"
248 for x in ${old_multidirs}; do
251 *) if [ x"$multidirs" = x ]; then multidirs="$x"; else multidirs="${multidirs} ${x}"; fi ;;
256 powerpc*-*-eabisim*) # don't both with {aix,aixdesc}/mrelocatable configurations
257 multidirs="little-endian big-endian aix aixdesc mrelocatable little-endian/mrelocatable big-endian/mrelocatable"
258 if [ x$enable_biendian = xno ]
260 old_multidirs="${multidirs}"
262 for x in ${old_multidirs}; do
265 *) if [ x"$multidirs" = x ]; then multidirs="$x"; else multidirs="${multidirs} ${x}"; fi ;;
269 if [ x$enable_aix = xno ]
271 old_multidirs="${multidirs}"
273 for x in ${old_multidirs}; do
276 *) if [ x"$multidirs" = x ]; then multidirs="$x"; else multidirs="${multidirs} ${x}"; fi ;;
280 if [ x$enable_relocatable = xno ]
282 old_multidirs="${multidirs}"
284 for x in ${old_multidirs}; do
287 *) if [ x"$multidirs" = x ]; then multidirs="$x"; else multidirs="${multidirs} ${x}"; fi ;;
292 powerpc-*-eabi* | powerpc-*-elf* | powerpc-*-sysv4*)
293 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"
294 if [ x$enable_biendian = xno ]
296 old_multidirs="${multidirs}"
298 for x in ${old_multidirs}; do
301 *) if [ x"$multidirs" = x ]; then multidirs="$x"; else multidirs="${multidirs} ${x}"; fi ;;
305 if [ x$enable_softfloat = xno ]
307 old_multidirs="${multidirs}"
309 for x in ${old_multidirs}; do
312 *) if [ x"$multidirs" = x ]; then multidirs="$x"; else multidirs="${multidirs} ${x}"; fi ;;
316 if [ x$enable_relocatable = xno ]
318 old_multidirs="${multidirs}"
320 for x in ${old_multidirs}; do
323 *) if [ x"$multidirs" = x ]; then multidirs="$x"; else multidirs="${multidirs} ${x}"; fi ;;
327 if [ x$enable_aix = xno ]
329 old_multidirs="${multidirs}"
331 for x in ${old_multidirs}; do
334 *) if [ x"$multidirs" = x ]; then multidirs="$x"; else multidirs="${multidirs} ${x}"; fi ;;
339 powerpcle-*-eabi* | powerpcle-*-elf* | powerpcle-*-sysv4*)
340 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"
341 if [ x$enable_biendian = xno ]
343 old_multidirs="${multidirs}"
345 for x in ${old_multidirs}; do
348 *) if [ x"$multidirs" = x ]; then multidirs="$x"; else multidirs="${multidirs} ${x}"; fi ;;
352 if [ x$enable_softfloat = xno ]
354 old_multidirs="${multidirs}"
356 for x in ${old_multidirs}; do
359 *) if [ x"$multidirs" = x ]; then multidirs="$x"; else multidirs="${multidirs} ${x}"; fi ;;
363 if [ x$enable_relocatable = xno ]
365 old_multidirs="${multidirs}"
367 for x in ${old_multidirs}; do
370 *) if [ x"$multidirs" = x ]; then multidirs="$x"; else multidirs="${multidirs} ${x}"; fi ;;
374 if [ x$enable_aix = xno ]
376 old_multidirs="${multidirs}"
378 for x in ${old_multidirs}; do
381 *) if [ x"$multidirs" = x ]; then multidirs="$x"; else multidirs="${multidirs} ${x}"; fi ;;
391 # We must freshly configure each subdirectory. This bit of code is
392 # actually partially stolen from the main configure script. FIXME.
394 if [ -n "${multidirs}" ] && [ -z "${norecursion}" ]; then
395 for dir in ${multidirs}; do
397 if [ -d ${dir} ]; then true; else mkdir ${dir}; fi
399 dotdot=../`echo ${dir} | sed -e 's|[^/]||g' -e 's|/|../|g'`
403 echo Building symlink tree in `pwd`/${dir}
405 cat >tmpconfig <<\EOF
407 for f in `ls -a $1`; do
411 if [ "$f" = "$i" ]; then
415 if [ -z "${found}" ]; then
416 if [ -d $f ]; then true; else mkdir $f; fi
417 (cd $f; ../$0 ../$1$f/ "$2")
427 ${dotdot}tmpconfig ${dotdot} ". .. CVS tmpconfig ${multidirs}")
430 multilib_top=${dotdot}
435 newsrcdir=${srcdir}/${configdir}
437 *) # otherwise relative
438 newsrcdir=${dotdot}${srcdir}/${configdir}
441 srcdiroption="-srcdir=${newsrcdir}"
442 multilib_top=${newsrcdir}
446 case "${progname}" in
447 /*) recprog=${progname} ;;
448 *) recprog=${dotdot}${progname} ;;
453 if eval ${config_shell} ${recprog} ${verbose} \
454 --with-multisubdir=${dir} --with-multilib-top=${multilib_top} \
455 ${buildopt} --host=${host_alias} --target=${target_alias} \
456 ${prefixoption} ${tmpdiroption} ${exec_prefixoption} \
457 ${srcdiroption} ${program_prefixoption} ${program_suffixoption} \
458 ${program_transform_nameoption} ${site_option} ${withoptions} \
459 ${withoutoptions} ${enableoptions} ${disableoptions} \
460 ${cache_file_option} ${removing} ${other_options} ${redirect} ; then
471 fi # ${enable_multilib = yes -a -z ${with_multisubdir}