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"
111 # start-sanitize-jaguar
115 # end-sanitize-jaguar
118 # start-sanitize-sh3e
123 # Note that not all of these will be built for a particular
124 # target; what is build depends upon the output gcc
125 # --print-multi-lib. We configure them all, to make our life
126 # simpler here. If somebody cares about configuration
127 # efficiency, they will need to switch off on the various
128 # targets to configure just the directories needed for that
131 # In the long run, it would be better to configure based on
132 # the output of gcc --print-multi-lib, but, to do that, we
133 # would have to build gcc before configuring newlib.
135 # Default to including the single-float directories.
136 if [ x$enable_single_float = x ]; then
137 enable_single_float=yes
139 if [ x$enable_single_float = xyes ]; then
140 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"
142 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"
144 if [ x$enable_biendian = xno ]
146 old_multidirs="${multidirs}"
148 for x in ${old_multidirs}; do
151 *) if [ x"$multidirs" = x ]; then multidirs="$x"; else multidirs="${multidirs} ${x}"; fi ;;
155 if [ x$enable_softfloat = xno ]
157 old_multidirs="${multidirs}"
159 for x in ${old_multidirs}; do
162 *) if [ x"$multidirs" = x ]; then multidirs="$x"; else multidirs="${multidirs} ${x}"; fi ;;
166 if [ x$enable_relocatable = xno ]
168 old_multidirs="${multidirs}"
170 for x in ${old_multidirs}; do
173 *) if [ x"$multidirs" = x ]; then multidirs="$x"; else multidirs="${multidirs} ${x}"; fi ;;
177 if [ x$enable_sysv = xno ]
179 old_multidirs="${multidirs}"
181 for x in ${old_multidirs}; do
184 *) if [ x"$multidirs" = x ]; then multidirs="$x"; else multidirs="${multidirs} ${x}"; fi ;;
189 powerpc-ibm-aix* | rs6000-ibm-aix*)
190 multidirs="soft-float common soft-float/common"
191 if [ x$enable_softfloat = xno ]
193 old_multidirs="${multidirs}"
195 for x in ${old_multidirs}; do
198 *) if [ x"$multidirs" = x ]; then multidirs="$x"; else multidirs="${multidirs} ${x}"; fi ;;
202 if [ x$enable_commoncpu = xno ]
204 old_multidirs="${multidirs}"
206 for x in ${old_multidirs}; do
209 *) if [ x"$multidirs" = x ]; then multidirs="$x"; else multidirs="${multidirs} ${x}"; fi ;;
215 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"
216 if [ x$enable_biendian = xno ]
218 old_multidirs="${multidirs}"
220 for x in ${old_multidirs}; do
223 *) if [ x"$multidirs" = x ]; then multidirs="$x"; else multidirs="${multidirs} ${x}"; fi ;;
227 if [ x$enable_softfloat = xno ]
229 old_multidirs="${multidirs}"
231 for x in ${old_multidirs}; do
234 *) if [ x"$multidirs" = x ]; then multidirs="$x"; else multidirs="${multidirs} ${x}"; fi ;;
238 if [ x$enable_relocatable = xno ]
240 old_multidirs="${multidirs}"
242 for x in ${old_multidirs}; do
245 *) if [ x"$multidirs" = x ]; then multidirs="$x"; else multidirs="${multidirs} ${x}"; fi ;;
249 if [ x$enable_sysv = xno ]
251 old_multidirs="${multidirs}"
253 for x in ${old_multidirs}; do
256 *) if [ x"$multidirs" = x ]; then multidirs="$x"; else multidirs="${multidirs} ${x}"; fi ;;
261 powerpc-*-eabi* | powerpc-*-elf* | powerpc-*-sysv4*)
262 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"
263 if [ x$enable_biendian = xno ]
265 old_multidirs="${multidirs}"
267 for x in ${old_multidirs}; do
270 *) if [ x"$multidirs" = x ]; then multidirs="$x"; else multidirs="${multidirs} ${x}"; fi ;;
274 if [ x$enable_softfloat = xno ]
276 old_multidirs="${multidirs}"
278 for x in ${old_multidirs}; do
281 *) if [ x"$multidirs" = x ]; then multidirs="$x"; else multidirs="${multidirs} ${x}"; fi ;;
285 if [ x$enable_relocatable = xno ]
287 old_multidirs="${multidirs}"
289 for x in ${old_multidirs}; do
292 *) if [ x"$multidirs" = x ]; then multidirs="$x"; else multidirs="${multidirs} ${x}"; fi ;;
296 if [ x$enable_aix = xno ]
298 old_multidirs="${multidirs}"
300 for x in ${old_multidirs}; do
303 *) if [ x"$multidirs" = x ]; then multidirs="$x"; else multidirs="${multidirs} ${x}"; fi ;;
308 powerpcle-*-eabi* | powerpcle-*-elf* | powerpcle-*-sysv4*)
309 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"
310 if [ x$enable_biendian = xno ]
312 old_multidirs="${multidirs}"
314 for x in ${old_multidirs}; do
317 *) if [ x"$multidirs" = x ]; then multidirs="$x"; else multidirs="${multidirs} ${x}"; fi ;;
321 if [ x$enable_softfloat = xno ]
323 old_multidirs="${multidirs}"
325 for x in ${old_multidirs}; do
328 *) if [ x"$multidirs" = x ]; then multidirs="$x"; else multidirs="${multidirs} ${x}"; fi ;;
332 if [ x$enable_relocatable = xno ]
334 old_multidirs="${multidirs}"
336 for x in ${old_multidirs}; do
339 *) if [ x"$multidirs" = x ]; then multidirs="$x"; else multidirs="${multidirs} ${x}"; fi ;;
343 if [ x$enable_aix = xno ]
345 old_multidirs="${multidirs}"
347 for x in ${old_multidirs}; do
350 *) if [ x"$multidirs" = x ]; then multidirs="$x"; else multidirs="${multidirs} ${x}"; fi ;;
360 # We must freshly configure each subdirectory. This bit of code is
361 # actually partially stolen from the main configure script. FIXME.
363 if [ -n "${multidirs}" ] && [ -z "${norecursion}" ]; then
364 for dir in ${multidirs}; do
366 if [ -d ${dir} ]; then true; else mkdir ${dir}; fi
368 dotdot=../`echo ${dir} | sed -e 's|[^/]||g' -e 's|/|../|g'`
372 echo Building symlink tree in `pwd`/${dir}
374 cat >tmpconfig <<\EOF
376 for f in `ls -a $1`; do
380 if [ "$f" = "$i" ]; then
384 if [ -z "${found}" ]; then
385 if [ -d $f ]; then true; else mkdir $f; fi
386 (cd $f; ../$0 ../$1$f/ "$2")
396 ${dotdot}tmpconfig ${dotdot} ". .. CVS tmpconfig ${multidirs}")
399 multilib_top=${dotdot}
404 newsrcdir=${srcdir}/${configdir}
406 *) # otherwise relative
407 newsrcdir=${dotdot}${srcdir}/${configdir}
410 srcdiroption="-srcdir=${newsrcdir}"
411 multilib_top=${newsrcdir}
415 case "${progname}" in
416 /*) recprog=${progname} ;;
417 *) recprog=${dotdot}${progname} ;;
422 if eval ${config_shell} ${recprog} ${verbose} \
423 --with-multisubdir=${dir} --with-multilib-top=${multilib_top} \
424 ${buildopt} --host=${host_alias} --target=${target_alias} \
425 ${prefixoption} ${tmpdiroption} ${exec_prefixoption} \
426 ${srcdiroption} ${program_prefixoption} ${program_suffixoption} \
427 ${program_transform_nameoption} ${site_option} ${withoptions} \
428 ${withoutoptions} ${enableoptions} ${disableoptions} \
429 ${cache_file_option} ${removing} ${other_options} ${redirect} ; then
440 fi # ${enable_multilib = yes -a -z ${with_multisubdir}