support for subdirs, multiple hosts, and multiple targets was
[external/binutils.git] / configure
1 #!/bin/sh
2
3 # Configuration script
4 #   Copyright (C) 1988, 1990, 1991, 1992 Free Software Foundation, Inc.
5
6 #This file is part of GNU.
7
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.
12
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.
17
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.  */
21
22 # Please email any bugs, comments, and/or additions to this file to:
23 # configure@cygnus.com
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 # NOTE: This script contains support for a Cygnus experimental feature, called
35 # +subdirs, which is currently, tentatively, de-supported.
36
37 export PATH || (echo "OOPS, this isn't sh.  Desperation time.  I will feed myself to sh."; sh $0 $argv; kill $$)
38
39 remove=rm
40 hard_link=ln
41 symbolic_link='ln -s'
42
43 #for Test
44 #remove="echo rm"
45 #hard_link="echo ln"
46 #symbolic_link="echo ln -s"
47
48 # clear some things potentially inherited from environment.
49
50 Makefile=Makefile
51 Makefile_in=Makefile.in
52 arguments=$*
53 commontargets=
54 configdirs=
55 datadir=
56 datadiroption=
57 defaulttargets=
58 fatal=
59 floating_point=default
60 gas=default
61 hosts=
62 next_prefix=
63 next_host=
64 next_site=
65 next_srcdir=
66 next_target=
67 next_tmpdir=
68 norecursion=
69 prefix=/usr/local
70 progname=
71 recurring=
72 removing=
73 srcdir=
74 srctrigger=
75 target=
76 targets=
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 be
87 ## 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 ## otherwise we prepend `pwd` to $0 and hope that will give us an absolute
93 ## path.
94 ##
95
96 PWD=`pwd`
97
98 if echo $0 | grep '^/' > /dev/null ; then
99         progname=$0
100 elif echo $0 | grep '/' > /dev/null ; then
101         progname=${PWD}/$0
102 else
103         progname=$0
104         PATH=$PATH:${PWD} ; export PATH
105 fi
106
107 for arg in $*;
108 do
109         # handle things that might have args following as separate words
110         if [ -n "${next_prefix}" ] ; then prefix=${arg} ; prefixoption="-prefix=${prefix}" ; next_prefix=
111         elif [ -n "${next_datadir}" ] ; then datadir=${arg} ; datadiroption="-datadir=${datadir}" ; next_datadir=
112         elif [ -n "${next_site}" ] ; then site=${arg} ; next_site=
113         elif [ -n "${next_srcdir}" ] ; then srcdir=${arg} ; next_srcdir=                
114         elif [ -n "${next_target}" ] ; then
115                 next_target=
116                 if [ -z "${targets}" ] ; then
117                         newtargets="${targets} ${arg}"
118                         targets="${newtargets}"
119                 else
120                         echo '***' Can only configure for one target at a time.
121                         fatal=yes
122                 fi
123         elif [ -n "${next_tmpdir}" ] ; then
124                 next_tmpdir=
125                 tmpdiroption="--tmpdir=${arg}"
126                 TMPDIR=${arg}
127
128         else
129                 case ${arg} in
130                 -datadir=* | --datadir=* | --datadi=* | --datad=* | --data=* | --dat=* | --da=* | --d=*)
131                         datadir=`echo ${arg} | sed 's/^[-a-z]*=//'`
132                         datadiroption=${arg}
133                         ;;
134                 -datadir | --datadir | --datadi | --datad | --data | --dat | --da | --d)
135                         next_datadir=yes
136                         ;;
137                 -gas | --g*)
138                         gas=yes
139                         ;;
140                 -help | --he*)
141                         fatal=true
142                         ;;
143                 -host=* | --host=* | --hos=* | --ho=*)
144                         if [ -z "${hosts}" ] ; then
145                                 newhosts="${hosts} `echo ${arg} | sed 's/^[-a-z]*=//'`"
146                                 hosts="${newhosts}"
147                         else
148                                 echo '***' Can only configure for one host at a time.
149                                 fatal=yes
150                         fi
151                         ;;
152                 -nfp | --nf*)
153                         floating_point=no
154                         ;;
155                 -norecursion | --no*)
156                         norecursion=true
157                         ;;
158                 -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*)
159                         prefix=`echo ${arg} | sed 's/^[-a-z]*=//'`
160                         prefixoption=${arg}
161                         ;;
162                 -prefix | --prefix | --prefi | --pref | --pre | --pr | --p)
163                         next_prefix=yes
164                         ;;
165                 -recurring | --recurring | --recurrin | --recurri | --recurr | --recur | --recu | --rec | --re)
166                         recurring=true
167                         arguments=`echo ${arguments} | sed "s:${arg}::"`
168                         ;;
169                 -rm | --rm)
170                         removing=${arg}
171                         ;;
172                 -site=* | --site=* | --sit=* | --si=*)
173                         site=`echo ${arg} | sed 's/^[-a-z]*=//'`
174                         ;;
175                 -site | --site | --sit | --si)
176                         next_site=yes
177                         ;;
178                 -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*)
179                         srcdir=`echo ${arg} | sed 's/^[-a-z]*=//'`
180                         ;;
181                 -srcdir | --srcdir | --srcdi | --srcd | --src | --sr)
182                         next_srcdir=yes
183                         ;;
184                 -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=*)
185                         if [ -z "${targets}" ] ; then
186                                 newtargets="${targets} `echo ${arg} | sed 's/^[-a-z]*=//'`"
187                                 targets="${newtargets}"
188                         else
189                                 echo '***' Can only configure for one target at a time.
190                                 fatal=yes
191                         fi
192                         ;;
193                 -target | --target | --targe | --targ | --tar | --ta)
194                         next_target=yes
195                         ;;
196                 -tmpdir=* | --tmpdir=* | --tmpdi=* | --tmpd=* | --tmp=* | --tm=*)
197                         tmpdiroption=${arg}
198                         TMPDIR=`echo ${arg} | sed 's/^[-a-z]*=//'`
199                         ;;
200                 -tmpdir | --tmpdir | --tmpdi | --tmpd | --tmp | --tm)
201                         next_tmpdir=yes
202                         ;;
203                 -v | -verbose | --v)
204                         verbose=${arg}
205                         ;;
206                 -version | -V | --version | --V)
207                         echo "This is Cygnus Configure version" `echo ${version} | sed 's/[ $:]//g'`
208                         exit 0
209                         ;;
210                 -x | --x) ;;
211                 -* | --*)
212                         (echo ;
213                         echo "Unrecognized option: \"${arg}\"". ;
214                         echo) 1>&2
215                         fatal=true
216                         ;;
217                 *)
218                         if [ -z "${undefs}" ] ; then
219                                 newundefs="${undefs} ${arg}"
220                                 undefs=${newundefs}
221                         else
222                                 echo '***' Can only configure for one host and one target at a time.
223                                 fatal=yes
224                         fi
225                         ;;
226                 esac
227         fi
228 done
229
230 # process host and target
231 if [ -z "${fatal}" ] ; then
232 #       # Complain if an arg is missing
233 #       if [ -z "${hosts}" ] ; then
234 #               (echo ;
235 #               echo "configure: No HOST specified." ;
236 #               echo) 1>&2
237 #               fatal=true
238 #       fi
239
240 ### This is a bit twisted.
241 ### * if all three are specified, this is an error.
242 ### * if we have neither hosts, nor unadorned args, this is an error.
243 ### * if no hosts are specified, then the unadorned args are hosts, but if
244 ### there were none, this is an error.
245 ### * if no targets are specified, then the unadorned args are targets, but if
246 ### there were no unadorned args, then the hosts are also targets.
247
248         if [ -n "${hosts}" -a -n "${targets}" -a -n "${undefs}" ] ; then
249                 echo '***' Can only configure for one host and one target at a time.
250                 fatal=yes
251         elif [ -z "${hosts}" -a -z "${undefs}" ] ; then
252                 echo '***' You must tell me for which host you want to configure.
253                 fatal=yes
254         else
255                 if [ -z "${hosts}" ] ; then
256                         hosts=${undefs}
257                 fi
258
259                 if [ -z "${targets}" ] ; then
260                         if [ -n "${undefs}" ] ; then
261                                 targets=${undefs}
262                         else
263                                 targets=${hosts}
264                         fi
265                 fi
266         fi
267 fi
268
269 if [ -n "${fatal}" -o "${hosts}" = "help" ] ; then
270         (echo "Usage: configure HOST" ;
271         echo ;
272         echo "Options: [defaults in brackets]" ;
273         echo " -datadir=MYDIR   configure for installation of host dependent files into MYDIR. [\"/usr/local\"]" ;
274         echo " -gas             configure the compilers for use with gas. [native as]" ;
275         echo " -help            print this message. [normal config]" ;
276         echo " -lang=LANG       configure to build LANG. [gcc]" ;
277         echo " -nfp             configure the compilers default to soft floating point. [hard float]" ;
278         echo " -norecursion     configure this directory only. [recurse]" ;
279         echo " -prefix=MYDIR    configure for installation of host dependent files into MYDIR. [\"/usr/local\"]" ;
280         echo " -rm              remove this configuration. [build a configuration]" ;
281         echo " -site            configure with site specific makefile" ;
282         echo " -srcdir=DIR      find the sources in DIR. [\".\" or \"..\"]" ;
283         echo " -target=TARGET   configure for TARGET.  [TARGET = HOST]" ;
284         echo " -tmpdir=TMPDIR   create temporary files in TMPDIR.  [ TMPDIR = \"/tmp\" ]" ;
285         echo ;
286         echo "Where HOST and TARGET are something like \"vax\", \"sun3\", \"encore\", etc." ;
287         ) 1>&2
288
289         if [ -r config.status ] ; then
290                 cat config.status
291         fi
292
293         exit 1
294 fi
295
296 configsub=`echo ${progname} | sed 's/configure$/config.sub/'`
297
298 if ${configsub} `echo ${hosts} | sed -e 's/ .*//'` >/dev/null 2>&1 ; then
299         true
300 else
301         echo '***' cannot find config.sub.
302         exit 1
303 fi
304
305 if [ -z "${srcdir}" ] ; then
306         if [ -r configure.in ] ; then
307                 srcdir=.
308         else
309                 echo '***' "Can't find configure.in.  Try using -srcdir=some_dir"
310                 exit 1
311         fi
312 fi
313
314
315 ### break up ${srcdir}/configure.in.
316 if [ -z "`grep '^# per\-host:' ${srcdir}/configure.in`" ] ; then
317         echo '***' ${srcdir}/configure.in has no "per-host:" line. 1>&2
318         exit 1
319 fi
320
321 if [ -z "`grep '^# per\-target:' ${srcdir}/configure.in`" ] ; then
322         echo '***' ${srcdir}/configure.in has no "per-target:" line. 1>&2
323         exit 1
324 fi
325
326 if [ -z "${TMPDIR}" ] ; then
327         TMPDIR=/tmp ; export TMPDIR
328 fi
329
330 # keep this filename short for &%*%$*# 14 char file names
331 tmpfile=${TMPDIR}/cONf$$
332 trap "rm -f ${tmpfile}.com ${tmpfile}.tgt ${tmpfile}.hst ${tmpfile}.pos" 0
333
334 # split ${srcdir}/configure.in into common, per-host, per-target,
335 # and post-target parts.  Post-target is optional.
336 sed -e '/^# per\-host:/,$d' ${srcdir}/configure.in > ${tmpfile}.com
337 sed -e '1,/^# per\-host:/d' -e '/^# per\-target:/,$d' ${srcdir}/configure.in > ${tmpfile}.hst
338 if grep '^# post-target:' ${srcdir}/configure.in >/dev/null ; then
339   sed -e '1,/^# per\-target:/d' -e '/^# post\-target:/,$d' ${srcdir}/configure.in > ${tmpfile}.tgt
340   sed -e '1,/^# post\-target:/d' ${srcdir}/configure.in > ${tmpfile}.pos
341 else
342   sed -e '1,/^# per\-target:/d' ${srcdir}/configure.in > ${tmpfile}.tgt
343   echo >${tmpfile}.pos
344 fi
345
346 ### do common part of configure.in
347
348 . ${tmpfile}.com
349
350 # some sanity checks on configure.in
351 if [ -z "${srctrigger}" ] ; then
352         echo '***' srctrigger not set in ${PWD}/configure.in.
353         exit 1
354 fi
355
356 for host in ${hosts} ; do
357         # Default other arg
358         if [ -z "${targets}" -o -n "${defaulttargets}" ] ; then
359                 targets=${host}
360                 defaulttargets=true
361         fi
362
363         host_alias=${host}
364
365         result=`${configsub} ${host}`
366         host_cpu=`echo $result | sed 's/^\(.*\)-\(.*\)-\(.*\)$/\1/'`
367         host_vendor=`echo $result | sed 's/^\(.*\)-\(.*\)-\(.*\)$/\2/'`
368         host_os=`echo $result | sed 's/^\(.*\)-\(.*\)-\(.*\)$/\3/'`
369         host=${host_cpu}-${host_vendor}-${host_os}
370         host_makefile_frag=config/mh-${host}
371         if [ ! -f ${host_makefile_frag} ]
372         then
373                 host_makefile_frag=config/mh-${host_alias}
374         fi
375
376         . ${tmpfile}.hst
377
378         for target in ${targets} ; do
379
380                 target_alias=${target}
381                 result=`${configsub} ${target}`
382                 target_cpu=`echo $result | sed 's/^\(.*\)-\(.*\)-\(.*\)$/\1/'`
383                 target_vendor=`echo $result | sed 's/^\(.*\)-\(.*\)-\(.*\)$/\2/'`
384                 target_os=`echo $result | sed 's/^\(.*\)-\(.*\)-\(.*\)$/\3/'`
385                 target=${target_cpu}-${target_vendor}-${target_os}
386                 target_makefile_frag=config/mt-${target}
387                 if [ ! -f ${target_makefile_frag} ]
388                 then
389                         target_makefile_frag=config/mt-${target_alias}
390                 fi
391
392                 . ${tmpfile}.tgt
393
394                 if [ "${host_alias}" = "${target_alias}" ] ; then
395                         subdirname=H-${host_alias}
396                 else
397                         subdirname=X-${host_alias}-${target_alias}
398                 fi
399
400                 if [ -n "${namesubdir}" ] ; then
401                         subdirname=${namesubdir}
402                 fi
403
404                 if [ -n "${removing}" ] ; then
405                                 rm -f ${Makefile} config.status ${links}
406                 else
407                         # Find the source files, if location was not specified.
408                         if [ -z "${srcdir}" ] ; then
409                                 srcdirdefaulted=1
410                                 srcdir=.
411                                 if [ ! -r ${srctrigger} ] ; then
412                                         srcdir=..
413                                 fi
414                         fi
415
416                         if [ ! -r ${srcdir}/${srctrigger} ] ; then
417                                 if [ -z "${srcdirdefaulted}" ] ; then
418                                         echo '***' "${progname}: Can't find ${srcname} sources in ${PWD}/${srcdir}" 1>&2
419                                 else
420                                         echo '***' "${progname}: Can't find ${srcname} sources in ${PWD}/. or ${PWD}/.." 1>&2
421                                 fi
422
423                                 echo '***' \(At least ${srctrigger} is missing.\) 1>&2
424                                 exit 1
425                         fi
426
427                         # Set up the list of links to be made.
428                         # ${links} is the list of link names, and ${files} is the list of names to link to.
429
430                         # Make the links.
431                         while [ -n "${files}" ] ; do
432                                 # set file to car of files, files to cdr of files
433                                 set ${files}; file=$1; shift; files=$*
434                                 set ${links}; link=$1; shift; links=$*
435
436                                 if [ ! -r ${srcdir}/${file} ] ; then
437                                         echo '***' "${progname}: cannot create a link \"${link}\"," 1>&2
438                                         echo '***' "since the file \"${file}\" does not exist." 1>&2
439                                         exit 1
440                                 fi
441
442                                 ${remove} -f ${link}
443                                 rm -f config.status
444                                 # Make a symlink if possible, otherwise try a hard link
445                                 ${symbolic_link} ${srcdir}/${file} ${link} 2>/dev/null || ${hard_link} ${srcdir}/${file} ${link}
446
447                                 if [ ! -r ${link} ] ; then
448                                         echo '***' "${progname}: unable to link \"${link}\" to \"${srcdir}/${file}\"." 1>&2
449                                         exit 1
450                                 fi
451
452                                 if [ -n "${verbose}" ] ; then
453                                         echo "Linked \"${link}\" to \"${srcdir}/${file}\"."
454                                 fi
455                         done
456
457                         # Create a .gdbinit file which runs the one in srcdir
458                         # and tells GDB to look there for source files.
459
460                         if [ -r ${srcdir}/.gdbinit ] ; then
461                                 case ${srcdir} in
462                                 .)
463                                         ;;
464                                 *)
465                                         echo "# "${NO_EDIT} > .gdbinit
466                                         echo "dir ." >> .gdbinit
467                                         echo "dir ${srcdir}" >> .gdbinit
468                                         echo "source ${srcdir}/.gdbinit" >> .gdbinit
469                                         ;;
470                                 esac
471                         fi
472
473                         # Install a makefile, and make it set VPATH
474                         # if necessary so that the sources are found.
475                         # Also change its value of srcdir.
476
477                 # FIXME-someday: This business of always writing to .tem and mv back
478                 # is so that I don't screw things up while developing.  Once this
479                 # template is stable, these should be optimized. xoxorich.
480
481                         # Define macro CROSS_COMPILE in compilation if this is a cross-compiler.
482                         if [ "${host}" != "${target}" ] ; then
483                                 echo "CROSS=-DCROSS_COMPILE" > ${Makefile}
484                                 echo "ALL=all.cross" >> ${Makefile}
485                         else
486                                 echo "ALL=all.internal" > ${Makefile}
487                         fi
488
489                         # set target, host, VPATH
490                         echo "host_alias = ${host_alias}" >> ${Makefile}
491                         echo "host_cpu = ${host_cpu}" >> ${Makefile}
492                         echo "host_vendor = ${host_vendor}" >> ${Makefile}
493                         echo "host_os = ${host_os}" >> ${Makefile}
494
495                         echo "target_alias = ${target_alias}" >> ${Makefile}
496                         echo "target_cpu = ${target_cpu}" >> ${Makefile}
497                         echo "target_vendor = ${target_vendor}" >> ${Makefile}
498                         echo "target_os = ${target_os}" >> ${Makefile}
499
500                                 echo "subdir =" >> ${Makefile}
501                                 echo "unsubdir = ." >> ${Makefile}
502
503                         echo "VPATH = ${srcdir}" >> ${Makefile}
504
505                         # add "Makefile.in" (or whatever it's called)
506                         cat ${srcdir}/${Makefile_in} >> ${Makefile}
507
508                         # Conditionalize the makefile for this site.
509                         if [ -n "${site}" ] ; then
510                                 site_makefile_frag=config/ms-${site}
511
512                                 if [ -f ${srcdir}/${site_makefile_frag} ] ; then
513                                         echo "site_makefile_frag = ${srcdir}/${site_makefile_frag}" > Makefile.tem
514                                         sed -e "/^####/  r ${srcdir}/${site_makefile_frag}" ${Makefile} >> Makefile.tem
515                                 else
516                                         echo "site_makefile_frag =" > Makefile.tem
517                                         cat ${Makefile} >> Makefile.tem
518                                 fi
519                                 mv Makefile.tem ${Makefile}
520                         fi
521
522                         # Conditionalize the makefile for this host.
523                         if [ -f ${srcdir}/${host_makefile_frag} ] ; then
524                                 echo "host_makefile_frag = ${srcdir}/${host_makefile_frag}" > Makefile.tem
525                                 sed -e "/^####/  r ${srcdir}/${host_makefile_frag}" ${Makefile} >> Makefile.tem
526                         else
527                                 echo "host_makefile_frag =" > Makefile.tem
528                                 cat ${Makefile} >> Makefile.tem
529                         fi
530                         mv Makefile.tem ${Makefile}
531
532                         # Conditionalize the makefile for this target.
533                         if [ -f ${srcdir}/${target_makefile_frag} ] ; then
534                                 echo "target_makefile_frag = ${srcdir}/${target_makefile_frag}" > Makefile.tem
535                                 sed -e "/^####/  r ${srcdir}/${target_makefile_frag}" ${Makefile} >> Makefile.tem
536                         else
537                                 echo "target_makefile_frag =" > Makefile.tem
538                                 cat ${Makefile} >> Makefile.tem
539                         fi
540                         mv Makefile.tem ${Makefile}
541
542                         # set srcdir
543                         sed "s:^srcdir[         ]*=.*$:srcdir = ${srcdir}:" ${Makefile} > Makefile.tem
544                         mv Makefile.tem ${Makefile}
545
546                         # set prefix
547                         if [ -n "${prefix}" ] ; then
548                                 sed "s:^prefix[         ]*=.*$:prefix = ${prefix}:" ${Makefile} > Makefile.tem
549                                 mv Makefile.tem ${Makefile}
550                         fi
551
552                         # set datadir
553                         if [ -n "${datadir}" ] ; then
554                                 sed "s:^datadir[        ]*=.*$:datadir = ${datadir}:" ${Makefile} > Makefile.tem
555                                 mv Makefile.tem ${Makefile}
556                         fi
557
558                         # reset SUBDIRS
559                         sed "s:^SUBDIRS[        ]*=.*$:SUBDIRS = ${configdirs}:" ${Makefile} > Makefile.tem
560                         mv Makefile.tem ${Makefile}
561
562                         # reset NONSUBDIRS
563                         sed "s:^NONSUBDIRS[     ]*=.*$:NONSUBDIRS = ${noconfigdirs}:" ${Makefile} > Makefile.tem
564                         mv Makefile.tem ${Makefile}
565
566                         # remove any form feeds.
567                         sed -e "s/\f//" ${Makefile} > Makefile.tem
568                         mv Makefile.tem ${Makefile}
569
570                         # prepend warning about editting.
571                         echo "# "${NO_EDIT} > ${Makefile}.tem
572                         cat ${Makefile} >> ${Makefile}.tem
573                         mv Makefile.tem ${Makefile}
574
575                         using=
576                         if [ -f ${srcdir}/${host_makefile_frag} ] ; then
577                                 using="${using} and \"${host_makefile_frag}\""
578                         fi
579                         if [ -f ${srcdir}/${target_makefile_frag} ] ; then
580                                 using="${using} and \"${target_makefile_frag}\""
581                         fi
582                         if [ -n "${site}" -a \
583                              -f ${srcdir}/${site_makefile_frag} ] ; then
584                                 using="${using} and \"${site_makefile_frag}\""
585                         fi
586                         using=`echo "${using}" | sed 's/and/using/'`
587                         using="Created \"${Makefile}\" in ${PWD}${using}."
588
589                         if [ -n "${verbose}" -o -z "${recurring}" ] ; then
590                                 echo ${using}
591                         fi
592
593                         . ${tmpfile}.pos
594
595                         # describe the chosen configuration in config.status.
596                         # Make that file a shellscript which will reestablish
597                         # the same configuration.  Used in Makefiles to rebuild
598                         # Makefiles.
599
600                         if [ -z "${norecursion}" ] ; then
601                                 arguments="${arguments} -norecursion"
602                         fi
603
604                         echo "#!/bin/sh
605 # ${NO_EDIT}
606 # ${PWD} was configured as follows:
607 ${progname}" ${arguments}  "
608 # ${using}" > config.status
609                         chmod a+x config.status
610
611                 fi
612
613                 # If there are subdirectories, then recur. 
614                 if [ -z "${norecursion}" -a -n "${configdirs}" ] ; then 
615                         for configdir in ${configdirs} ; do
616                                 if [ -n "${verbose}" ] ; then
617                                         echo Configuring ${configdir}...
618                                 fi
619
620                                 if [ -d ${srcdir}/${configdir} ] ; then
621                                         if [ "${srcdir}" != "." ] ; then
622                                                 if [ ! -d ./${configdir} ] ; then
623                                                         mkdir ./${configdir}
624                                                 fi
625                                         fi
626
627                                         POPDIR=${PWD}
628                                         cd ${configdir} 
629
630 ### figure out what to do with srcdir
631                                         case "${srcdir}" in
632                                         ".") ;; # do nothing.  We're building in place.
633                                         /*) srcdiroption="-srcdir=${srcdir}/${configdir}" ;; # absolute path
634                                         *) srcdiroption="-srcdir=../${srcdir}/${configdir}" ;; # otherwise relative
635                                         esac
636
637 ### The recursion line is here.
638                                         if [ -f configure ] ; then
639                                                 recprog=`pwd`/configure
640                                         else
641                                                 recprog=${progname}
642                                         fi
643
644                                         if ${recprog} -recurring ${host_alias} -target=${target_alias} \
645                                                 ${verbose} ${subdirs} ${removing} ${prefixoption} \
646                                                 ${tmpdiroption} ${namesubdiroption} ${datadiroption} \
647                                                 ${srcdiroption} ; then
648                                                 true
649                                         else
650                                                 exit 1
651                                         fi
652
653                                         cd ${POPDIR}
654                                 elif [ -n "${verbose}" ] ; then
655                                         echo Warning: source directory \"${srcdir}/${configdir}\" is missing.
656                                 fi
657                         done
658                 fi
659         done # for each target
660 done # for each host
661
662 ### clean up.
663
664 # trap cmd above handles this now:
665 #rm -f ${tmpfile}.com ${tmpfile}.tgt ${tmpfile}.hst ${tmpfile}.pos
666
667 exit 0
668
669 #
670 # Local Variables:
671 # fill-column: 131
672 # End:
673 #
674
675 # end of configure