*** empty log message ***
[deliverable/binutils-gdb.git] / configure
1 #!/bin/sh
2
3 # Configuration script
4 # Copyright (C) 1988, 1990, 1991, 1992 Free Software Foundation, Inc.
5
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.
10 #
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.
15 #
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. */
19
20 # Please email any bugs, comments, and/or additions to this file to:
21 # configure@cygnus.com
22
23 # This file was written by K. Richard Pixley.
24
25 #
26 # Shell script to create proper links to machine-dependent files in
27 # preparation for compilation.
28 #
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.
32 #
33
34 export PATH || (echo "OOPS, this isn't sh. Desperation time. I will feed myself to sh."; sh $0 $argv; kill $$)
35
36 remove=rm
37 hard_link=ln
38 symbolic_link='ln -s'
39
40 #for Test
41 #remove="echo rm"
42 #hard_link="echo ln"
43 #symbolic_link="echo ln -s"
44
45 # clear some things potentially inherited from environment.
46
47 Makefile=Makefile
48 Makefile_in=Makefile.in
49 arguments=$*
50 configdirs=
51 exec_prefix=
52 exec_prefixoption=
53 fatal=
54 floating_point=default
55 gas=default
56 host_alias=
57 host_makefile_frag=
58 next_host=
59 next_prefix=
60 next_site=
61 next_srcdir=
62 next_target=
63 next_tmpdir=
64 norecursion=
65 prefix=/usr/local
66 progname=
67 program_prefix=
68 program_prefix_option=
69 silent=
70 site=
71 site_option=
72 site_makefile_frag=
73 srcdir=
74 srctrigger=
75 target_alias=
76 target_makefile_frag=
77 undefinedargs=
78 verbose=
79 version="$Revision$"
80 x11=default
81
82 NO_EDIT="This file was generated automatically by configure. Do not edit."
83
84 ## this is a little touchy and won't always work, but...
85 ##
86 ## if the argv[0] starts with a slash then it is an absolute name that can (and
87 ## must) be used as is.
88 ##
89 ## otherwise, if argv[0] has no slash in it, we can assume that it is on the
90 ## path. Since PATH might include "." we also add `pwd` to the end of PATH.
91 ##
92
93 PWD=`pwd`
94 progname=$0
95
96 case "${progname}" in
97 /*) ;;
98 */*) ;;
99 *)
100 PATH=$PATH:${PWD} ; export PATH
101 ;;
102 esac
103
104 for arg in $*;
105 do
106 # handle things that might have args following as separate words
107 if [ -n "${next_prefix}" ] ; then prefix=${arg} ; prefixoption="-prefix=${prefix}" ; next_prefix=
108 elif [ -n "${next_exec_prefix}" ] ; then
109 exec_prefix=${arg}
110 exec_prefixoption="-exec_prefix=${exec_prefix}"
111 next_exec_prefix=
112 elif [ -n "${next_site}" ] ; then site=${arg} ; site_option=-site=${site} ; next_site=
113 # remove any possible trailing slash from srcdir. See note below.
114 elif [ -n "${next_srcdir}" ] ; then srcdir=`echo ${arg} | sed -e 's:/$::'` ; next_srcdir=
115 elif [ -n "${next_program_prefix}" ] ; then
116 program_prefix=${arg}
117 program_prefixoption="-program_prefix=${program_prefix}"
118 next_program_prefix=
119 elif [ -n "${next_target}" ] ; then
120 next_target=
121 case "${target_alias}" in
122 "")
123 target_alias="${arg}"
124 ;;
125 *)
126 echo '***' Can only configure for one target at a time. 1>&2
127 fatal=yes
128 ;;
129 esac
130 elif [ -n "${next_tmpdir}" ] ; then
131 next_tmpdir=
132 tmpdiroption="--tmpdir=${arg}"
133 TMPDIR=${arg}
134
135 else
136 case ${arg} in
137 -exec_prefix=* | --exec_prefix=* | --exec_prefi=* | --exec_pref=* | --exec_pre=* | --exec_pr=* | --exec_p=* | --exec_=* | --exec=* | --exe=* | --ex=* | --e=*)
138 exec_prefix=`echo ${arg} | sed 's/^[-a-z_]*=//'`
139 exec_prefixoption=${arg}
140 ;;
141 -exec_prefix | --exec_prefix | --exec_prefi | --exec_pref | --exec_pre | --exec_pr | --exec_p | --exec_ | --exec | --exe | --ex | --e)
142 next_exec_prefix=yes
143 ;;
144 -gas | --g*)
145 gas=yes
146 ;;
147 -help | --he*)
148 fatal=true
149 ;;
150 -host=* | --host=* | --hos=* | --ho=*)
151 case "${host_alias}" in
152 "")
153 host_alias="`echo ${arg} | sed 's/^[-a-z]*=//'`"
154 ;;
155 *)
156 echo '***' Can only configure for one host at a time. 1>&2
157 fatal=yes
158 ;;
159 esac
160 ;;
161 -nfp | --nf*)
162 floating_point=no
163 ;;
164 -norecursion | --no*)
165 norecursion=true
166 ;;
167 -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=*)
168 prefix=`echo ${arg} | sed 's/^[-a-z]*=//'`
169 prefixoption=${arg}
170 ;;
171 -prefix | --prefix | --prefi | --pref | --pre)
172 next_prefix=yes
173 ;;
174 -program_prefix=* | --program_prefix=* | --program_prefi=* | --program_pref=* | --program_pre=* | --program_pr=* | --program_p=* | --program_=* | --program=* | --progra=* | --progr=* | --prog=* | --pro=*)
175 program_prefix=`echo ${arg} | sed 's/^[-a-z]*=//'`
176 program_prefixoption=${arg}
177 ;;
178 -program_prefix | --program_prefix | --program_prefi | --program_pref | --program_pre | --program_pr | --program_p | --program_ | --program | --progra | --progr | --prog | --pro)
179 next_program_prefix=yes
180 ;;
181 -s | -silent | --silent | --silen | --sile | --sil)
182 silent=true
183 arguments=`echo ${arguments} | sed "s:${arg}::"`
184 ;;
185 -site=* | --site=* | --sit=* | --si=*)
186 site_option=${arg}
187 site=`echo ${arg} | sed 's/^[-a-z]*=//'`
188 ;;
189 -site | --site | --sit)
190 next_site=yes
191 ;;
192 # remove trailing slashes. Otherwise, when the file name gets
193 # bolted into an object file as debug info, it has two slashes in
194 # it. Ordinarily this is ok, but emacs takes double slash to
195 # mean "forget the first part".
196 -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*)
197 srcdir=`echo ${arg} | sed 's/^[-a-z]*=//' | sed -e 's:/$::'`
198 ;;
199 -srcdir | --srcdir | --srcdi | --srcd | --src | --sr)
200 next_srcdir=yes
201 ;;
202 -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=*)
203 case "${target_alias}" in
204 "") target_alias="`echo ${arg} | sed 's/^[-a-z]*=//'`" ;;
205 *)
206 echo '***' Can only configure for one target at a time. 1>&2
207 fatal=yes
208 ;;
209 esac
210 ;;
211 -target | --target | --targe | --targ | --tar | --ta)
212 next_target=yes
213 ;;
214 -tmpdir=* | --tmpdir=* | --tmpdi=* | --tmpd=* | --tmp=* | --tm=*)
215 tmpdiroption=${arg}
216 TMPDIR=`echo ${arg} | sed 's/^[-a-z]*=//'`
217 ;;
218 -tmpdir | --tmpdir | --tmpdi | --tmpd | --tmp | --tm)
219 next_tmpdir=yes
220 ;;
221 -v | -verbose | --v)
222 verbose=${arg}
223 ;;
224 -version | -V | --version | --V)
225 echo "This is Cygnus Configure version" `echo ${version} | sed 's/[ $:]//g'`
226 exit 0
227 ;;
228 -x | --x) ;;
229 -* | --*)
230 (echo ;
231 echo "Unrecognized option: \"${arg}\"". ;
232 echo) 1>&2
233 fatal=true
234 ;;
235 *)
236 case "${undefs}" in
237 "")
238 undefs="${arg}"
239 ;;
240 *)
241 echo '***' Can only configure for one host and one target at a time. 1>&2
242 fatal=yes
243 ;;
244 esac
245 ;;
246 esac
247 fi
248 done
249
250 # process host and target
251 case "${fatal}" in
252 "")
253 # # Complain if an arg is missing
254 # if [ -z "${host_alias}" ] ; then
255 # (echo ;
256 # echo "configure: No HOST specified." ;
257 # echo) 1>&2
258 # fatal=true
259 # fi
260
261 ### This is a bit twisted.
262 ### * if all three are specified, this is an error.
263 ### * if we have neither hosts, nor unadorned args, this is an error.
264 ### * if no hosts are specified, then the unadorned args are hosts, but if
265 ### there were none, this is an error.
266 ### * if no targets are specified, then the unadorned args are targets, but if
267 ### there were no unadorned args, then the hosts are also targets.
268
269 if [ -n "${host_alias}" -a -n "${target_alias}" -a -n "${undefs}" ] ; then
270 echo '***' Can only configure for one host and one target at a time. 1>&2
271 fatal=yes
272 elif [ -z "${host_alias}" -a -z "${undefs}" ] ; then
273 echo '***' You must tell me for which host you want to configure. 1>&2
274 fatal=yes
275 else
276 case "${host_alias}" in
277 "") host_alias=${undefs} ;;
278 *) ;;
279 esac
280
281 case "${target_alias}" in
282 "")
283 case "${undefs}" in
284 "") target_alias=${host_alias} ;;
285 *) target_alias=${undefs} ;;
286 esac
287 ;;
288 *) ;;
289 esac
290 fi
291 ;;
292 *) ;;
293 esac
294
295 if [ -n "${fatal}" -o "${host_alias}" = "help" ] ; then
296 (echo "Usage: configure HOST" ;
297 echo ;
298 echo "Options: [defaults in brackets]" ;
299 echo " -exec_prefix=MYDIR configure for installation of host dependent files into MYDIR. [\"/usr/local\"]" ;
300 echo " -gas configure the compilers for use with gas. [native as]" ;
301 echo " -help print this message. [normal config]" ;
302 echo " -lang=LANG configure to build LANG. [gcc]" ;
303 echo " -nfp configure the compilers default to soft floating point. [hard float]" ;
304 echo " -norecursion configure this directory only. [recurse]" ;
305 echo " -prefix=MYDIR configure for installation of host dependent files into MYDIR. [\"/usr/local\"]" ;
306 echo " -program_prefix=FOO install programs with FOO prepended to their names. [ \"\" ]" ;
307 echo " -site=SITE configure with site specific makefile for SITE" ;
308 echo " -srcdir=DIR find the sources in DIR. [\".\" or \"..\"]" ;
309 echo " -target=TARGET configure for TARGET. [TARGET = HOST]" ;
310 echo " -tmpdir=TMPDIR create temporary files in TMPDIR. [ TMPDIR = \"/tmp\" ]" ;
311 echo ;
312 echo "Where HOST and TARGET are something like \"vax\", \"sun3\", \"encore\", etc." ;
313 ) 1>&2
314
315 if [ -r config.status ] ; then
316 cat config.status
317 fi
318
319 exit 1
320 fi
321
322 configsub=`echo ${progname} | sed 's/configure$/config.sub/'`
323
324 if ${configsub} `echo ${host_alias} | sed -e 's/ .*//'` >/dev/null 2>&1 ; then
325 true
326 else
327 echo '***' cannot find config.sub. 1>&2
328 exit 1
329 fi
330
331 case "${srcdir}" in
332 "")
333 if [ -r configure.in ] ; then
334 srcdir=.
335 else
336 if [ -r ${progname}.in ] ; then
337 srcdir=`echo ${progname} | sed 's:/configure$::'`
338 else
339 echo '***' "Can't find configure.in. Try using -srcdir=some_dir" 1>&2
340 exit 1
341 fi
342 fi
343 ;;
344 *) ;;
345 esac
346
347 ### warn about some conflicting configurations.
348
349 case "${srcdir}" in
350 ".") ;;
351 *)
352 if [ -f ${srcdir}/config.status ] ; then
353 echo '***' Cannot configure here in \"${PWD}\" when \"${srcdir}\" is currently configured. 1>&2
354 exit 1
355 fi
356 esac
357
358 # default exec_prefix
359 case "${exec_prefix}" in
360 "") exec_prefix="$(prefix)" ;;
361 *) ;;
362 esac
363
364 ### break up ${srcdir}/configure.in.
365 case "`grep '^# per\-host:' ${srcdir}/configure.in`" in
366 "")
367 echo '***' ${srcdir}/configure.in has no "per-host:" line. 1>&2
368 exit 1
369 ;;
370 *) ;;
371 esac
372
373 case "`grep '^# per\-target:' ${srcdir}/configure.in`" in
374 "")
375 echo '***' ${srcdir}/configure.in has no "per-target:" line. 1>&2
376 exit 1
377 ;;
378 *) ;;
379 esac
380
381 case "${TMPDIR}" in
382 "") TMPDIR=/tmp ; export TMPDIR ;;
383 *) ;;
384 esac
385
386 # keep this filename short for &%*%$*# 14 char file names
387 tmpfile=${TMPDIR}/cONf$$
388 trap "rm -f ${tmpfile}.com ${tmpfile}.tgt ${tmpfile}.hst ${tmpfile}.pos" 0
389
390 # split ${srcdir}/configure.in into common, per-host, per-target,
391 # and post-target parts. Post-target is optional.
392 sed -e '/^# per\-host:/,$d' ${srcdir}/configure.in > ${tmpfile}.com
393 sed -e '1,/^# per\-host:/d' -e '/^# per\-target:/,$d' ${srcdir}/configure.in > ${tmpfile}.hst
394 if grep '^# post-target:' ${srcdir}/configure.in >/dev/null ; then
395 sed -e '1,/^# per\-target:/d' -e '/^# post\-target:/,$d' ${srcdir}/configure.in > ${tmpfile}.tgt
396 sed -e '1,/^# post\-target:/d' ${srcdir}/configure.in > ${tmpfile}.pos
397 else
398 sed -e '1,/^# per\-target:/d' ${srcdir}/configure.in > ${tmpfile}.tgt
399 echo >${tmpfile}.pos
400 fi
401
402 ### do common part of configure.in
403
404 . ${tmpfile}.com
405
406 # some sanity checks on configure.in
407 case "${srctrigger}" in
408 "")
409 echo '***' srctrigger not set in ${PWD}/configure.in. 1>&2
410 exit 1
411 ;;
412 *) ;;
413 esac
414
415 result=`${configsub} ${host_alias}`
416 host_cpu=`echo $result | sed 's/^\(.*\)-\(.*\)-\(.*\)$/\1/'`
417 host_vendor=`echo $result | sed 's/^\(.*\)-\(.*\)-\(.*\)$/\2/'`
418 host_os=`echo $result | sed 's/^\(.*\)-\(.*\)-\(.*\)$/\3/'`
419 host=${host_cpu}-${host_vendor}-${host_os}
420
421 . ${tmpfile}.hst
422
423 result=`${configsub} ${target_alias}`
424 target_cpu=`echo $result | sed 's/^\(.*\)-\(.*\)-\(.*\)$/\1/'`
425 target_vendor=`echo $result | sed 's/^\(.*\)-\(.*\)-\(.*\)$/\2/'`
426 target_os=`echo $result | sed 's/^\(.*\)-\(.*\)-\(.*\)$/\3/'`
427 target=${target_cpu}-${target_vendor}-${target_os}
428
429 . ${tmpfile}.tgt
430
431 # Find the source files, if location was not specified.
432 case "${srcdir}" in
433 "")
434 srcdirdefaulted=1
435 srcdir=.
436 if [ ! -r ${srctrigger} ] ; then
437 srcdir=..
438 fi
439 ;;
440 *) ;;
441 esac
442
443 if [ ! -r ${srcdir}/${srctrigger} ] ; then
444 case "${srcdirdefaulted}" in
445 "") echo '***' "${progname}: Can't find ${srcname} sources in ${PWD}/${srcdir}" 1>&2 ;;
446 *) echo '***' "${progname}: Can't find ${srcname} sources in ${PWD}/. or ${PWD}/.." 1>&2 ;;
447 esac
448
449 echo '***' \(At least ${srctrigger} is missing.\) 1>&2
450 exit 1
451 fi
452
453 # Set up the list of links to be made.
454 # ${links} is the list of link names, and ${files} is the list of names to link to.
455
456 # Make the links.
457 configlinks="${links}"
458 while [ -n "${files}" ] ; do
459 # set file to car of files, files to cdr of files
460 set ${files}; file=$1; shift; files=$*
461 set ${links}; link=$1; shift; links=$*
462
463 if [ ! -r ${srcdir}/${file} ] ; then
464 echo '***' "${progname}: cannot create a link \"${link}\"," 1>&2
465 echo '***' "since the file \"${file}\" does not exist." 1>&2
466 exit 1
467 fi
468
469 ${remove} -f ${link}
470 rm -f config.status
471 # Make a symlink if possible, otherwise try a hard link
472 ${symbolic_link} ${srcdir}/${file} ${link} 2>/dev/null || ${hard_link} ${srcdir}/${file} ${link}
473
474 if [ ! -r ${link} ] ; then
475 echo '***' "${progname}: unable to link \"${link}\" to \"${srcdir}/${file}\"." 1>&2
476 exit 1
477 fi
478
479 case "${verbose}" in
480 "") ;;
481 *) echo "Linked \"${link}\" to \"${srcdir}/${file}\"." ;;
482 esac
483 done
484
485 # Create a .gdbinit file which runs the one in srcdir
486 # and tells GDB to look there for source files.
487
488 if [ -r ${srcdir}/.gdbinit ] ; then
489 case ${srcdir} in
490 .)
491 ;;
492 *) cat > .gdbinit <<EOF
493 # ${NO_EDIT} > .gdbinit
494 dir .
495 dir ${srcdir}
496 source ${srcdir}/.gdbinit
497 EOF
498 ;;
499 esac
500 fi
501
502 # Install a makefile, and make it set VPATH
503 # if necessary so that the sources are found.
504 # Also change its value of srcdir.
505 # NOTE: Makefile generation constitutes the majority of the time in configure. Hence, this section has
506 # been somewhat optimized and is perhaps a bit twisty.
507
508 # code is order so as to try to sed the smallest input files we know.
509
510 # the three makefile fragments MUST end up in the resulting Makefile in this order: target, host, and site.
511 # so do these separately because I don't trust the order of sed -e expressions.
512
513 # Conditionalize for this site from "Makefile.in" (or whatever it's called) into Makefile.tem
514 case "${site}" in
515 "") cp ${srcdir}/${Makefile_in} Makefile.tem ;;
516 *)
517 site_makefile_frag=${srcdir}/config/ms-${site}
518
519 if [ -f ${site_makefile_frag} ] ; then
520 sed -e "/^####/ r ${site_makefile_frag}" ${srcdir}/${Makefile_in} \
521 > Makefile.tem
522 else
523 cp ${srcdir}/${Makefile_in} Makefile.tem
524 site_makefile_frag=
525 fi
526 ;;
527 esac
528 # working copy now in Makefile.tem
529
530 # Conditionalize the makefile for this host.
531 case "${host_makefile_frag}" in
532 "") mv Makefile.tem ${Makefile} ;;
533 *)
534 host_makefile_frag=${srcdir}/${host_makefile_frag}
535 if [ -f ${host_makefile_frag} ] ; then
536 sed -e "/^####/ r ${host_makefile_frag}" Makefile.tem > ${Makefile}
537 else
538 echo '***' Expected host makefile fragment \"${host_makefile_frag}\" 1>&2
539 echo '***' is missing in ${PWD}. 1>&2
540 mv Makefile.tem ${Makefile}
541 fi
542 esac
543 # working copy now in ${Makefile}
544
545 # Conditionalize the makefile for this target.
546 case "${target_makefile_frag}" in
547 "") mv ${Makefile} Makefile.tem ;;
548 *)
549 target_makefile_frag=${srcdir}/${target_makefile_frag}
550 if [ -f ${target_makefile_frag} ] ; then
551 sed -e "/^####/ r ${target_makefile_frag}" ${Makefile} > Makefile.tem
552 else
553 mv ${Makefile} Makefile.tem
554 target_makefile_frag=
555 fi
556 ;;
557 esac
558 # real copy now in Makefile.tem
559
560 # prepend warning about editting, and a bunch of variables.
561 cat > ${Makefile} <<EOF
562 # ${NO_EDIT}
563 host_alias = ${host_alias}
564 host_cpu = ${host_cpu}
565 host_vendor = ${host_vendor}
566 host_os = ${host_os}
567 target_alias = ${target_alias}
568 target_cpu = ${target_cpu}
569 target_vendor = ${target_vendor}
570 target_os = ${target_os}
571 target_makefile_frag = ${target_makefile_frag}
572 host_makefile_frag = ${host_makefile_frag}
573 site_makefile_frag = ${site_makefile_frag}
574 links = ${configlinks}
575 VPATH = ${srcdir}
576 EOF
577
578 # fixme: this shouldn't be in configure.
579 # Define macro CROSS_COMPILE in compilation if this is a cross-compiler.
580 case "${host_alias}" in
581 "${target_alias}")
582 tooldir="$(libdir)"
583 echo "ALL=all.internal" >> ${Makefile}
584 ;;
585 *)
586 echo "CROSS=-DCROSS_COMPILE" >> ${Makefile}
587 echo "ALL=all.cross" >> ${Makefile}
588 case "${program_prefix}" in
589 "") program_prefix=${target_alias}- ;;
590 *) ;;
591 esac
592
593 tooldir="$(libdir)/${target_alias}"
594 ;;
595 esac
596
597 # reset prefix, exec_prefix, srcdir, SUBDIRS, NONSUBDIRS, remove any form
598 # feeds.
599 sed -e "s:^prefix[ ]*=.*$:prefix = ${prefix}:" \
600 -e "s:^exec_prefix[ ]*=.*$:exec_prefix = ${exec_prefix}:" \
601 -e "s:^srcdir[ ]*=.*$:srcdir = ${srcdir}:" \
602 -e "s:^SUBDIRS[ ]*=.*$:SUBDIRS = ${configdirs}:" \
603 -e "s:^NONSUBDIRS[ ]*=.*$:NONSUBDIRS = ${noconfigdirs}:" \
604 -e "s/\f//" \
605 -e "s:^program_prefix[ ]*=.*$:program_prefix = ${program_prefix}:" \
606 -e "s:^tooldir[ ]*=.*$:tooldir = ${tooldir}:" \
607 Makefile.tem >> ${Makefile}
608 # final copy now in ${Makefile}
609
610 rm Makefile.tem
611
612 if [ -n "${verbose}" -o -z "${silent}" ] ; then
613 case "${host_makefile_frag}" in
614 "") using= ;;
615 *) using="and \"${host_makefile_frag}\"" ;;
616 esac
617
618 case "${target_makefile_frag}" in
619 "") ;;
620 *) using="${using} and \"${target_makefile_frag}\"" ;;
621 esac
622
623 case "${site_makefile_frag}" in
624 "") ;;
625 *) using="${using} and \"${site_makefile_frag}\"" ;;
626 esac
627
628 echo "Created \"${Makefile}\" in" ${PWD} `echo "${using}" | sed 's/and/using/'`
629 fi
630
631 . ${tmpfile}.pos
632
633 # describe the chosen configuration in config.status.
634 # Make that file a shellscript which will reestablish
635 # the same configuration. Used in Makefiles to rebuild
636 # Makefiles.
637
638 case "${norecursion}" in
639 "") arguments="${arguments} -norecursion" ;;
640 *) ;;
641 esac
642
643 echo "#!/bin/sh
644 # ${NO_EDIT}
645 # ${PWD} was configured as follows:
646 ${progname}" ${arguments} "
647 # ${using}" > config.status
648 chmod a+x config.status
649
650 # If there are subdirectories, then recur.
651 if [ -z "${norecursion}" -a -n "${configdirs}" ] ; then
652 for configdir in ${configdirs} ; do
653 case "${verbose}" in
654 "") ;;
655 *) echo Configuring ${configdir}... ;;
656 esac
657
658 if [ -d ${srcdir}/${configdir} ] ; then
659 case "${srcdir}" in
660 ".") ;;
661 *)
662 if [ ! -d ./${configdir} ] ; then
663 mkdir ./${configdir}
664 fi
665 ;;
666 esac
667
668 POPDIR=${PWD}
669 cd ${configdir}
670
671 ### figure out what to do with srcdir
672 case "${srcdir}" in
673 ".") newsrcdir=${srcdir} ;; # no -srcdir option. We're building in place.
674 /*) # absolute path
675 newsrcdir=${srcdir}/${configdir}
676 srcdiroption="-srcdir=${newsrcdir}"
677 ;;
678 *) # otherwise relative
679 newsrcdir=../${srcdir}/${configdir}
680 srcdiroption="-srcdir=${newsrcdir}"
681 ;;
682 esac
683
684 ### check for guested configure, otherwise fix possibly relative progname
685 if [ -f ${newsrcdir}/configure ] ; then
686 recprog=${newsrcdir}/configure
687 else
688 case "${progname}" in
689 /*) recprog=${progname} ;;
690 *) recprog=../${progname} ;;
691 esac
692 fi
693
694 ### The recursion line is here.
695 if ${recprog} -s ${host_alias} -target=${target_alias} \
696 ${verbose} ${prefixoption} ${tmpdiroption} ${exec_prefixoption} \
697 ${srcdiroption} ${program_prefixoption} ${site_option} ; then
698 true
699 else
700 exit 1
701 fi
702
703 cd ${POPDIR}
704 else
705 case "${verbose}" in
706 "") ;;
707 *) echo Warning: source directory \"${srcdir}/${configdir}\" is missing. ;;
708 esac
709 fi
710 done
711 fi
712
713 ### clean up.
714
715 # trap cmd above handles this now:
716 #rm -f ${tmpfile}.com ${tmpfile}.tgt ${tmpfile}.hst ${tmpfile}.pos
717
718 exit 0
719
720 #
721 # Local Variables:
722 # fill-column: 131
723 # End:
724 #
725
726 # end of configure
This page took 0.044268 seconds and 4 git commands to generate.