4 # Copyright (C) 1988, 1990, 1991, 1992 Free Software Foundation, Inc.
6 # This program is free software; you can redistribute it and/or modify
7 # it under the terms of the GNU General Public License as published by
8 # the Free Software Foundation; either version 2 of the License, or
9 # (at your option) any later version.
11 # This program is distributed in the hope that it will be useful,
12 # but WITHOUT ANY WARRANTY; without even the implied warranty of
13 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 # 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., 675 Mass Ave, Cambridge, MA 02139, USA. */
20 # Please email any bugs, comments, and/or additions to this file to:
21 # configure@cygnus.com
23 # This file was written by K. Richard Pixley.
26 # Shell script to create proper links to machine-dependent files in
27 # preparation for compilation.
29 # If configure succeeds, it leaves its status in config.status.
30 # If configure fails after disturbing the status quo,
31 # config.status is removed.
34 export PATH || (echo "OOPS, this isn't sh. Desperation time. I will feed myself to sh."; sh $0 $argv; kill $$)
43 #symbolic_link="echo ln -s"
45 # clear some things potentially inherited from environment.
48 Makefile_in=Makefile.in
54 floating_point=default
72 program_transform_name=
73 program_transform_nameoption=
88 NO_EDIT="This file was generated automatically by configure. Do not edit."
90 ## this is a little touchy and won't always work, but...
92 ## if the argv[0] starts with a slash then it is an absolute name that can (and
93 ## must) be used as is.
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.
102 case "${progname}" in
106 PATH=$PATH:${PWD=`pwd`} ; export PATH
112 # handle things that might have args following as separate words
113 if [ -n "${next_prefix}" ] ; then prefix=${arg} ; prefixoption="-prefix=${prefix}" ; next_prefix=
114 elif [ -n "${next_exec_prefix}" ] ; then
116 exec_prefixoption="-exec_prefix=${exec_prefix}"
118 elif [ -n "${next_site}" ] ; then site=${arg} ; site_option=-site=${site} ; next_site=
119 # remove any possible trailing slash from srcdir. See note below.
120 elif [ -n "${next_srcdir}" ] ; then srcdir=`echo ${arg} | sed -e 's:/$::'` ; next_srcdir=
121 elif [ -n "${next_program_prefix}" ] ; then
122 program_prefix=${arg}
123 program_prefixoption="-program_prefix=${program_prefix}"
125 elif [ -n "${next_program_suffix}" ] ; then
126 program_suffix=${arg}
127 program_suffixoption="-program_suffix=${program_suffix}"
129 elif [ -n "${next_program_transform_name}" ] ; then
130 # Double any backslashes or dollar signs in the argument
131 program_transform_name="${program_transform_name} -e `echo ${arg} | sed -e 's/\\\\/\\\\\\\\/g' -e 's/\\\$/$$/g'`"
132 program_transform_nameoption="${program_transform_nameoption} -program_transform_name='${arg}'"
133 next_program_transform_name=
134 elif [ -n "${next_target}" ] ; then
136 case "${target_alias}" in
138 target_alias="${arg}"
141 echo '***' Can only configure for one target at a time. 1>&2
145 elif [ -n "${next_tmpdir}" ] ; then
147 tmpdiroption="--tmpdir=${arg}"
152 -exec_prefix=* | --exec_prefix=* | --exec_prefi=* | --exec_pref=* | --exec_pre=* | --exec_pr=* | --exec_p=* | --exec_=* | --exec=* | --exe=* | --ex=* | --e=*)
153 exec_prefix=`echo ${arg} | sed 's/^[-a-z_]*=//'`
154 exec_prefixoption=${arg}
156 -exec_prefix | --exec_prefix | --exec_prefi | --exec_pref | --exec_pre | --exec_pr | --exec_p | --exec_ | --exec | --exe | --ex | --e)
165 -host=* | --host=* | --hos=* | --ho=*)
166 case "${host_alias}" in
168 host_alias="`echo ${arg} | sed 's/^[-a-z]*=//'`"
171 echo '***' Can only configure for one host at a time. 1>&2
179 -norecursion | --no*)
182 -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=*)
183 prefix=`echo ${arg} | sed 's/^[-a-z]*=//'`
186 -prefix | --prefix | --prefi | --pref | --pre)
189 -rm | --rm) removing=${arg} ;;
190 -program_prefix=* | --program_prefix=* | --program_prefi=* | --program_pref=* | --program_pre=* | --program_pr=* | --program_p=*)
191 program_prefix=`echo ${arg} | sed 's/^[-a-z_]*=//'`
192 program_prefixoption=${arg}
194 -program_prefix | --program_prefix | --program_prefi | --program_pref | --program_pre | --program_pr | --program_p)
195 next_program_prefix=yes
197 -program_suffix=* | --program_suffix=* | --program_suffi=* | --program_suff=* | --program_suf=* | --program_su=* | --program_s=*)
198 program_suffix=`echo ${arg} | sed 's/^[-a-z_]*=//'`
199 program_suffixoption=${arg}
201 -program_suffix | --program_suffix | --program_suffi | --program_suff | --program_suf | --program_su | --program_s )
202 next_program_suffix=yes
204 -program_transform_name=* | --program_transform_name=* | --program_transform_nam=* | --program_transform_na=* | --program_transform_n=* | --program_transform_=* | --program_transform=* | --program_transfor=* | --program_transfo=* | --program_transf=* | --program_trans=* | --program_tran=* | --program_tra=* | --program_tr=* | --program_t=*)
205 # Double any \ or $ in the argument
206 program_transform_name="${program_transform_name} -e `echo ${arg} | sed -e 's/^[-a-z_]*=//' -e 's/\\\\/\\\\\\\\/g' -e 's/\\\$/$$/g'`"
207 program_transform_nameoption="${program_transform_nameoption} -program_transform_name='`echo ${arg} | sed 's/^[-a-z_]*=//'`'"
209 -program_transform_name | --program_transform_name | --program_transform_nam | --program_transform_na | --program_transform_n | --program_transform_ | --program_transform | --program_transfor | --program_transfo | --program_transf | --program_trans | --program_tran | --program_tra | --program_tr | --program_t)
210 next_program_transform_name=yes
212 -site=* | --site=* | --sit=* | --si=*)
214 site=`echo ${arg} | sed 's/^[-a-z]*=//'`
216 -site | --site | --sit)
219 # remove trailing slashes. Otherwise, when the file name gets
220 # bolted into an object file as debug info, it has two slashes in
221 # it. Ordinarily this is ok, but emacs takes double slash to
222 # mean "forget the first part".
223 -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*)
224 srcdir=`echo ${arg} | sed 's/^[-a-z]*=//' | sed -e 's:/$::'`
226 -srcdir | --srcdir | --srcdi | --srcd | --src | --sr)
229 -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=*)
230 case "${target_alias}" in
231 "") target_alias="`echo ${arg} | sed 's/^[-a-z]*=//'`" ;;
233 echo '***' Can only configure for one target at a time. 1>&2
238 -target | --target | --targe | --targ | --tar | --ta)
241 -tmpdir=* | --tmpdir=* | --tmpdi=* | --tmpd=* | --tmp=* | --tm=*)
243 TMPDIR=`echo ${arg} | sed 's/^[-a-z]*=//'`
245 -tmpdir | --tmpdir | --tmpdi | --tmpd | --tmp | --tm)
252 -version | -V | --version | --V)
253 echo "This is Cygnus Configure version" `echo ${version} | sed 's/[ $:]//g'`
259 echo "Unrecognized option: \"${arg}\"". ;
269 echo '***' Can only configure for one host and one target at a time. 1>&2
278 # process host and target
281 # # Complain if an arg is missing
282 # if [ -z "${host_alias}" ] ; then
284 # echo "configure: No HOST specified." ;
289 ### This is a bit twisted.
290 ### * if all three are specified, this is an error.
291 ### * if we have neither hosts, nor unadorned args, this is an error.
292 ### * if no hosts are specified, then the unadorned args are hosts, but if
293 ### there were none, this is an error.
294 ### * if no targets are specified, then the unadorned args are targets, but if
295 ### there were no unadorned args, then the hosts are also targets.
297 if [ -n "${host_alias}" -a -n "${target_alias}" -a -n "${undefs}" ] ; then
298 echo '***' Can only configure for one host and one target at a time. 1>&2
300 elif [ -z "${host_alias}" -a -z "${undefs}" ] ; then
301 echo '***' You must tell me for which host you want to configure. 1>&2
304 case "${host_alias}" in
305 "") host_alias=${undefs} ;;
309 case "${target_alias}" in
312 "") target_alias=${host_alias} ;;
313 *) target_alias=${undefs} ;;
323 if [ -n "${fatal}" -o "${host_alias}" = "help" ] ; then
324 (echo "Usage: configure HOST" ;
326 echo "Options: [defaults in brackets]" ;
327 echo " -exec_prefix=MYDIR configure for installation of host dependent files into MYDIR. [\"/usr/local\"]" ;
328 echo " -gas configure the compilers for use with gas. [native as]" ;
329 echo " -help print this message. [normal config]" ;
330 echo " -lang=LANG configure to build LANG. [gcc]" ;
331 echo " -nfp configure the compilers default to soft floating point. [hard float]" ;
332 echo " -norecursion configure this directory only. [recurse]" ;
333 echo " -prefix=MYDIR configure for installation of host dependent files into MYDIR. [\"/usr/local\"]" ;
334 echo " -program_prefix=FOO install programs with FOO prepended to their names. [ \"\" ]" ;
335 echo " -program_suffix=FOO install programs with FOO appended to their names. [ \"\" ]" ;
336 echo " -program_transform_name=FOO install programs with names transformed by sed pattern FOO. [ \"\" ]" ;
337 echo " -site=SITE configure with site specific makefile for SITE" ;
338 echo " -srcdir=DIR find the sources in DIR. [\".\" or \"..\"]" ;
339 echo " -target=TARGET configure for TARGET. [TARGET = HOST]" ;
340 echo " -tmpdir=TMPDIR create temporary files in TMPDIR. [ TMPDIR = \"/tmp\" ]" ;
342 echo "Where HOST and TARGET are something like \"vax\", \"sun3\", \"encore\", etc." ;
345 if [ -r config.status ] ; then
352 configsub=`echo ${progname} | sed 's/configure$/config.sub/'`
353 moveifchange=`echo ${progname} | sed 's/configure$/move-if-change/'`
355 # this is a hack. sun4 must always be a valid host alias or this will fail.
356 if ${configsub} sun4 >/dev/null 2>&1 ; then
359 echo '***' cannot find config.sub. 1>&2
364 if ${moveifchange} config.junk config.trash ; then
367 echo '***' cannot find move-if-change. 1>&2
370 rm -f config.junk config.trash
374 if [ -r configure.in ] ; then
377 if [ -r ${progname}.in ] ; then
378 srcdir=`echo ${progname} | sed 's:/configure$::'`
380 echo '***' "Can't find configure.in. Try using -srcdir=some_dir" 1>&2
388 ### warn about some conflicting configurations.
393 if [ -f ${srcdir}/config.status ] ; then
394 echo '***' Cannot configure here in \"${PWD=`pwd`}\" when \"${srcdir}\" is currently configured. 1>&2
399 # default exec_prefix
400 case "${exec_prefix}" in
401 "") exec_prefix="\$(prefix)" ;;
405 ### break up ${srcdir}/configure.in.
406 case "`grep '^# per\-host:' ${srcdir}/configure.in`" in
408 echo '***' ${srcdir}/configure.in has no "per-host:" line. 1>&2
414 case "`grep '^# per\-target:' ${srcdir}/configure.in`" in
416 echo '***' ${srcdir}/configure.in has no "per-target:" line. 1>&2
423 "") TMPDIR=/tmp ; export TMPDIR ;;
427 # keep this filename short for &%*%$*# 14 char file names
428 tmpfile=${TMPDIR}/cONf$$
429 trap "rm -f ${tmpfile}.com ${tmpfile}.tgt ${tmpfile}.hst ${tmpfile}.pos" 0
431 # split ${srcdir}/configure.in into common, per-host, per-target,
432 # and post-target parts. Post-target is optional.
433 sed -e '/^# per\-host:/,$d' ${srcdir}/configure.in > ${tmpfile}.com
434 sed -e '1,/^# per\-host:/d' -e '/^# per\-target:/,$d' ${srcdir}/configure.in > ${tmpfile}.hst
435 if grep '^# post-target:' ${srcdir}/configure.in >/dev/null ; then
436 sed -e '1,/^# per\-target:/d' -e '/^# post\-target:/,$d' ${srcdir}/configure.in > ${tmpfile}.tgt
437 sed -e '1,/^# post\-target:/d' ${srcdir}/configure.in > ${tmpfile}.pos
439 sed -e '1,/^# per\-target:/d' ${srcdir}/configure.in > ${tmpfile}.tgt
443 ### do common part of configure.in
447 # some sanity checks on configure.in
448 case "${srctrigger}" in
450 echo '***' srctrigger not set in ${PWD=`pwd`}/configure.in. 1>&2
456 result=`${configsub} ${host_alias}`
457 host_cpu=`echo $result | sed 's/^\(.*\)-\(.*\)-\(.*\)$/\1/'`
458 host_vendor=`echo $result | sed 's/^\(.*\)-\(.*\)-\(.*\)$/\2/'`
459 host_os=`echo $result | sed 's/^\(.*\)-\(.*\)-\(.*\)$/\3/'`
460 host=${host_cpu}-${host_vendor}-${host_os}
464 result=`${configsub} ${target_alias}`
465 target_cpu=`echo $result | sed 's/^\(.*\)-\(.*\)-\(.*\)$/\1/'`
466 target_vendor=`echo $result | sed 's/^\(.*\)-\(.*\)-\(.*\)$/\2/'`
467 target_os=`echo $result | sed 's/^\(.*\)-\(.*\)-\(.*\)$/\3/'`
468 target=${target_cpu}-${target_vendor}-${target_os}
472 # Find the source files, if location was not specified.
477 if [ ! -r ${srctrigger} ] ; then
484 if [ ! -r ${srcdir}/${srctrigger} ] ; then
485 case "${srcdirdefaulted}" in
486 "") echo '***' "${progname}: Can't find ${srcname} sources in ${PWD=`pwd`}/${srcdir}" 1>&2 ;;
487 *) echo '***' "${progname}: Can't find ${srcname} sources in ${PWD=`pwd`}/. or ${PWD=`pwd`}/.." 1>&2 ;;
490 echo '***' \(At least ${srctrigger} is missing.\) 1>&2
494 tooldir="\$(libdir)/${target_alias}"
496 if [ "${host_alias}" != "${target_alias}" ] ; then
497 if [ "${program_prefix}" = "" ] ; then
498 if [ "${program_suffix}" = "" ] ; then
499 if [ "${program_transform_name}" = "" ] ; then
500 program_prefix=${target_alias}- ;
506 # Merge program_prefix and program_suffix onto program_transform_name
507 # Use a double $ so that make ignores it
508 if [ "${program_suffix}" != "" ] ; then
509 program_transform_name="-e s/\$\$/${program_suffix}/ ${program_transform_name}"
512 if [ "${program_prefix}" != "" ] ; then
513 program_transform_name="-e s/^/${program_prefix}/ ${program_transform_name}"
516 for subdir in . ${subdirs} ; do
518 # ${subdir} is relative path from . to the directory we're currently
520 # ${invsubdir} is inverse of ${subdir), *with* trailing /, if needed.
521 invsubdir=`echo ${subdir}/ | sed -e 's|\./||g' -e 's|[^/]*/|../|g'`
523 ### figure out what to do with srcdir
525 ".") # no -srcdir option. We're building in place.
528 makesrcdir=`echo ${srcdir}/${subdir} | sed -e 's|/\.$||'`
530 *) # otherwise relative
532 .) makesrcdir=${srcdir} ;;
533 *) makesrcdir=`echo ${subdir} | sed -e 's:[^./][^./]*:..:g'`/${srcdir}/${subdir} ;;
538 if [ "${subdir}/" != "./" ] ; then
539 Makefile=${subdir}/Makefile
542 if [ ! -d ${subdir} ] ; then
546 case "${removing}" in
550 *) eval echo Building in ${subdir} ${redirect} ;;
553 # FIXME Should this be done recursively ??? (Useful for e.g. gdbtest)
554 # Set up the list of links to be made.
555 # ${links} is the list of link names, and ${files} is the list of names to link to.
558 configlinks="${links}"
559 if [ -r ${subdir}/config.status ] ; then
560 mv -f ${subdir}/config.status ${subdir}/config.back
562 while [ -n "${files}" ] ; do
563 # set file to car of files, files to cdr of files
564 set ${files}; file=$1; shift; files=$*
565 set ${links}; link=$1; shift; links=$*
567 if [ ! -r ${srcdir}/${file} ] ; then
568 echo '***' "${progname}: cannot create a link \"${link}\"," 1>&2
569 echo '***' "since the file \"${file}\" does not exist." 1>&2
574 # Make a symlink if possible, otherwise try a hard link
575 ${symbolic_link} ${srcdir}/${file} ${link} 2>/dev/null || ${hard_link} ${srcdir}/${file} ${link}
577 if [ ! -r ${link} ] ; then
578 echo '***' "${progname}: unable to link \"${link}\" to \"${srcdir}/${file}\"." 1>&2
582 echo "Linked \"${link}\" to \"${srcdir}/${file}\"."
585 # Create a .gdbinit file which runs the one in srcdir
586 # and tells GDB to look there for source files.
588 if [ -r ${srcdir}/${subdir}/.gdbinit ] ; then
591 *) cat > ${subdir}/.gdbinit <<EOF
595 source ${makesrcdir}/.gdbinit
601 # Install a makefile, and make it set VPATH
602 # if necessary so that the sources are found.
603 # Also change its value of srcdir.
604 # NOTE: Makefile generation constitutes the majority of the time in configure. Hence, this section has
605 # been somewhat optimized and is perhaps a bit twisty.
607 # code is order so as to try to sed the smallest input files we know.
609 # the three makefile fragments MUST end up in the resulting Makefile in this order: target, host, and site.
610 # so do these separately because I don't trust the order of sed -e expressions.
612 # Conditionalize for this site from "Makefile.in" (or whatever it's called) into Makefile.tem
613 rm -f ${subdir}/Makefile.tem
615 "") cp ${srcdir}/${subdir}/${Makefile_in} ${subdir}/Makefile.tem ;;
617 site_makefile_frag=${srcdir}/config/ms-${site}
619 if [ -f ${site_makefile_frag} ] ; then
620 sed -e "/^####/ r ${site_makefile_frag}" ${srcdir}/${subdir}/${Makefile_in} \
621 > ${subdir}/Makefile.tem
623 cp ${srcdir}/${subdir}/${Makefile_in} ${subdir}/Makefile.tem
628 # working copy now in ${subdir}/Makefile.tem
630 # Conditionalize the makefile for this host.
632 case "${host_makefile_frag}" in
633 "") mv ${subdir}/Makefile.tem ${Makefile} ;;
635 if [ ! -f ${host_makefile_frag} ] ; then
636 host_makefile_frag=${srcdir}/${host_makefile_frag}
638 if [ -f ${host_makefile_frag} ] ; then
639 sed -e "/^####/ r ${host_makefile_frag}" ${subdir}/Makefile.tem > ${Makefile}
641 echo '***' Expected host makefile fragment \"${host_makefile_frag}\" 1>&2
642 echo '***' is missing in ${PWD=`pwd`}. 1>&2
643 mv ${subdir}/Makefile.tem ${Makefile}
646 # working copy now in ${Makefile}
648 # Conditionalize the makefile for this target.
649 rm -f ${subdir}/Makefile.tem
650 case "${target_makefile_frag}" in
651 "") mv ${Makefile} ${subdir}/Makefile.tem ;;
653 if [ ! -f ${target_makefile_frag} ] ; then
654 target_makefile_frag=${srcdir}/${target_makefile_frag}
656 if [ -f ${target_makefile_frag} ] ; then
657 sed -e "/^####/ r ${target_makefile_frag}" ${Makefile} > ${subdir}/Makefile.tem
659 mv ${Makefile} ${subdir}/Makefile.tem
660 target_makefile_frag=
664 # real copy now in ${subdir}/Makefile.tem
666 # prepend warning about editting, and a bunch of variables.
668 cat > ${Makefile} <<EOF
670 VPATH = ${makesrcdir}
671 links = ${configlinks}
672 host_alias = ${host_alias}
673 host_cpu = ${host_cpu}
674 host_vendor = ${host_vendor}
676 target_alias = ${target_alias}
677 target_cpu = ${target_cpu}
678 target_vendor = ${target_vendor}
679 target_os = ${target_os}
681 case "${target_makefile_frag}" in
684 echo target_makefile_frag = ${target_makefile_frag} >>${Makefile} ;;
686 echo target_makefile_frag = ${invsubdir}${target_makefile_frag} >>${Makefile} ;;
689 case "${host_makefile_frag}" in
692 echo host_makefile_frag = ${host_makefile_frag} >>${Makefile} ;;
694 echo host_makefile_frag = ${invsubdir}${host_makefile_frag} >>${Makefile} ;;
697 if [ "${site_makefile_frag}" != "" ] ; then
698 echo site_makefile_frag = ${invsubdir}${site_makefile_frag} >>${Makefile}
701 # fixme: this shouldn't be in configure.
702 # Define macro CROSS_COMPILE in compilation if this is a cross-compiler.
703 case "${host_alias}" in
705 echo "ALL=all.internal" >> ${Makefile}
708 echo "CROSS=-DCROSS_COMPILE" >> ${Makefile}
709 echo "ALL=all.cross" >> ${Makefile}
713 # reset prefix, exec_prefix, srcdir, SUBDIRS, NONSUBDIRS,
714 # remove any form feeds.
715 if [ -z "${subdirs}" ]; then
716 rm -f ${subdir}/Makefile.tem2
717 sed -e "s:^SUBDIRS[ ]*=.*$:SUBDIRS = ${configdirs}:" \
718 -e "s:^NONSUBDIRS[ ]*=.*$:NONSUBDIRS = ${noconfigdirs}:" \
719 ${subdir}/Makefile.tem > ${subdir}/Makefile.tem2
720 rm -f ${subdir}/Makefile.tem
721 mv ${subdir}/Makefile.tem2 ${subdir}/Makefile.tem
723 sed -e "s:^prefix[ ]*=.*$:prefix = ${prefix}:" \
724 -e "s:^exec_prefix[ ]*=.*$:exec_prefix = ${exec_prefix}:" \
725 -e "s:^srcdir[ ]*=.*$:srcdir = ${makesrcdir}:" \
727 -e "s:^program_prefix[ ]*=.*$:program_prefix = ${program_prefix}:" \
728 -e "s:^program_suffix[ ]*=.*$:program_suffix = ${program_suffix}:" \
729 -e "s:^program_transform_name[ ]*=.*$:program_transform_name = ${program_transform_name}:" \
730 -e "s:^tooldir[ ]*=.*$:tooldir = ${tooldir}:" \
731 ${subdir}/Makefile.tem >> ${Makefile}
732 # final copy now in ${Makefile}
734 rm -f ${subdir}/Makefile.tem
736 case "${host_makefile_frag}" in
738 *) using="and \"${host_makefile_frag}\"" ;;
741 case "${target_makefile_frag}" in
743 *) using="${using} and \"${target_makefile_frag}\"" ;;
746 case "${site_makefile_frag}" in
748 *) using="${using} and \"${site_makefile_frag}\"" ;;
751 newusing=`echo "${using}" | sed 's/and/using/'`
753 echo "Created \"${Makefile}\" in" ${PWD=`pwd`} ${using}
757 # describe the chosen configuration in config.status.
758 # Make that file a shellscript which will reestablish
759 # the same configuration. Used in Makefiles to rebuild
762 case "${norecursion}" in
763 "") arguments="${arguments} -norecursion" ;;
767 if [ ${subdir} = . ] ; then
770 # This directory was configured as follows:
771 ${progname}" ${arguments} "
772 # ${using}" > ${subdir}/config.new
776 # This directory was configured as follows:
778 ${progname}" ${arguments} "
779 # ${using}" > ${subdir}/config.new
781 chmod a+x ${subdir}/config.new
782 if [ -r ${subdir}/config.back ] ; then
783 mv -f ${subdir}/config.back ${subdir}/config.status
785 ${moveifchange} ${subdir}/config.new ${subdir}/config.status
788 *) rm -f ${Makefile} ${subdir}/config.status ${links} ;;
792 # If there are subdirectories, then recur.
793 if [ -z "${norecursion}" -a -n "${configdirs}" ] ; then
794 for configdir in ${configdirs} ; do
795 eval echo Configuring ${configdir}... ${redirect}
797 if [ -d ${srcdir}/${configdir} ] ; then
801 if [ ! -d ./${configdir} ] ; then
810 ### figure out what to do with srcdir
812 ".") newsrcdir=${srcdir} ;; # no -srcdir option. We're building in place.
814 newsrcdir=${srcdir}/${configdir}
815 srcdiroption="-srcdir=${newsrcdir}"
817 *) # otherwise relative
818 newsrcdir=../${srcdir}/${configdir}
819 srcdiroption="-srcdir=${newsrcdir}"
823 ### check for guested configure, otherwise fix possibly relative progname
824 if [ -f ${newsrcdir}/configure ] ; then
825 recprog=${newsrcdir}/configure
827 case "${progname}" in
828 /*) recprog=${progname} ;;
829 *) recprog=../${progname} ;;
833 ### The recursion line is here.
834 if eval ${recprog} ${verbose} ${host_alias} -target=${target_alias} \
835 ${prefixoption} ${tmpdiroption} ${exec_prefixoption} \
836 ${srcdiroption} ${program_prefixoption} ${program_suffixoption} ${program_transform_nameoption} ${site_option} ${removing} ${redirect} ; then
844 eval echo Warning: source directory \"${srcdir}/${configdir}\" is missing. ${redirect}