home *** CD-ROM | disk | FTP | other *** search
/ Geek Gadgets 1 / ADE-1.bin / ade-dist / libg++-2.7.1-base.tgz / libg++-2.7.1-src.tar / fsf / libg++ / configure < prev    next >
Text File  |  1995-11-08  |  38KB  |  1,218 lines

  1. #!/bin/sh
  2.  
  3. ### WARNING: this file contains embedded tabs.  Do not run untabify on this file.
  4.  
  5. # Configuration script
  6. # Copyright (C) 1988, 90, 91, 92, 93, 94 Free Software Foundation, Inc.
  7.  
  8. # This program is free software; you can redistribute it and/or modify
  9. # it under the terms of the GNU General Public License as published by
  10. # the Free Software Foundation; either version 2 of the License, or
  11. # (at your option) any later version.
  12. # This program is distributed in the hope that it will be useful,
  13. # but WITHOUT ANY WARRANTY; without even the implied warranty of
  14. # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  15. # GNU General Public License for more details.
  16. # You should have received a copy of the GNU General Public License
  17. # along with this program; if not, write to the Free Software
  18. # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
  19.  
  20. # This file was originally written by K. Richard Pixley.
  21.  
  22. #
  23. # Shell script to create proper links to machine-dependent files in
  24. # preparation for compilation.
  25. #
  26. # If configure succeeds, it leaves its status in config.status.
  27. # If configure fails after disturbing the status quo, 
  28. #       config.status is removed.
  29. #
  30.  
  31. export PATH || (echo "OOPS, this isn't sh.  Desperation time.  I will feed myself to sh."; sh $0 $argv; kill $$)
  32.  
  33. remove=rm
  34. hard_link=ln
  35. symbolic_link='ln -s'
  36.  
  37. #for Test
  38. #remove="echo rm"
  39. #hard_link="echo ln"
  40. #symbolic_link="echo ln -s"
  41.  
  42. # clear some things potentially inherited from environment.
  43.  
  44. Makefile=Makefile
  45. Makefile_in=Makefile.in
  46. arguments=$*
  47. build_alias=
  48. cache_file=
  49. cache_file_option=
  50. configdirs=
  51. exec_prefix=
  52. exec_prefixoption=
  53. fatal=
  54. floating_point=default
  55. gas=default
  56. host_alias=NOHOST
  57. host_makefile_frag=
  58. moveifchange=
  59. norecursion=
  60. other_options=
  61. package_makefile_frag=
  62. prefix=/usr/local
  63. progname=
  64. program_prefix=
  65. program_prefixoption=
  66. program_suffix=
  67. program_suffixoption=
  68. program_transform_name=
  69. program_transform_nameoption=
  70. redirect=">/dev/null"
  71. removing=
  72. site=
  73. site_makefile_frag=
  74. site_option=
  75. srcdir=
  76. srctrigger=
  77. subdirs=
  78. target_alias=NOTARGET
  79. target_makefile_frag=
  80. undefs=NOUNDEFS
  81. version="$Revision: 1.211 $"
  82. x11=default
  83.  
  84. ### we might need to use some other shell than /bin/sh for running subshells
  85. #
  86. config_shell=${CONFIG_SHELL-/bin/sh}
  87.  
  88. NO_EDIT="This file was generated automatically by configure.  Do not edit."
  89.  
  90. ## this is a little touchy and won't always work, but...
  91. ##
  92. ## if the argv[0] starts with a slash then it is an absolute name that can (and
  93. ## must) be used as is.
  94. ##
  95. ## otherwise, if argv[0] has no slash in it, we can assume that it is on the
  96. ## path.  Since PATH might include "." we also add `pwd` to the end of PATH.
  97. ##
  98.  
  99. progname=$0
  100. # if PWD already has a value, it is probably wrong.
  101. if [ -n "$PWD" ]; then PWD=`pwd`; fi
  102.  
  103. case "${progname}" in
  104. /*) ;;
  105. */*) ;;
  106. *)
  107.         PATH=$PATH:${PWD=`pwd`} ; export PATH
  108.         ;;
  109. esac
  110.  
  111. # Loop over all args
  112.  
  113. while :
  114. do
  115.  
  116. # Break out if there are no more args
  117.     case $# in
  118.     0)
  119.         break
  120.         ;;
  121.     esac
  122.  
  123. # Get the first arg, and shuffle
  124.     option=$1
  125.     shift
  126.  
  127. # Make all options have two hyphens
  128.     orig_option=$option    # Save original for error messages
  129.     case $option in
  130.     --*) ;;
  131.     -*) option=-$option ;;
  132.     esac
  133.         
  134. # Split out the argument for options that take them
  135.     case $option in
  136.     --*=*)
  137.         optarg=`echo $option | sed -e 's/^[^=]*=//'`
  138.         ;;
  139. # These options have mandatory values.  Since we didn't find an = sign,
  140. # the value must be in the next argument
  141.     --b* | --cache* | --ex* | --ho* | --pre* | --program-p* | --program-s* | --program-t* | --si* | --sr* | --ta* | --tm* | --x-*)
  142.         optarg=$1
  143.         shift
  144.         ;;
  145.     esac
  146.  
  147. # Now, process the options
  148.     case $option in
  149.  
  150.     --build* | --b*)
  151.         case "$build_alias" in
  152.         "") build_alias=$optarg ;;
  153.         *) echo '***' Can only configure for one build machine at a time.  1>&2
  154.            fatal=yes
  155.            ;;
  156.         esac
  157.         ;;
  158.     --cache*)
  159.         cache_file=$optarg
  160.         ;;
  161.     --disable-*)
  162.         enableopt=`echo ${option} | sed 's:^--disable-:enable_:;s:-:_:g'`
  163.         eval $enableopt=no
  164.         disableoptions="$disableoptions $option"
  165.         ;;
  166.     --enable-*)
  167.         case "$option" in
  168.         *=*)    ;;
  169.         *)    optarg=yes ;;
  170.         esac
  171.  
  172.         enableopt=`echo ${option} | sed 's:^--::;s:=.*$::;s:-:_:g'`
  173.         eval $enableopt="$optarg"
  174.         enableoptions="$enableoptions $option"
  175.         ;;
  176.     --exec-prefix* | --ex*)
  177.         exec_prefix=$optarg
  178.         exec_prefixoption="--exec-prefix=$optarg"
  179.         ;;
  180.     --gas | --g*)
  181.         gas=yes
  182.         ;;
  183.     --help | --he*)
  184.         fatal=yes
  185.         ;;
  186.     --host* | --ho*)
  187.         case $host_alias in
  188.         NOHOST) host_alias=$optarg ;;
  189.         *) echo '***' Can only configure for one host at a time.  1>&2
  190.            fatal=yes
  191.            ;;
  192.         esac
  193.         ;;
  194.     --nfp | --nf*)
  195.         floating_point=no
  196.         ;;
  197.     --norecursion | --no*)
  198.         norecursion=yes
  199.         ;;
  200.     --prefix* | --pre*)
  201.         prefix=$optarg
  202.         prefixoption="--prefix=$optarg"
  203.         ;;
  204.     --program-prefix* | --program-p*)
  205.         program_prefix=$optarg
  206.         program_prefixoption="--program-prefix=$optarg"
  207.         ;;
  208.     --program-suffix* | --program-s*)
  209.         program_suffix=$optarg
  210.         program_suffixoption="--program-suffix=$optarg"
  211.         ;;
  212.     --program-transform-name* | --program-t*)
  213.         # Double any backslashes or dollar signs in the argument
  214.         program_transform_name="${program_transform_name} -e `echo ${optarg} | sed -e 's/\\\\/\\\\\\\\/g' -e 's/\\\$/$$/g'`"
  215.         program_transform_nameoption="${program_transform_nameoption} --program-transform-name='$optarg'"
  216.         ;;
  217.     --rm)
  218.         removing=--rm
  219.         ;;
  220.     --silent | --sil* | --quiet | --q*)
  221.         redirect=">/dev/null"
  222.         verbose=--silent
  223.         ;;
  224.     --site* | --sit*)
  225.         site=$optarg
  226.         site_option="--site=$optarg"
  227.         ;;
  228.     --srcdir*/ | --sr*/)
  229.                 # Remove trailing slashes.  Otherwise, when the file name gets
  230.                 # bolted into an object file as debug info, it has two slashes
  231.                 # in it.  Ordinarily this is ok, but emacs takes double slash
  232.                 # to mean "forget the first part".
  233.         srcdir=`echo $optarg | sed -e 's:/$::'`
  234.         ;;
  235.     --srcdir* | --sr*)
  236.         srcdir=$optarg
  237.         ;;
  238.     --target* | --ta*)
  239.         case $target_alias in
  240.         NOTARGET) target_alias=$optarg ;;
  241.         *) echo '***' Can only configure for one target at a time.  1>&2
  242.            fatal=yes
  243.            ;;
  244.         esac
  245.         ;;
  246.     --tmpdir* | --tm*)
  247.         TMPDIR=$optarg
  248.         tmpdiroption="--tmpdir=$optarg"
  249.         ;;
  250.     --verbose | --v | --verb*)
  251.         redirect=
  252.         verbose=--verbose
  253.         ;;
  254.     --version | --V | --vers*)
  255.         echo "This is Cygnus Configure version" `echo ${version} | sed 's/[ $:]//g'`
  256.         exit 0
  257.         ;;
  258.     --with-*)
  259.         case "$option" in
  260.         *=*)    ;;
  261.         *)    optarg=yes ;;
  262.         esac
  263.  
  264.         withopt=`echo ${option} | sed 's:^--::;s:=.*$::;s:-:_:g'`
  265.         eval $withopt="$optarg"
  266.         withoptions="$withoptions $option"
  267.         ;;
  268.     --without-*)
  269.         withopt=`echo ${option} | sed 's:^--::;s:out::;s:-:_:g'`
  270.         eval $withopt=no
  271.         withoutoptions="$withoutoptions $option"
  272.         ;;
  273.     --x)    with_x=yes
  274.         withoptions="$withoptions --with-x"
  275.         ;;
  276.     --x-i* | --x-l*) other_options="$other_options $orig_option"
  277.         ;;
  278.     --*)
  279.         echo "configure: Unrecognized option: \"$orig_option\"; use --help for usage." >&2
  280.         exit 1
  281.         ;;
  282.     *)
  283.         case $undefs in
  284.         NOUNDEFS) undefs=$option ;;
  285.         *) echo '***' Can only configure for one host and one target at a time.  1>&2
  286.            fatal=yes
  287.            ;;
  288.         esac
  289.         ;;
  290.     esac
  291. done
  292.  
  293. # process host and target
  294.  
  295. # Do some error checking and defaulting for the host and target type.
  296. # The inputs are:
  297. #    configure --host=HOST --target=TARGET UNDEFS
  298. #
  299. # The rules are:
  300. # 1. You aren't allowed to specify --host, --target, and undefs at the
  301. #    same time.
  302. # 2. Host defaults to undefs.
  303. # 3. If undefs is not specified, then host defaults to the current host,
  304. #    as determined by config.guess.
  305. # 4. Target defaults to undefs.
  306. # 5. If undefs is not specified, then target defaults to host.
  307.  
  308. case "${fatal}" in
  309. "")
  310.     # Make sure that host, target & undefs aren't all specified at the
  311.     # same time.
  312.     case $host_alias---$target_alias---$undefs in
  313.     NOHOST---*---* | *---NOTARGET---* | *---*---NOUNDEFS)
  314.         ;;
  315.     *) echo '***' Can only configure for one host and one target at a time.  1>&2
  316.        fatal=yes
  317.        break 2
  318.         ;;
  319.     esac
  320.  
  321.     # Now, do defaulting for host.
  322.     case $host_alias in
  323.     NOHOST)
  324.         case $undefs in
  325.         NOUNDEFS)
  326.             # Neither --host option nor undefs were present.
  327.             # Call config.guess.
  328.             guesssys=`echo ${progname} | sed 's/configure$/config.guess/'`
  329.             if host_alias=`${guesssys}`
  330.             then
  331.                 # If the string we are going to use for
  332.                 # the target is a prefix of the string
  333.                 # we just guessed for the host, then
  334.                 # assume we are running native, and force
  335.                 # the same string for both target and host.
  336.                 case $target_alias in
  337.                 NOTARGET) ;;
  338.                 *)
  339.                     if expr $host_alias : $target_alias >/dev/null
  340.                     then
  341.                         host_alias=$target_alias
  342.                     fi
  343.                     ;;
  344.                 esac
  345.                 echo "Configuring for a ${host_alias} host." 1>&2
  346.                 arguments="--host=$host_alias $arguments"
  347.             else
  348.                 echo 'Config.guess failed to determine the host type.  You need to specify one.' 1>&2
  349.                 fatal=yes
  350.             fi
  351.             ;;
  352.         *)
  353.             host_alias=$undefs
  354.             ;;
  355.         esac
  356.     esac
  357.  
  358.     # Do defaulting for target.  If --target option isn't present, default
  359.     # to undefs.  If undefs isn't present, default to host.
  360.     case $target_alias in
  361.     NOTARGET)
  362.         case $undefs in
  363.         NOUNDEFS)
  364.             target_alias=$host_alias
  365.             ;;
  366.         *)
  367.             target_alias=$undefs
  368.             ;;
  369.         esac
  370.     esac
  371.     ;;
  372. *) ;;
  373. esac
  374.  
  375. if [ -n "${fatal}" -o "${host_alias}" = "help" ] ; then
  376.     exec 1>&2
  377.     echo Usage: configure [OPTIONS] [HOST]
  378.     echo
  379.     echo Options: [defaults in brackets]
  380.     echo ' --prefix=MYDIR         install into MYDIR [/usr/local]'
  381.     echo ' --exec-prefix=MYDIR     install host-dependent files into MYDIR [/usr/local]'
  382.     echo ' --help             print this message [normal config]'
  383.     echo ' --build=BUILD         configure for building on BUILD [BUILD=HOST]'
  384.     echo ' --host=HOST         configure for HOST [determined via config.guess]'
  385.     echo ' --norecursion         configure this directory only [recurse]'
  386.     echo ' --program-prefix=FOO     prepend FOO to installed program names [""]'
  387.     echo ' --program-suffix=FOO     append FOO to installed program names [""]'
  388.     echo ' --program-transform-name=P transform installed names by sed pattern P [""]'
  389.     echo ' --site=SITE         configure with site-specific makefile for SITE'
  390.     echo ' --srcdir=DIR         find the sources in DIR [. or ..]'
  391.     echo ' --target=TARGET     configure for TARGET [TARGET=HOST]'
  392.     echo ' --tmpdir=TMPDIR     create temporary files in TMPDIR [/tmp]'
  393.     echo ' --nfp             configure for software floating point [hard float]'
  394.     echo ' --with-FOO, --with-FOO=BAR package FOO is available (parameter BAR)'
  395.     echo ' --without-FOO         package FOO is NOT available'
  396.     echo ' --enable-FOO, --enable-FOO=BAR include feature FOO (parameter BAR)'
  397.     echo ' --disable-FOO         do not include feature FOO'
  398.     echo
  399.     echo 'Where HOST and TARGET are something like "sparc-sunos", "mips-sgi-irix5", etc.'
  400.     echo
  401.     if [ -r config.status ] ; then
  402.         cat config.status
  403.     fi
  404.  
  405.     exit 1
  406. fi
  407.  
  408. configsub=`echo ${progname} | sed 's/configure$/config.sub/'`
  409. moveifchange=`echo ${progname} | sed 's/configure$/move-if-change/'`
  410.  
  411. # this is a hack.  sun4 must always be a valid host alias or this will fail.
  412. if ${configsub} sun4 >/dev/null 2>&1 ; then
  413.         true
  414. else
  415.         echo '***' cannot find config.sub.  1>&2
  416.         exit 1
  417. fi
  418.  
  419. touch config.junk
  420. if ${moveifchange} config.junk config.trash ; then
  421.         true
  422. else
  423.         echo '***' cannot find move-if-change.  1>&2
  424.         exit 1
  425. fi
  426. rm -f config.junk config.trash
  427.  
  428. case "${srcdir}" in
  429. "")
  430.         if [ -r configure.in ] ; then
  431.                 srcdir=.
  432.         else
  433.                 if [ -r ${progname}.in ] ; then
  434.                         srcdir=`echo ${progname} | sed 's:/configure$::'`
  435.                 else
  436.                         echo '***' "Can't find configure.in.  Try using --srcdir=some_dir"  1>&2
  437.                         exit 1
  438.                 fi
  439.         fi
  440.         ;;
  441. *) ;;
  442. esac
  443.  
  444. ### warn about some conflicting configurations.
  445.  
  446. case "${srcdir}" in
  447. ".") ;;
  448. *)
  449.         if [ -f ${srcdir}/config.status ] ; then
  450.                 echo '***' Cannot configure here in \"${PWD=`pwd`}\" when \"${srcdir}\" is currently configured. 1>&2
  451.                 exit 1
  452.         fi
  453. esac
  454.  
  455. # default exec_prefix
  456. case "${exec_prefixoption}" in
  457. "") exec_prefix="\$(prefix)" ;;
  458. *) ;;
  459. esac
  460.  
  461. ### break up ${srcdir}/configure.in.
  462. case "`grep '^# per\-host:' ${srcdir}/configure.in`" in
  463. "")
  464.         echo '***' ${srcdir}/configure.in has no \"per-host:\" line. 1>&2
  465.     # Check for a directory that's been converted to use autoconf since
  466.     # it was last configured.
  467.     if grep AC_OUTPUT ${srcdir}/configure.in >/dev/null ; then
  468.       echo '***' Hmm, looks like this directory has been autoconfiscated. 1>&2
  469.       if [ -r ${srcdir}/configure ] ; then
  470.         echo '***' Running the local configure script. 1>&2
  471.         case "${cache_file}" in
  472.         "") cache_file_option= ;;
  473.         *)  cache_file_option="--cache-file=${cache_file}" ;;
  474.         esac
  475.         srcdiroption="--srcdir=${srcdir}"
  476.         case "${build_alias}" in
  477.         "") buildopt= ;;
  478.         *)  buildopt="--build=${build_alias}" ;;
  479.         esac
  480.         eval exec ${config_shell} ${srcdir}/configure ${verbose} \
  481.         ${buildopt} --host=${host_alias} --target=${target_alias} \
  482.         ${prefixoption} ${tmpdiroption} ${exec_prefixoption} \
  483.         ${srcdiroption} \
  484.         ${program_prefixoption} ${program_suffixoption} \
  485.         ${program_transform_nameoption} ${site_option} \
  486.         ${withoptions} ${withoutoptions} \
  487.         ${enableoptions} ${disableoptions} \
  488.         ${cache_file_option} ${removing} ${other_options} ${redirect}
  489.       else
  490.         echo '***' There is no configure script present though. 1>&2
  491.       fi
  492.     fi
  493.         exit 1
  494.         ;;
  495. *) ;;
  496. esac
  497.  
  498. case "`grep '^# per\-target:' ${srcdir}/configure.in`" in
  499. "")
  500.         echo '***' ${srcdir}/configure.in has no \"per-target:\" line. 1>&2
  501.         exit 1
  502.         ;;
  503. *) ;;
  504. esac
  505.  
  506. case "${TMPDIR}" in
  507. "") TMPDIR=/tmp ; export TMPDIR ;;
  508. *) ;;
  509. esac
  510.  
  511. # keep this filename short for &%*%$*# 14 char file names
  512. tmpfile=${TMPDIR}/cONf$$
  513. # Note that under many versions of sh a trap handler for 0 will *override* any
  514. # exit status you explicitly specify!  At this point, the only non-error exit
  515. # is at the end of the script; these actions are duplicated there, minus
  516. # the "exit 1".  Don't use "exit 0" anywhere after this without resetting the
  517. # trap handler, or you'll lose.
  518. trap "rm -f Makefile.tem ${tmpfile}.com ${tmpfile}.tgt ${tmpfile}.hst ${tmpfile}.pos; exit 1" 0 1 2 15
  519.  
  520. # split ${srcdir}/configure.in into common, per-host, per-target,
  521. # and post-target parts.  Post-target is optional.
  522. sed -e '/^# per\-host:/,$d' ${srcdir}/configure.in > ${tmpfile}.com
  523. sed -e '1,/^# per\-host:/d' -e '/^# per\-target:/,$d' ${srcdir}/configure.in > ${tmpfile}.hst
  524. if grep '^# post-target:' ${srcdir}/configure.in >/dev/null ; then
  525.   sed -e '1,/^# per\-target:/d' -e '/^# post\-target:/,$d' ${srcdir}/configure.in > ${tmpfile}.tgt
  526.   sed -e '1,/^# post\-target:/d' ${srcdir}/configure.in > ${tmpfile}.pos
  527. else
  528.   sed -e '1,/^# per\-target:/d' ${srcdir}/configure.in > ${tmpfile}.tgt
  529.   echo >${tmpfile}.pos
  530. fi
  531.  
  532. ### do common part of configure.in
  533.  
  534. . ${tmpfile}.com
  535.  
  536. # some sanity checks on configure.in
  537. case "${srctrigger}" in
  538. "")
  539.         echo '***' srctrigger not set in ${PWD=`pwd`}/configure.in.  1>&2
  540.         exit 1
  541.         ;;
  542. *) ;;
  543. esac
  544.  
  545. case "${build_alias}" in
  546. "")
  547.     if result=`${config_shell} ${configsub} ${host_alias}` ; then
  548.         build_cpu=`echo $result | sed 's/^\(.*\)-\(.*\)-\(.*\)$/\1/'`
  549.         build_vendor=`echo $result | sed 's/^\(.*\)-\(.*\)-\(.*\)$/\2/'`
  550.         build_os=`echo $result | sed 's/^\(.*\)-\(.*\)-\(.*\)$/\3/'`
  551.         build=${build_cpu}-${build_vendor}-${build_os}
  552.         build_alias=${host_alias}
  553.     fi
  554.     ;;
  555. *)
  556.     if result=`${config_shell} ${configsub} ${build_alias}` ; then
  557.         buildopt="--build=${build_alias}"
  558.         build_cpu=`echo $result | sed 's/^\(.*\)-\(.*\)-\(.*\)$/\1/'`
  559.         build_vendor=`echo $result | sed 's/^\(.*\)-\(.*\)-\(.*\)$/\2/'`
  560.         build_os=`echo $result | sed 's/^\(.*\)-\(.*\)-\(.*\)$/\3/'`
  561.         build=${build_cpu}-${build_vendor}-${build_os}
  562.     else
  563.         echo "Unrecognized build system name ${build_alias}." 1>&2
  564.         exit 1
  565.     fi
  566.     ;;
  567. esac
  568.  
  569. if result=`${config_shell} ${configsub} ${host_alias}` ; then
  570.     true
  571. else
  572.     echo "Unrecognized host system name ${host_alias}." 1>&2
  573.     exit 1
  574. fi
  575. host_cpu=`echo $result | sed 's/^\(.*\)-\(.*\)-\(.*\)$/\1/'`
  576. host_vendor=`echo $result | sed 's/^\(.*\)-\(.*\)-\(.*\)$/\2/'`
  577. host_os=`echo $result | sed 's/^\(.*\)-\(.*\)-\(.*\)$/\3/'`
  578. host=${host_cpu}-${host_vendor}-${host_os}
  579.  
  580. . ${tmpfile}.hst
  581.  
  582. if result=`${config_shell} ${configsub} ${target_alias}` ; then
  583.     true
  584. else
  585.     echo "Unrecognized target system name ${target_alias}." 1>&2
  586.     exit 1
  587. fi
  588. target_cpu=`echo $result | sed 's/^\(.*\)-\(.*\)-\(.*\)$/\1/'`
  589. target_vendor=`echo $result | sed 's/^\(.*\)-\(.*\)-\(.*\)$/\2/'`
  590. target_os=`echo $result | sed 's/^\(.*\)-\(.*\)-\(.*\)$/\3/'`
  591. target=${target_cpu}-${target_vendor}-${target_os}
  592.  
  593. . ${tmpfile}.tgt
  594.  
  595. # Find the source files, if location was not specified.
  596. case "${srcdir}" in
  597. "")
  598.         srcdirdefaulted=1
  599.         srcdir=.
  600.         if [ ! -r ${srctrigger} ] ; then
  601.                 srcdir=..
  602.         fi
  603.         ;;
  604. *) ;;
  605. esac
  606.  
  607. if [ ! -r ${srcdir}/${srctrigger} ] ; then
  608.         case "${srcdirdefaulted}" in
  609.         "") echo '***' "${progname}: Can't find ${srcname} sources in ${PWD=`pwd`}/${srcdir}" 1>&2 ;;
  610.         *)  echo '***' "${progname}: Can't find ${srcname} sources in ${PWD=`pwd`}/. or ${PWD=`pwd`}/.." 1>&2 ;;
  611.         esac
  612.  
  613.         echo '***' \(At least ${srctrigger} is missing.\) 1>&2
  614.         exit 1
  615. fi
  616.  
  617. # Some systems (e.g., one of the i386-aix systems the gas testers are
  618. # using) don't handle "\$" correctly, so don't use it here.
  619. tooldir='$(exec_prefix)'/${target_alias}
  620.  
  621. if [ "${host_alias}" != "${target_alias}" ] ; then
  622.     if [ "${program_prefixoption}" = "" ] ; then
  623.         if [ "${program_suffixoption}" = "" ] ; then 
  624.             if [ "${program_transform_nameoption}" = "" ] ; then
  625.                 program_prefix=${target_alias}- ;
  626.             fi
  627.         fi
  628.     fi
  629. fi
  630.  
  631. # Merge program_prefix and program_suffix onto program_transform_name.
  632. # (program_suffix used to use $, but it's hard to preserve $ through both
  633. # make and sh.)
  634. if [ "${program_suffix}" != "" ] ; then
  635.     program_transform_name="-e s,\\\\(.*\\\\),\\\\1${program_suffix}, ${program_transform_name}"
  636. fi
  637.  
  638. if [ "${program_prefix}" != "" ] ; then
  639.     program_transform_name="-e s,^,${program_prefix}, ${program_transform_name}"
  640. fi
  641.  
  642. # If CC and CXX are not set in the environment, and the Makefile
  643. # exists, try to extract them from it.  This is to handle running
  644. # ./config.status by hand.
  645. if [ -z "${CC}" -a -r Makefile ]; then
  646.   sed -n -e ':loop
  647. /\\$/ N
  648. /\\$/ b loop
  649. s/\\\n//g
  650. /^CC[     ]*=/ s/CC[     ]*=[     ]*\(.*\)/\1/p' < Makefile > Makefile.cc
  651.   CC=`tail -1 Makefile.cc`
  652.   rm -f Makefile.cc
  653. fi
  654.  
  655. if [ -z "${CXX}" -a -r Makefile ]; then
  656.   sed -n -e ':loop
  657. /\\$/ N
  658. /\\$/ b loop
  659. s/\\\n//g
  660. /^CXX[     ]*=/ s/CXX[     ]*=[     ]*\(.*\)/\1/p' < Makefile > Makefile.cc
  661.   CXX=`tail -1 Makefile.cc`
  662.   rm -f Makefile.cc
  663. fi
  664.  
  665. if [ "${build}" != "${host}" ]; then
  666.   # If we are doing a Canadian Cross, in which the host and build systems
  667.   # are not the same, we set reasonable default values for the tools.
  668.  
  669.   tools="AR AR_FOR_TARGET AS AS_FOR_TARGET BISON CC_FOR_BUILD"
  670.   tools="${tools} CC_FOR_TARGET CXX_FOR_TARGET HOST_PREFIX"
  671.   tools="${tools} HOST_PREFIX_1 LEX MAKEINFO NM NM_FOR_TARGET"
  672.   tools="${tools} RANLIB RANLIB_FOR_TARGET"
  673.  
  674.   for var in ${tools}; do
  675.     if [ -z "`eval 'echo $'"${var}"`" -a -r Makefile ]; then
  676.       sed -n -e ':loop
  677. /\\$/ N
  678. /\\$/ b loop
  679. s/\\\n//g
  680. /^'"${var}"'[     ]*=/ s/'"${var}"'[     ]*=[     ]*\(.*\)/\1/p' \
  681.     < Makefile > Makefile.v
  682.       t=`tail -1 Makefile.v`
  683.       if [ -n "${t}" ]; then
  684.     eval "${var}='${t}'"
  685.       fi
  686.       rm -f Makefile.v
  687.     fi
  688.   done
  689.  
  690.   AR=${AR-${host_alias}-ar}
  691.   AR_FOR_TARGET=${AR_FOR_TARGET-${target_alias}-ar}
  692.   AS=${AS-${host_alias}-as}
  693.   AS_FOR_TARGET=${AS_FOR_TARGET-${target_alias}-as}
  694.   CC=${CC-${host_alias}-gcc}
  695.   CXX=${CXX-${host_alias}-gcc}
  696.   CC_FOR_BUILD=${CC_FOR_BUILD-gcc}
  697.   CC_FOR_TARGET=${CC_FOR_TARGET-${target_alias}-gcc}
  698.   CXX_FOR_TARGET=${CXX_FOR_TARGET-${target_alias}-gcc}
  699.   HOST_PREFIX=${build_alias}-
  700.   HOST_PREFIX_1=${build_alias}-
  701.   MAKEINFO=${MAKEINFO-makeinfo}
  702.   NM=${NM-${host_alias}-nm}
  703.   NM_FOR_TARGET=${NM_FOR_TARGET-${target_alias}-nm}
  704.   RANLIB=${RANLIB-${host_alias}-ranlib}
  705.   RANLIB_FOR_TARGET=${RANLIB_FOR_TARGET-${target_alias}-ranlib}
  706.  
  707.   if [ -z "${BISON}" ]; then
  708.     IFS="${IFS=     }"; save_ifs="$IFS"; IFS="${IFS}:"
  709.     for dir in $PATH; do
  710.       test -z "$dir" && dir=.
  711.       if test -f $dir/byacc; then
  712.     BISON=byacc
  713.     break
  714.       fi
  715.       if test -f $dir/bison; then
  716.     BISON=bison
  717.     break
  718.       fi
  719.       if test -f $dir/yacc; then
  720.     BISON=yacc
  721.     break
  722.       fi
  723.     done
  724.     IFS="$save_ifs"
  725.     BISON=${BISON-bison}
  726.   fi
  727.  
  728.   if [ -z "${LEX}" ]; then
  729.     IFS="${IFS=     }"; save_ifs="$IFS"; IFS="${IFS}:"
  730.     for dir in $PATH; do
  731.       test -z "$dir" && dir=.
  732.       if test -f $dir/flex; then
  733.     LEX=flex
  734.     break
  735.       fi
  736.       if test -f $dir/lex; then
  737.     LEX=lex
  738.     break
  739.       fi
  740.     done
  741.     IFS="$save_ifs"
  742.     LEX=${LEX-flex}
  743.   fi
  744.  
  745.   # Export variables which autoconf might try to set.
  746.   export AS
  747.   export AR
  748.   export CC_FOR_BUILD
  749.   export NM
  750.   export RANLIB
  751. else
  752.   # If CC is still not set, try to get gcc.
  753.   if [ -z "${CC}" ]; then
  754.     IFS="${IFS=     }"; save_ifs="$IFS"; IFS="${IFS}:"
  755.     for dir in $PATH; do
  756.       test -z "$dir" && dir=.
  757.       if test -f $dir/gcc; then
  758.     CC="gcc -O2"
  759.     break
  760.       fi
  761.     done
  762.     IFS="$save_ifs"
  763.     CC=${CC-cc}
  764.   fi
  765.  
  766.   CXX=${CXX-"gcc"}
  767. fi
  768.  
  769. export CC
  770. export CXX
  771.  
  772. for subdir in . ${subdirs} ; do
  773.  
  774.     # ${subdir} is relative path from . to the directory we're currently
  775.     # configuring.
  776.     # ${invsubdir} is inverse of ${subdir), *with* trailing /, if needed.
  777.     invsubdir=`echo ${subdir}/ | sed -e 's|\./||g' -e 's|[^/]*/|../|g'`
  778.  
  779.     ### figure out what to do with srcdir
  780.     case "${srcdir}" in
  781.         ".")  # no -srcdir option.  We're building in place.
  782.                 makesrcdir=. ;;
  783.         /*) # absolute path
  784.                 makesrcdir=`echo ${srcdir}/${subdir} | sed -e 's|/\.$||'`
  785.                 ;;
  786.         *) # otherwise relative
  787.                 case "${subdir}" in
  788.                 .) makesrcdir=${srcdir} ;;
  789.                 *) makesrcdir=${invsubdir}${srcdir}/${subdir} ;;
  790.                 esac
  791.                 ;;
  792.     esac
  793.  
  794.     if [ "${subdir}/" != "./" ] ; then
  795.         Makefile=${subdir}/Makefile
  796.     fi
  797.  
  798.     if [ ! -d ${subdir} ] ; then
  799.         if mkdir ${subdir} ; then
  800.                 true
  801.         else
  802.                 echo '***' "${progname}: could not make ${PWD=`pwd`}/${subdir}" 1>&2
  803.                 exit 1
  804.         fi
  805.     fi
  806.  
  807.     case "${removing}" in
  808.     "")
  809.         case "${subdir}" in
  810.         .) ;;
  811.         *) eval echo Building in ${subdir} ${redirect} ;;
  812.         esac
  813.  
  814.         # FIXME Should this be done recursively ??? (Useful for e.g. gdbtest)
  815.         # Set up the list of links to be made.
  816.         # ${links} is the list of link names, and ${files} is the list of names to link to.
  817.  
  818.         # Make the links.
  819.         configlinks="${links}"
  820.         if [ -r ${subdir}/config.status ] ; then
  821.                 mv -f ${subdir}/config.status ${subdir}/config.back
  822.         fi
  823.         while [ -n "${files}" ] ; do
  824.                 # set file to car of files, files to cdr of files
  825.                 set ${files}; file=$1; shift; files=$*
  826.                 set ${links}; link=$1; shift; links=$*
  827.  
  828.                 if [ ! -r ${srcdir}/${file} ] ; then
  829.                         echo '***' "${progname}: cannot create a link \"${link}\"," 1>&2
  830.                         echo '***' "since the file \"${srcdir}/${file}\" does not exist." 1>&2
  831.                         exit 1
  832.                 fi
  833.  
  834.                 ${remove} -f ${link}
  835.         # Make a symlink if possible, otherwise try a hard link
  836.         if ${symbolic_link} ${srcdir}/${file} ${link} >/dev/null 2>&1 ; then
  837.             true
  838.         else
  839.             # We need to re-remove the file because Lynx leaves a 
  840.             # very strange directory there when it fails an NFS symlink.
  841.             ${remove} -r -f ${link}
  842.             ${hard_link} ${srcdir}/${file} ${link}
  843.         fi
  844.                 if [ ! -r ${link} ] ; then
  845.                         echo '***' "${progname}: unable to link \"${link}\" to \"${srcdir}/${file}\"." 1>&2
  846.                         exit 1
  847.                 fi
  848.  
  849.                 echo "Linked \"${link}\" to \"${srcdir}/${file}\"."
  850.         done
  851.  
  852.         # Create a .gdbinit file which runs the one in srcdir
  853.         # and tells GDB to look there for source files.
  854.  
  855.         if [ -r ${srcdir}/${subdir}/.gdbinit ] ; then
  856.                 case ${srcdir} in
  857.                 .) ;;
  858.                 *) cat > ${subdir}/.gdbinit <<EOF
  859. # ${NO_EDIT}
  860. dir ${makesrcdir}
  861. dir .
  862. source ${makesrcdir}/.gdbinit
  863. EOF
  864.                         ;;
  865.                 esac
  866.         fi
  867.  
  868.         # Install a makefile, and make it set VPATH
  869.         # if necessary so that the sources are found.
  870.         # Also change its value of srcdir.
  871.         # NOTE: Makefile generation constitutes the majority of the time in configure.  Hence, this section has
  872.         # been somewhat optimized and is perhaps a bit twisty.
  873.  
  874.         # code is order so as to try to sed the smallest input files we know.
  875.  
  876.         # the four makefile fragments MUST end up in the resulting Makefile in this order: 
  877.         # package, target, host, and site.  so do these separately because I don't trust the
  878.         #  order of sed -e expressions.
  879.  
  880.         if [ -f ${srcdir}/${subdir}/${Makefile_in} ] ; then
  881.  
  882.             # Conditionalize for this site from "Makefile.in" (or whatever it's called) into Makefile.tem
  883.             rm -f ${subdir}/Makefile.tem
  884.               case "${site}" in
  885.               "") cp ${srcdir}/${subdir}/${Makefile_in} ${subdir}/Makefile.tem ;;
  886.               *)
  887.                       site_makefile_frag=${srcdir}/config/ms-${site}
  888.  
  889.                       if [ -f ${site_makefile_frag} ] ; then
  890.                               sed -e "/^####/  r ${site_makefile_frag}" ${srcdir}/${subdir}/${Makefile_in} \
  891.                                       > ${subdir}/Makefile.tem
  892.                       else
  893.                               cp ${srcdir}/${subdir}/${Makefile_in} ${subdir}/Makefile.tem
  894.                               site_makefile_frag=
  895.                       fi
  896.                       ;;
  897.             esac
  898.             # working copy now in ${subdir}/Makefile.tem
  899.  
  900.             # Conditionalize the makefile for this host.
  901.             rm -f ${Makefile}
  902.             case "${host_makefile_frag}" in
  903.               "") mv ${subdir}/Makefile.tem ${Makefile} ;;
  904.               *)
  905.                       if [ ! -f ${host_makefile_frag} ] ; then
  906.                               host_makefile_frag=${srcdir}/${host_makefile_frag}
  907.                       fi
  908.                       if [ -f ${host_makefile_frag} ] ; then
  909.                               sed -e "/^####/  r ${host_makefile_frag}" ${subdir}/Makefile.tem > ${Makefile}
  910.                       else
  911.                               echo '***' Expected host makefile fragment \"${host_makefile_frag}\" 1>&2
  912.                               echo '***' is missing in ${PWD=`pwd`}. 1>&2
  913.                               mv ${subdir}/Makefile.tem ${Makefile}
  914.                       fi
  915.             esac
  916.             # working copy now in ${Makefile}
  917.  
  918.             # Conditionalize the makefile for this target.
  919.             rm -f ${subdir}/Makefile.tem
  920.             case "${target_makefile_frag}" in
  921.               "") mv ${Makefile} ${subdir}/Makefile.tem ;;
  922.               *)
  923.                       if [ ! -f ${target_makefile_frag} ] ; then
  924.                               target_makefile_frag=${srcdir}/${target_makefile_frag}
  925.                       fi
  926.                       if [ -f ${target_makefile_frag} ] ; then
  927.                               sed -e "/^####/  r ${target_makefile_frag}" ${Makefile} > ${subdir}/Makefile.tem
  928.                       else
  929.                               mv ${Makefile} ${subdir}/Makefile.tem
  930.                               target_makefile_frag=
  931.                       fi
  932.                       ;;
  933.             esac
  934.             # real copy now in ${subdir}/Makefile.tem
  935.  
  936.             # Conditionalize the makefile for this package.
  937.             rm -f ${Makefile}
  938.             case "${package_makefile_frag}" in
  939.               "") mv ${subdir}/Makefile.tem ${Makefile} ;;
  940.               *)
  941.                       if [ ! -f ${package_makefile_frag} ] ; then
  942.                               package_makefile_frag=${srcdir}/${package_makefile_frag}
  943.                       fi
  944.                       if [ -f ${package_makefile_frag} ] ; then
  945.                               sed -e "/^####/  r ${package_makefile_frag}" ${subdir}/Makefile.tem > ${Makefile}
  946.                   rm -f ${subdir}/Makefile.tem
  947.                       else
  948.                               echo '***' Expected package makefile fragment \"${package_makefile_frag}\" 1>&2
  949.                               echo '***' is missing in ${PWD=`pwd`}. 1>&2
  950.                               mv ${subdir}/Makefile.tem ${Makefile}
  951.                       fi
  952.             esac
  953.             # working copy now in ${Makefile}
  954.  
  955.             mv ${Makefile} ${subdir}/Makefile.tem
  956.  
  957.             # real copy now in ${subdir}/Makefile.tem
  958.  
  959.             # prepend warning about editting, and a bunch of variables.
  960.             rm -f ${Makefile}
  961.             cat > ${Makefile} <<EOF
  962. # ${NO_EDIT}
  963. VPATH = ${makesrcdir}
  964. links = ${configlinks}
  965. host_alias = ${host_alias}
  966. host_cpu = ${host_cpu}
  967. host_vendor = ${host_vendor}
  968. host_os = ${host_os}
  969. host_canonical = ${host_cpu}-${host_vendor}-${host_os}
  970. target_alias = ${target_alias}
  971. target_cpu = ${target_cpu}
  972. target_vendor = ${target_vendor}
  973. target_os = ${target_os}
  974. target_canonical = ${target_cpu}-${target_vendor}-${target_os}
  975. EOF
  976.         case "${build}" in
  977.           "") ;;
  978.           *)  cat >> ${Makefile} << EOF
  979. build_alias = ${build_alias}
  980. build_cpu = ${build_cpu}
  981. build_vendor = ${build_vendor}
  982. build_os = ${build_os}
  983. build_canonical = ${build_cpu}-${build_vendor}-${build_os}
  984. EOF
  985.         esac
  986.  
  987.             case "${package_makefile_frag}" in
  988.               "") ;;
  989.               /*) echo package_makefile_frag = ${package_makefile_frag} >>${Makefile} ;;
  990.               *)  echo package_makefile_frag = ${invsubdir}${package_makefile_frag} >>${Makefile} ;;
  991.             esac
  992.  
  993.             case "${target_makefile_frag}" in
  994.               "") ;;
  995.               /*) echo target_makefile_frag = ${target_makefile_frag} >>${Makefile} ;;
  996.               *)  echo target_makefile_frag = ${invsubdir}${target_makefile_frag} >>${Makefile} ;;
  997.             esac
  998.  
  999.             case "${host_makefile_frag}" in
  1000.               "") ;;
  1001.               /*) echo host_makefile_frag = ${host_makefile_frag} >>${Makefile} ;;
  1002.               *)  echo host_makefile_frag = ${invsubdir}${host_makefile_frag} >>${Makefile} ;;
  1003.             esac
  1004.  
  1005.             if [ "${site_makefile_frag}" != "" ] ; then
  1006.                 echo site_makefile_frag = ${invsubdir}${site_makefile_frag} >>${Makefile}
  1007.             fi 
  1008.  
  1009.             # reset prefix, exec_prefix, srcdir, SUBDIRS, NONSUBDIRS,
  1010.             # remove any form feeds.
  1011.             if [ -z "${subdirs}" ]; then
  1012.                 rm -f ${subdir}/Makefile.tem2
  1013.                 sed -e "s:^SUBDIRS[     ]*=.*$:SUBDIRS = ${configdirs}:" \
  1014.                     -e "s:^NONSUBDIRS[     ]*=.*$:NONSUBDIRS = ${noconfigdirs}:" \
  1015.                     ${subdir}/Makefile.tem > ${subdir}/Makefile.tem2
  1016.                 rm -f ${subdir}/Makefile.tem
  1017.                 mv ${subdir}/Makefile.tem2 ${subdir}/Makefile.tem
  1018.             fi
  1019.             sed -e "s:^prefix[     ]*=.*$:prefix = ${prefix}:" \
  1020.                     -e "s:^exec_prefix[     ]*=.*$:exec_prefix = ${exec_prefix}:" \
  1021.             -e "/^CC[     ]*=/{
  1022.             :loop1
  1023.             /\\\\$/ N
  1024.             /\\\\$/ b loop1
  1025.             s/\\\\\\n//g
  1026.             s%^CC[     ]*=.*$%CC = ${CC}%
  1027.             }" \
  1028.             -e "/^CXX[     ]*=/{
  1029.             :loop2
  1030.             /\\\\$/ N
  1031.             /\\\\$/ b loop2
  1032.             s/\\\\\\n//g
  1033.             s%^CXX[     ]*=.*$%CXX = ${CXX}%
  1034.             }" \
  1035.             -e "s:^SHELL[     ]*=.*$:SHELL = ${config_shell}:" \
  1036.                     -e "s:^srcdir[     ]*=.*$:srcdir = ${makesrcdir}:" \
  1037.                     -e "s/ //" \
  1038.                     -e "s:^program_prefix[     ]*=.*$:program_prefix = ${program_prefix}:" \
  1039.                     -e "s:^program_suffix[     ]*=.*$:program_suffix = ${program_suffix}:" \
  1040.                     -e "s:^program_transform_name[     ]*=.*$:program_transform_name = ${program_transform_name}:" \
  1041.                     -e "s:^tooldir[     ]*=.*$:tooldir = ${tooldir}:" \
  1042.                     ${subdir}/Makefile.tem >> ${Makefile}
  1043.  
  1044.         # If this is a Canadian Cross, preset the values of many more
  1045.         # tools.
  1046.         if [ "${build}" != "${host}" ]; then
  1047.         for var in ${tools}; do
  1048.             val=`eval 'echo $'"${var}"`
  1049.             sed -e "/^${var}[     ]*=/{
  1050.                :loop1
  1051.                /\\\\$/ N
  1052.                /\\\\$/ b loop1
  1053.                s/\\\\\\n//g
  1054.                s%^${var}[     ]*=.*$%${var} = ${val}%
  1055.                }" ${Makefile} > ${Makefile}.tem
  1056.             mv -f ${Makefile}.tem ${Makefile}
  1057.         done
  1058.         fi
  1059.  
  1060.             # final copy now in ${Makefile}
  1061.  
  1062.         else
  1063.            echo "No Makefile.in found in ${srcdir}/${subdir}, unable to configure" 1>&2
  1064.         fi
  1065.  
  1066.         rm -f ${subdir}/Makefile.tem
  1067.  
  1068.         case "${host_makefile_frag}" in
  1069.         "") using= ;;
  1070.         *) using="and \"${host_makefile_frag}\"" ;;
  1071.         esac
  1072.  
  1073.         case "${target_makefile_frag}" in
  1074.         "") ;;
  1075.         *) using="${using} and \"${target_makefile_frag}\"" ;;
  1076.         esac
  1077.  
  1078.         case "${site_makefile_frag}" in
  1079.         "") ;;
  1080.         *) using="${using} and \"${site_makefile_frag}\"" ;;
  1081.         esac
  1082.  
  1083.         newusing=`echo "${using}" | sed 's/and/using/'`
  1084.         using=${newusing}
  1085.         echo "Created \"${Makefile}\" in" ${PWD=`pwd`} ${using}
  1086.  
  1087.         . ${tmpfile}.pos
  1088.  
  1089.         # describe the chosen configuration in config.status.
  1090.         # Make that file a shellscript which will reestablish
  1091.         # the same configuration.  Used in Makefiles to rebuild
  1092.         # Makefiles.
  1093.  
  1094.         case "${norecursion}" in
  1095.         "") arguments="${arguments} --norecursion" ;;
  1096.         *) ;;
  1097.         esac
  1098.  
  1099.         if [ ${subdir} = . ] ; then
  1100.             echo "#!/bin/sh
  1101. # ${NO_EDIT}
  1102. # This directory was configured as follows:
  1103. ${progname}" ${arguments}  "
  1104. # ${using}" > ${subdir}/config.new
  1105.         else
  1106.             echo "#!/bin/sh
  1107. # ${NO_EDIT}
  1108. # This directory was configured as follows:
  1109. cd ${invsubdir}
  1110. ${progname}" ${arguments}  "
  1111. # ${using}" > ${subdir}/config.new
  1112.         fi
  1113.         chmod a+x ${subdir}/config.new
  1114.         if [ -r ${subdir}/config.back ] ; then
  1115.                 mv -f ${subdir}/config.back ${subdir}/config.status
  1116.         fi
  1117.         ${moveifchange} ${subdir}/config.new ${subdir}/config.status
  1118.         ;;
  1119.  
  1120.     *)  rm -f ${Makefile} ${subdir}/config.status ${links} ;;
  1121.     esac
  1122. done
  1123.  
  1124. # If there are subdirectories, then recur. 
  1125. if [ -z "${norecursion}" -a -n "${configdirs}" ] ; then 
  1126.         for configdir in ${configdirs} ; do
  1127.  
  1128.                 if [ -d ${srcdir}/${configdir} ] ; then
  1129.                         eval echo Configuring ${configdir}... ${redirect}
  1130.                         case "${srcdir}" in
  1131.                         ".") ;;
  1132.                         *)
  1133.                                 if [ ! -d ./${configdir} ] ; then
  1134.                                         if mkdir ./${configdir} ; then
  1135.                                                 true
  1136.                                         else
  1137.                                                 echo '***' "${progname}: could not make ${PWD=`pwd`}/${configdir}" 1>&2
  1138.                                                 exit 1
  1139.                                         fi
  1140.                                 fi
  1141.                                 ;;
  1142.                         esac
  1143.  
  1144.                         POPDIR=${PWD=`pwd`}
  1145.                         cd ${configdir} 
  1146.  
  1147. ### figure out what to do with srcdir
  1148.                         case "${srcdir}" in
  1149.                         ".") newsrcdir=${srcdir} ;; # no -srcdir option.  We're building in place.
  1150.                         /*) # absolute path
  1151.                                 newsrcdir=${srcdir}/${configdir}
  1152.                                 srcdiroption="--srcdir=${newsrcdir}"
  1153.                                 ;;
  1154.                         *) # otherwise relative
  1155.                                 newsrcdir=../${srcdir}/${configdir}
  1156.                                 srcdiroption="--srcdir=${newsrcdir}"
  1157.                                 ;;
  1158.                         esac
  1159.  
  1160.             # Handle --cache-file=../XXX
  1161.             case "${cache_file}" in
  1162.             "") # empty
  1163.                 ;;
  1164.             /*) # absolute path
  1165.                 cache_file_option="--cache-file=${cache_file}"
  1166.                 ;;
  1167.             *) # relative path
  1168.                 cache_file_option="--cache-file=../${cache_file}"
  1169.                 ;;
  1170.             esac
  1171.  
  1172. ### check for guested configure, otherwise fix possibly relative progname
  1173.                         if [ -f ${newsrcdir}/configure ] ; then
  1174.                                 recprog=${newsrcdir}/configure
  1175.                         elif [ -f ${newsrcdir}/configure.in ] ; then
  1176.                                 case "${progname}" in
  1177.                                 /*)     recprog=${progname} ;;
  1178.                                 *)      recprog=../${progname} ;;
  1179.                                 esac
  1180.             else
  1181.                 eval echo No configuration information in ${configdir} ${redirect}
  1182.                 recprog=
  1183.                         fi
  1184.  
  1185. ### The recursion line is here.
  1186.             if [ ! -z "${recprog}" ] ; then
  1187.                             if eval ${config_shell} ${recprog} ${verbose} ${buildopt} --host=${host_alias} --target=${target_alias} \
  1188.                                     ${prefixoption} ${tmpdiroption} ${exec_prefixoption} \
  1189.                                     ${srcdiroption} ${program_prefixoption} ${program_suffixoption} ${program_transform_nameoption} ${site_option} ${withoptions} ${withoutoptions} ${enableoptions} ${disableoptions} ${cache_file_option} ${removing} ${other_options} ${redirect} ; then
  1190.                                     true
  1191.                             else
  1192.                     echo Configure in `pwd` failed, exiting. 1>&2
  1193.                                     exit 1
  1194.                             fi
  1195.             fi
  1196.  
  1197.                         cd ${POPDIR}
  1198.                 fi
  1199.         done
  1200. fi
  1201.  
  1202. # Perform the same cleanup as the trap handler, minus the "exit 1" of course,
  1203. # and reset the trap handler.
  1204. rm -f ${tmpfile}.com ${tmpfile}.tgt ${tmpfile}.hst ${tmpfile}.pos
  1205. trap 0
  1206.  
  1207. exit 0
  1208.  
  1209. #
  1210. # Local Variables:
  1211. # fill-column: 131
  1212. # End:
  1213. #
  1214.  
  1215. # end of configure
  1216.