3 ### WARNING: this file contains embedded tabs. Do not run untabify on this file.
6 # Copyright (C) 1988, 90, 91, 92, 93, 94 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
64 package_makefile_frag=
71 program_transform_name=
72 program_transform_nameoption=
87 ### we might need to use some other shell than /bin/sh for running subshells
89 config_shell=${CONFIG_SHELL-/bin/sh}
91 NO_EDIT="This file was generated automatically by configure. Do not edit."
93 ## this is a little touchy and won't always work, but...
95 ## if the argv[0] starts with a slash then it is an absolute name that can (and
96 ## must) be used as is.
98 ## otherwise, if argv[0] has no slash in it, we can assume that it is on the
99 ## path. Since PATH might include "." we also add `pwd` to the end of PATH.
103 # if PWD already has a value, it is probably wrong.
104 if [ -n "$PWD" ]; then PWD=`pwd`; fi
106 case "${progname}" in
110 PATH=$PATH:${PWD=`pwd`} ; export PATH
119 # Break out if there are no more args
126 # Get the first arg, and shuffle
130 # Make all options have two hyphens
131 orig_option=$option # Save original for error messages
134 -*) option=-$option ;;
137 # Split out the argument for options that take them
140 optarg=`echo $option | sed -e 's/^[^=]*=//'`
142 # These options have mandatory values. Since we didn't find an = sign,
143 # the value must be in the next argument
144 --b* | --ex* | --ho* | --pre* | --program-p* | --program-s* | --program-t* | --si* | --sr* | --ta* | --tm*)
150 # Now, process the options
154 case "$build_alias" in
155 "") build_alias=$optarg ;;
156 *) echo '***' Can only configure for one build machine at a time. 1>&2
162 enableopt=`echo ${option} | sed 's:^--disable-:enable_:;s:-:_:g'`
164 disableoptions="$disableoptions $option"
172 enableopt=`echo ${option} | sed 's:^--::;s:=.*$::;s:-:_:g'`
173 eval $enableopt="$optarg"
174 enableoptions="$enableoptions $option"
176 --exec-prefix* | --ex*)
178 exec_prefixoption="--exec-prefix=$optarg"
188 NOHOST) host_alias=$optarg ;;
189 *) echo '***' Can only configure for one host at a time. 1>&2
197 --norecursion | --no*)
202 prefixoption="--prefix=$optarg"
204 --program-prefix* | --program-p*)
205 program_prefix=$optarg
206 program_prefixoption="--program-prefix=$optarg"
208 --program-suffix* | --program-s*)
209 program_suffix=$optarg
210 program_suffixoption="--program-suffix=$optarg"
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='$optarg'"
222 site_option="--site=$optarg"
225 # Remove trailing slashes. Otherwise, when the file name gets
226 # bolted into an object file as debug info, it has two slashes in
227 # it. Ordinarily this is ok, but emacs takes double slash to
228 # mean "forget the first part".
229 srcdir=`echo $optarg | sed -e 's:/$::'`
235 case $target_alias in
236 NOTARGET) target_alias=$optarg ;;
237 *) echo '***' Can only configure for one target at a time. 1>&2
244 tmpdiroption="--tmpdir=$optarg"
246 --verbose | --v | --verb*)
250 --version | --V | --vers*)
251 echo "This is Cygnus Configure version" `echo ${version} | sed 's/[ $:]//g'`
260 withopt=`echo ${option} | sed 's:^--::;s:=.*$::;s:-:_:g'`
261 eval $withopt="$optarg"
262 withoptions="$withoptions $option"
265 withopt=`echo ${option} | sed 's:^--::;s:out::;s:-:_:g'`
267 withoutoptions="$withoutoptions $option"
270 withoptions="$withoptions --with-x"
273 echo "Warning: Unrecognized option: \"$orig_option\"". >&2
274 # Pass the option to any configure scripts in subdirectories
275 # in case they recognize it.
276 other_options="$other_options $orig_option"
280 NOUNDEFS) undefs=$option ;;
281 *) echo '***' Can only configure for one host and one target at a time. 1>&2
289 # process host and target
291 # Do some error checking and defaulting for the host and target type.
293 # configure --host=HOST --target=TARGET UNDEFS
296 # 1. You aren't allowed to specify --host, --target, and undefs at the
298 # 2. Host defaults to undefs.
299 # 3. If undefs is not specified, then host defaults to the current host,
300 # as determined by config.guess.
301 # 4. Target defaults to undefs.
302 # 5. If undefs is not specified, then target defaults to host.
306 # Make sure that host, target & undefs aren't all specified at the
308 case $host_alias---$target_alias---$undefs in
309 NOHOST---*---* | *---NOTARGET---* | *---*---NOUNDEFS)
311 *) echo '***' Can only configure for one host and one target at a time. 1>&2
317 # Now, do defaulting for host.
322 # Neither --host option nor undefs were present.
324 guesssys=`echo ${progname} | sed 's/configure$/config.guess/'`
325 if host_alias=`${guesssys}`
327 echo "Configuring for a ${host_alias} host." 1>&2
328 arguments="--host=$host_alias $arguments"
330 echo 'Config.guess failed to determine the host type. You need to specify one.' 1>&2
340 # Do defaulting for target. If --target option isn't present, default
341 # to undefs. If undefs isn't present, default to host.
342 case $target_alias in
346 target_alias=$host_alias
357 if [ -n "${fatal}" -o "${host_alias}" = "help" ] ; then
359 echo Usage: configure HOST
361 echo Options: [defaults in brackets]
362 echo ' --prefix=MYDIR configure for installation of host independent files into MYDIR. ["/usr/local"]'
363 echo ' --exec-prefix=MYDIR configure for installation of host dependent files into MYDIR. ["/usr/local"]'
364 echo ' --help print this message. [normal config]'
365 echo ' --build=BUILD configure for building on BUILD. [BUILD=HOST]'
366 echo ' --host=HOST configure for HOST. [determined via config.guess]'
367 echo ' --norecursion configure this directory only. [recurse]'
368 echo ' --program-prefix=FOO install programs with FOO prepended to their names. [ "" ]'
369 echo ' --program-suffix=FOO install programs with FOO appended to their names. [ "" ]'
370 echo ' --program-transform-name=FOO install programs with names transformed by sed pattern FOO. [ "" ]'
371 echo ' --site=SITE configure with site specific makefile for SITE'
372 echo ' --srcdir=DIR find the sources in DIR. ["." or ".."]'
373 echo ' --target=TARGET configure for TARGET. [TARGET = HOST]'
374 echo ' --tmpdir=TMPDIR create temporary files in TMPDIR. [ TMPDIR = "/tmp" ]'
375 echo ' --nfp configure the compilers default to soft floating point. [hard float]'
376 echo ' --with-FOO, --with-FOO=BAR package FOO is available (parameter BAR)'
377 echo ' --without-FOO package FOO is NOT available'
378 echo ' --enable-FOO, --enable-FOO=BAR include feature FOO (parameter BAR)'
379 echo ' --disable-FOO do not include feature FOO'
381 echo 'Where HOST and TARGET are something like "vax", "sun3", "encore", etc.'
383 if [ -r config.status ] ; then
390 configsub=`echo ${progname} | sed 's/configure$/config.sub/'`
391 moveifchange=`echo ${progname} | sed 's/configure$/move-if-change/'`
393 # this is a hack. sun4 must always be a valid host alias or this will fail.
394 if ${configsub} sun4 >/dev/null 2>&1 ; then
397 echo '***' cannot find config.sub. 1>&2
402 if ${moveifchange} config.junk config.trash ; then
405 echo '***' cannot find move-if-change. 1>&2
408 rm -f config.junk config.trash
412 if [ -r configure.in ] ; then
415 if [ -r ${progname}.in ] ; then
416 srcdir=`echo ${progname} | sed 's:/configure$::'`
418 echo '***' "Can't find configure.in. Try using --srcdir=some_dir" 1>&2
426 ### warn about some conflicting configurations.
431 if [ -f ${srcdir}/config.status ] ; then
432 echo '***' Cannot configure here in \"${PWD=`pwd`}\" when \"${srcdir}\" is currently configured. 1>&2
437 # default exec_prefix
438 case "${exec_prefix}" in
439 "") exec_prefix="\$(prefix)" ;;
443 ### break up ${srcdir}/configure.in.
444 case "`grep '^# per\-host:' ${srcdir}/configure.in`" in
446 echo '***' ${srcdir}/configure.in has no \"per-host:\" line. 1>&2
452 case "`grep '^# per\-target:' ${srcdir}/configure.in`" in
454 echo '***' ${srcdir}/configure.in has no \"per-target:\" line. 1>&2
461 "") TMPDIR=/tmp ; export TMPDIR ;;
465 # keep this filename short for &%*%$*# 14 char file names
466 tmpfile=${TMPDIR}/cONf$$
467 trap "rm -f ${tmpfile}.com ${tmpfile}.tgt ${tmpfile}.hst ${tmpfile}.pos" 0
469 # split ${srcdir}/configure.in into common, per-host, per-target,
470 # and post-target parts. Post-target is optional.
471 sed -e '/^# per\-host:/,$d' ${srcdir}/configure.in > ${tmpfile}.com
472 sed -e '1,/^# per\-host:/d' -e '/^# per\-target:/,$d' ${srcdir}/configure.in > ${tmpfile}.hst
473 if grep '^# post-target:' ${srcdir}/configure.in >/dev/null ; then
474 sed -e '1,/^# per\-target:/d' -e '/^# post\-target:/,$d' ${srcdir}/configure.in > ${tmpfile}.tgt
475 sed -e '1,/^# post\-target:/d' ${srcdir}/configure.in > ${tmpfile}.pos
477 sed -e '1,/^# per\-target:/d' ${srcdir}/configure.in > ${tmpfile}.tgt
481 ### do common part of configure.in
485 # some sanity checks on configure.in
486 case "${srctrigger}" in
488 echo '***' srctrigger not set in ${PWD=`pwd`}/configure.in. 1>&2
494 case "${build_alias}" in
497 result=`${configsub} ${build_alias}`
498 buildopt="--build=${build_alias}"
499 build_cpu=`echo $result | sed 's/^\(.*\)-\(.*\)-\(.*\)$/\1/'`
500 build_vendor=`echo $result | sed 's/^\(.*\)-\(.*\)-\(.*\)$/\2/'`
501 build_os=`echo $result | sed 's/^\(.*\)-\(.*\)-\(.*\)$/\3/'`
502 build=${build_cpu}-${build_vendor}-${build_os}
506 result=`${configsub} ${host_alias}`
507 host_cpu=`echo $result | sed 's/^\(.*\)-\(.*\)-\(.*\)$/\1/'`
508 host_vendor=`echo $result | sed 's/^\(.*\)-\(.*\)-\(.*\)$/\2/'`
509 host_os=`echo $result | sed 's/^\(.*\)-\(.*\)-\(.*\)$/\3/'`
510 host=${host_cpu}-${host_vendor}-${host_os}
514 result=`${configsub} ${target_alias}`
515 target_cpu=`echo $result | sed 's/^\(.*\)-\(.*\)-\(.*\)$/\1/'`
516 target_vendor=`echo $result | sed 's/^\(.*\)-\(.*\)-\(.*\)$/\2/'`
517 target_os=`echo $result | sed 's/^\(.*\)-\(.*\)-\(.*\)$/\3/'`
518 target=${target_cpu}-${target_vendor}-${target_os}
522 # Find the source files, if location was not specified.
527 if [ ! -r ${srctrigger} ] ; then
534 if [ ! -r ${srcdir}/${srctrigger} ] ; then
535 case "${srcdirdefaulted}" in
536 "") echo '***' "${progname}: Can't find ${srcname} sources in ${PWD=`pwd`}/${srcdir}" 1>&2 ;;
537 *) echo '***' "${progname}: Can't find ${srcname} sources in ${PWD=`pwd`}/. or ${PWD=`pwd`}/.." 1>&2 ;;
540 echo '***' \(At least ${srctrigger} is missing.\) 1>&2
544 # Some systems (e.g., one of the i386-aix systems the gas testers are
545 # using) don't handle "\$" correctly, so don't use it here.
546 tooldir='$(exec_prefix)'/${target_alias}
548 if [ "${host_alias}" != "${target_alias}" ] ; then
549 if [ "${program_prefixoption}" = "" ] ; then
550 if [ "${program_suffixoption}" = "" ] ; then
551 if [ "${program_transform_nameoption}" = "" ] ; then
552 program_prefix=${target_alias}- ;
558 # Merge program_prefix and program_suffix onto program_transform_name
559 # Use a double $ so that make ignores it
560 if [ "${program_suffix}" != "" ] ; then
561 program_transform_name="-e s,\$\$,${program_suffix}, ${program_transform_name}"
564 if [ "${program_prefix}" != "" ] ; then
565 program_transform_name="-e s,^,${program_prefix}, ${program_transform_name}"
568 for subdir in . ${subdirs} ; do
570 # ${subdir} is relative path from . to the directory we're currently
572 # ${invsubdir} is inverse of ${subdir), *with* trailing /, if needed.
573 invsubdir=`echo ${subdir}/ | sed -e 's|\./||g' -e 's|[^/]*/|../|g'`
575 ### figure out what to do with srcdir
577 ".") # no -srcdir option. We're building in place.
580 makesrcdir=`echo ${srcdir}/${subdir} | sed -e 's|/\.$||'`
582 *) # otherwise relative
584 .) makesrcdir=${srcdir} ;;
585 *) makesrcdir=${invsubdir}${srcdir}/${subdir} ;;
590 if [ "${subdir}/" != "./" ] ; then
591 Makefile=${subdir}/Makefile
594 if [ ! -d ${subdir} ] ; then
595 if mkdir ${subdir} ; then
598 echo '***' "${progname}: could not make ${PWD=`pwd`}/${subdir}" 1>&2
603 case "${removing}" in
607 *) eval echo Building in ${subdir} ${redirect} ;;
610 # FIXME Should this be done recursively ??? (Useful for e.g. gdbtest)
611 # Set up the list of links to be made.
612 # ${links} is the list of link names, and ${files} is the list of names to link to.
615 configlinks="${links}"
616 if [ -r ${subdir}/config.status ] ; then
617 mv -f ${subdir}/config.status ${subdir}/config.back
619 while [ -n "${files}" ] ; do
620 # set file to car of files, files to cdr of files
621 set ${files}; file=$1; shift; files=$*
622 set ${links}; link=$1; shift; links=$*
624 if [ ! -r ${srcdir}/${file} ] ; then
625 echo '***' "${progname}: cannot create a link \"${link}\"," 1>&2
626 echo '***' "since the file \"${srcdir}/${file}\" does not exist." 1>&2
631 # Make a symlink if possible, otherwise try a hard link
632 ${symbolic_link} ${srcdir}/${file} ${link} 2>/dev/null || ${hard_link} ${srcdir}/${file} ${link}
634 if [ ! -r ${link} ] ; then
635 echo '***' "${progname}: unable to link \"${link}\" to \"${srcdir}/${file}\"." 1>&2
639 echo "Linked \"${link}\" to \"${srcdir}/${file}\"."
642 # Create a .gdbinit file which runs the one in srcdir
643 # and tells GDB to look there for source files.
645 if [ -r ${srcdir}/${subdir}/.gdbinit ] ; then
648 *) cat > ${subdir}/.gdbinit <<EOF
652 source ${makesrcdir}/.gdbinit
658 # Install a makefile, and make it set VPATH
659 # if necessary so that the sources are found.
660 # Also change its value of srcdir.
661 # NOTE: Makefile generation constitutes the majority of the time in configure. Hence, this section has
662 # been somewhat optimized and is perhaps a bit twisty.
664 # code is order so as to try to sed the smallest input files we know.
666 # the four makefile fragments MUST end up in the resulting Makefile in this order:
667 # package, target, host, and site. so do these separately because I don't trust the
668 # order of sed -e expressions.
670 if [ -f ${srcdir}/${subdir}/${Makefile_in} ] ; then
672 # Conditionalize for this site from "Makefile.in" (or whatever it's called) into Makefile.tem
673 rm -f ${subdir}/Makefile.tem
675 "") cp ${srcdir}/${subdir}/${Makefile_in} ${subdir}/Makefile.tem ;;
677 site_makefile_frag=${srcdir}/config/ms-${site}
679 if [ -f ${site_makefile_frag} ] ; then
680 sed -e "/^####/ r ${site_makefile_frag}" ${srcdir}/${subdir}/${Makefile_in} \
681 > ${subdir}/Makefile.tem
683 cp ${srcdir}/${subdir}/${Makefile_in} ${subdir}/Makefile.tem
688 # working copy now in ${subdir}/Makefile.tem
690 # Conditionalize the makefile for this host.
692 case "${host_makefile_frag}" in
693 "") mv ${subdir}/Makefile.tem ${Makefile} ;;
695 if [ ! -f ${host_makefile_frag} ] ; then
696 host_makefile_frag=${srcdir}/${host_makefile_frag}
698 if [ -f ${host_makefile_frag} ] ; then
699 sed -e "/^####/ r ${host_makefile_frag}" ${subdir}/Makefile.tem > ${Makefile}
701 echo '***' Expected host makefile fragment \"${host_makefile_frag}\" 1>&2
702 echo '***' is missing in ${PWD=`pwd`}. 1>&2
703 mv ${subdir}/Makefile.tem ${Makefile}
706 # working copy now in ${Makefile}
708 # Conditionalize the makefile for this target.
709 rm -f ${subdir}/Makefile.tem
710 case "${target_makefile_frag}" in
711 "") mv ${Makefile} ${subdir}/Makefile.tem ;;
713 if [ ! -f ${target_makefile_frag} ] ; then
714 target_makefile_frag=${srcdir}/${target_makefile_frag}
716 if [ -f ${target_makefile_frag} ] ; then
717 sed -e "/^####/ r ${target_makefile_frag}" ${Makefile} > ${subdir}/Makefile.tem
719 mv ${Makefile} ${subdir}/Makefile.tem
720 target_makefile_frag=
724 # real copy now in ${subdir}/Makefile.tem
726 # Conditionalize the makefile for this package.
728 case "${package_makefile_frag}" in
729 "") mv ${subdir}/Makefile.tem ${Makefile} ;;
731 if [ ! -f ${package_makefile_frag} ] ; then
732 package_makefile_frag=${srcdir}/${package_makefile_frag}
734 if [ -f ${package_makefile_frag} ] ; then
735 sed -e "/^####/ r ${package_makefile_frag}" ${subdir}/Makefile.tem > ${Makefile}
737 echo '***' Expected package makefile fragment \"${package_makefile_frag}\" 1>&2
738 echo '***' is missing in ${PWD=`pwd`}. 1>&2
739 mv ${subdir}/Makefile.tem ${Makefile}
742 # working copy now in ${Makefile}
744 mv ${Makefile} ${subdir}/Makefile.tem
746 # real copy now in ${subdir}/Makefile.tem
748 # prepend warning about editting, and a bunch of variables.
750 cat > ${Makefile} <<EOF
752 VPATH = ${makesrcdir}
753 links = ${configlinks}
754 host_alias = ${host_alias}
755 host_cpu = ${host_cpu}
756 host_vendor = ${host_vendor}
758 host_canonical = ${host_cpu}-${host_vendor}-${host_os}
759 target_alias = ${target_alias}
760 target_cpu = ${target_cpu}
761 target_vendor = ${target_vendor}
762 target_os = ${target_os}
763 target_canonical = ${target_cpu}-${target_vendor}-${target_os}
767 *) cat >> ${Makefile} << EOF
768 build_alias = ${build_alias}
769 build_cpu = ${build_cpu}
770 build_vendor = ${build_vendor}
771 build_os = ${build_os}
772 build_canonical = ${build_cpu}-${build_vendor}-${build_os}
776 case "${package_makefile_frag}" in
778 /*) echo package_makefile_frag = ${package_makefile_frag} >>${Makefile} ;;
779 *) echo package_makefile_frag = ${invsubdir}${package_makefile_frag} >>${Makefile} ;;
782 case "${target_makefile_frag}" in
784 /*) echo target_makefile_frag = ${target_makefile_frag} >>${Makefile} ;;
785 *) echo target_makefile_frag = ${invsubdir}${target_makefile_frag} >>${Makefile} ;;
788 case "${host_makefile_frag}" in
790 /*) echo host_makefile_frag = ${host_makefile_frag} >>${Makefile} ;;
791 *) echo host_makefile_frag = ${invsubdir}${host_makefile_frag} >>${Makefile} ;;
794 if [ "${site_makefile_frag}" != "" ] ; then
795 echo site_makefile_frag = ${invsubdir}${site_makefile_frag} >>${Makefile}
798 # make sure that some sort of reasonable default exists for these
803 # reset prefix, exec_prefix, srcdir, SUBDIRS, NONSUBDIRS,
804 # remove any form feeds.
805 if [ -z "${subdirs}" ]; then
806 rm -f ${subdir}/Makefile.tem2
807 sed -e "s:^SUBDIRS[ ]*=.*$:SUBDIRS = ${configdirs}:" \
808 -e "s:^NONSUBDIRS[ ]*=.*$:NONSUBDIRS = ${noconfigdirs}:" \
809 ${subdir}/Makefile.tem > ${subdir}/Makefile.tem2
810 rm -f ${subdir}/Makefile.tem
811 mv ${subdir}/Makefile.tem2 ${subdir}/Makefile.tem
813 sed -e "s:^prefix[ ]*=.*$:prefix = ${prefix}:" \
814 -e "s:^exec_prefix[ ]*=.*$:exec_prefix = ${exec_prefix}:" \
815 -e "s:^SHELL[ ]*=.*$:SHELL = ${config_shell}:" \
816 -e "s:^srcdir[ ]*=.*$:srcdir = ${makesrcdir}:" \
818 -e "s:^program_prefix[ ]*=.*$:program_prefix = ${program_prefix}:" \
819 -e "s:^program_suffix[ ]*=.*$:program_suffix = ${program_suffix}:" \
820 -e "s:^program_transform_name[ ]*=.*$:program_transform_name = ${program_transform_name}:" \
821 -e "s:^tooldir[ ]*=.*$:tooldir = ${tooldir}:" \
822 ${subdir}/Makefile.tem >> ${Makefile}
823 # final copy now in ${Makefile}
826 echo "No Makefile.in found in ${srcdir}/${subdir}, unable to configure" 1>&2
829 rm -f ${subdir}/Makefile.tem
831 case "${host_makefile_frag}" in
833 *) using="and \"${host_makefile_frag}\"" ;;
836 case "${target_makefile_frag}" in
838 *) using="${using} and \"${target_makefile_frag}\"" ;;
841 case "${site_makefile_frag}" in
843 *) using="${using} and \"${site_makefile_frag}\"" ;;
846 newusing=`echo "${using}" | sed 's/and/using/'`
848 echo "Created \"${Makefile}\" in" ${PWD=`pwd`} ${using}
852 # describe the chosen configuration in config.status.
853 # Make that file a shellscript which will reestablish
854 # the same configuration. Used in Makefiles to rebuild
857 case "${norecursion}" in
858 "") arguments="${arguments} --norecursion" ;;
862 if [ ${subdir} = . ] ; then
865 # This directory was configured as follows:
866 ${progname}" ${arguments} "
867 # ${using}" > ${subdir}/config.new
871 # This directory was configured as follows:
873 ${progname}" ${arguments} "
874 # ${using}" > ${subdir}/config.new
876 chmod a+x ${subdir}/config.new
877 if [ -r ${subdir}/config.back ] ; then
878 mv -f ${subdir}/config.back ${subdir}/config.status
880 ${moveifchange} ${subdir}/config.new ${subdir}/config.status
883 *) rm -f ${Makefile} ${subdir}/config.status ${links} ;;
887 # If there are subdirectories, then recur.
888 if [ -z "${norecursion}" -a -n "${configdirs}" ] ; then
889 for configdir in ${configdirs} ; do
891 if [ -d ${srcdir}/${configdir} ] ; then
892 eval echo Configuring ${configdir}... ${redirect}
896 if [ ! -d ./${configdir} ] ; then
897 if mkdir ./${configdir} ; then
900 echo '***' "${progname}: could not make ${PWD=`pwd`}/${configdir}" 1>&2
910 ### figure out what to do with srcdir
912 ".") newsrcdir=${srcdir} ;; # no -srcdir option. We're building in place.
914 newsrcdir=${srcdir}/${configdir}
915 srcdiroption="--srcdir=${newsrcdir}"
917 *) # otherwise relative
918 newsrcdir=../${srcdir}/${configdir}
919 srcdiroption="--srcdir=${newsrcdir}"
923 ### check for guested configure, otherwise fix possibly relative progname
924 if [ -f ${newsrcdir}/configure ] ; then
925 recprog=${newsrcdir}/configure
926 elif [ -f ${newsrcdir}/configure.in ] ; then
927 case "${progname}" in
928 /*) recprog=${progname} ;;
929 *) recprog=../${progname} ;;
932 eval echo No configuration information in ${configdir} ${redirect}
936 ### The recursion line is here.
937 if [ ! -z "${recprog}" ] ; then
938 if eval ${config_shell} ${recprog} ${verbose} ${buildopt} --host=${host_alias} --target=${target_alias} \
939 ${prefixoption} ${tmpdiroption} ${exec_prefixoption} \
940 ${srcdiroption} ${program_prefixoption} ${program_suffixoption} ${program_transform_nameoption} ${site_option} ${withoptions} ${withoutoptions} ${enableoptions} ${disableoptions} ${removing} ${other_options} ${redirect} ; then
943 echo Configure in `pwd` failed, exiting. 1>&2