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
56 floating_point=default
68 package_makefile_frag=
75 program_transform_name=
76 program_transform_nameoption=
91 ### we might need to use some other shell than /bin/sh for running subshells
93 config_shell=${CONFIG_SHELL-}
95 NO_EDIT="This file was generated automatically by configure. Do not edit."
97 ## this is a little touchy and won't always work, but...
99 ## if the argv[0] starts with a slash then it is an absolute name that can (and
100 ## must) be used as is.
102 ## otherwise, if argv[0] has no slash in it, we can assume that it is on the
103 ## path. Since PATH might include "." we also add `pwd` to the end of PATH.
107 # if PWD already has a value, it is probably wrong.
108 if [ -n "$PWD" ]; then PWD=`pwd`; fi
110 case "${progname}" in
114 PATH=$PATH:${PWD=`pwd`} ; export PATH
120 # handle things that might have args following as separate words
121 if [ -n "${next_prefix}" ] ; then prefix=${arg} ; prefixoption="-prefix=${prefix}" ; next_prefix=
122 elif [ -n "${next_exec_prefix}" ] ; then
124 exec_prefixoption="-exec-prefix=${exec_prefix}"
126 elif [ -n "${next_site}" ] ; then site=${arg} ; site_option=-site=${site} ; next_site=
127 # remove any possible trailing slash from srcdir. See note below.
128 elif [ -n "${next_srcdir}" ] ; then srcdir=`echo ${arg} | sed -e 's:/$::'` ; next_srcdir=
129 elif [ -n "${next_program_prefix}" ] ; then
130 program_prefix=${arg}
131 program_prefixoption="-program_prefix=${program_prefix}"
133 elif [ -n "${next_program_suffix}" ] ; then
134 program_suffix=${arg}
135 program_suffixoption="-program_suffix=${program_suffix}"
137 elif [ -n "${next_program_transform_name}" ] ; then
138 # Double any backslashes or dollar signs in the argument
139 if [ -n "${arg}" ] ; then
140 program_transform_name="${program_transform_name} -e `echo ${arg} | sed -e 's/\\\\/\\\\\\\\/g' -e 's/\\\$/$$/g'`"
142 program_transform_nameoption="${program_transform_nameoption} --program-transform-name='${arg}'"
143 next_program_transform_name=
144 elif [ -n "${next_target}" ] ; then
146 case "${target_alias}" in
148 target_alias="${arg}"
151 echo '***' Can only configure for one target at a time. 1>&2
155 elif [ -n "${next_tmpdir}" ] ; then
157 tmpdiroption="--tmpdir=${arg}"
162 -exec_prefix=* | --exec_prefix=* | --exec_prefi=* | --exec_pref=* | --exec_pre=* | --exec_pr=* | --exec_p=* | --exec_=* | --exec=* | --exe=* | --ex=* | --e=* | -exec-prefix=* | --exec-prefix=* | --exec-prefi=* | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* )
163 exec_prefix=`echo ${arg} | sed 's/^[-a-z_]*=//'`
164 exec_prefixoption=${arg}
166 -exec_prefix | --exec_prefix | --exec_prefi | --exec_pref | --exec_pre | --exec_pr | --exec_p | --exec_ | --exec | --exe | --ex | --e | -exec-prefix | --exec-prefix | --exec-prefi | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec-)
175 -host=* | --host=* | --hos=* | --ho=*)
176 case "${host_alias}" in
178 host_alias="`echo ${arg} | sed 's/^[-a-z]*=//'`"
181 echo '***' Can only configure for one host at a time. 1>&2
189 -norecursion | --no*)
192 -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=*)
193 prefix=`echo ${arg} | sed 's/^[-a-z]*=//'`
196 -prefix | --prefix | --prefi | --pref | --pre)
199 -rm | --rm) removing=${arg} ;;
200 -program_prefix=* | --program_prefix=* | --program_prefi=* | --program_pref=* | --program_pre=* | --program_pr=* | --program_p=* | -program-prefix=* | --program-prefix=* | --program-prefi=* | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*)
201 program_prefix=`echo ${arg} | sed 's/^[-a-z_]*=//'`
202 program_prefixoption=${arg}
204 -program_prefix | --program_prefix | --program_prefi | --program_pref | --program_pre | --program_pr | --program_p | -program-prefix | --program-prefix | --program-prefi | --program-pref | --program-pre | --program-pr | --program-p)
205 next_program_prefix=yes
207 -program_suffix=* | --program_suffix=* | --program_suffi=* | --program_suff=* | --program_suf=* | --program_su=* | --program_s=* | -program-suffix=* | --program-suffix=* | --program-suffi=* | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*)
208 program_suffix=`echo ${arg} | sed 's/^[-a-z_]*=//'`
209 program_suffixoption=${arg}
211 -program_suffix | --program_suffix | --program_suffi | --program_suff | --program_suf | --program_su | --program_s |-program-suffix | --program-suffix | --program-suffi | --program-suff | --program-suf | --program-su | --program-s)
212 next_program_suffix=yes
214 -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=* | -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=*)
215 arg=`echo ${arg} | sed -e 's/^[-a-z_]*=//'`
216 # Double any \ or $ in the argument
217 if [ -n "${arg}" ] ; then
218 program_transform_name="${program_transform_name} -e `echo ${arg} | sed -e 's/\\\\/\\\\\\\\/g' -e 's/\\\$/$$/g'`"
220 program_transform_nameoption="${program_transform_nameoption} --program-transform-name='${arg}'"
222 -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 | -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)
223 next_program_transform_name=yes
225 -site=* | --site=* | --sit=* | --si=*)
227 site=`echo ${arg} | sed 's/^[-a-z]*=//'`
229 -site | --site | --sit)
232 # remove trailing slashes. Otherwise, when the file name gets
233 # bolted into an object file as debug info, it has two slashes in
234 # it. Ordinarily this is ok, but emacs takes double slash to
235 # mean "forget the first part".
236 -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*)
237 srcdir=`echo ${arg} | sed 's/^[-a-z]*=//' | sed -e 's:/$::'`
239 -srcdir | --srcdir | --srcdi | --srcd | --src | --sr)
242 -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=*)
243 case "${target_alias}" in
244 "") target_alias="`echo ${arg} | sed 's/^[-a-z]*=//'`" ;;
246 echo '***' Can only configure for one target at a time. 1>&2
251 -target | --target | --targe | --targ | --tar | --ta)
254 -tmpdir=* | --tmpdir=* | --tmpdi=* | --tmpd=* | --tmp=* | --tm=*)
256 TMPDIR=`echo ${arg} | sed 's/^[-a-z]*=//'`
258 -tmpdir | --tmpdir | --tmpdi | --tmpd | --tmp | --tm)
265 -version | -V | --version | --V)
266 echo "This is Cygnus Configure version" `echo ${version} | sed 's/[ $:]//g'`
269 -with*=* | --with*=*)
270 withopt=`echo ${arg} | sed 's:^-*\(with[^=]*\)=.*$:\1:;s/-/_/g'`
271 withval=`echo ${arg} | sed 's:^-*with[^=]*=\(.*\)$:\1:'`
272 eval $withopt="$withval"
273 withoptions="$withoptions $arg"
275 -without* | --without*)
276 withopt=`echo ${arg} | sed 's:^-*without:with:;s/-/_/g'`
278 withoutoptions="$withoutoptions $arg"
281 withopt=`echo ${arg} | sed 's:^-*with:with:;s/-/_/g'`
283 withoptions="$withoptions $arg"
288 echo "Unrecognized option: \"${arg}\"". ;
298 echo '***' Can only configure for one host and one target at a time. 1>&2
307 # process host and target
310 # # Complain if an arg is missing
311 # if [ -z "${host_alias}" ] ; then
313 # echo "configure: No HOST specified." ;
318 ### This is a bit twisted.
319 ### * if all three are specified, this is an error.
320 ### * if we have neither hosts, nor unadorned args, this is an error.
321 ### * if no hosts are specified, then the unadorned args are hosts, but if
322 ### there were none, this is an error.
323 ### * if no targets are specified, then the unadorned args are targets, but if
324 ### there were no unadorned args, then the hosts are also targets.
326 if [ -n "${host_alias}" -a -n "${target_alias}" -a -n "${undefs}" ] ; then
327 echo '***' Can only configure for one host and one target at a time. 1>&2
329 elif [ -z "${host_alias}" -a -z "${undefs}" ] ; then
330 guesssys=`echo ${progname} | sed 's/configure$/config.guess/'`
331 if tmp_alias=`${guesssys}` ; then
332 echo "Configuring for a ${tmp_alias} host." 1>&2
333 host_alias=${tmp_alias}
334 case "${target_alias}" in
335 "") target_alias=${tmp_alias} ;;
338 arguments="--host=${host_alias} ${arguments}"
340 echo 'Config.guess failed to determine the host type. You need to specify one.' 1>&2
344 case "${host_alias}" in
345 "") host_alias=${undefs} ;;
349 case "${target_alias}" in
352 "") target_alias=${host_alias} ;;
353 *) target_alias=${undefs} ;;
363 if [ -n "${fatal}" -o "${host_alias}" = "help" ] ; then
364 (echo "Usage: configure HOST" ;
366 echo "Options: [defaults in brackets]" ;
367 echo " --prefix=MYDIR configure for installation of host dependent files into MYDIR. [\"/usr/local\"]" ;
368 echo " --exec-prefix=MYDIR configure for installation of host dependent files into MYDIR. [\"/usr/local\"]" ;
369 echo " --help print this message. [normal config]" ;
370 echo " --norecursion configure this directory only. [recurse]" ;
371 echo " --program-prefix=FOO install programs with FOO prepended to their names. [ \"\" ]" ;
372 echo " --program-suffix=FOO install programs with FOO appended to their names. [ \"\" ]" ;
373 echo " --program-transform-name=FOO install programs with names transformed by sed pattern FOO. [ \"\" ]" ;
374 echo " --site=SITE configure with site specific makefile for SITE" ;
375 echo " --srcdir=DIR find the sources in DIR. [\".\" or \"..\"]" ;
376 echo " --target=TARGET configure for TARGET. [TARGET = HOST]" ;
377 echo " --tmpdir=TMPDIR create temporary files in TMPDIR. [ TMPDIR = \"/tmp\" ]" ;
378 echo " --nfp configure the compilers default to soft floating point. [hard float]" ;
379 echo " --with-FOO, --with-FOO=BAR specify that FOO is available"
380 echo " --without-FOO specify that FOO is NOT available"
382 echo "Where HOST and TARGET are something like \"vax\", \"sun3\", \"encore\", etc." ;
385 if [ -r config.status ] ; then
392 configsub=`echo ${progname} | sed 's/configure$/config.sub/'`
393 moveifchange=`echo ${progname} | sed 's/configure$/move-if-change/'`
395 # this is a hack. sun4 must always be a valid host alias or this will fail.
396 if ${configsub} sun4 >/dev/null 2>&1 ; then
399 echo '***' cannot find config.sub. 1>&2
404 if ${moveifchange} config.junk config.trash ; then
407 echo '***' cannot find move-if-change. 1>&2
410 rm -f config.junk config.trash
414 if [ -r configure.in ] ; then
417 if [ -r ${progname}.in ] ; then
418 srcdir=`echo ${progname} | sed 's:/configure$::'`
420 echo '***' "Can't find configure.in. Try using -srcdir=some_dir" 1>&2
428 ### warn about some conflicting configurations.
433 if [ -f ${srcdir}/config.status ] ; then
434 echo '***' Cannot configure here in \"${PWD=`pwd`}\" when \"${srcdir}\" is currently configured. 1>&2
439 # default exec_prefix
440 case "${exec_prefix}" in
441 "") exec_prefix="\$(prefix)" ;;
445 ### break up ${srcdir}/configure.in.
446 case "`grep '^# per\-host:' ${srcdir}/configure.in`" in
448 echo '***' ${srcdir}/configure.in has no "per-host:" line. 1>&2
454 case "`grep '^# per\-target:' ${srcdir}/configure.in`" in
456 echo '***' ${srcdir}/configure.in has no "per-target:" line. 1>&2
463 "") TMPDIR=/tmp ; export TMPDIR ;;
467 # keep this filename short for &%*%$*# 14 char file names
468 tmpfile=${TMPDIR}/cONf$$
469 trap "rm -f ${tmpfile}.com ${tmpfile}.tgt ${tmpfile}.hst ${tmpfile}.pos" 0
471 # split ${srcdir}/configure.in into common, per-host, per-target,
472 # and post-target parts. Post-target is optional.
473 sed -e '/^# per\-host:/,$d' ${srcdir}/configure.in > ${tmpfile}.com
474 sed -e '1,/^# per\-host:/d' -e '/^# per\-target:/,$d' ${srcdir}/configure.in > ${tmpfile}.hst
475 if grep '^# post-target:' ${srcdir}/configure.in >/dev/null ; then
476 sed -e '1,/^# per\-target:/d' -e '/^# post\-target:/,$d' ${srcdir}/configure.in > ${tmpfile}.tgt
477 sed -e '1,/^# post\-target:/d' ${srcdir}/configure.in > ${tmpfile}.pos
479 sed -e '1,/^# per\-target:/d' ${srcdir}/configure.in > ${tmpfile}.tgt
483 ### do common part of configure.in
487 # some sanity checks on configure.in
488 case "${srctrigger}" in
490 echo '***' srctrigger not set in ${PWD=`pwd`}/configure.in. 1>&2
496 result=`${configsub} ${host_alias}`
497 host_cpu=`echo $result | sed 's/^\(.*\)-\(.*\)-\(.*\)$/\1/'`
498 host_vendor=`echo $result | sed 's/^\(.*\)-\(.*\)-\(.*\)$/\2/'`
499 host_os=`echo $result | sed 's/^\(.*\)-\(.*\)-\(.*\)$/\3/'`
500 host=${host_cpu}-${host_vendor}-${host_os}
504 result=`${configsub} ${target_alias}`
505 target_cpu=`echo $result | sed 's/^\(.*\)-\(.*\)-\(.*\)$/\1/'`
506 target_vendor=`echo $result | sed 's/^\(.*\)-\(.*\)-\(.*\)$/\2/'`
507 target_os=`echo $result | sed 's/^\(.*\)-\(.*\)-\(.*\)$/\3/'`
508 target=${target_cpu}-${target_vendor}-${target_os}
512 # Find the source files, if location was not specified.
517 if [ ! -r ${srctrigger} ] ; then
524 if [ ! -r ${srcdir}/${srctrigger} ] ; then
525 case "${srcdirdefaulted}" in
526 "") echo '***' "${progname}: Can't find ${srcname} sources in ${PWD=`pwd`}/${srcdir}" 1>&2 ;;
527 *) echo '***' "${progname}: Can't find ${srcname} sources in ${PWD=`pwd`}/. or ${PWD=`pwd`}/.." 1>&2 ;;
530 echo '***' \(At least ${srctrigger} is missing.\) 1>&2
534 # Some systems (e.g., one of the i386-aix systems the gas testers are
535 # using) don't handle "\$" correctly, so don't use it here.
536 tooldir='$(exec_prefix)'/${target_alias}
538 if [ "${host_alias}" != "${target_alias}" ] ; then
539 if [ "${program_prefixoption}" = "" ] ; then
540 if [ "${program_suffixoption}" = "" ] ; then
541 if [ "${program_transform_nameoption}" = "" ] ; then
542 program_prefix=${target_alias}- ;
548 # Merge program_prefix and program_suffix onto program_transform_name
549 # Use a double $ so that make ignores it
550 if [ "${program_suffix}" != "" ] ; then
551 program_transform_name="-e s/\$\$/${program_suffix}/ ${program_transform_name}"
554 if [ "${program_prefix}" != "" ] ; then
555 program_transform_name="-e s/^/${program_prefix}/ ${program_transform_name}"
558 for subdir in . ${subdirs} ; do
560 # ${subdir} is relative path from . to the directory we're currently
562 # ${invsubdir} is inverse of ${subdir), *with* trailing /, if needed.
563 invsubdir=`echo ${subdir}/ | sed -e 's|\./||g' -e 's|[^/]*/|../|g'`
565 ### figure out what to do with srcdir
567 ".") # no -srcdir option. We're building in place.
570 makesrcdir=`echo ${srcdir}/${subdir} | sed -e 's|/\.$||'`
572 *) # otherwise relative
574 .) makesrcdir=${srcdir} ;;
575 *) makesrcdir=${invsubdir}${srcdir}/${subdir} ;;
580 if [ "${subdir}/" != "./" ] ; then
581 Makefile=${subdir}/Makefile
584 if [ ! -d ${subdir} ] ; then
585 if mkdir ${subdir} ; then
588 echo '***' "${progname}: could not make ${PWD=`pwd`}/${subdir}" 1>&2
593 case "${removing}" in
597 *) eval echo Building in ${subdir} ${redirect} ;;
600 # FIXME Should this be done recursively ??? (Useful for e.g. gdbtest)
601 # Set up the list of links to be made.
602 # ${links} is the list of link names, and ${files} is the list of names to link to.
605 configlinks="${links}"
606 if [ -r ${subdir}/config.status ] ; then
607 mv -f ${subdir}/config.status ${subdir}/config.back
609 while [ -n "${files}" ] ; do
610 # set file to car of files, files to cdr of files
611 set ${files}; file=$1; shift; files=$*
612 set ${links}; link=$1; shift; links=$*
614 if [ ! -r ${srcdir}/${file} ] ; then
615 echo '***' "${progname}: cannot create a link \"${link}\"," 1>&2
616 echo '***' "since the file \"${srcdir}/${file}\" does not exist." 1>&2
621 # Make a symlink if possible, otherwise try a hard link
622 ${symbolic_link} ${srcdir}/${file} ${link} 2>/dev/null || ${hard_link} ${srcdir}/${file} ${link}
624 if [ ! -r ${link} ] ; then
625 echo '***' "${progname}: unable to link \"${link}\" to \"${srcdir}/${file}\"." 1>&2
629 echo "Linked \"${link}\" to \"${srcdir}/${file}\"."
632 # Create a .gdbinit file which runs the one in srcdir
633 # and tells GDB to look there for source files.
635 if [ -r ${srcdir}/${subdir}/.gdbinit ] ; then
638 *) cat > ${subdir}/.gdbinit <<EOF
642 source ${makesrcdir}/.gdbinit
648 # Install a makefile, and make it set VPATH
649 # if necessary so that the sources are found.
650 # Also change its value of srcdir.
651 # NOTE: Makefile generation constitutes the majority of the time in configure. Hence, this section has
652 # been somewhat optimized and is perhaps a bit twisty.
654 # code is order so as to try to sed the smallest input files we know.
656 # the four makefile fragments MUST end up in the resulting Makefile in this order:
657 # package, target, host, and site. so do these separately because I don't trust the
658 # order of sed -e expressions.
660 if [ -f ${srcdir}/${subdir}/${Makefile_in} ] ; then
662 # Conditionalize for this site from "Makefile.in" (or whatever it's called) into Makefile.tem
663 rm -f ${subdir}/Makefile.tem
665 "") cp ${srcdir}/${subdir}/${Makefile_in} ${subdir}/Makefile.tem ;;
667 site_makefile_frag=${srcdir}/config/ms-${site}
669 if [ -f ${site_makefile_frag} ] ; then
670 sed -e "/^####/ r ${site_makefile_frag}" ${srcdir}/${subdir}/${Makefile_in} \
671 > ${subdir}/Makefile.tem
673 cp ${srcdir}/${subdir}/${Makefile_in} ${subdir}/Makefile.tem
678 # working copy now in ${subdir}/Makefile.tem
680 # Conditionalize the makefile for this host.
682 case "${host_makefile_frag}" in
683 "") mv ${subdir}/Makefile.tem ${Makefile} ;;
685 if [ ! -f ${host_makefile_frag} ] ; then
686 host_makefile_frag=${srcdir}/${host_makefile_frag}
688 if [ -f ${host_makefile_frag} ] ; then
689 sed -e "/^####/ r ${host_makefile_frag}" ${subdir}/Makefile.tem > ${Makefile}
691 echo '***' Expected host makefile fragment \"${host_makefile_frag}\" 1>&2
692 echo '***' is missing in ${PWD=`pwd`}. 1>&2
693 mv ${subdir}/Makefile.tem ${Makefile}
696 # working copy now in ${Makefile}
698 # Conditionalize the makefile for this target.
699 rm -f ${subdir}/Makefile.tem
700 case "${target_makefile_frag}" in
701 "") mv ${Makefile} ${subdir}/Makefile.tem ;;
703 if [ ! -f ${target_makefile_frag} ] ; then
704 target_makefile_frag=${srcdir}/${target_makefile_frag}
706 if [ -f ${target_makefile_frag} ] ; then
707 sed -e "/^####/ r ${target_makefile_frag}" ${Makefile} > ${subdir}/Makefile.tem
709 mv ${Makefile} ${subdir}/Makefile.tem
710 target_makefile_frag=
714 # real copy now in ${subdir}/Makefile.tem
716 # Conditionalize the makefile for this package.
718 case "${package_makefile_frag}" in
719 "") mv ${subdir}/Makefile.tem ${Makefile} ;;
721 if [ ! -f ${package_makefile_frag} ] ; then
722 package_makefile_frag=${srcdir}/${package_makefile_frag}
724 if [ -f ${package_makefile_frag} ] ; then
725 sed -e "/^####/ r ${package_makefile_frag}" ${subdir}/Makefile.tem > ${Makefile}
727 echo '***' Expected package makefile fragment \"${package_makefile_frag}\" 1>&2
728 echo '***' is missing in ${PWD=`pwd`}. 1>&2
729 mv ${subdir}/Makefile.tem ${Makefile}
732 # working copy now in ${Makefile}
734 mv ${Makefile} ${subdir}/Makefile.tem
736 # real copy now in ${subdir}/Makefile.tem
738 # prepend warning about editting, and a bunch of variables.
740 cat > ${Makefile} <<EOF
742 VPATH = ${makesrcdir}
743 links = ${configlinks}
744 host_alias = ${host_alias}
745 host_cpu = ${host_cpu}
746 host_vendor = ${host_vendor}
748 host_canonical = ${host_cpu}-${host_vendor}-${host_os}
749 target_alias = ${target_alias}
750 target_cpu = ${target_cpu}
751 target_vendor = ${target_vendor}
752 target_os = ${target_os}
753 target_canonical = ${target_cpu}-${target_vendor}-${target_os}
755 case "${package_makefile_frag}" in
757 /*) echo package_makefile_frag = ${package_makefile_frag} >>${Makefile} ;;
758 *) echo package_makefile_frag = ${invsubdir}${package_makefile_frag} >>${Makefile} ;;
761 case "${target_makefile_frag}" in
763 /*) echo target_makefile_frag = ${target_makefile_frag} >>${Makefile} ;;
764 *) echo target_makefile_frag = ${invsubdir}${target_makefile_frag} >>${Makefile} ;;
767 case "${host_makefile_frag}" in
769 /*) echo host_makefile_frag = ${host_makefile_frag} >>${Makefile} ;;
770 *) echo host_makefile_frag = ${invsubdir}${host_makefile_frag} >>${Makefile} ;;
773 if [ "${site_makefile_frag}" != "" ] ; then
774 echo site_makefile_frag = ${invsubdir}${site_makefile_frag} >>${Makefile}
777 # reset prefix, exec_prefix, srcdir, SUBDIRS, NONSUBDIRS,
778 # remove any form feeds.
779 if [ -z "${subdirs}" ]; then
780 rm -f ${subdir}/Makefile.tem2
781 sed -e "s:^SUBDIRS[ ]*=.*$:SUBDIRS = ${configdirs}:" \
782 -e "s:^NONSUBDIRS[ ]*=.*$:NONSUBDIRS = ${noconfigdirs}:" \
783 ${subdir}/Makefile.tem > ${subdir}/Makefile.tem2
784 rm -f ${subdir}/Makefile.tem
785 mv ${subdir}/Makefile.tem2 ${subdir}/Makefile.tem
787 sed -e "s:^prefix[ ]*=.*$:prefix = ${prefix}:" \
788 -e "s:^exec_prefix[ ]*=.*$:exec_prefix = ${exec_prefix}:" \
789 -e "s:^srcdir[ ]*=.*$:srcdir = ${makesrcdir}:" \
791 -e "s:^program_prefix[ ]*=.*$:program_prefix = ${program_prefix}:" \
792 -e "s:^program_suffix[ ]*=.*$:program_suffix = ${program_suffix}:" \
793 -e "s:^program_transform_name[ ]*=.*$:program_transform_name = ${program_transform_name}:" \
794 -e "s:^tooldir[ ]*=.*$:tooldir = ${tooldir}:" \
795 ${subdir}/Makefile.tem >> ${Makefile}
796 # final copy now in ${Makefile}
799 echo "No Makefile.in found in ${srcdir}/${subdir}, unable to configure" 1>&2
802 rm -f ${subdir}/Makefile.tem
804 case "${host_makefile_frag}" in
806 *) using="and \"${host_makefile_frag}\"" ;;
809 case "${target_makefile_frag}" in
811 *) using="${using} and \"${target_makefile_frag}\"" ;;
814 case "${site_makefile_frag}" in
816 *) using="${using} and \"${site_makefile_frag}\"" ;;
819 newusing=`echo "${using}" | sed 's/and/using/'`
821 echo "Created \"${Makefile}\" in" ${PWD=`pwd`} ${using}
825 # describe the chosen configuration in config.status.
826 # Make that file a shellscript which will reestablish
827 # the same configuration. Used in Makefiles to rebuild
830 case "${norecursion}" in
831 "") arguments="${arguments} -norecursion" ;;
835 if [ ${subdir} = . ] ; then
838 # This directory was configured as follows:
839 ${progname}" ${arguments} "
840 # ${using}" > ${subdir}/config.new
844 # This directory was configured as follows:
846 ${progname}" ${arguments} "
847 # ${using}" > ${subdir}/config.new
849 chmod a+x ${subdir}/config.new
850 if [ -r ${subdir}/config.back ] ; then
851 mv -f ${subdir}/config.back ${subdir}/config.status
853 ${moveifchange} ${subdir}/config.new ${subdir}/config.status
856 *) rm -f ${Makefile} ${subdir}/config.status ${links} ;;
860 # If there are subdirectories, then recur.
861 if [ -z "${norecursion}" -a -n "${configdirs}" ] ; then
862 for configdir in ${configdirs} ; do
864 if [ -d ${srcdir}/${configdir} ] ; then
865 eval echo Configuring ${configdir}... ${redirect}
869 if [ ! -d ./${configdir} ] ; then
870 if mkdir ./${configdir} ; then
873 echo '***' "${progname}: could not make ${PWD=`pwd`}/${configdir}" 1>&2
883 ### figure out what to do with srcdir
885 ".") newsrcdir=${srcdir} ;; # no -srcdir option. We're building in place.
887 newsrcdir=${srcdir}/${configdir}
888 srcdiroption="-srcdir=${newsrcdir}"
890 *) # otherwise relative
891 newsrcdir=../${srcdir}/${configdir}
892 srcdiroption="-srcdir=${newsrcdir}"
896 ### check for guested configure, otherwise fix possibly relative progname
897 if [ -f ${newsrcdir}/configure ] ; then
898 recprog=${newsrcdir}/configure
899 elif [ -f ${newsrcdir}/configure.in ] ; then
900 case "${progname}" in
901 /*) recprog=${progname} ;;
902 *) recprog=../${progname} ;;
905 echo No configuration information in ${configdir} ${redirect}
909 ### The recursion line is here.
910 if [ ! -z "${recprog}" ] ; then
911 if eval ${config_shell} ${recprog} ${verbose} --host=${host_alias} --target=${target_alias} \
912 ${prefixoption} ${tmpdiroption} ${exec_prefixoption} \
913 ${srcdiroption} ${program_prefixoption} ${program_suffixoption} ${program_transform_nameoption} ${site_option} ${withoptions} ${withoutoptions} ${removing} ${redirect} ; then