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 # FIXME: Multilib is currently disabled by default for everything other than
16 # newlib. It is up to each target to turn on multilib support for the other
17 # libraries as desired.
19 # FIXME: It would be better if we could use the --print-multi-lib switch to
20 # gcc to get the list of directories to build, but at this point the compiler
23 # Only do this if --enable-multilib.
24 # And only if at the top level, not a multilib subdirectory.
26 if [ "${enable_multilib}" = yes -a -z "${with_multisubdir}" ]; then
28 # Doing this in the common section means ${target} isn't set yet, so compute
29 # a copy here. This is a bit kludgey, but again the current (short term) goal
30 # is to be as unobtrusive (sp?) to the rest of the sources as possible.
32 if result=`${config_shell} ${configsub} ${target_alias}` ; then
35 echo "Unrecognized target system name ${target_alias}." 1>&2
38 target_cpu=`echo $result | sed 's/^\(.*\)-\(.*\)-\(.*\)$/\1/'`
39 target_vendor=`echo $result | sed 's/^\(.*\)-\(.*\)-\(.*\)$/\2/'`
40 target_os=`echo $result | sed 's/^\(.*\)-\(.*\)-\(.*\)$/\3/'`
41 target=${target_cpu}-${target_vendor}-${target_os}
43 # FIXME: Perhaps we can do something like the following instead.
44 # Fetch from gcc the multilib directories to use if we can.
45 # if [ -f ${srcdir}/../gcc/genmultilib -a -f ../gcc/Makefile ]; then
46 # options=`grep "^MULTILIB_OPTIONS" ../gcc/Makefile | sed -e 's/^.*=//'`
47 # multidirs=`${srcdir}/../gcc/genmultilib "$options" | \
48 # sed -e 's/^#define.*//' -e 's/^[.].*//' -e 's/".*//' -e 's/ .*//'`
56 if [ x$enable_biendian = xyes ]
58 multidirs="be host graphics audio be/host be/graphics be/audio"
60 multidirs="host graphics audio"
68 multidirs="soft-float"
71 multidirs="m68000 m68020 m68881 msoft-float m68000/m68881 m68000/msoft-float m68020/m68881 m68020/msoft-float"
76 sparclite-*-* | sparclitefrw*-*-*)
77 multidirs="mfpu msoft-float mflat mno-flat mfpu/mflat mfpu/mno-flat msoft-float/mflat msoft-float/mno-flat"
79 sparc-*-* | sparcfrw*-*-*)
80 multidirs="soft v8 soft/v8"
89 multidirs="mbig msmall mcompact mmedium"
95 # Note that not all of these will be built for a particular
96 # target; what is build depends upon the output gcc
97 # --print-multi-lib. We configure them all, to make our life
98 # simpler here. If somebody cares about configuration
99 # efficiency, they will need to switch off on the various
100 # targets to configure just the directories needed for that
103 # In the long run, it would be better to configure based on
104 # the output of gcc --print-multi-lib, but, to do that, we
105 # would have to build gcc before configuring newlib.
107 # Default to including the single-float directories.
108 if [ x$enable_single_float = x ]; then
109 enable_single_float=yes
111 if [ x$enable_single_float = xyes ]; then
112 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"
114 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"
118 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"
120 powerpc-*-eabi* | powerpc-*-elf* | powerpc-*-sysv4*)
121 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"
123 powerpcle-*-eabi* | powerpcle-*-elf* | powerpcle-*-sysv4*)
124 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"
131 # We must freshly configure each subdirectory. This bit of code is
132 # actually partially stolen from the main configure script. FIXME.
134 if [ -n "${multidirs}" ] && [ -z "${norecursion}" ]; then
135 for dir in ${multidirs}; do
137 if [ -d ${dir} ]; then true; else mkdir ${dir}; fi
139 dotdot=../`echo ${dir} | sed -e 's|[^/]||g' -e 's|/|../|g'`
143 echo Building symlink tree in `pwd`/${dir}
145 cat >tmpconfig <<\EOF
147 for f in `ls -a $1`; do
151 if [ "$f" = "$i" ]; then
155 if [ -z "${found}" ]; then
156 if [ -d $f ]; then true; else mkdir $f; fi
157 (cd $f; ../$0 ../$1$f/ "$2")
167 ${dotdot}tmpconfig ${dotdot} ". .. CVS tmpconfig ${multidirs}")
174 newsrcdir=${srcdir}/${configdir}
176 *) # otherwise relative
177 newsrcdir=${dotdot}${srcdir}/${configdir}
180 srcdiroption="-srcdir=${newsrcdir}"
184 case "${progname}" in
185 /*) recprog=${progname} ;;
186 *) recprog=${dotdot}${progname} ;;
191 if eval ${config_shell} ${recprog} ${verbose} \
192 --with-multisubdir=${dir} \
193 ${buildopt} --host=${host_alias} --target=${target_alias} \
194 ${prefixoption} ${tmpdiroption} ${exec_prefixoption} \
195 ${srcdiroption} ${program_prefixoption} ${program_suffixoption} \
196 ${program_transform_nameoption} ${site_option} ${withoptions} \
197 ${withoutoptions} ${enableoptions} ${disableoptions} \
198 ${cache_file_option} ${removing} ${other_options} ${redirect} ; then
209 fi # ${enable_multilib = yes -a -z ${with_multisubdir}