3 ### WARNING: this file contains embedded tabs. Do not run untabify on this file.
6 # Copyright (C) 1988, 1990, 1991, 1992, 1993 Free Software Foundation, Inc.
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.
13 # This program is distributed in the hope that it will be useful,
14 # but WITHOUT ANY WARRANTY; without even the implied warranty of
15 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 # GNU General Public License for more details.
18 # You should have received a copy of the GNU General Public License
19 # along with this program; if not, write to the Free Software
20 # Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */
22 # Please email any bugs, comments, and/or additions to this file to:
23 # configure@cygnus.com
25 # This file was written by K. Richard Pixley.
28 # Shell script to create proper links to machine-dependent files in
29 # preparation for compilation.
31 # If configure succeeds, it leaves its status in config.status.
32 # If configure fails after disturbing the status quo,
33 # config.status is removed.
36 export PATH || (echo "OOPS, this isn't sh. Desperation time. I will feed myself to sh."; sh $0 $argv; kill $$)
45 #symbolic_link="echo ln -s"
47 # clear some things potentially inherited from environment.
50 Makefile_in=Makefile.in
57 floating_point=default
63 package_makefile_frag=
70 program_transform_name=
71 program_transform_nameoption=
86 ### we might need to use some other shell than /bin/sh for running subshells
88 config_shell=${CONFIG_SHELL-/bin/sh}
90 NO_EDIT="This file was generated automatically by configure. Do not edit."
92 ## this is a little touchy and won't always work, but...
94 ## if the argv[0] starts with a slash then it is an absolute name that can (and
95 ## must) be used as is.
97 ## otherwise, if argv[0] has no slash in it, we can assume that it is on the
98 ## path. Since PATH might include "." we also add `pwd` to the end of PATH.
102 # if PWD already has a value, it is probably wrong.
103 if [ -n "$PWD" ]; then PWD=`pwd`; fi
105 case "${progname}" in
109 PATH=$PATH:${PWD=`pwd`} ; export PATH
118 # Break out if there are no more args
125 # Get the first arg, and shuffle
129 # Make all options have two hyphens
130 orig_option=$option # Save original for error messages
133 -*) option=-$option ;;
136 # Split out the argument for options that take them
139 optarg=`echo $option | sed -e 's/^[^=]*=//'`
141 # These options have mandatory values. Since we didn't find an = sign,
142 # the value must be in the next argument
143 --b* | --e* | --ho* | --pre* | --program-p* | --program-s* | --program-t* | --si* | --sr* | --ta* | --tm*)
149 # Now, process the options
153 case "$build_alias" in
154 "") build_alias=$optarg ;;
155 *) echo '***' Can only configure for one build machine at a time. 1>&2
160 --exec-prefix* | --e*)
162 exec_prefixoption="--exec-prefix=$optarg"
172 NOHOST) host_alias=$optarg ;;
173 *) echo '***' Can only configure for one host at a time. 1>&2
181 --norecursion | --no*)
186 prefixoption="--prefix=$optarg"
188 --program-prefix* | --program-p*)
189 program_prefix=$optarg
190 program_prefixoption="--program-prefix=$optarg"
192 --program-suffix* | --program-s*)
193 program_suffix=$optarg
194 program_suffixoption="--program-suffix=$optarg"
196 --program-transform-name* | --program-t*)
197 # Double any backslashes or dollar signs in the argument
198 program_transform_name="${program_transform_name} -e `echo ${optarg} | sed -e 's/\\\\/\\\\\\\\/g' -e 's/\\\$/$$/g'`"
199 program_transform_nameoption="--program-transform-nameoption='$optarg'"
206 site_option="--site=$optarg"
209 # Remove trailing slashes. Otherwise, when the file name gets
210 # bolted into an object file as debug info, it has two slashes in
211 # it. Ordinarily this is ok, but emacs takes double slash to
212 # mean "forget the first part".
213 srcdir=`echo $optarg | sed -e 's:/$::'`
219 case $target_alias in
220 NOTARGET) target_alias=$optarg ;;
221 *) echo '***' Can only configure for one target at a time. 1>&2
228 tmpdiroption="--tmpdir=$optarg"
230 --verbose | --v | --verb*)
234 --version | --V | --vers*)
235 echo "This is Cygnus Configure version" `echo ${version} | sed 's/[ $:]//g'`
244 withopt=`echo ${option} | sed 's:^--::;s:=.*$::;s:-:_:g'`
245 eval $withopt="$optarg"
246 withoptions="$withoptions $option"
249 withopt=`echo ${option} | sed 's:^--::;s:out::;s:-:_:g'`
251 withoutoptions="$withoutoptions $option"
257 echo "Unrecognized option: \"$orig_option\"".
263 NOUNDEFS) undefs=$option ;;
264 *) echo '***' Can only configure for one host and one target at a time. 1>&2
272 # process host and target
274 # The following section does some error checking, and then does defaulting for
275 # the host and target. The inputs are host, which comes from the --host
276 # option, target, which comes from the --target options, and undefs, which is
277 # an argument that isn't an option (cuz it doesn't start with --). Ie:
278 # configure --host HOST --target TARGET --opt1 UNDEFS --opt2 --opt3 ...
280 # The first rule is that you aren't allowed to specify --host, --target and
281 # undefs at the same time. After that, we do defaulting. The host defaults to
283 # configure --target TARGET --opt1 HOST --opt2
285 # If there are no undefs, the host defaults to the current host (as determined
288 # Target defaults to undefs. If undefs wasn't specified, then it defaults to
293 # Make sure that host, target & undefs aren't all specified at the
295 case $host_alias---$target_alias---$undefs in
296 NOHOST---*---* | *---NOTARGET---* | *---*---NOUNDEFS)
298 *) echo '***' Can only configure for one host and one target at a time. 1>&2
304 # Now, do defaulting for host.
309 # Neither --host option nor undefs were present.
311 guesssys=`echo ${progname} | sed 's/configure$/config.guess/'`
312 if host_alias=`${guesssys}`
314 echo "Configuring for a ${host_alias} host." 1>&2
315 arguments="--host=$host_alias $arguments"
317 echo 'Config.guess failed to determine the host type. You need to specify one.' 1>&2
327 # Do defaulting for target. If --target option isn't present, default
328 # to undefs. If undefs isn't present, default to host.
329 case $target_alias in
333 target_alias=$host_alias
344 if [ -n "${fatal}" -o "${host_alias}" = "help" ] ; then
346 echo Usage: configure HOST
348 echo Options: [defaults in brackets]
349 echo ' --prefix=MYDIR configure for installation of host dependent files into MYDIR. ["/usr/local"]'
350 echo ' --exec-prefix=MYDIR configure for installation of host dependent files into MYDIR. ["/usr/local"]'
351 echo ' --help print this message. [normal config]'
352 echo ' --build=BUILD configure for building on BUILD. [BUILD=HOST]'
353 echo ' --host=HOST configure for HOST. [determined via config.guess]'
354 echo ' --norecursion configure this directory only. [recurse]'
355 echo ' --program-prefix=FOO install programs with FOO prepended to their names. [ "" ]'
356 echo ' --program-suffix=FOO install programs with FOO appended to their names. [ "" ]'
357 echo ' --program-transform-name=FOO install programs with names transformed by sed pattern FOO. [ "" ]'
358 echo ' --site=SITE configure with site specific makefile for SITE'
359 echo ' --srcdir=DIR find the sources in DIR. ["." or ".."]'
360 echo ' --target=TARGET configure for TARGET. [TARGET = HOST]'
361 echo ' --tmpdir=TMPDIR create temporary files in TMPDIR. [ TMPDIR = "/tmp" ]'
362 echo ' --nfp configure the compilers default to soft floating point. [hard float]'
363 echo ' --with-FOO, --with-FOO=BAR specify that FOO is available'
364 echo ' --without-FOO specify that FOO is NOT available'
366 echo 'Where HOST and TARGET are something like "vax", "sun3", "encore", etc.'
368 if [ -r config.status ] ; then
375 configsub=`echo ${progname} | sed 's/configure$/config.sub/'`
376 moveifchange=`echo ${progname} | sed 's/configure$/move-if-change/'`
378 # this is a hack. sun4 must always be a valid host alias or this will fail.
379 if ${configsub} sun4 >/dev/null 2>&1 ; then
382 echo '***' cannot find config.sub. 1>&2
387 if ${moveifchange} config.junk config.trash ; then
390 echo '***' cannot find move-if-change. 1>&2
393 rm -f config.junk config.trash
397 if [ -r configure.in ] ; then
400 if [ -r ${progname}.in ] ; then
401 srcdir=`echo ${progname} | sed 's:/configure$::'`
403 echo '***' "Can't find configure.in. Try using --srcdir=some_dir" 1>&2
411 ### warn about some conflicting configurations.
416 if [ -f ${srcdir}/config.status ] ; then
417 echo '***' Cannot configure here in \"${PWD=`pwd`}\" when \"${srcdir}\" is currently configured. 1>&2
422 # default exec_prefix
423 case "${exec_prefix}" in
424 "") exec_prefix="\$(prefix)" ;;
428 ### break up ${srcdir}/configure.in.
429 case "`grep '^# per\-host:' ${srcdir}/configure.in`" in
431 echo '***' ${srcdir}/configure.in has no \"per-host:\" line. 1>&2
437 case "`grep '^# per\-target:' ${srcdir}/configure.in`" in
439 echo '***' ${srcdir}/configure.in has no \"per-target:\" line. 1>&2
446 "") TMPDIR=/tmp ; export TMPDIR ;;
450 # keep this filename short for &%*%$*# 14 char file names
451 tmpfile=${TMPDIR}/cONf$$
452 trap "rm -f ${tmpfile}.com ${tmpfile}.tgt ${tmpfile}.hst ${tmpfile}.pos" 0
454 # split ${srcdir}/configure.in into common, per-host, per-target,
455 # and post-target parts. Post-target is optional.
456 sed -e '/^# per\-host:/,$d' ${srcdir}/configure.in > ${tmpfile}.com
457 sed -e '1,/^# per\-host:/d' -e '/^# per\-target:/,$d' ${srcdir}/configure.in > ${tmpfile}.hst
458 if grep '^# post-target:' ${srcdir}/configure.in >/dev/null ; then
459 sed -e '1,/^# per\-target:/d' -e '/^# post\-target:/,$d' ${srcdir}/configure.in > ${tmpfile}.tgt
460 sed -e '1,/^# post\-target:/d' ${srcdir}/configure.in > ${tmpfile}.pos
462 sed -e '1,/^# per\-target:/d' ${srcdir}/configure.in > ${tmpfile}.tgt
466 ### do common part of configure.in
470 # some sanity checks on configure.in
471 case "${srctrigger}" in
473 echo '***' srctrigger not set in ${PWD=`pwd`}/configure.in. 1>&2
479 case "${build_alias}" in
482 result=`${configsub} ${build_alias}`
483 buildopt="--build=${build_alias}"
484 build_cpu=`echo $result | sed 's/^\(.*\)-\(.*\)-\(.*\)$/\1/'`
485 build_vendor=`echo $result | sed 's/^\(.*\)-\(.*\)-\(.*\)$/\2/'`
486 build_os=`echo $result | sed 's/^\(.*\)-\(.*\)-\(.*\)$/\3/'`
487 build=${build_cpu}-${build_vendor}-${build_os}
491 result=`${configsub} ${host_alias}`
492 host_cpu=`echo $result | sed 's/^\(.*\)-\(.*\)-\(.*\)$/\1/'`
493 host_vendor=`echo $result | sed 's/^\(.*\)-\(.*\)-\(.*\)$/\2/'`
494 host_os=`echo $result | sed 's/^\(.*\)-\(.*\)-\(.*\)$/\3/'`
495 host=${host_cpu}-${host_vendor}-${host_os}
499 result=`${configsub} ${target_alias}`
500 target_cpu=`echo $result | sed 's/^\(.*\)-\(.*\)-\(.*\)$/\1/'`
501 target_vendor=`echo $result | sed 's/^\(.*\)-\(.*\)-\(.*\)$/\2/'`
502 target_os=`echo $result | sed 's/^\(.*\)-\(.*\)-\(.*\)$/\3/'`
503 target=${target_cpu}-${target_vendor}-${target_os}
507 # Find the source files, if location was not specified.
512 if [ ! -r ${srctrigger} ] ; then
519 if [ ! -r ${srcdir}/${srctrigger} ] ; then
520 case "${srcdirdefaulted}" in
521 "") echo '***' "${progname}: Can't find ${srcname} sources in ${PWD=`pwd`}/${srcdir}" 1>&2 ;;
522 *) echo '***' "${progname}: Can't find ${srcname} sources in ${PWD=`pwd`}/. or ${PWD=`pwd`}/.." 1>&2 ;;
525 echo '***' \(At least ${srctrigger} is missing.\) 1>&2
529 # Some systems (e.g., one of the i386-aix systems the gas testers are
530 # using) don't handle "\$" correctly, so don't use it here.
531 tooldir='$(exec_prefix)'/${target_alias}
533 if [ "${host_alias}" != "${target_alias}" ] ; then
534 if [ "${program_prefixoption}" = "" ] ; then
535 if [ "${program_suffixoption}" = "" ] ; then
536 if [ "${program_transform_nameoption}" = "" ] ; then
537 program_prefix=${target_alias}- ;
543 # Merge program_prefix and program_suffix onto program_transform_name
544 # Use a double $ so that make ignores it
545 if [ "${program_suffix}" != "" ] ; then
546 program_transform_name="-e s,\$\$,${program_suffix}, ${program_transform_name}"
549 if [ "${program_prefix}" != "" ] ; then
550 program_transform_name="-e s,^,${program_prefix}, ${program_transform_name}"
553 for subdir in . ${subdirs} ; do
555 # ${subdir} is relative path from . to the directory we're currently
557 # ${invsubdir} is inverse of ${subdir), *with* trailing /, if needed.
558 invsubdir=`echo ${subdir}/ | sed -e 's|\./||g' -e 's|[^/]*/|../|g'`
560 ### figure out what to do with srcdir
562 ".") # no -srcdir option. We're building in place.
565 makesrcdir=`echo ${srcdir}/${subdir} | sed -e 's|/\.$||'`
567 *) # otherwise relative
569 .) makesrcdir=${srcdir} ;;
570 *) makesrcdir=${invsubdir}${srcdir}/${subdir} ;;
575 if [ "${subdir}/" != "./" ] ; then
576 Makefile=${subdir}/Makefile
579 if [ ! -d ${subdir} ] ; then
580 if mkdir ${subdir} ; then
583 echo '***' "${progname}: could not make ${PWD=`pwd`}/${subdir}" 1>&2
588 case "${removing}" in
592 *) eval echo Building in ${subdir} ${redirect} ;;
595 # FIXME Should this be done recursively ??? (Useful for e.g. gdbtest)
596 # Set up the list of links to be made.
597 # ${links} is the list of link names, and ${files} is the list of names to link to.
600 configlinks="${links}"
601 if [ -r ${subdir}/config.status ] ; then
602 mv -f ${subdir}/config.status ${subdir}/config.back
604 while [ -n "${files}" ] ; do
605 # set file to car of files, files to cdr of files
606 set ${files}; file=$1; shift; files=$*
607 set ${links}; link=$1; shift; links=$*
609 if [ ! -r ${srcdir}/${file} ] ; then
610 echo '***' "${progname}: cannot create a link \"${link}\"," 1>&2
611 echo '***' "since the file \"${srcdir}/${file}\" does not exist." 1>&2
616 # Make a symlink if possible, otherwise try a hard link
617 ${symbolic_link} ${srcdir}/${file} ${link} 2>/dev/null || ${hard_link} ${srcdir}/${file} ${link}
619 if [ ! -r ${link} ] ; then
620 echo '***' "${progname}: unable to link \"${link}\" to \"${srcdir}/${file}\"." 1>&2
624 echo "Linked \"${link}\" to \"${srcdir}/${file}\"."
627 # Create a .gdbinit file which runs the one in srcdir
628 # and tells GDB to look there for source files.
630 if [ -r ${srcdir}/${subdir}/.gdbinit ] ; then
633 *) cat > ${subdir}/.gdbinit <<EOF
637 source ${makesrcdir}/.gdbinit
643 # Install a makefile, and make it set VPATH
644 # if necessary so that the sources are found.
645 # Also change its value of srcdir.
646 # NOTE: Makefile generation constitutes the majority of the time in configure. Hence, this section has
647 # been somewhat optimized and is perhaps a bit twisty.
649 # code is order so as to try to sed the smallest input files we know.
651 # the four makefile fragments MUST end up in the resulting Makefile in this order:
652 # package, target, host, and site. so do these separately because I don't trust the
653 # order of sed -e expressions.
655 if [ -f ${srcdir}/${subdir}/${Makefile_in} ] ; then
657 # Conditionalize for this site from "Makefile.in" (or whatever it's called) into Makefile.tem
658 rm -f ${subdir}/Makefile.tem
660 "") cp ${srcdir}/${subdir}/${Makefile_in} ${subdir}/Makefile.tem ;;
662 site_makefile_frag=${srcdir}/config/ms-${site}
664 if [ -f ${site_makefile_frag} ] ; then
665 sed -e "/^####/ r ${site_makefile_frag}" ${srcdir}/${subdir}/${Makefile_in} \
666 > ${subdir}/Makefile.tem
668 cp ${srcdir}/${subdir}/${Makefile_in} ${subdir}/Makefile.tem
673 # working copy now in ${subdir}/Makefile.tem
675 # Conditionalize the makefile for this host.
677 case "${host_makefile_frag}" in
678 "") mv ${subdir}/Makefile.tem ${Makefile} ;;
680 if [ ! -f ${host_makefile_frag} ] ; then
681 host_makefile_frag=${srcdir}/${host_makefile_frag}
683 if [ -f ${host_makefile_frag} ] ; then
684 sed -e "/^####/ r ${host_makefile_frag}" ${subdir}/Makefile.tem > ${Makefile}
686 echo '***' Expected host makefile fragment \"${host_makefile_frag}\" 1>&2
687 echo '***' is missing in ${PWD=`pwd`}. 1>&2
688 mv ${subdir}/Makefile.tem ${Makefile}
691 # working copy now in ${Makefile}
693 # Conditionalize the makefile for this target.
694 rm -f ${subdir}/Makefile.tem
695 case "${target_makefile_frag}" in
696 "") mv ${Makefile} ${subdir}/Makefile.tem ;;
698 if [ ! -f ${target_makefile_frag} ] ; then
699 target_makefile_frag=${srcdir}/${target_makefile_frag}
701 if [ -f ${target_makefile_frag} ] ; then
702 sed -e "/^####/ r ${target_makefile_frag}" ${Makefile} > ${subdir}/Makefile.tem
704 mv ${Makefile} ${subdir}/Makefile.tem
705 target_makefile_frag=
709 # real copy now in ${subdir}/Makefile.tem
711 # Conditionalize the makefile for this package.
713 case "${package_makefile_frag}" in
714 "") mv ${subdir}/Makefile.tem ${Makefile} ;;
716 if [ ! -f ${package_makefile_frag} ] ; then
717 package_makefile_frag=${srcdir}/${package_makefile_frag}
719 if [ -f ${package_makefile_frag} ] ; then
720 sed -e "/^####/ r ${package_makefile_frag}" ${subdir}/Makefile.tem > ${Makefile}
722 echo '***' Expected package makefile fragment \"${package_makefile_frag}\" 1>&2
723 echo '***' is missing in ${PWD=`pwd`}. 1>&2
724 mv ${subdir}/Makefile.tem ${Makefile}
727 # working copy now in ${Makefile}
729 mv ${Makefile} ${subdir}/Makefile.tem
731 # real copy now in ${subdir}/Makefile.tem
733 # prepend warning about editting, and a bunch of variables.
735 cat > ${Makefile} <<EOF
737 VPATH = ${makesrcdir}
738 links = ${configlinks}
739 host_alias = ${host_alias}
740 host_cpu = ${host_cpu}
741 host_vendor = ${host_vendor}
743 host_canonical = ${host_cpu}-${host_vendor}-${host_os}
744 target_alias = ${target_alias}
745 target_cpu = ${target_cpu}
746 target_vendor = ${target_vendor}
747 target_os = ${target_os}
748 target_canonical = ${target_cpu}-${target_vendor}-${target_os}
752 *) cat >> ${Makefile} << EOF
753 build_alias = ${build_alias}
754 build_cpu = ${build_cpu}
755 build_vendor = ${build_vendor}
756 build_os = ${build_os}
757 build_canonical = ${build_cpu}-${build_vendor}-${build_os}
761 case "${package_makefile_frag}" in
763 /*) echo package_makefile_frag = ${package_makefile_frag} >>${Makefile} ;;
764 *) echo package_makefile_frag = ${invsubdir}${package_makefile_frag} >>${Makefile} ;;
767 case "${target_makefile_frag}" in
769 /*) echo target_makefile_frag = ${target_makefile_frag} >>${Makefile} ;;
770 *) echo target_makefile_frag = ${invsubdir}${target_makefile_frag} >>${Makefile} ;;
773 case "${host_makefile_frag}" in
775 /*) echo host_makefile_frag = ${host_makefile_frag} >>${Makefile} ;;
776 *) echo host_makefile_frag = ${invsubdir}${host_makefile_frag} >>${Makefile} ;;
779 if [ "${site_makefile_frag}" != "" ] ; then
780 echo site_makefile_frag = ${invsubdir}${site_makefile_frag} >>${Makefile}
783 # make sure that some sort of reasonable default exists for these
788 # reset prefix, exec_prefix, srcdir, SUBDIRS, NONSUBDIRS,
789 # remove any form feeds.
790 if [ -z "${subdirs}" ]; then
791 rm -f ${subdir}/Makefile.tem2
792 sed -e "s:^SUBDIRS[ ]*=.*$:SUBDIRS = ${configdirs}:" \
793 -e "s:^NONSUBDIRS[ ]*=.*$:NONSUBDIRS = ${noconfigdirs}:" \
794 ${subdir}/Makefile.tem > ${subdir}/Makefile.tem2
795 rm -f ${subdir}/Makefile.tem
796 mv ${subdir}/Makefile.tem2 ${subdir}/Makefile.tem
798 sed -e "s:^prefix[ ]*=.*$:prefix = ${prefix}:" \
799 -e "s:^exec_prefix[ ]*=.*$:exec_prefix = ${exec_prefix}:" \
800 -e "s:^SHELL[ ]*=.*$:SHELL = ${config_shell}:" \
801 -e "s:^srcdir[ ]*=.*$:srcdir = ${makesrcdir}:" \
803 -e "s:^program_prefix[ ]*=.*$:program_prefix = ${program_prefix}:" \
804 -e "s:^program_suffix[ ]*=.*$:program_suffix = ${program_suffix}:" \
805 -e "s:^program_transform_name[ ]*=.*$:program_transform_name = ${program_transform_name}:" \
806 -e "s:^tooldir[ ]*=.*$:tooldir = ${tooldir}:" \
807 ${subdir}/Makefile.tem >> ${Makefile}
808 # final copy now in ${Makefile}
811 echo "No Makefile.in found in ${srcdir}/${subdir}, unable to configure" 1>&2
814 rm -f ${subdir}/Makefile.tem
816 case "${host_makefile_frag}" in
818 *) using="and \"${host_makefile_frag}\"" ;;
821 case "${target_makefile_frag}" in
823 *) using="${using} and \"${target_makefile_frag}\"" ;;
826 case "${site_makefile_frag}" in
828 *) using="${using} and \"${site_makefile_frag}\"" ;;
831 newusing=`echo "${using}" | sed 's/and/using/'`
833 echo "Created \"${Makefile}\" in" ${PWD=`pwd`} ${using}
837 # describe the chosen configuration in config.status.
838 # Make that file a shellscript which will reestablish
839 # the same configuration. Used in Makefiles to rebuild
842 case "${norecursion}" in
843 "") arguments="${arguments} --norecursion" ;;
847 if [ ${subdir} = . ] ; then
850 # This directory was configured as follows:
851 ${progname}" ${arguments} "
852 # ${using}" > ${subdir}/config.new
856 # This directory was configured as follows:
858 ${progname}" ${arguments} "
859 # ${using}" > ${subdir}/config.new
861 chmod a+x ${subdir}/config.new
862 if [ -r ${subdir}/config.back ] ; then
863 mv -f ${subdir}/config.back ${subdir}/config.status
865 ${moveifchange} ${subdir}/config.new ${subdir}/config.status
868 *) rm -f ${Makefile} ${subdir}/config.status ${links} ;;
872 # If there are subdirectories, then recur.
873 if [ -z "${norecursion}" -a -n "${configdirs}" ] ; then
874 for configdir in ${configdirs} ; do
876 if [ -d ${srcdir}/${configdir} ] ; then
877 eval echo Configuring ${configdir}... ${redirect}
881 if [ ! -d ./${configdir} ] ; then
882 if mkdir ./${configdir} ; then
885 echo '***' "${progname}: could not make ${PWD=`pwd`}/${configdir}" 1>&2
895 ### figure out what to do with srcdir
897 ".") newsrcdir=${srcdir} ;; # no -srcdir option. We're building in place.
899 newsrcdir=${srcdir}/${configdir}
900 srcdiroption="--srcdir=${newsrcdir}"
902 *) # otherwise relative
903 newsrcdir=../${srcdir}/${configdir}
904 srcdiroption="--srcdir=${newsrcdir}"
908 ### check for guested configure, otherwise fix possibly relative progname
909 if [ -f ${newsrcdir}/configure ] ; then
910 recprog=${newsrcdir}/configure
911 elif [ -f ${newsrcdir}/configure.in ] ; then
912 case "${progname}" in
913 /*) recprog=${progname} ;;
914 *) recprog=../${progname} ;;
917 eval echo No configuration information in ${configdir} ${redirect}
921 ### The recursion line is here.
922 if [ ! -z "${recprog}" ] ; then
923 if eval ${config_shell} ${recprog} ${verbose} ${buildopt} --host=${host_alias} --target=${target_alias} \
924 ${prefixoption} ${tmpdiroption} ${exec_prefixoption} \
925 ${srcdiroption} ${program_prefixoption} ${program_suffixoption} ${program_transform_nameoption} ${site_option} ${withoptions} ${withoutoptions} ${removing} ${redirect} ; then