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 report any problems running this configure script to
24 # Please do not send reports about other problems to this address. See
25 # gdb/README, gas/README, etc., for info on where and how to report
26 # problems about particular tools.
28 # This file was written by K. Richard Pixley.
31 # Shell script to create proper links to machine-dependent files in
32 # preparation for compilation.
34 # If configure succeeds, it leaves its status in config.status.
35 # If configure fails after disturbing the status quo,
36 # config.status is removed.
39 export PATH || (echo "OOPS, this isn't sh. Desperation time. I will feed myself to sh."; sh $0 $argv; kill $$)
48 #symbolic_link="echo ln -s"
50 # clear some things potentially inherited from environment.
53 Makefile_in=Makefile.in
60 floating_point=default
67 package_makefile_frag=
74 program_transform_name=
75 program_transform_nameoption=
90 ### we might need to use some other shell than /bin/sh for running subshells
92 config_shell=${CONFIG_SHELL-/bin/sh}
94 NO_EDIT="This file was generated automatically by configure. Do not edit."
96 ## this is a little touchy and won't always work, but...
98 ## if the argv[0] starts with a slash then it is an absolute name that can (and
99 ## must) be used as is.
101 ## otherwise, if argv[0] has no slash in it, we can assume that it is on the
102 ## path. Since PATH might include "." we also add `pwd` to the end of PATH.
106 # if PWD already has a value, it is probably wrong.
107 if [ -n "$PWD" ]; then PWD=`pwd`; fi
109 case "${progname}" in
113 PATH=$PATH:${PWD=`pwd`} ; export PATH
122 # Break out if there are no more args
129 # Get the first arg, and shuffle
133 # Make all options have two hyphens
134 orig_option=$option # Save original for error messages
137 -*) option=-$option ;;
140 # Split out the argument for options that take them
143 optarg=`echo $option | sed -e 's/^[^=]*=//'`
145 # These options have mandatory values. Since we didn't find an = sign,
146 # the value must be in the next argument
147 --b* | --cache* | --ex* | --ho* | --pre* | --program-p* | --program-s* | --program-t* | --si* | --sr* | --ta* | --tm* | --x-*)
153 # Now, process the options
157 case "$build_alias" in
158 "") build_alias=$optarg ;;
159 *) echo '***' Can only configure for one build machine at a time. 1>&2
166 *=*) other_options="${other_options} ${option}" ;;
167 *) other_options="${other_options} ${option}=${optarg}" ;;
171 enableopt=`echo ${option} | sed 's:^--disable-:enable_:;s:-:_:g'`
173 disableoptions="$disableoptions $option"
181 enableopt=`echo ${option} | sed 's:^--::;s:=.*$::;s:-:_:g'`
182 eval $enableopt="$optarg"
183 enableoptions="$enableoptions $option"
185 --exec-prefix* | --ex*)
187 exec_prefixoption="--exec-prefix=$optarg"
197 NOHOST) host_alias=$optarg ;;
198 *) echo '***' Can only configure for one host at a time. 1>&2
206 --norecursion | --no*)
211 prefixoption="--prefix=$optarg"
213 --program-prefix* | --program-p*)
214 program_prefix=$optarg
215 program_prefixoption="--program-prefix=$optarg"
217 --program-suffix* | --program-s*)
218 program_suffix=$optarg
219 program_suffixoption="--program-suffix=$optarg"
221 --program-transform-name* | --program-t*)
222 # Double any backslashes or dollar signs in the argument
223 program_transform_name="${program_transform_name} -e `echo ${optarg} | sed -e 's/\\\\/\\\\\\\\/g' -e 's/\\\$/$$/g'`"
224 program_transform_nameoption="${program_transform_nameoption} --program-transform-name='$optarg'"
229 --silent | --sil* | --quiet | --q*)
230 redirect=">/dev/null"
235 site_option="--site=$optarg"
238 # Remove trailing slashes. Otherwise, when the file name gets
239 # bolted into an object file as debug info, it has two slashes
240 # in it. Ordinarily this is ok, but emacs takes double slash
241 # to mean "forget the first part".
242 srcdir=`echo $optarg | sed -e 's:/$::'`
248 case $target_alias in
249 NOTARGET) target_alias=$optarg ;;
250 *) echo '***' Can only configure for one target at a time. 1>&2
257 tmpdiroption="--tmpdir=$optarg"
259 --verbose | --v | --verb*)
263 --version | --V | --vers*)
264 echo "This is Cygnus Configure version" `echo ${version} | sed 's/[ $:]//g'`
273 withopt=`echo ${option} | sed 's:^--::;s:=.*$::;s:-:_:g'`
274 eval $withopt="$optarg"
275 withoptions="$withoptions $option"
278 withopt=`echo ${option} | sed 's:^--::;s:out::;s:-:_:g'`
280 withoutoptions="$withoutoptions $option"
283 withoptions="$withoptions --with-x"
285 --x-i* | --x-l*) other_options="$other_options $orig_option"
288 echo "configure: Unrecognized option: \"$orig_option\"; use --help for usage." >&2
293 NOUNDEFS) undefs=$option ;;
294 *) echo '***' Can only configure for one host and one target at a time. 1>&2
302 # process host and target
304 # Do some error checking and defaulting for the host and target type.
306 # configure --host=HOST --target=TARGET UNDEFS
309 # 1. You aren't allowed to specify --host, --target, and undefs at the
311 # 2. Host defaults to undefs.
312 # 3. If undefs is not specified, then host defaults to the current host,
313 # as determined by config.guess.
314 # 4. Target defaults to undefs.
315 # 5. If undefs is not specified, then target defaults to host.
319 # Make sure that host, target & undefs aren't all specified at the
321 case $host_alias---$target_alias---$undefs in
322 NOHOST---*---* | *---NOTARGET---* | *---*---NOUNDEFS)
324 *) echo '***' Can only configure for one host and one target at a time. 1>&2
330 # Now, do defaulting for host.
335 # Neither --host option nor undefs were present.
337 guesssys=`echo ${progname} | sed 's/configure$/config.guess/'`
338 if host_alias=`${guesssys}`
340 # If the string we are going to use for
341 # the target is a prefix of the string
342 # we just guessed for the host, then
343 # assume we are running native, and force
344 # the same string for both target and host.
345 case $target_alias in
348 if expr $host_alias : $target_alias >/dev/null
350 host_alias=$target_alias
354 echo "Configuring for a ${host_alias} host." 1>&2
355 arguments="--host=$host_alias $arguments"
357 echo 'Config.guess failed to determine the host type. You need to specify one.' 1>&2
367 # Do defaulting for target. If --target option isn't present, default
368 # to undefs. If undefs isn't present, default to host.
369 case $target_alias in
373 target_alias=$host_alias
384 if [ -n "${fatal}" -o "${host_alias}" = "help" ] ; then
386 echo Usage: configure [OPTIONS] [HOST]
388 echo Options: [defaults in brackets]
389 echo ' --prefix=MYDIR install into MYDIR [/usr/local]'
390 echo ' --exec-prefix=MYDIR install host-dependent files into MYDIR [/usr/local]'
391 echo ' --help print this message [normal config]'
392 echo ' --build=BUILD configure for building on BUILD [BUILD=HOST]'
393 echo ' --host=HOST configure for HOST [determined via config.guess]'
394 echo ' --norecursion configure this directory only [recurse]'
395 echo ' --program-prefix=FOO prepend FOO to installed program names [""]'
396 echo ' --program-suffix=FOO append FOO to installed program names [""]'
397 echo ' --program-transform-name=P transform installed names by sed pattern P [""]'
398 echo ' --site=SITE configure with site-specific makefile for SITE'
399 echo ' --srcdir=DIR find the sources in DIR [. or ..]'
400 echo ' --target=TARGET configure for TARGET [TARGET=HOST]'
401 echo ' --tmpdir=TMPDIR create temporary files in TMPDIR [/tmp]'
402 echo ' --nfp configure for software floating point [hard float]'
403 echo ' --with-FOO, --with-FOO=BAR package FOO is available (parameter BAR)'
404 echo ' --without-FOO package FOO is NOT available'
405 echo ' --enable-FOO, --enable-FOO=BAR include feature FOO (parameter BAR)'
406 echo ' --disable-FOO do not include feature FOO'
408 echo 'Where HOST and TARGET are something like "sparc-sunos", "mips-sgi-irix5", etc.'
410 if [ -r config.status ] ; then
417 configsub=`echo ${progname} | sed 's/configure$/config.sub/'`
418 moveifchange=`echo ${progname} | sed 's/configure$/move-if-change/'`
420 # this is a hack. sun4 must always be a valid host alias or this will fail.
421 if ${configsub} sun4 >/dev/null 2>&1 ; then
424 echo '***' cannot find config.sub. 1>&2
429 if ${moveifchange} config.junk config.trash ; then
432 echo '***' cannot find move-if-change. 1>&2
435 rm -f config.junk config.trash
439 if [ -r configure.in ] ; then
442 if [ -r ${progname}.in ] ; then
443 srcdir=`echo ${progname} | sed 's:/configure$::'`
445 echo '***' "Can't find configure.in. Try using --srcdir=some_dir" 1>&2
453 ### warn about some conflicting configurations.
458 if [ -f ${srcdir}/config.status ] ; then
459 echo '***' Cannot configure here in \"${PWD=`pwd`}\" when \"${srcdir}\" is currently configured. 1>&2
464 # default exec_prefix
465 case "${exec_prefixoption}" in
466 "") exec_prefix="\$(prefix)" ;;
470 ### break up ${srcdir}/configure.in.
471 case "`grep '^# per\-host:' ${srcdir}/configure.in`" in
473 echo '***' ${srcdir}/configure.in has no \"per-host:\" line. 1>&2
479 case "`grep '^# per\-target:' ${srcdir}/configure.in`" in
481 echo '***' ${srcdir}/configure.in has no \"per-target:\" line. 1>&2
488 "") TMPDIR=/tmp ; export TMPDIR ;;
492 # keep this filename short for &%*%$*# 14 char file names
493 tmpfile=${TMPDIR}/cONf$$
494 # Note that under many versions of sh a trap handler for 0 will *override* any
495 # exit status you explicitly specify! At this point, the only non-error exit
496 # is at the end of the script; these actions are duplicated there, minus
497 # the "exit 1". Don't use "exit 0" anywhere after this without resetting the
498 # trap handler, or you'll lose.
499 trap "rm -f ${tmpfile}.com ${tmpfile}.tgt ${tmpfile}.hst ${tmpfile}.pos; exit 1" 0 1 2 15
501 # split ${srcdir}/configure.in into common, per-host, per-target,
502 # and post-target parts. Post-target is optional.
503 sed -e '/^# per\-host:/,$d' ${srcdir}/configure.in > ${tmpfile}.com
504 sed -e '1,/^# per\-host:/d' -e '/^# per\-target:/,$d' ${srcdir}/configure.in > ${tmpfile}.hst
505 if grep '^# post-target:' ${srcdir}/configure.in >/dev/null ; then
506 sed -e '1,/^# per\-target:/d' -e '/^# post\-target:/,$d' ${srcdir}/configure.in > ${tmpfile}.tgt
507 sed -e '1,/^# post\-target:/d' ${srcdir}/configure.in > ${tmpfile}.pos
509 sed -e '1,/^# per\-target:/d' ${srcdir}/configure.in > ${tmpfile}.tgt
513 ### do common part of configure.in
517 # some sanity checks on configure.in
518 case "${srctrigger}" in
520 echo '***' srctrigger not set in ${PWD=`pwd`}/configure.in. 1>&2
526 case "${build_alias}" in
529 if result=`${config_shell} ${configsub} ${build_alias}` ; then
530 buildopt="--build=${build_alias}"
531 build_cpu=`echo $result | sed 's/^\(.*\)-\(.*\)-\(.*\)$/\1/'`
532 build_vendor=`echo $result | sed 's/^\(.*\)-\(.*\)-\(.*\)$/\2/'`
533 build_os=`echo $result | sed 's/^\(.*\)-\(.*\)-\(.*\)$/\3/'`
534 build=${build_cpu}-${build_vendor}-${build_os}
536 echo "Unrecognized build system name ${build_alias}." 1>&2
542 if result=`${config_shell} ${configsub} ${host_alias}` ; then
545 echo "Unrecognized host system name ${host_alias}." 1>&2
548 host_cpu=`echo $result | sed 's/^\(.*\)-\(.*\)-\(.*\)$/\1/'`
549 host_vendor=`echo $result | sed 's/^\(.*\)-\(.*\)-\(.*\)$/\2/'`
550 host_os=`echo $result | sed 's/^\(.*\)-\(.*\)-\(.*\)$/\3/'`
551 host=${host_cpu}-${host_vendor}-${host_os}
555 if result=`${config_shell} ${configsub} ${target_alias}` ; then
558 echo "Unrecognized target system name ${target_alias}." 1>&2
561 target_cpu=`echo $result | sed 's/^\(.*\)-\(.*\)-\(.*\)$/\1/'`
562 target_vendor=`echo $result | sed 's/^\(.*\)-\(.*\)-\(.*\)$/\2/'`
563 target_os=`echo $result | sed 's/^\(.*\)-\(.*\)-\(.*\)$/\3/'`
564 target=${target_cpu}-${target_vendor}-${target_os}
568 # Find the source files, if location was not specified.
573 if [ ! -r ${srctrigger} ] ; then
580 if [ ! -r ${srcdir}/${srctrigger} ] ; then
581 case "${srcdirdefaulted}" in
582 "") echo '***' "${progname}: Can't find ${srcname} sources in ${PWD=`pwd`}/${srcdir}" 1>&2 ;;
583 *) echo '***' "${progname}: Can't find ${srcname} sources in ${PWD=`pwd`}/. or ${PWD=`pwd`}/.." 1>&2 ;;
586 echo '***' \(At least ${srctrigger} is missing.\) 1>&2
590 # Some systems (e.g., one of the i386-aix systems the gas testers are
591 # using) don't handle "\$" correctly, so don't use it here.
592 tooldir='$(exec_prefix)'/${target_alias}
594 if [ "${host_alias}" != "${target_alias}" ] ; then
595 if [ "${program_prefixoption}" = "" ] ; then
596 if [ "${program_suffixoption}" = "" ] ; then
597 if [ "${program_transform_nameoption}" = "" ] ; then
598 program_prefix=${target_alias}- ;
604 # Merge program_prefix and program_suffix onto program_transform_name.
605 # (program_suffix used to use $, but it's hard to preserve $ through both
607 if [ "${program_suffix}" != "" ] ; then
608 program_transform_name="-e s,\\\\(.*\\\\),\\\\1${program_suffix}, ${program_transform_name}"
611 if [ "${program_prefix}" != "" ] ; then
612 program_transform_name="-e s,^,${program_prefix}, ${program_transform_name}"
615 for subdir in . ${subdirs} ; do
617 # ${subdir} is relative path from . to the directory we're currently
619 # ${invsubdir} is inverse of ${subdir), *with* trailing /, if needed.
620 invsubdir=`echo ${subdir}/ | sed -e 's|\./||g' -e 's|[^/]*/|../|g'`
622 ### figure out what to do with srcdir
624 ".") # no -srcdir option. We're building in place.
627 makesrcdir=`echo ${srcdir}/${subdir} | sed -e 's|/\.$||'`
629 *) # otherwise relative
631 .) makesrcdir=${srcdir} ;;
632 *) makesrcdir=${invsubdir}${srcdir}/${subdir} ;;
637 if [ "${subdir}/" != "./" ] ; then
638 Makefile=${subdir}/Makefile
641 if [ ! -d ${subdir} ] ; then
642 if mkdir ${subdir} ; then
645 echo '***' "${progname}: could not make ${PWD=`pwd`}/${subdir}" 1>&2
650 case "${removing}" in
654 *) eval echo Building in ${subdir} ${redirect} ;;
657 # FIXME Should this be done recursively ??? (Useful for e.g. gdbtest)
658 # Set up the list of links to be made.
659 # ${links} is the list of link names, and ${files} is the list of names to link to.
662 configlinks="${links}"
663 if [ -r ${subdir}/config.status ] ; then
664 mv -f ${subdir}/config.status ${subdir}/config.back
666 while [ -n "${files}" ] ; do
667 # set file to car of files, files to cdr of files
668 set ${files}; file=$1; shift; files=$*
669 set ${links}; link=$1; shift; links=$*
671 if [ ! -r ${srcdir}/${file} ] ; then
672 echo '***' "${progname}: cannot create a link \"${link}\"," 1>&2
673 echo '***' "since the file \"${srcdir}/${file}\" does not exist." 1>&2
678 # Make a symlink if possible, otherwise try a hard link
679 if ${symbolic_link} ${srcdir}/${file} ${link} >/dev/null 2>&1 ; then
682 # We need to re-remove the file because Lynx leaves a
683 # very strange directory there when it fails an NFS symlink.
684 ${remove} -r -f ${link}
685 ${hard_link} ${srcdir}/${file} ${link}
687 if [ ! -r ${link} ] ; then
688 echo '***' "${progname}: unable to link \"${link}\" to \"${srcdir}/${file}\"." 1>&2
692 echo "Linked \"${link}\" to \"${srcdir}/${file}\"."
695 # Create a .gdbinit file which runs the one in srcdir
696 # and tells GDB to look there for source files.
698 if [ -r ${srcdir}/${subdir}/.gdbinit ] ; then
701 *) cat > ${subdir}/.gdbinit <<EOF
705 source ${makesrcdir}/.gdbinit
711 # Install a makefile, and make it set VPATH
712 # if necessary so that the sources are found.
713 # Also change its value of srcdir.
714 # NOTE: Makefile generation constitutes the majority of the time in configure. Hence, this section has
715 # been somewhat optimized and is perhaps a bit twisty.
717 # code is order so as to try to sed the smallest input files we know.
719 # the four makefile fragments MUST end up in the resulting Makefile in this order:
720 # package, target, host, and site. so do these separately because I don't trust the
721 # order of sed -e expressions.
723 if [ -f ${srcdir}/${subdir}/${Makefile_in} ] ; then
725 # Conditionalize for this site from "Makefile.in" (or whatever it's called) into Makefile.tem
726 rm -f ${subdir}/Makefile.tem
728 "") cp ${srcdir}/${subdir}/${Makefile_in} ${subdir}/Makefile.tem ;;
730 site_makefile_frag=${srcdir}/config/ms-${site}
732 if [ -f ${site_makefile_frag} ] ; then
733 sed -e "/^####/ r ${site_makefile_frag}" ${srcdir}/${subdir}/${Makefile_in} \
734 > ${subdir}/Makefile.tem
736 cp ${srcdir}/${subdir}/${Makefile_in} ${subdir}/Makefile.tem
741 # working copy now in ${subdir}/Makefile.tem
743 # Conditionalize the makefile for this host.
745 case "${host_makefile_frag}" in
746 "") mv ${subdir}/Makefile.tem ${Makefile} ;;
748 if [ ! -f ${host_makefile_frag} ] ; then
749 host_makefile_frag=${srcdir}/${host_makefile_frag}
751 if [ -f ${host_makefile_frag} ] ; then
752 sed -e "/^####/ r ${host_makefile_frag}" ${subdir}/Makefile.tem > ${Makefile}
754 echo '***' Expected host makefile fragment \"${host_makefile_frag}\" 1>&2
755 echo '***' is missing in ${PWD=`pwd`}. 1>&2
756 mv ${subdir}/Makefile.tem ${Makefile}
759 # working copy now in ${Makefile}
761 # Conditionalize the makefile for this target.
762 rm -f ${subdir}/Makefile.tem
763 case "${target_makefile_frag}" in
764 "") mv ${Makefile} ${subdir}/Makefile.tem ;;
766 if [ ! -f ${target_makefile_frag} ] ; then
767 target_makefile_frag=${srcdir}/${target_makefile_frag}
769 if [ -f ${target_makefile_frag} ] ; then
770 sed -e "/^####/ r ${target_makefile_frag}" ${Makefile} > ${subdir}/Makefile.tem
772 mv ${Makefile} ${subdir}/Makefile.tem
773 target_makefile_frag=
777 # real copy now in ${subdir}/Makefile.tem
779 # Conditionalize the makefile for this package.
781 case "${package_makefile_frag}" in
782 "") mv ${subdir}/Makefile.tem ${Makefile} ;;
784 if [ ! -f ${package_makefile_frag} ] ; then
785 package_makefile_frag=${srcdir}/${package_makefile_frag}
787 if [ -f ${package_makefile_frag} ] ; then
788 sed -e "/^####/ r ${package_makefile_frag}" ${subdir}/Makefile.tem > ${Makefile}
789 rm -f ${subdir}/Makefile.tem
791 echo '***' Expected package makefile fragment \"${package_makefile_frag}\" 1>&2
792 echo '***' is missing in ${PWD=`pwd`}. 1>&2
793 mv ${subdir}/Makefile.tem ${Makefile}
796 # working copy now in ${Makefile}
798 mv ${Makefile} ${subdir}/Makefile.tem
800 # real copy now in ${subdir}/Makefile.tem
802 # prepend warning about editting, and a bunch of variables.
804 cat > ${Makefile} <<EOF
806 VPATH = ${makesrcdir}
807 links = ${configlinks}
808 host_alias = ${host_alias}
809 host_cpu = ${host_cpu}
810 host_vendor = ${host_vendor}
812 host_canonical = ${host_cpu}-${host_vendor}-${host_os}
813 target_alias = ${target_alias}
814 target_cpu = ${target_cpu}
815 target_vendor = ${target_vendor}
816 target_os = ${target_os}
817 target_canonical = ${target_cpu}-${target_vendor}-${target_os}
821 *) cat >> ${Makefile} << EOF
822 build_alias = ${build_alias}
823 build_cpu = ${build_cpu}
824 build_vendor = ${build_vendor}
825 build_os = ${build_os}
826 build_canonical = ${build_cpu}-${build_vendor}-${build_os}
830 case "${package_makefile_frag}" in
832 /*) echo package_makefile_frag = ${package_makefile_frag} >>${Makefile} ;;
833 *) echo package_makefile_frag = ${invsubdir}${package_makefile_frag} >>${Makefile} ;;
836 case "${target_makefile_frag}" in
838 /*) echo target_makefile_frag = ${target_makefile_frag} >>${Makefile} ;;
839 *) echo target_makefile_frag = ${invsubdir}${target_makefile_frag} >>${Makefile} ;;
842 case "${host_makefile_frag}" in
844 /*) echo host_makefile_frag = ${host_makefile_frag} >>${Makefile} ;;
845 *) echo host_makefile_frag = ${invsubdir}${host_makefile_frag} >>${Makefile} ;;
848 if [ "${site_makefile_frag}" != "" ] ; then
849 echo site_makefile_frag = ${invsubdir}${site_makefile_frag} >>${Makefile}
852 # make sure that some sort of reasonable default exists for these
857 # reset prefix, exec_prefix, srcdir, SUBDIRS, NONSUBDIRS,
858 # remove any form feeds.
859 if [ -z "${subdirs}" ]; then
860 rm -f ${subdir}/Makefile.tem2
861 sed -e "s:^SUBDIRS[ ]*=.*$:SUBDIRS = ${configdirs}:" \
862 -e "s:^NONSUBDIRS[ ]*=.*$:NONSUBDIRS = ${noconfigdirs}:" \
863 ${subdir}/Makefile.tem > ${subdir}/Makefile.tem2
864 rm -f ${subdir}/Makefile.tem
865 mv ${subdir}/Makefile.tem2 ${subdir}/Makefile.tem
867 sed -e "s:^prefix[ ]*=.*$:prefix = ${prefix}:" \
868 -e "s:^exec_prefix[ ]*=.*$:exec_prefix = ${exec_prefix}:" \
869 -e "s:^SHELL[ ]*=.*$:SHELL = ${config_shell}:" \
870 -e "s:^srcdir[ ]*=.*$:srcdir = ${makesrcdir}:" \
872 -e "s:^program_prefix[ ]*=.*$:program_prefix = ${program_prefix}:" \
873 -e "s:^program_suffix[ ]*=.*$:program_suffix = ${program_suffix}:" \
874 -e "s:^program_transform_name[ ]*=.*$:program_transform_name = ${program_transform_name}:" \
875 -e "s:^tooldir[ ]*=.*$:tooldir = ${tooldir}:" \
876 ${subdir}/Makefile.tem >> ${Makefile}
877 # final copy now in ${Makefile}
880 echo "No Makefile.in found in ${srcdir}/${subdir}, unable to configure" 1>&2
883 rm -f ${subdir}/Makefile.tem
885 case "${host_makefile_frag}" in
887 *) using="and \"${host_makefile_frag}\"" ;;
890 case "${target_makefile_frag}" in
892 *) using="${using} and \"${target_makefile_frag}\"" ;;
895 case "${site_makefile_frag}" in
897 *) using="${using} and \"${site_makefile_frag}\"" ;;
900 newusing=`echo "${using}" | sed 's/and/using/'`
902 echo "Created \"${Makefile}\" in" ${PWD=`pwd`} ${using}
906 # describe the chosen configuration in config.status.
907 # Make that file a shellscript which will reestablish
908 # the same configuration. Used in Makefiles to rebuild
911 case "${norecursion}" in
912 "") arguments="${arguments} --norecursion" ;;
916 if [ ${subdir} = . ] ; then
919 # This directory was configured as follows:
920 ${progname}" ${arguments} "
921 # ${using}" > ${subdir}/config.new
925 # This directory was configured as follows:
927 ${progname}" ${arguments} "
928 # ${using}" > ${subdir}/config.new
930 chmod a+x ${subdir}/config.new
931 if [ -r ${subdir}/config.back ] ; then
932 mv -f ${subdir}/config.back ${subdir}/config.status
934 ${moveifchange} ${subdir}/config.new ${subdir}/config.status
937 *) rm -f ${Makefile} ${subdir}/config.status ${links} ;;
941 # If there are subdirectories, then recur.
942 if [ -z "${norecursion}" -a -n "${configdirs}" ] ; then
943 for configdir in ${configdirs} ; do
945 if [ -d ${srcdir}/${configdir} ] ; then
946 eval echo Configuring ${configdir}... ${redirect}
950 if [ ! -d ./${configdir} ] ; then
951 if mkdir ./${configdir} ; then
954 echo '***' "${progname}: could not make ${PWD=`pwd`}/${configdir}" 1>&2
964 ### figure out what to do with srcdir
966 ".") newsrcdir=${srcdir} ;; # no -srcdir option. We're building in place.
968 newsrcdir=${srcdir}/${configdir}
969 srcdiroption="--srcdir=${newsrcdir}"
971 *) # otherwise relative
972 newsrcdir=../${srcdir}/${configdir}
973 srcdiroption="--srcdir=${newsrcdir}"
977 ### check for guested configure, otherwise fix possibly relative progname
978 if [ -f ${newsrcdir}/configure ] ; then
979 recprog=${newsrcdir}/configure
980 elif [ -f ${newsrcdir}/configure.in ] ; then
981 case "${progname}" in
982 /*) recprog=${progname} ;;
983 *) recprog=../${progname} ;;
986 eval echo No configuration information in ${configdir} ${redirect}
990 ### The recursion line is here.
991 if [ ! -z "${recprog}" ] ; then
992 if eval ${config_shell} ${recprog} ${verbose} ${buildopt} --host=${host_alias} --target=${target_alias} \
993 ${prefixoption} ${tmpdiroption} ${exec_prefixoption} \
994 ${srcdiroption} ${program_prefixoption} ${program_suffixoption} ${program_transform_nameoption} ${site_option} ${withoptions} ${withoutoptions} ${enableoptions} ${disableoptions} ${removing} ${other_options} ${redirect} ; then
997 echo Configure in `pwd` failed, exiting. 1>&2
1007 # Perform the same cleanup as the trap handler, minus the "exit 1" of course,
1008 # and reset the trap handler.
1009 rm -f ${tmpfile}.com ${tmpfile}.tgt ${tmpfile}.hst ${tmpfile}.pos