# Compute the list of sysdep directories for this configuration. # This can take a while to compute. ac_prev= for ac_option do # If the previous option needs an argument, assign it. if test -n "$ac_prev"; then eval "$ac_prev=\$ac_option" ac_prev= continue fi ac_optarg=`expr "x$ac_option" : 'x[^=]*=\(.*\)'` # Accept the important Cygnus configure options, so we can diagnose typos. case $ac_option in -findfile | --findfile | --findfil | --findfi | --findf | --find | --fin | --fi) ac_prev=findfile ;; -findfile=* | --findfile=* | --findfil=* | --findfi=* | --findf=* | --find=* | --fin=* | --fi=*) findfile=$ac_optarg ;; -help | --help | --hel | --he | -h) ac_init_help=long ;; -machine | --machine | --machin | --machi | --mach | --mac | --ma) ac_prev=machine ;; -machine=* | --machine=* | --machin=* | --machi=* | --mach=* | --mac=* | --ma=*) machine=$ac_optarg ;; -os | --os) ac_prev=os ;; -os=* | --os=*) os=$ac_optarg ;; -srcdir | --srcdir | --srcdi | --srcd | --src | --sr) ac_prev=srcdir ;; -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sri=*) srcdir=$ac_optarg ;; *) # ;; esac done if test -n "$ac_prev"; then ac_option=--`echo $ac_prev | sed 's/_/-/g'` { echo "$as_me: error: missing argument to $ac_option" >&2 { (exit 1); exit 1; }; } fi if test -z "$srcdir"; then srcdir=. fi if test -z "$os"; then echo "Must specify --os, see --help for more details" exit 0 fi if test -z "$machine"; then echo "Must specify --machine, see --help for more details" exit 0 fi if test "$ac_init_help" = "long"; then cat < FOO exit 0 fi # Expand the configuration machine name into a subdirectory by architecture # type and particular chip. case "$machine" in a29k | am29000) base_machine=a29k machine=a29k ;; alpha*) base_machine=alpha machine=alpha/$machine ;; arm*) base_machine=arm machine=arm/arm32/$machine ;; c3[012]) base_machine=cx0 machine=cx0/c30 ;; c4[04]) base_machine=cx0 machine=cx0/c40 ;; hppa*64*) base_machine=hppa machine=hppa/hppa64 ;; hppa*) base_machine=hppa machine=hppa/hppa1.1 ;; i[3456]86) base_machine=i386 machine=i386/$machine ;; ia64) base_machine=ia64 machine=ia64 ;; m680?0) base_machine=m68k machine=m68k/$machine ;; m68k) base_machine=m68k machine=m68k/m68020 ;; m88???) base_machine=m88k machine=m88k/$machine ;; m88k) base_machine=m88k machine=m88k/m88100 ;; mips64*) base_machine=mips64 case "$CC $CFLAGS $CPPFLAGS " in *" -mabi=n32 "*) mips_cc_abi=n32 ;; *" -mabi=64 "*|*" -mabi=n64 "*) mips_cc_abi=64 ;; *" -mabi=32 "*|*" -mabi=o32 "*) mips_cc_abi=32 ;; *) mips_cc_abi=default ;; esac case $config_os in *abin32*) mips_config_abi=n32 ;; *abi64*|*abin64*) mips_config_abi=64 ;; *abi32*|*abio32*) mips_config_abi=32 ;; *) mips_config_abi=$mips_cc_abi ;; esac case $mips_config_abi in default) machine=mips/mips64/n32 mips_config_abi=n32 ;; n32) machine=mips/mips64/n32 ;; 64) machine=mips/mips64/n64 ;; 32) machine=mips/mips32/kern64 ;; esac machine=$machine/$config_machine if test $mips_config_abi != $mips_cc_abi; then # This won't make it to config.make, but we want to # set this in case configure tests depend on it. CPPFLAGS="$CPPFLAGS -mabi=$mips_config_abi" fi ;; mips*) base_machine=mips machine=mips/mips32/$machine ;; powerpc) base_machine=powerpc machine=powerpc/powerpc32 ;; powerpc64) base_machine=powerpc machine=powerpc/powerpc64 ;; s390) base_machine=s390 machine=s390/s390-32 ;; s390x) base_machine=s390 machine=s390/s390-64 ;; sh3*) base_machine=sh machine=sh/sh3 ;; sh4*) base_machine=sh machine=sh/sh4 ;; sparc | sparcv[67]) base_machine=sparc machine=sparc/sparc32 ;; sparcv8 | supersparc | hypersparc) base_machine=sparc machine=sparc/sparc32/sparcv8 ;; sparcv8plus | sparcv8plusa | sparcv9) base_machine=sparc machine=sparc/sparc32/sparcv9 ;; sparcv8plusb | sparcv9b) base_machine=sparc machine=sparc/sparc32/sparcv9b ;; sparc64 | ultrasparc) base_machine=sparc machine=sparc/sparc64 ;; sparc64b | ultrasparc3) base_machine=sparc machine=sparc/sparc64/sparcv9b ;; thumb*) base_machine=thumb machine=arm/thumb/$machine ;; *) base_machine=$machine ;; esac case "$os" in # i586-linuxaout is mangled into i586-pc-linux-gnuaout linux*ecoff* | linux*aout* | gnu*aout* | gnu*ecoff*) ;; gnu* | linux* | freebsd* | netbsd* | sysv4* | solaris2* | irix6*) # These systems (almost) always use the ELF format. elf=yes ;; aix*) # These systems are always xcoff xcoff=yes elf=no ;; esac sysdep_dir=$srcdir/sysdeps # Make sco3.2v4 become sco3.2.4 and sunos4.1.1_U1 become sunos4.1.1.U1. #os="`echo $os | sed 's/\([0-9A-Z]\)[v_]\([0-9A-Z]\)/\1.\2/g'`" case "$os" in gnu*) base_os=mach/hurd ;; netbsd* | 386bsd* | freebsd* | bsdi*) base_os=unix/bsd/bsd4.4 ;; osf* | sunos* | ultrix* | newsos* | dynix* | *bsd*) base_os=unix/bsd ;; sysv* | isc* | esix* | sco* | minix* | irix4* | linux*) base_os=unix/sysv ;; irix6*) base_os=unix/sysv/irix6/$os ;; solaris[2-9]*) base_os=unix/sysv/sysv4 ;; hpux*) base_os=unix/sysv/hpux/$os ;; aix4.3*) base_os=unix/sysv/aix/aix4.3 ;; none) base_os=standalone ;; *) base_os='' ;; esac # For sunos4.1.1, try sunos4.1.1, then sunos4.1, then sunos4, then sunos. tail=$os ostry=$os while o=`echo $tail | sed 's/\.[^.]*$//'`; test $o != $tail; do ostry="$ostry /$o" tail=$o done o=`echo $tail | sed 's/[0-9]*$//'` if test $o != $tail; then ostry="$ostry /$o" fi # For linux-gnu, try linux-gnu, then linux. o=`echo $tail | sed 's/-.*$//'` if test $o != $tail; then ostry="$ostry /$o" fi # For unix/sysv/sysv4, try unix/sysv/sysv4, then unix/sysv, then unix. base= tail=$base_os while b=`echo $tail | sed 's@^\(.*\)/\([^/]*\)$@& \1@'`; test -n "$b"; do set $b base="$base /$1" tail="$2" done # For sparc/sparc32, try sparc/sparc32 and then sparc. mach= tail=$machine while m=`echo $tail | sed 's@^\(.*\)/\([^/]*\)$@& \1@'`; test -n "$m"; do set $m # Prepend the machine's FPU directory unless --without-fp. if test "$with_fp" = yes; then mach="$mach /$1/fpu" else mach="$mach /$1/nofpu" fi mach="$mach /$1" tail="$2" done # Find what sysdep directories exist. sysnames= IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:" for d in $add_ons_pfx ''; do for b in $base ''; do for m0 in $mach ''; do for v in /$vendor ''; do test "$v" = / && continue for o in /$ostry ''; do test "$o" = / && continue for m in $mach ''; do if test "$m0$b$v$o$m"; then try="${d}sysdeps$m0$b$v$o$m" test -n "$enable_debug_configure" && echo "$0 [DEBUG]: try $try" >&2 if test -d $srcdir/$try; then sysnames="$sysnames $try" { test -n "$o" || test -n "$b"; } && os_used=t { test -n "$m" || test -n "$m0"; } && machine_used=t fi fi done done done done done done IFS="$ac_save_ifs" if test -z "$os_used" && test "$os" != none; then #jb AC_MSG_ERROR(Operating system $os is not supported.) exit 1 fi if test -z "$machine_used" && test "$machine" != none; then #jb AC_MSG_ERROR(The $machine is not supported.) exit 1 fi # We have now validated the configuration. # If using ELF, look for an `elf' subdirectory of each machine directory. # We prepend these rather than inserting them whereever the machine appears # because things specified by the machine's ELF ABI should override # OS-specific things, and should always be the same for any OS on the # machine (otherwise what's the point of an ABI?). if test "$elf" = yes; then elf_dirs= for d in $add_ons_pfx ''; do for m in $mach; do if test -d $srcdir/${d}sysdeps$m/elf; then elf_dirs="$elf_dirs ${d}sysdeps$m/elf" fi done done sysnames="`echo $elf_dirs | sed -e 's,//,/,g'` $sysnames" fi # Expand the list of system names into a full list of directories # from each element's parent name and Implies file (if present). set $sysnames names= while test $# -gt 0; do name=$1 shift case " $names " in *" $name "*) # Already in the list. continue esac # Report each name as we discover it, so there is no long pause in output. #JB echo $ECHO_N "$name $ECHO_C" >&AS_MESSAGE_FD #JB Don't do this anymore. Processors are fast, and noone watches #JB this beast build anymore. name_base=`echo $name | sed -e 's@\(.*sysdeps\)/.*@\1@'` case $name in /*) xsrcdir= ;; *) xsrcdir=$srcdir/ ;; esac test -n "$enable_debug_configure" && echo "[DEBUG]: name/Implies $xsrcdir$name/Implies" >&2 if test -f $xsrcdir$name/Implies; then # Collect more names from the `Implies' file (removing comments). implied_candidate="`sed 's/#.*$//' < $xsrcdir$name/Implies`" implied= for x in $implied_candidate; do found=no if test -d $xsrcdir$name_base/$x; then implied="$implied $name_base/$x"; found=yes fi for d in $add_ons_pfx ''; do try="${d}sysdeps/$x" case $d in /*) try_srcdir= ;; *) try_srcdir=$srcdir/ ;; esac test -n "$enable_debug_configure" && echo "[DEBUG]: $name implied $x try($d) {$try_srcdir}$try" >&2 if test $try != $xsrcdir$name_base/$x && test -d $try_srcdir$try; then implied="$implied $try" found=yes fi done if test $found = no; then #jb AC_MSG_WARN($name/Implies specifies nonexistent $x) exit 1 fi done else implied= fi # Add NAME to the list of names. names="$names $name" # Find the parent of NAME, using the empty string if it has none. parent="`echo $name | sed -n -e 's=/[^/]*$==' -e '/sysdeps$/q' -e p`" # Add the names implied by NAME, and NAME's parent (if it has one), to # the list of names to be processed (the argument list). We prepend the # implied names to the list and append the parent. We want implied # directories to come before further directories inferred from the # configuration components; this ensures that for sysv4, unix/common # (implied by unix/sysv/sysv4) comes before unix/sysv (in ostry (here $*) # after sysv4). sysnames="`echo $implied $* $parent`" test -n "$sysnames" && set $sysnames done # Add the default directories. default_sysnames=sysdeps/generic if test "$elf" = yes; then default_sysnames="sysdeps/generic/elf $default_sysnames" fi sysnames="$names $default_sysnames" #jb AC_SUBST(sysnames) # The other names were emitted during the scan. #jb AC_MSG_RESULT($default_sysnames) #FIXME This is the wrong way to do this if test -z "$findfile"; then echo $sysnames exit 0 fi for x in $sysnames; do if test -f "$x/$findfile"; then echo "$x/$findfile" exit 0 fi done .