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.
100 # if PWD already has a value, it is probably wrong.
101 if [ -n "$PWD" ]; then PWD
=`pwd`; fi
103 case "${progname}" in
107 PATH
=$PATH:${PWD=`pwd`} ; export PATH
113 # handle things that might have args following as separate words
114 if [ -n "${next_prefix}" ] ; then prefix=${arg} ; prefixoption="-prefix=${prefix}" ; next_prefix
=
115 elif [ -n "${next_exec_prefix}" ] ; then
117 exec_prefixoption
="-exec_prefix=${exec_prefix}"
119 elif [ -n "${next_site}" ] ; then site=${arg} ; site_option=-site=${site} ; next_site=
120 # remove any possible trailing slash from srcdir. See note below.
121 elif [ -n "${next_srcdir}" ] ; then srcdir=`echo ${arg} | sed -e 's:/$::'` ; next_srcdir=
122 elif [ -n "${next_program_prefix}" ] ; then
123 program_prefix=${arg}
124 program_prefixoption="-program_prefix=${program_prefix}"
126 elif [ -n "${next_program_suffix}" ] ; then
127 program_suffix=${arg}
128 program_suffixoption="-program_suffix=${program_suffix}"
130 elif [ -n "${next_program_transform_name}" ] ; then
131 # Double any backslashes or dollar signs in the argument
132 program_transform_name="${program_transform_name} -e `echo ${arg} | sed -e 's/\\\\/\\\\\\\\/g' -e 's/\\\$/$$/g'`"
133 program_transform_nameoption="${program_transform_nameoption} -program_transform_name='${arg}'"
134 next_program_transform_name=
135 elif [ -n "${next_target}" ] ; then
137 case "${target_alias}" in
139 target_alias="${arg}"
142 echo '***' Can only configure for one target at a time. 1>&2
146 elif [ -n "${next_tmpdir}" ] ; then
148 tmpdiroption="--tmpdir=${arg}"
153 -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-=* )
154 exec_prefix=`echo ${arg} | sed 's/^[-a-z_]*=//'`
155 exec_prefixoption=${arg}
157 -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-)
166 -host=* | --host=* | --hos=* | --ho=*)
167 case "${host_alias}" in
169 host_alias="`echo ${arg} | sed 's/^[-a-z]*=//'`"
172 echo '***' Can only configure for one host at a time. 1>&2
180 -norecursion | --no*)
183 -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=*)
184 prefix=`echo ${arg} | sed 's/^[-a-z]*=//'`
187 -prefix | --prefix | --prefi | --pref | --pre)
190 -rm | --rm) removing=${arg} ;;
191 -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=*)
192 program_prefix=`echo ${arg} | sed 's/^[-a-z_]*=//'`
193 program_prefixoption=${arg}
195 -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)
196 next_program_prefix=yes
198 -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=*)
199 program_suffix=`echo ${arg} | sed 's/^[-a-z_]*=//'`
200 program_suffixoption=${arg}
202 -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)
203 next_program_suffix=yes
205 -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=*)
206 # Double any \ or $ in the argument
207 program_transform_name="${program_transform_name} -e `echo ${arg} | sed -e 's/^[-a-z_]*=//' -e 's/\\\\/\\\\\\\\/g' -e 's/\\\$/$$/g'`"
208 program_transform_nameoption="${program_transform_nameoption} -program_transform_name='`echo ${arg} | sed 's
/^
[-a-z_]*=//'`'"
210 -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)
211 next_program_transform_name=yes
213 -site=* | --site=* | --sit=* | --si=*)
215 site=`echo ${arg} | sed 's/^[-a-z]*=//'`
217 -site | --site | --sit)
220 # remove trailing slashes. Otherwise, when the file name gets
221 # bolted into an object file as debug info, it has two slashes in
222 # it. Ordinarily this is ok, but emacs takes double slash to
223 # mean "forget the first part
".
224 -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*)
225 srcdir=`echo ${arg} | sed 's/^[-a-z]*=//' | sed -e 's:/$::'`
227 -srcdir | --srcdir | --srcdi | --srcd | --src | --sr)
230 -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=*)
231 case "${target_alias}" in
232 "") target_alias="`echo ${arg} | sed 's/^[-a-z]*=//'`" ;;
234 echo '***' Can only configure for one target at a time. 1>&2
239 -target | --target | --targe | --targ | --tar | --ta)
242 -tmpdir=* | --tmpdir=* | --tmpdi=* | --tmpd=* | --tmp=* | --tm=*)
244 TMPDIR=`echo ${arg} | sed 's/^[-a-z]*=//'`
246 -tmpdir | --tmpdir | --tmpdi | --tmpd | --tmp | --tm)
253 -version | -V | --version | --V)
254 echo "This is Cygnus Configure version
" `echo ${version} | sed 's/[ $:]//g'`
257 -with*=* | --with*=*)
258 withopt=`echo ${arg} | sed 's:^-*\(with[^=]*\)=.*$:\1:;s/-/_/g'`
259 withval=`echo ${arg} | sed 's:^-*with[^=]*=\(.*\)$:\1:'`
260 eval $withopt="$withval"
261 withoptions="$withoptions -$withopt=\"$withval\""
264 withopt=`echo ${arg} | sed 's:^-*with:with:;s/-/_/g'`
266 withoptions="$withoptions -$withopt"
271 echo "Unrecognized option
: \"${arg}\"". ;
281 echo '***' Can only configure for one host and one target at a time. 1>&2
290 # process host and target
293 # # Complain if an arg is missing
294 # if [ -z "${host_alias}" ] ; then
296 # echo "configure
: No HOST specified.
" ;
301 ### This is a bit twisted.
302 ### * if all three are specified, this is an error.
303 ### * if we have neither hosts, nor unadorned args, this is an error.
304 ### * if no hosts are specified, then the unadorned args are hosts, but if
305 ### there were none, this is an error.
306 ### * if no targets are specified, then the unadorned args are targets, but if
307 ### there were no unadorned args, then the hosts are also targets.
309 if [ -n "${host_alias}" -a -n "${target_alias}" -a -n "${undefs}" ] ; then
310 echo '***' Can only configure for one host and one target at a time. 1>&2
312 elif [ -z "${host_alias}" -a -z "${undefs}" ] ; then
313 echo '- You did not tell me what kind of host system you want to configure.
314 - I will attempt to guess the kind of system this is.' 1>&2
315 guesssys=`echo ${progname} | sed 's/configure$/config.guess/'`
316 if tmp_alias=`${guesssys}` ; then
317 echo "- Looks like this is a
${tmp_alias}" 1>&2
318 host_alias=${tmp_alias}
319 target_alias=${tmp_alias}
321 echo '- Failed to guess the system type. You need to tell me.' 1>&2
325 case "${host_alias}" in
326 "") host_alias=${undefs} ;;
330 case "${target_alias}" in
333 "") target_alias=${host_alias} ;;
334 *) target_alias=${undefs} ;;
344 if [ -n "${fatal}" -o "${host_alias}" = "help" ] ; then
345 (echo "Usage
: configure HOST
" ;
347 echo "Options
: [defaults
in brackets
]" ;
348 echo " -exec-prefix=MYDIR configure
for installation of
host dependent files into MYDIR.
[\"/usr
/local\"]" ;
349 echo " -gas configure the compilers
for use with gas.
[native as
]" ;
350 echo " -help print this message.
[normal config
]" ;
351 echo " -lang=LANG configure to build LANG.
[gcc
]" ;
352 echo " -nfp configure the compilers default to soft floating point.
[hard float
]" ;
353 echo " -norecursion configure this directory only.
[recurse
]" ;
354 echo " -prefix=MYDIR configure
for installation of
host dependent files into MYDIR.
[\"/usr
/local\"]" ;
355 echo " -program-prefix=FOO
install programs with FOO prepended to their names.
[ \"\" ]" ;
356 echo " -program-suffix=FOO
install programs with FOO appended to their names.
[ \"\" ]" ;
357 echo " -program-transform-name=FOO
install programs with names transformed by
sed pattern FOO.
[ \"\" ]" ;
358 echo " -site=SITE configure with site specific makefile
for SITE
" ;
359 echo " -srcdir=DIR
find the sources
in DIR.
[\".
\" or
\"..
\"]" ;
360 echo " -target=TARGET configure
for TARGET.
[TARGET
= HOST
]" ;
361 echo " -tmpdir=TMPDIR create temporary files
in TMPDIR.
[ TMPDIR
= \"/tmp
\" ]" ;
363 echo "Where HOST and TARGET are something like
\"vax
\", \"sun3
\", \"encore
\", etc.
" ;
366 if [ -r config.status ] ; then
373 configsub=`echo ${progname} | sed 's/configure$/config.sub/'`
374 moveifchange=`echo ${progname} | sed 's/configure$/move-if-change/'`
376 # this is a hack. sun4 must always be a valid host alias or this will fail.
377 if ${configsub} sun4 >/dev/null 2>&1 ; then
380 echo '***' cannot find config.sub. 1>&2
385 if ${moveifchange} config.junk config.trash ; then
388 echo '***' cannot find move-if-change. 1>&2
391 rm -f config.junk config.trash
395 if [ -r configure.in ] ; then
398 if [ -r ${progname}.in ] ; then
399 srcdir=`echo ${progname} | sed 's:/configure$::'`
401 echo '***' "Can
't find configure.in. Try using -srcdir=some_dir" 1>&2
409 ### warn about some conflicting configurations.
414 if [ -f ${srcdir}/config.status ] ; then
415 echo '***' Cannot configure here in \"${PWD=`pwd`}\" when \"${srcdir}\" is currently configured. 1>&2
420 # default exec_prefix
421 case "${exec_prefix}" in
422 "") exec_prefix="\$(prefix)" ;;
426 ### break up ${srcdir}/configure.in.
427 case "`grep '^
# per\-host:' ${srcdir}/configure.in`" in
429 echo '***' ${srcdir}/configure.
in has no
"per-host:" line.
1>&2
435 case "`grep '^# per\-target:' ${srcdir}/configure.in`" in
437 echo '***' ${srcdir}/configure.
in has no
"per-target:" line.
1>&2
444 "") TMPDIR
=/tmp
; export TMPDIR
;;
448 # keep this filename short for &%*%$*# 14 char file names
449 tmpfile
=${TMPDIR}/cONf$$
450 trap "rm -f ${tmpfile}.com ${tmpfile}.tgt ${tmpfile}.hst ${tmpfile}.pos" 0
452 # split ${srcdir}/configure.in into common, per-host, per-target,
453 # and post-target parts. Post-target is optional.
454 sed -e '/^# per\-host:/,$d' ${srcdir}/configure.
in > ${tmpfile}.com
455 sed -e '1,/^# per\-host:/d' -e '/^# per\-target:/,$d' ${srcdir}/configure.
in > ${tmpfile}.hst
456 if grep '^# post-target:' ${srcdir}/configure.
in >/dev
/null
; then
457 sed -e '1,/^# per\-target:/d' -e '/^# post\-target:/,$d' ${srcdir}/configure.
in > ${tmpfile}.tgt
458 sed -e '1,/^# post\-target:/d' ${srcdir}/configure.
in > ${tmpfile}.pos
460 sed -e '1,/^# per\-target:/d' ${srcdir}/configure.
in > ${tmpfile}.tgt
464 ### do common part of configure.in
468 # some sanity checks on configure.in
469 case "${srctrigger}" in
471 echo '***' srctrigger not
set in ${PWD=`pwd`}/configure.
in.
1>&2
477 result
=`${configsub} ${host_alias}`
478 host_cpu
=`echo $result | sed 's/^\(.*\)-\(.*\)-\(.*\)$/\1/'`
479 host_vendor
=`echo $result | sed 's/^\(.*\)-\(.*\)-\(.*\)$/\2/'`
480 host_os
=`echo $result | sed 's/^\(.*\)-\(.*\)-\(.*\)$/\3/'`
481 host=${host_cpu}-${host_vendor}-${host_os}
485 result
=`${configsub} ${target_alias}`
486 target_cpu
=`echo $result | sed 's/^\(.*\)-\(.*\)-\(.*\)$/\1/'`
487 target_vendor
=`echo $result | sed 's/^\(.*\)-\(.*\)-\(.*\)$/\2/'`
488 target_os
=`echo $result | sed 's/^\(.*\)-\(.*\)-\(.*\)$/\3/'`
489 target
=${target_cpu}-${target_vendor}-${target_os}
493 # Find the source files, if location was not specified.
498 if [ ! -r ${srctrigger} ] ; then
505 if [ ! -r ${srcdir}/${srctrigger} ] ; then
506 case "${srcdirdefaulted}" in
507 "") echo '***' "${progname}: Can't find ${srcname} sources in ${PWD=`pwd`}/${srcdir}" 1>&2 ;;
508 *) echo '***' "${progname}: Can't find ${srcname} sources in ${PWD=`pwd`}/. or ${PWD=`pwd`}/.." 1>&2 ;;
511 echo '***' \
(At least
${srctrigger} is missing.\
) 1>&2
515 tooldir
="\$(libdir)/${target_alias}"
517 if [ "${host_alias}" != "${target_alias}" ] ; then
518 if [ "${program_prefix}" = "" ] ; then
519 if [ "${program_suffix}" = "" ] ; then
520 if [ "${program_transform_name}" = "" ] ; then
521 program_prefix
=${target_alias}- ;
527 # Merge program_prefix and program_suffix onto program_transform_name
528 # Use a double $ so that make ignores it
529 if [ "${program_suffix}" != "" ] ; then
530 program_transform_name
="-e s/\$\$/${program_suffix}/ ${program_transform_name}"
533 if [ "${program_prefix}" != "" ] ; then
534 program_transform_name
="-e s/^/${program_prefix}/ ${program_transform_name}"
537 for subdir
in .
${subdirs} ; do
539 # ${subdir} is relative path from . to the directory we're currently
541 # ${invsubdir} is inverse of ${subdir), *with* trailing /, if needed.
542 invsubdir
=`echo ${subdir}/ | sed -e 's|\./||g' -e 's|[^/]*/|../|g'`
544 ### figure out what to do with srcdir
546 ".") # no -srcdir option. We're building in place.
549 makesrcdir
=`echo ${srcdir}/${subdir} | sed -e 's|/\.$||'`
551 *) # otherwise relative
553 .
) makesrcdir
=${srcdir} ;;
554 *) makesrcdir
=`echo ${subdir} | sed -e 's:[^./][^./]*:..:g'`/${srcdir}/${subdir} ;;
559 if [ "${subdir}/" != "./" ] ; then
560 Makefile=${subdir}/Makefile
563 if [ ! -d ${subdir} ] ; then
567 case "${removing}" in
571 *) eval echo Building in ${subdir} ${redirect} ;;
574 # FIXME Should this be done recursively ??? (Useful for e.g. gdbtest)
575 # Set up the list of links to be made.
576 # ${links} is the list of link names, and ${files} is the list of names to link to.
579 configlinks="${links}"
580 if [ -r ${subdir}/config.status ] ; then
581 mv -f ${subdir}/config.status ${subdir}/config.back
583 while [ -n "${files}" ] ; do
584 # set file to car of files, files to cdr of files
585 set ${files}; file=$1; shift; files=$*
586 set ${links}; link=$1; shift; links=$*
588 if [ ! -r ${srcdir}/${file} ] ; then
589 echo '***' "${progname}: cannot create a link \"${link}\"," 1>&2
590 echo '***' "since the file \"${file}\" does not exist." 1>&2
595 # Make a symlink if possible, otherwise try a hard link
596 ${symbolic_link} ${srcdir}/${file} ${link} 2>/dev/null || ${hard_link} ${srcdir}/${file} ${link}
598 if [ ! -r ${link} ] ; then
599 echo '***' "${progname}: unable to link \"${link}\" to \"${srcdir}/${file}\"." 1>&2
603 echo "Linked \"${link}\" to \"${srcdir}/${file}\"."
606 # Create a .gdbinit file which runs the one in srcdir
607 # and tells GDB to look there for source files.
609 if [ -r ${srcdir}/${subdir}/.gdbinit ] ; then
612 *) cat > ${subdir}/.gdbinit <<EOF
616 source ${makesrcdir}/.gdbinit
622 # Install a makefile, and make it set VPATH
623 # if necessary so that the sources are found.
624 # Also change its value of srcdir.
625 # NOTE: Makefile generation constitutes the majority of the time in configure. Hence, this section has
626 # been somewhat optimized and is perhaps a bit twisty.
628 # code is order so as to try to sed the smallest input files we know.
630 # the three makefile fragments MUST end up in the resulting Makefile in this order: target, host, and site.
631 # so do these separately because I don't trust the order of sed -e expressions.
633 # Conditionalize for this site from "Makefile.in" (or whatever it's called) into Makefile.tem
634 rm -f ${subdir}/Makefile.tem
636 "") cp ${srcdir}/${subdir}/${Makefile_in} ${subdir}/Makefile.tem ;;
638 site_makefile_frag=${srcdir}/config/ms-${site}
640 if [ -f ${site_makefile_frag} ] ; then
641 sed -e "/^####/ r ${site_makefile_frag}" ${srcdir}/${subdir}/${Makefile_in} \
642 > ${subdir}/Makefile.tem
644 cp ${srcdir}/${subdir}/${Makefile_in} ${subdir}/Makefile.tem
649 # working copy now in ${subdir}/Makefile.tem
651 # Conditionalize the makefile for this host.
653 case "${host_makefile_frag}" in
654 "") mv ${subdir}/Makefile.tem ${Makefile} ;;
656 if [ ! -f ${host_makefile_frag} ] ; then
657 host_makefile_frag=${srcdir}/${host_makefile_frag}
659 if [ -f ${host_makefile_frag} ] ; then
660 sed -e "/^####/ r ${host_makefile_frag}" ${subdir}/Makefile.tem > ${Makefile}
662 echo '***' Expected host makefile fragment \"${host_makefile_frag}\" 1>&2
663 echo '***' is missing in ${PWD=`pwd`}. 1>&2
664 mv ${subdir}/Makefile.tem ${Makefile}
667 # working copy now in ${Makefile}
669 # Conditionalize the makefile for this target.
670 rm -f ${subdir}/Makefile.tem
671 case "${target_makefile_frag}" in
672 "") mv ${Makefile} ${subdir}/Makefile.tem ;;
674 if [ ! -f ${target_makefile_frag} ] ; then
675 target_makefile_frag=${srcdir}/${target_makefile_frag}
677 if [ -f ${target_makefile_frag} ] ; then
678 sed -e "/^####/ r ${target_makefile_frag}" ${Makefile} > ${subdir}/Makefile.tem
680 mv ${Makefile} ${subdir}/Makefile.tem
681 target_makefile_frag=
685 # real copy now in ${subdir}/Makefile.tem
687 # prepend warning about editting, and a bunch of variables.
689 cat > ${Makefile} <<EOF
691 VPATH = ${makesrcdir}
692 links = ${configlinks}
693 host_alias = ${host_alias}
694 host_cpu = ${host_cpu}
695 host_vendor = ${host_vendor}
697 host_canonical = ${host_cpu}-${host_vendor}-${host_os}
698 target_alias = ${target_alias}
699 target_cpu = ${target_cpu}
700 target_vendor = ${target_vendor}
701 target_os = ${target_os}
702 target_canonical = ${target_cpu}-${target_vendor}-${target_os}
704 case "${target_makefile_frag}" in
707 echo target_makefile_frag = ${target_makefile_frag} >>${Makefile} ;;
709 echo target_makefile_frag = ${invsubdir}${target_makefile_frag} >>${Makefile} ;;
712 case "${host_makefile_frag}" in
715 echo host_makefile_frag = ${host_makefile_frag} >>${Makefile} ;;
717 echo host_makefile_frag = ${invsubdir}${host_makefile_frag} >>${Makefile} ;;
720 if [ "${site_makefile_frag}" != "" ] ; then
721 echo site_makefile_frag = ${invsubdir}${site_makefile_frag} >>${Makefile}
724 # fixme: this shouldn't be in configure.
725 # Define macro CROSS_COMPILE in compilation if this is a cross-compiler.
726 case "${host_alias}" in
728 echo "ALL=all.internal" >> ${Makefile}
731 echo "CROSS=-DCROSS_COMPILE" >> ${Makefile}
732 echo "ALL=all.cross" >> ${Makefile}
736 # reset prefix, exec_prefix, srcdir, SUBDIRS, NONSUBDIRS,
737 # remove any form feeds.
738 if [ -z "${subdirs}" ]; then
739 rm -f ${subdir}/Makefile.tem2
740 sed -e "s:^SUBDIRS[ ]*=.*$:SUBDIRS = ${configdirs}:" \
741 -e "s:^NONSUBDIRS[ ]*=.*$:NONSUBDIRS = ${noconfigdirs}:" \
742 ${subdir}/Makefile.tem > ${subdir}/Makefile.tem2
743 rm -f ${subdir}/Makefile.tem
744 mv ${subdir}/Makefile.tem2 ${subdir}/Makefile.tem
746 sed -e "s:^prefix[ ]*=.*$:prefix = ${prefix}:" \
747 -e "s:^exec_prefix[ ]*=.*$:exec_prefix = ${exec_prefix}:" \
748 -e "s:^srcdir[ ]*=.*$:srcdir = ${makesrcdir}:" \
750 -e "s:^program_prefix[ ]*=.*$:program_prefix = ${program_prefix}:" \
751 -e "s:^program_suffix[ ]*=.*$:program_suffix = ${program_suffix}:" \
752 -e "s:^program_transform_name[ ]*=.*$:program_transform_name = ${program_transform_name}:" \
753 -e "s:^tooldir[ ]*=.*$:tooldir = ${tooldir}:" \
754 ${subdir}/Makefile.tem >> ${Makefile}
755 # final copy now in ${Makefile}
757 rm -f ${subdir}/Makefile.tem
759 case "${host_makefile_frag}" in
761 *) using="and \"${host_makefile_frag}\"" ;;
764 case "${target_makefile_frag}" in
766 *) using="${using} and \"${target_makefile_frag}\"" ;;
769 case "${site_makefile_frag}" in
771 *) using="${using} and \"${site_makefile_frag}\"" ;;
774 newusing=`echo "${using}" |
sed 's/and/using/'`
776 echo "Created \"${Makefile}\" in" ${PWD=`pwd`} ${using}
780 # describe the chosen configuration in config.status.
781 # Make that file a shellscript which will reestablish
782 # the same configuration. Used in Makefiles to rebuild
785 case "${norecursion}" in
786 "") arguments="${arguments} -norecursion" ;;
790 if [ ${subdir} = . ] ; then
793 # This directory was configured as follows:
794 ${progname}" ${arguments} "
795 # ${using}" > ${subdir}/config.new
799 # This directory was configured as follows:
801 ${progname}" ${arguments} "
802 # ${using}" > ${subdir}/config.new
804 chmod a+x ${subdir}/config.new
805 if [ -r ${subdir}/config.back ] ; then
806 mv -f ${subdir}/config.back ${subdir}/config.status
808 ${moveifchange} ${subdir}/config.new ${subdir}/config.status
811 *) rm -f ${Makefile} ${subdir}/config.status ${links} ;;
815 # If there are subdirectories, then recur.
816 if [ -z "${norecursion}" -a -n "${configdirs}" ] ; then
817 for configdir in ${configdirs} ; do
818 eval echo Configuring ${configdir}... ${redirect}
820 if [ -d ${srcdir}/${configdir} ] ; then
824 if [ ! -d ./${configdir} ] ; then
833 ### figure out what to do with srcdir
835 ".") newsrcdir=${srcdir} ;; # no -srcdir option. We're building in place.
837 newsrcdir=${srcdir}/${configdir}
838 srcdiroption="-srcdir=${newsrcdir}"
840 *) # otherwise relative
841 newsrcdir=../${srcdir}/${configdir}
842 srcdiroption="-srcdir=${newsrcdir}"
846 ### check for guested configure, otherwise fix possibly relative progname
847 if [ -f ${newsrcdir}/configure ] ; then
848 recprog=${newsrcdir}/configure
850 case "${progname}" in
851 /*) recprog=${progname} ;;
852 *) recprog=../${progname} ;;
856 ### The recursion line is here.
857 if eval ${recprog} ${verbose} ${host_alias} -target=${target_alias} \
858 ${prefixoption} ${tmpdiroption} ${exec_prefixoption} \
859 ${srcdiroption} ${program_prefixoption} ${program_suffixoption} ${program_transform_nameoption} ${site_option} ${withoptions} ${removing} ${redirect} ; then
867 eval echo Warning: source directory \"${srcdir}/${configdir}\" is missing. ${redirect}