# Configure fragment invoked in the common section for subdirs # wanting multilib support. # # The common section was chosen because xiberty clobbers $srcdir in the # common section of its configure.in. # # The intent is to keep as much of this in one place as possible (and out # of each subdirectory, eg: newlib, libio, etc.) until the right way to do # this (ha ha) is decided upon. # # This is where a target selects what multilib directories to build. # It is advisable to support a few --enable/--disable options to let the # user select which libraries s/he really wants. # # Subdirectories wishing to use multilib should put the following lines # in the initial ("common") section of configure.in: # #if [ -n "${with_multilib_top}" ]; then # . ${with_multilib_top}/../cfg-ml-com.in #else # . ${srcdir}/../cfg-ml-com.in #fi # # `with_multilib_top' exists to handle the case of configuring in the source # tree: ${srcdir} is not constant. # # The following should be added to the "post-target" section of configure.in: # #if [ -n "${with_multilib_top}" ]; then # . ${with_multilib_top}/../cfg-ml-pos.in #else # . ${srcdir}/../cfg-ml-pos.in #fi # FIXME: Multilib is currently disabled by default for everything other than # newlib. It is up to each target to turn on multilib support for the other # libraries as desired. # # FIXME: It would be better if we could use the --print-multi-lib switch to # gcc to get the list of directories to build, but at this point the compiler # has not been built. # Only do this if --enable-multilib. # And only if at the top level, not a multilib subdirectory. if [ "${enable_multilib}" = yes -a -z "${with_multisubdir}" ]; then # Doing this in the common section means ${target} isn't set yet, so compute # a copy here. This is a bit kludgey, but again the current (short term) goal # is to be as unobtrusive (sp?) to the rest of the sources as possible. if result=`${config_shell} ${configsub} ${target_alias}` ; then true else echo "Unrecognized target system name ${target_alias}." 1>&2 exit 1 fi target_cpu=`echo $result | sed 's/^\(.*\)-\(.*\)-\(.*\)$/\1/'` target_vendor=`echo $result | sed 's/^\(.*\)-\(.*\)-\(.*\)$/\2/'` target_os=`echo $result | sed 's/^\(.*\)-\(.*\)-\(.*\)$/\3/'` target=${target_cpu}-${target_vendor}-${target_os} # FIXME: Perhaps we can do something like the following instead. # Fetch from gcc the multilib directories to use if we can. # if [ -f ${srcdir}/../gcc/genmultilib -a -f ../gcc/Makefile ]; then # options=`grep "^MULTILIB_OPTIONS" ../gcc/Makefile | sed -e 's/^.*=//'` # multidirs=`${srcdir}/../gcc/genmultilib "$options" | \ # sed -e 's/^#define.*//' -e 's/^[.].*//' -e 's/".*//' -e 's/ .*//'` # else # multidirs="" # fi case "${target}" in # start-sanitize-arc arc-sbp-elf*) if [ x$enable_biendian = xyes ] then multidirs="be host graphics audio be/host be/graphics be/audio" else multidirs="host graphics audio" fi ;; arc-*-*) multidirs="be" ;; # end-sanitize-arc hppa*-*-*) multidirs="soft-float" ;; m68*-*-aout* | m68*-*-coff* | m68*-*-elf* | m68*-*-vxworks*) multidirs="m68000 m68020 m68881 msoft-float m68000/m68881 m68000/msoft-float m68020/m68881 m68020/msoft-float" ;; i960-*-*) multidirs=float ;; sparclite-*-* | sparclitefrw*-*-*) multidirs="mfpu msoft-float mflat mno-flat mfpu/mflat mfpu/mno-flat msoft-float/mflat msoft-float/mno-flat" ;; sparc-*-* | sparcfrw*-*-*) multidirs="soft v8 soft/v8" ;; z8k-*-coff) multidirs="z8001 std z8001/std" ;; h8300-*-*) multidirs=h8300h ;; h8500-*-*) multidirs="mbig msmall mcompact mmedium" ;; # start-sanitize-jaguar jaguar-*-*) multidirs="be" ;; # end-sanitize-jaguar sh-*-*) multidirs="ml" # start-sanitize-sh3e multidirs="ml m3e" # end-sanitize-sh3e ;; mips*-*-*) # Note that not all of these will be built for a particular # target; what is build depends upon the output gcc # --print-multi-lib. We configure them all, to make our life # simpler here. If somebody cares about configuration # efficiency, they will need to switch off on the various # targets to configure just the directories needed for that # target. # # In the long run, it would be better to configure based on # the output of gcc --print-multi-lib, but, to do that, we # would have to build gcc before configuring newlib. # # Default to including the single-float directories. if [ x$enable_single_float = x ]; then enable_single_float=yes fi if [ x$enable_single_float = xyes ]; then 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" else 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" fi if [ x$enable_biendian = xno ] then old_multidirs="${multidirs}" multidirs="" for x in ${old_multidirs}; do case "$x" in *endian* ) : ;; *) if [ x"$multidirs" = x ]; then multidirs="$x"; else multidirs="${multidirs} ${x}"; fi ;; esac done fi if [ x$enable_softfloat = xno ] then old_multidirs="${multidirs}" multidirs="" for x in ${old_multidirs}; do case "$x" in *soft-float* ) : ;; *) if [ x"$multidirs" = x ]; then multidirs="$x"; else multidirs="${multidirs} ${x}"; fi ;; esac done fi if [ x$enable_relocatable = xno ] then old_multidirs="${multidirs}" multidirs="" for x in ${old_multidirs}; do case "$x" in *relocatable* ) : ;; *) if [ x"$multidirs" = x ]; then multidirs="$x"; else multidirs="${multidirs} ${x}"; fi ;; esac done fi if [ x$enable_sysv = xno ] then old_multidirs="${multidirs}" multidirs="" for x in ${old_multidirs}; do case "$x" in *sysv* ) : ;; *) if [ x"$multidirs" = x ]; then multidirs="$x"; else multidirs="${multidirs} ${x}"; fi ;; esac done fi ;; powerpc-ibm-aix* | rs6000-ibm-aix*) multidirs="soft-float common soft-float/common" if [ x$enable_softfloat = xno ] then old_multidirs="${multidirs}" multidirs="" for x in ${old_multidirs}; do case "$x" in *soft-float* ) : ;; *) if [ x"$multidirs" = x ]; then multidirs="$x"; else multidirs="${multidirs} ${x}"; fi ;; esac done fi if [ x$enable_commoncpu = xno ] then old_multidirs="${multidirs}" multidirs="" for x in ${old_multidirs}; do case "$x" in *common* ) : ;; *) if [ x"$multidirs" = x ]; then multidirs="$x"; else multidirs="${multidirs} ${x}"; fi ;; esac done fi ;; powerpc-*-eabiaix*) 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" if [ x$enable_biendian = xno ] then old_multidirs="${multidirs}" multidirs="" for x in ${old_multidirs}; do case "$x" in *endian* ) : ;; *) if [ x"$multidirs" = x ]; then multidirs="$x"; else multidirs="${multidirs} ${x}"; fi ;; esac done fi if [ x$enable_softfloat = xno ] then old_multidirs="${multidirs}" multidirs="" for x in ${old_multidirs}; do case "$x" in *soft-float* ) : ;; *) if [ x"$multidirs" = x ]; then multidirs="$x"; else multidirs="${multidirs} ${x}"; fi ;; esac done fi if [ x$enable_relocatable = xno ] then old_multidirs="${multidirs}" multidirs="" for x in ${old_multidirs}; do case "$x" in *relocatable* ) : ;; *) if [ x"$multidirs" = x ]; then multidirs="$x"; else multidirs="${multidirs} ${x}"; fi ;; esac done fi if [ x$enable_sysv = xno ] then old_multidirs="${multidirs}" multidirs="" for x in ${old_multidirs}; do case "$x" in *sysv* ) : ;; *) if [ x"$multidirs" = x ]; then multidirs="$x"; else multidirs="${multidirs} ${x}"; fi ;; esac done fi ;; powerpc-*-eabi* | powerpc-*-elf* | powerpc-*-sysv4*) 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 call-aixdesc soft-float/call-aixdesc" if [ x$enable_biendian = xno ] then old_multidirs="${multidirs}" multidirs="" for x in ${old_multidirs}; do case "$x" in *endian* ) : ;; *) if [ x"$multidirs" = x ]; then multidirs="$x"; else multidirs="${multidirs} ${x}"; fi ;; esac done fi if [ x$enable_softfloat = xno ] then old_multidirs="${multidirs}" multidirs="" for x in ${old_multidirs}; do case "$x" in *soft-float* ) : ;; *) if [ x"$multidirs" = x ]; then multidirs="$x"; else multidirs="${multidirs} ${x}"; fi ;; esac done fi if [ x$enable_relocatable = xno ] then old_multidirs="${multidirs}" multidirs="" for x in ${old_multidirs}; do case "$x" in *relocatable* ) : ;; *) if [ x"$multidirs" = x ]; then multidirs="$x"; else multidirs="${multidirs} ${x}"; fi ;; esac done fi if [ x$enable_aix = xno ] then old_multidirs="${multidirs}" multidirs="" for x in ${old_multidirs}; do case "$x" in *aix* ) : ;; *) if [ x"$multidirs" = x ]; then multidirs="$x"; else multidirs="${multidirs} ${x}"; fi ;; esac done fi ;; powerpcle-*-eabi* | powerpcle-*-elf* | powerpcle-*-sysv4*) 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" if [ x$enable_biendian = xno ] then old_multidirs="${multidirs}" multidirs="" for x in ${old_multidirs}; do case "$x" in *endian* ) : ;; *) if [ x"$multidirs" = x ]; then multidirs="$x"; else multidirs="${multidirs} ${x}"; fi ;; esac done fi if [ x$enable_softfloat = xno ] then old_multidirs="${multidirs}" multidirs="" for x in ${old_multidirs}; do case "$x" in *soft-float* ) : ;; *) if [ x"$multidirs" = x ]; then multidirs="$x"; else multidirs="${multidirs} ${x}"; fi ;; esac done fi if [ x$enable_relocatable = xno ] then old_multidirs="${multidirs}" multidirs="" for x in ${old_multidirs}; do case "$x" in *relocatable* ) : ;; *) if [ x"$multidirs" = x ]; then multidirs="$x"; else multidirs="${multidirs} ${x}"; fi ;; esac done fi if [ x$enable_aix = xno ] then old_multidirs="${multidirs}" multidirs="" for x in ${old_multidirs}; do case "$x" in *aix* ) : ;; *) if [ x"$multidirs" = x ]; then multidirs="$x"; else multidirs="${multidirs} ${x}"; fi ;; esac done fi ;; *) multidirs= ;; esac # We must freshly configure each subdirectory. This bit of code is # actually partially stolen from the main configure script. FIXME. if [ -n "${multidirs}" ] && [ -z "${norecursion}" ]; then for dir in ${multidirs}; do if [ -d ${dir} ]; then true; else mkdir ${dir}; fi dotdot=../`echo ${dir} | sed -e 's|[^/]||g' -e 's|/|../|g'` case ${srcdir} in ".") echo Building symlink tree in `pwd`/${dir} rm -f tmpconfig cat >tmpconfig <<\EOF #!/bin/sh for f in `ls -a $1`; do if [ -d $1$f ]; then found= for i in $2; do if [ "$f" = "$i" ]; then found=yes fi done if [ -z "${found}" ]; then if [ -d $f ]; then true; else mkdir $f; fi (cd $f; ../$0 ../$1$f/ "$2") fi else rm -f $f ln -s $1$f . fi done EOF chmod +x tmpconfig (cd ${dir}; ${dotdot}tmpconfig ${dotdot} ". .. CVS tmpconfig ${multidirs}") rm -f tmpconfig srcdiroption= multilib_top=${dotdot} ;; *) case "${srcdir}" in /*) # absolute path newsrcdir=${srcdir}/${configdir} ;; *) # otherwise relative newsrcdir=${dotdot}${srcdir}/${configdir} ;; esac srcdiroption="-srcdir=${newsrcdir}" multilib_top=${newsrcdir} ;; esac case "${progname}" in /*) recprog=${progname} ;; *) recprog=${dotdot}${progname} ;; esac POPDIR=${PWD=`pwd`} cd ${dir} if eval ${config_shell} ${recprog} ${verbose} \ --with-multisubdir=${dir} --with-multilib-top=${multilib_top} \ ${buildopt} --host=${host_alias} --target=${target_alias} \ ${prefixoption} ${tmpdiroption} ${exec_prefixoption} \ ${srcdiroption} ${program_prefixoption} ${program_suffixoption} \ ${program_transform_nameoption} ${site_option} ${withoptions} \ ${withoutoptions} ${enableoptions} ${disableoptions} \ ${cache_file_option} ${removing} ${other_options} ${redirect} ; then true else exit 1 fi cd ${POPDIR} done fi fi # ${enable_multilib = yes -a -z ${with_multisubdir}