4 # Copyright (C) 1988, 1990-1993 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
66 package_makefile_frag
=
73 program_transform_name
=
74 program_transform_nameoption
=
89 NO_EDIT
="This file was generated automatically by configure. Do not edit."
91 ## this is a little touchy and won't always work, but...
93 ## if the argv[0] starts with a slash then it is an absolute name that can (and
94 ## must) be used as is.
96 ## otherwise, if argv[0] has no slash in it, we can assume that it is on the
97 ## path. Since PATH might include "." we also add `pwd` to the end of PATH.
101 # if PWD already has a value, it is probably wrong.
102 if [ -n "$PWD" ]; then PWD
=`pwd`; fi
104 case "${progname}" in
108 PATH
=$PATH:${PWD=`pwd`} ; export PATH
114 # handle things that might have args following as separate words
115 if [ -n "${next_prefix}" ] ; then prefix=${arg} ; prefixoption="-prefix=${prefix}" ; next_prefix
=
116 elif [ -n "${next_exec_prefix}" ] ; then
118 exec_prefixoption
="-exec_prefix=${exec_prefix}"
120 elif [ -n "${next_site}" ] ; then site=${arg} ; site_option=-site=${site} ; next_site=
121 # remove any possible trailing slash from srcdir. See note below.
122 elif [ -n "${next_srcdir}" ] ; then srcdir=`echo ${arg} | sed -e 's:/$::'` ; next_srcdir=
123 elif [ -n "${next_program_prefix}" ] ; then
124 program_prefix=${arg}
125 program_prefixoption="-program_prefix=${program_prefix}"
127 elif [ -n "${next_program_suffix}" ] ; then
128 program_suffix=${arg}
129 program_suffixoption="-program_suffix=${program_suffix}"
131 elif [ -n "${next_program_transform_name}" ] ; then
132 # Double any backslashes or dollar signs in the argument
133 program_transform_name="${program_transform_name} -e `echo ${arg} | sed -e 's/\\\\/\\\\\\\\/g' -e 's/\\\$/$$/g'`"
134 program_transform_nameoption="${program_transform_nameoption} -program_transform_name='${arg}'"
135 next_program_transform_name=
136 elif [ -n "${next_target}" ] ; then
138 case "${target_alias}" in
140 target_alias="${arg}"
143 echo '***' Can only configure for one target at a time. 1>&2
147 elif [ -n "${next_tmpdir}" ] ; then
149 tmpdiroption="--tmpdir=${arg}"
154 -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-=* )
155 exec_prefix=`echo ${arg} | sed 's/^[-a-z_]*=//'`
156 exec_prefixoption=${arg}
158 -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-)
167 -host=* | --host=* | --hos=* | --ho=*)
168 case "${host_alias}" in
170 host_alias="`echo ${arg} | sed 's/^[-a-z]*=//'`"
173 echo '***' Can only configure for one host at a time. 1>&2
181 -norecursion | --no*)
184 -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=*)
185 prefix=`echo ${arg} | sed 's/^[-a-z]*=//'`
188 -prefix | --prefix | --prefi | --pref | --pre)
191 -rm | --rm) removing=${arg} ;;
192 -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=*)
193 program_prefix=`echo ${arg} | sed 's/^[-a-z_]*=//'`
194 program_prefixoption=${arg}
196 -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)
197 next_program_prefix=yes
199 -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=*)
200 program_suffix=`echo ${arg} | sed 's/^[-a-z_]*=//'`
201 program_suffixoption=${arg}
203 -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)
204 next_program_suffix=yes
206 -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=*)
207 # Double any \ or $ in the argument
208 program_transform_name="${program_transform_name} -e `echo ${arg} | sed -e 's/^[-a-z_]*=//' -e 's/\\\\/\\\\\\\\/g' -e 's/\\\$/$$/g'`"
209 program_transform_nameoption="${program_transform_nameoption} -program_transform_name='`echo ${arg} | sed 's
/^
[-a-z_]*=//'`'"
211 -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)
212 next_program_transform_name=yes
214 -site=* | --site=* | --sit=* | --si=*)
216 site=`echo ${arg} | sed 's/^[-a-z]*=//'`
218 -site | --site | --sit)
221 # remove trailing slashes. Otherwise, when the file name gets
222 # bolted into an object file as debug info, it has two slashes in
223 # it. Ordinarily this is ok, but emacs takes double slash to
224 # mean "forget the first part
".
225 -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*)
226 srcdir=`echo ${arg} | sed 's/^[-a-z]*=//' | sed -e 's:/$::'`
228 -srcdir | --srcdir | --srcdi | --srcd | --src | --sr)
231 -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=*)
232 case "${target_alias}" in
233 "") target_alias="`echo ${arg} | sed 's/^[-a-z]*=//'`" ;;
235 echo '***' Can only configure for one target at a time. 1>&2
240 -target | --target | --targe | --targ | --tar | --ta)
243 -tmpdir=* | --tmpdir=* | --tmpdi=* | --tmpd=* | --tmp=* | --tm=*)
245 TMPDIR=`echo ${arg} | sed 's/^[-a-z]*=//'`
247 -tmpdir | --tmpdir | --tmpdi | --tmpd | --tmp | --tm)
254 -version | -V | --version | --V)
255 echo "This is Cygnus Configure version
" `echo ${version} | sed 's/[ $:]//g'`
258 -with*=* | --with*=*)
259 withopt=`echo ${arg} | sed 's:^-*\(with[^=]*\)=.*$:\1:;s/-/_/g'`
260 withval=`echo ${arg} | sed 's:^-*with[^=]*=\(.*\)$:\1:'`
261 eval $withopt="$withval"
262 withoptions="$withoptions $arg"
264 -without* | --without*)
265 withopt=`echo ${arg} | sed 's:^-*without:with:;s/-/_/g'`
267 withoutoptions="$withoutoptions $arg"
270 withopt=`echo ${arg} | sed 's:^-*with:with:;s/-/_/g'`
272 withoptions="$withoptions $arg"
277 echo "Unrecognized option
: \"${arg}\"". ;
287 echo '***' Can only configure for one host and one target at a time. 1>&2
296 # process host and target
299 # # Complain if an arg is missing
300 # if [ -z "${host_alias}" ] ; then
302 # echo "configure
: No HOST specified.
" ;
307 ### This is a bit twisted.
308 ### * if all three are specified, this is an error.
309 ### * if we have neither hosts, nor unadorned args, this is an error.
310 ### * if no hosts are specified, then the unadorned args are hosts, but if
311 ### there were none, this is an error.
312 ### * if no targets are specified, then the unadorned args are targets, but if
313 ### there were no unadorned args, then the hosts are also targets.
315 if [ -n "${host_alias}" -a -n "${target_alias}" -a -n "${undefs}" ] ; then
316 echo '***' Can only configure for one host and one target at a time. 1>&2
318 elif [ -z "${host_alias}" -a -z "${undefs}" ] ; then
319 echo '- You did not tell me what kind of host system you want to configure.
320 - I will attempt to guess the kind of system this is.' 1>&2
321 guesssys=`echo ${progname} | sed 's/configure$/config.guess/'`
322 if tmp_alias=`${guesssys}` ; then
323 echo "- Looks like this is a
${tmp_alias}" 1>&2
324 host_alias=${tmp_alias}
325 target_alias=${tmp_alias}
326 arguments="--host=${host_alias} ${arguments}"
328 echo '- Failed to guess the system type. You need to tell me.' 1>&2
332 case "${host_alias}" in
333 "") host_alias=${undefs} ;;
337 case "${target_alias}" in
340 "") target_alias=${host_alias} ;;
341 *) target_alias=${undefs} ;;
351 if [ -n "${fatal}" -o "${host_alias}" = "help" ] ; then
352 (echo "Usage
: configure HOST
" ;
354 echo "Options
: [defaults
in brackets
]" ;
355 echo " -prefix=MYDIR configure
for installation of
host dependent files into MYDIR.
[\"/usr
/local\"]" ;
356 echo " -exec-prefix=MYDIR configure
for installation of
host dependent files into MYDIR.
[\"/usr
/local\"]" ;
357 echo " -help print this message.
[normal config
]" ;
358 echo " -norecursion configure this directory only.
[recurse
]" ;
359 echo " -program-prefix=FOO
install programs with FOO prepended to their names.
[ \"\" ]" ;
360 echo " -program-suffix=FOO
install programs with FOO appended to their names.
[ \"\" ]" ;
361 echo " -program-transform-name=FOO
install programs with names transformed by
sed pattern FOO.
[ \"\" ]" ;
362 echo " -site=SITE configure with site specific makefile
for SITE
" ;
363 echo " -srcdir=DIR
find the sources
in DIR.
[\".
\" or
\"..
\"]" ;
364 echo " -target=TARGET configure
for TARGET.
[TARGET
= HOST
]" ;
365 echo " -tmpdir=TMPDIR create temporary files
in TMPDIR.
[ TMPDIR
= \"/tmp
\" ]" ;
366 echo " -nfp configure the compilers default to soft floating point.
[hard float
]" ;
367 echo " -with-FOO, -with-FOO=BAR specify that FOO is available
"
368 echo " -without-FOO specify that FOO is NOT available
"
370 echo "Where HOST and TARGET are something like
\"vax
\", \"sun3
\", \"encore
\", etc.
" ;
373 if [ -r config.status ] ; then
380 configsub=`echo ${progname} | sed 's/configure$/config.sub/'`
381 moveifchange=`echo ${progname} | sed 's/configure$/move-if-change/'`
383 # this is a hack. sun4 must always be a valid host alias or this will fail.
384 if ${configsub} sun4 >/dev/null 2>&1 ; then
387 echo '***' cannot find config.sub. 1>&2
392 if ${moveifchange} config.junk config.trash ; then
395 echo '***' cannot find move-if-change. 1>&2
398 rm -f config.junk config.trash
402 if [ -r configure.in ] ; then
405 if [ -r ${progname}.in ] ; then
406 srcdir=`echo ${progname} | sed 's:/configure$::'`
408 echo '***' "Can
't find configure.in. Try using -srcdir=some_dir" 1>&2
416 ### warn about some conflicting configurations.
421 if [ -f ${srcdir}/config.status ] ; then
422 echo '***' Cannot configure here in \"${PWD=`pwd`}\" when \"${srcdir}\" is currently configured. 1>&2
427 # default exec_prefix
428 case "${exec_prefix}" in
429 "") exec_prefix="\$(prefix)" ;;
433 ### break up ${srcdir}/configure.in.
434 case "`grep '^
# per\-host:' ${srcdir}/configure.in`" in
436 echo '***' ${srcdir}/configure.
in has no
"per-host:" line.
1>&2
442 case "`grep '^# per\-target:' ${srcdir}/configure.in`" in
444 echo '***' ${srcdir}/configure.
in has no
"per-target:" line.
1>&2
451 "") TMPDIR
=/tmp
; export TMPDIR
;;
455 # keep this filename short for &%*%$*# 14 char file names
456 tmpfile
=${TMPDIR}/cONf$$
457 trap "rm -f ${tmpfile}.com ${tmpfile}.tgt ${tmpfile}.hst ${tmpfile}.pos" 0
459 # split ${srcdir}/configure.in into common, per-host, per-target,
460 # and post-target parts. Post-target is optional.
461 sed -e '/^# per\-host:/,$d' ${srcdir}/configure.
in > ${tmpfile}.com
462 sed -e '1,/^# per\-host:/d' -e '/^# per\-target:/,$d' ${srcdir}/configure.
in > ${tmpfile}.hst
463 if grep '^# post-target:' ${srcdir}/configure.
in >/dev
/null
; then
464 sed -e '1,/^# per\-target:/d' -e '/^# post\-target:/,$d' ${srcdir}/configure.
in > ${tmpfile}.tgt
465 sed -e '1,/^# post\-target:/d' ${srcdir}/configure.
in > ${tmpfile}.pos
467 sed -e '1,/^# per\-target:/d' ${srcdir}/configure.
in > ${tmpfile}.tgt
471 ### do common part of configure.in
475 # some sanity checks on configure.in
476 case "${srctrigger}" in
478 echo '***' srctrigger not
set in ${PWD=`pwd`}/configure.
in.
1>&2
484 result
=`${configsub} ${host_alias}`
485 host_cpu
=`echo $result | sed 's/^\(.*\)-\(.*\)-\(.*\)$/\1/'`
486 host_vendor
=`echo $result | sed 's/^\(.*\)-\(.*\)-\(.*\)$/\2/'`
487 host_os
=`echo $result | sed 's/^\(.*\)-\(.*\)-\(.*\)$/\3/'`
488 host=${host_cpu}-${host_vendor}-${host_os}
492 result
=`${configsub} ${target_alias}`
493 target_cpu
=`echo $result | sed 's/^\(.*\)-\(.*\)-\(.*\)$/\1/'`
494 target_vendor
=`echo $result | sed 's/^\(.*\)-\(.*\)-\(.*\)$/\2/'`
495 target_os
=`echo $result | sed 's/^\(.*\)-\(.*\)-\(.*\)$/\3/'`
496 target
=${target_cpu}-${target_vendor}-${target_os}
500 # Find the source files, if location was not specified.
505 if [ ! -r ${srctrigger} ] ; then
512 if [ ! -r ${srcdir}/${srctrigger} ] ; then
513 case "${srcdirdefaulted}" in
514 "") echo '***' "${progname}: Can't find ${srcname} sources in ${PWD=`pwd`}/${srcdir}" 1>&2 ;;
515 *) echo '***' "${progname}: Can't find ${srcname} sources in ${PWD=`pwd`}/. or ${PWD=`pwd`}/.." 1>&2 ;;
518 echo '***' \
(At least
${srctrigger} is missing.\
) 1>&2
522 tooldir
="\$(libdir)/${target_alias}"
524 if [ "${host_alias}" != "${target_alias}" ] ; then
525 if [ "${program_prefix}" = "" ] ; then
526 if [ "${program_suffix}" = "" ] ; then
527 if [ "${program_transform_name}" = "" ] ; then
528 program_prefix
=${target_alias}- ;
534 # Merge program_prefix and program_suffix onto program_transform_name
535 # Use a double $ so that make ignores it
536 if [ "${program_suffix}" != "" ] ; then
537 program_transform_name
="-e s/\$\$/${program_suffix}/ ${program_transform_name}"
540 if [ "${program_prefix}" != "" ] ; then
541 program_transform_name
="-e s/^/${program_prefix}/ ${program_transform_name}"
544 for subdir
in .
${subdirs} ; do
546 # ${subdir} is relative path from . to the directory we're currently
548 # ${invsubdir} is inverse of ${subdir), *with* trailing /, if needed.
549 invsubdir
=`echo ${subdir}/ | sed -e 's|\./||g' -e 's|[^/]*/|../|g'`
551 ### figure out what to do with srcdir
553 ".") # no -srcdir option. We're building in place.
556 makesrcdir
=`echo ${srcdir}/${subdir} | sed -e 's|/\.$||'`
558 *) # otherwise relative
560 .
) makesrcdir
=${srcdir} ;;
561 *) makesrcdir
=${invsubdir}${srcdir}/${subdir} ;;
566 if [ "${subdir}/" != "./" ] ; then
567 Makefile
=${subdir}/Makefile
570 if [ ! -d ${subdir} ] ; then
571 if mkdir
${subdir} ; then
574 echo '***' "${progname}: could not make ${PWD=`pwd`}/${subdir}" 1>&2
579 case "${removing}" in
583 *) eval echo Building
in ${subdir} ${redirect} ;;
586 # FIXME Should this be done recursively ??? (Useful for e.g. gdbtest)
587 # Set up the list of links to be made.
588 # ${links} is the list of link names, and ${files} is the list of names to link to.
591 configlinks
="${links}"
592 if [ -r ${subdir}/config.status
] ; then
593 mv -f ${subdir}/config.status
${subdir}/config.back
595 while [ -n "${files}" ] ; do
596 # set file to car of files, files to cdr of files
597 set ${files}; file=$1; shift; files
=$
*
598 set ${links}; link
=$1; shift; links
=$
*
600 if [ ! -r ${srcdir}/${file} ] ; then
601 echo '***' "${progname}: cannot create a link \"${link}\"," 1>&2
602 echo '***' "since the file \"${srcdir}/${file}\" does not exist." 1>&2
607 # Make a symlink if possible, otherwise try a hard link
608 ${symbolic_link} ${srcdir}/${file} ${link} 2>/dev/null || ${hard_link} ${srcdir}/${file} ${link}
610 if [ ! -r ${link} ] ; then
611 echo '***' "${progname}: unable to link \"${link}\" to \"${srcdir}/${file}\"." 1>&2
615 echo "Linked \"${link}\" to \"${srcdir}/${file}\"."
618 # Create a .gdbinit file which runs the one in srcdir
619 # and tells GDB to look there for source files.
621 if [ -r ${srcdir}/${subdir}/.gdbinit
] ; then
624 *) cat > ${subdir}/.gdbinit
<<EOF
628 source ${makesrcdir}/.gdbinit
634 # Install a makefile, and make it set VPATH
635 # if necessary so that the sources are found.
636 # Also change its value of srcdir.
637 # NOTE: Makefile generation constitutes the majority of the time in configure. Hence, this section has
638 # been somewhat optimized and is perhaps a bit twisty.
640 # code is order so as to try to sed the smallest input files we know.
642 # the four makefile fragments MUST end up in the resulting Makefile in this order:
643 # package, target, host, and site. so do these separately because I don't trust the
644 # order of sed -e expressions.
646 if [ -f ${srcdir}/${subdir}/${Makefile_in} ] ; then
648 # Conditionalize for this site from "Makefile.in" (or whatever it's called) into Makefile.tem
649 rm -f ${subdir}/Makefile.tem
651 "") cp ${srcdir}/${subdir}/${Makefile_in} ${subdir}/Makefile.tem
;;
653 site_makefile_frag
=${srcdir}/config
/ms-
${site}
655 if [ -f ${site_makefile_frag} ] ; then
656 sed -e "/^####/ r ${site_makefile_frag}" ${srcdir}/${subdir}/${Makefile_in} \
657 > ${subdir}/Makefile.tem
659 cp ${srcdir}/${subdir}/${Makefile_in} ${subdir}/Makefile.tem
664 # working copy now in ${subdir}/Makefile.tem
666 # Conditionalize the makefile for this host.
668 case "${host_makefile_frag}" in
669 "") mv ${subdir}/Makefile.tem ${Makefile} ;;
671 if [ ! -f ${host_makefile_frag} ] ; then
672 host_makefile_frag=${srcdir}/${host_makefile_frag}
674 if [ -f ${host_makefile_frag} ] ; then
675 sed -e "/^
####/ r ${host_makefile_frag}" ${subdir}/Makefile.tem > ${Makefile}
677 echo '***' Expected
host makefile fragment
\"${host_makefile_frag}\" 1>&2
678 echo '***' is missing
in ${PWD=`pwd`}.
1>&2
679 mv ${subdir}/Makefile.tem
${Makefile}
682 # working copy now in ${Makefile}
684 # Conditionalize the makefile for this target.
685 rm -f ${subdir}/Makefile.tem
686 case "${target_makefile_frag}" in
687 "") mv ${Makefile} ${subdir}/Makefile.tem
;;
689 if [ ! -f ${target_makefile_frag} ] ; then
690 target_makefile_frag
=${srcdir}/${target_makefile_frag}
692 if [ -f ${target_makefile_frag} ] ; then
693 sed -e "/^####/ r ${target_makefile_frag}" ${Makefile} > ${subdir}/Makefile.tem
695 mv ${Makefile} ${subdir}/Makefile.tem
696 target_makefile_frag=
700 # real copy now in ${subdir}/Makefile.tem
702 # Conditionalize the makefile for this package.
704 case "${package_makefile_frag}" in
705 "") mv ${subdir}/Makefile.tem ${Makefile} ;;
707 if [ ! -f ${package_makefile_frag} ] ; then
708 package_makefile_frag=${srcdir}/${package_makefile_frag}
710 if [ -f ${package_makefile_frag} ] ; then
711 sed -e "/^
####/ r ${package_makefile_frag}" ${subdir}/Makefile.tem > ${Makefile}
713 echo '***' Expected package makefile fragment
\"${package_makefile_frag}\" 1>&2
714 echo '***' is missing
in ${PWD=`pwd`}.
1>&2
715 mv ${subdir}/Makefile.tem
${Makefile}
718 # working copy now in ${Makefile}
720 mv ${Makefile} ${subdir}/Makefile.tem
722 # real copy now in ${subdir}/Makefile.tem
724 # prepend warning about editting, and a bunch of variables.
726 cat > ${Makefile} <<EOF
728 VPATH = ${makesrcdir}
729 links = ${configlinks}
730 host_alias = ${host_alias}
731 host_cpu = ${host_cpu}
732 host_vendor = ${host_vendor}
734 host_canonical = ${host_cpu}-${host_vendor}-${host_os}
735 target_alias = ${target_alias}
736 target_cpu = ${target_cpu}
737 target_vendor = ${target_vendor}
738 target_os = ${target_os}
739 target_canonical = ${target_cpu}-${target_vendor}-${target_os}
741 case "${package_makefile_frag}" in
743 /*) echo package_makefile_frag
= ${package_makefile_frag} >>${Makefile} ;;
744 *) echo package_makefile_frag
= ${invsubdir}${package_makefile_frag} >>${Makefile} ;;
747 case "${target_makefile_frag}" in
749 /*) echo target_makefile_frag
= ${target_makefile_frag} >>${Makefile} ;;
750 *) echo target_makefile_frag
= ${invsubdir}${target_makefile_frag} >>${Makefile} ;;
753 case "${host_makefile_frag}" in
755 /*) echo host_makefile_frag
= ${host_makefile_frag} >>${Makefile} ;;
756 *) echo host_makefile_frag
= ${invsubdir}${host_makefile_frag} >>${Makefile} ;;
759 if [ "${site_makefile_frag}" != "" ] ; then
760 echo site_makefile_frag
= ${invsubdir}${site_makefile_frag} >>${Makefile}
763 # fixme: this shouldn't be in configure.
764 # Define macro CROSS_COMPILE in compilation if this is a cross-compiler.
765 case "${host_alias}" in
767 echo "ALL=all.internal" >> ${Makefile}
770 echo "CROSS=-DCROSS_COMPILE" >> ${Makefile}
771 echo "ALL=all.cross" >> ${Makefile}
775 # reset prefix, exec_prefix, srcdir, SUBDIRS, NONSUBDIRS,
776 # remove any form feeds.
777 if [ -z "${subdirs}" ]; then
778 rm -f ${subdir}/Makefile.tem2
779 sed -e "s:^SUBDIRS[ ]*=.*$:SUBDIRS = ${configdirs}:" \
780 -e "s:^NONSUBDIRS[ ]*=.*$:NONSUBDIRS = ${noconfigdirs}:" \
781 ${subdir}/Makefile.tem
> ${subdir}/Makefile.tem2
782 rm -f ${subdir}/Makefile.tem
783 mv ${subdir}/Makefile.tem2
${subdir}/Makefile.tem
785 sed -e "s:^prefix[ ]*=.*$:prefix = ${prefix}:" \
786 -e "s:^exec_prefix[ ]*=.*$:exec_prefix = ${exec_prefix}:" \
787 -e "s:^srcdir[ ]*=.*$:srcdir = ${makesrcdir}:" \
789 -e "s:^program_prefix[ ]*=.*$:program_prefix = ${program_prefix}:" \
790 -e "s:^program_suffix[ ]*=.*$:program_suffix = ${program_suffix}:" \
791 -e "s:^program_transform_name[ ]*=.*$:program_transform_name = ${program_transform_name}:" \
792 -e "s:^tooldir[ ]*=.*$:tooldir = ${tooldir}:" \
793 ${subdir}/Makefile.tem
>> ${Makefile}
794 # final copy now in ${Makefile}
797 echo "No Makefile.in found in ${srcdir}, unable to configure" 1>&2
800 rm -f ${subdir}/Makefile.tem
802 case "${host_makefile_frag}" in
804 *) using
="and \"${host_makefile_frag}\"" ;;
807 case "${target_makefile_frag}" in
809 *) using
="${using} and \"${target_makefile_frag}\"" ;;
812 case "${site_makefile_frag}" in
814 *) using
="${using} and \"${site_makefile_frag}\"" ;;
817 newusing
=`echo "${using}" | sed 's/and/using/'`
819 echo "Created \"${Makefile}\" in" ${PWD=`pwd`} ${using}
823 # describe the chosen configuration in config.status.
824 # Make that file a shellscript which will reestablish
825 # the same configuration. Used in Makefiles to rebuild
828 case "${norecursion}" in
829 "") arguments="${arguments} -norecursion" ;;
833 if [ ${subdir} = . ] ; then
836 # This directory was configured as follows:
837 ${progname}" ${arguments} "
838 # ${using}" > ${subdir}/config.new
842 # This directory was configured as follows:
844 ${progname}" ${arguments} "
845 # ${using}" > ${subdir}/config.new
847 chmod a
+x
${subdir}/config.new
848 if [ -r ${subdir}/config.back
] ; then
849 mv -f ${subdir}/config.back
${subdir}/config.status
851 ${moveifchange} ${subdir}/config.new ${subdir}/config.status
854 *) rm -f ${Makefile} ${subdir}/config.status ${links} ;;
858 # If there are subdirectories, then recur.
859 if [ -z "${norecursion}" -a -n "${configdirs}" ] ; then
860 for configdir
in ${configdirs} ; do
862 if [ -d ${srcdir}/${configdir} ] ; then
863 eval echo Configuring
${configdir}...
${redirect}
867 if [ ! -d .
/${configdir} ] ; then
868 if mkdir .
/${configdir} ; then
871 echo '***' "${progname}: could not make ${PWD=`pwd`}/${configdir}" 1>&2
881 ### figure out what to do with srcdir
883 ".") newsrcdir
=${srcdir} ;; # no -srcdir option. We're building in place.
885 newsrcdir
=${srcdir}/${configdir}
886 srcdiroption
="-srcdir=${newsrcdir}"
888 *) # otherwise relative
889 newsrcdir
=..
/${srcdir}/${configdir}
890 srcdiroption
="-srcdir=${newsrcdir}"
894 ### check for guested configure, otherwise fix possibly relative progname
895 if [ -f ${newsrcdir}/configure
] ; then
896 recprog
=${newsrcdir}/configure
898 case "${progname}" in
899 /*) recprog
=${progname} ;;
900 *) recprog
=..
/${progname} ;;
904 ### The recursion line is here.
905 if eval ${recprog} ${verbose} --host=${host_alias} --target=${target_alias} \
906 ${prefixoption} ${tmpdiroption} ${exec_prefixoption} \
907 ${srcdiroption} ${program_prefixoption} ${program_suffixoption} ${program_transform_nameoption} ${site_option} ${withoptions} ${withoutoptions} ${removing} ${redirect} ; then