Insert the incidentals and things I forgot to ci last time, same log message:
[external/binutils.git] / bfd / configure
1 #!/bin/sh
2 # Please do not edit this file.  It is generated automatically from
3 # configure.in and a configure template.
4 configdirs=
5
6 #!/bin/sh
7
8 # Configuration script template
9 #   Copyright (C) 1988, 1990, 1991 Free Software Foundation, Inc.
10
11 #This file is part of GNU.
12
13 # This program is free software; you can redistribute it and/or modify
14 # it under the terms of the GNU General Public License as published by
15 # the Free Software Foundation; either version 2 of the License, or
16 # (at your option) any later version.
17
18 # This program is distributed in the hope that it will be useful,
19 # but WITHOUT ANY WARRANTY; without even the implied warranty of
20 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
21 # GNU General Public License for more details.
22
23 # You should have received a copy of the GNU General Public License
24 # along with this program; if not, write to the Free Software
25 # Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.  */
26
27 # $Id$
28
29 #
30 # Shell script to create proper links to machine-dependent files in
31 # preparation for compilation.
32 #
33 # If configure succeeds, it leaves its status in config.status.
34 # If configure fails after disturbing the status quo, 
35 #       config.status is removed.
36 #
37
38 remove=rm
39 hard_link=ln
40 symbolic_link='ln -s'
41
42 #for Test
43 #remove="echo rm"
44 #hard_link="echo ln"
45 #symbolic_link="echo ln -s"
46
47 progname=$0
48
49 # clear some things potentially inherited from environment.
50 ansi=
51 defaulttargets=
52 destdir=
53 fatal=
54 hostsubdir=
55 Makefile=Makefile
56 Makefile_in=Makefile.in
57 norecurse=
58 recursing=
59 removing=
60 srcdir=
61 srctrigger=
62 target=
63 targets=
64 commontargets=
65 targetsubdir=
66 template=
67 verbose=
68
69 for arg in $*;
70 do
71         case ${arg} in
72         -ansi | +a*)
73                 ansi=true
74                 clib=clib
75                 ;;
76         -destdir=* | +destdir=* | +destdi=* | +destd=* | +dest=* | +des=* | +de=* | +d=*)
77                 destdir=`echo ${arg} | sed 's/[+-]d[a-z]*=//'`
78                 ;;
79         -languages=* | +languages=* | +language=* | +languag=* \
80                 | +langua=* | +langu=* | +lang=* | +lan=* | +la=* \
81                 | +l=*)
82                 languages="${languages} `echo ${arg} | sed 's/[+-]l[a-z]*=//'`"
83                 ;;
84         -gas | +g*)
85                 gas=yes
86                 ;;
87         -help | +h*)
88                 fatal=true
89                 ;;
90         -nfp | +nf*)
91                 nfp=yes
92                 ;;
93         -norecurse | +no*)
94                 norecurse=true
95                 ;;
96         -recursing)
97                 recursing=true
98                 ;;
99         -rm | +r*)
100                 removing=${arg}
101                 ;;
102 #       -srcdir=* | +srcdir=* | +srcdi=* | +srcd=* | +src=* | +sr=* | +s=*)
103 #               srcdir=`echo ${arg} | sed 's/[+-]s[a-z]*=//'`
104 #               ;;
105         -subdirs | +f* | +su*)
106                 subdirs=${arg}
107                 ;;
108         -target=* | +target=* | +targe=* | +targ=* | +tar=* | +ta=*)
109                 if [ -n "${targets}" ] ; then
110                         subdirs="+subdirs"
111                 fi
112
113                 newtargets="${targets} `echo ${arg} | sed 's/[+-]t[a-z]*=//'`"
114                 targets="${newtargets}"
115                 ;;
116         -template=* | +template=* | +templat=* | +templa=* | +templ=* | +temp=* | +tem=* | +te=*)
117                 template=`echo ${arg} | sed 's/[+-]template=//'`
118                 ;;
119         -v | -verbose | +v*)
120                 verbose=${arg}
121                 ;;
122         -* | +*)
123                 (echo ;
124                 echo "Unrecognized option: \"${arg}\"". ;
125                 echo) 1>&2
126                 fatal=true
127                 ;;
128         *)
129                 if [ -n "${hosts}" ] ; then
130                         subdirs="+subdirs"
131                 fi
132
133                 newhosts="${hosts} ${arg}"
134                 hosts=${newhosts}
135                 ;;
136         esac
137 done
138
139 if [ -n "${verbose}" ] ; then
140         echo `pwd`/configure $*
141 fi
142
143 # process host and target only if not rebuilding configure itself or removing.
144 if [ -z "${template}" -a -z "${removing}" -a -z "${fatal}" ] ; then
145         # Complain if an arg is missing
146         if [ -z "${hosts}" ] ; then
147                 (echo ;
148                 echo "configure: No HOST specified." ;
149                 echo) 1>&2
150                 fatal=true
151         fi
152 fi
153
154 if [ -n "${fatal}" -o "${hosts}" = "help" ] ; then
155         (echo "Usage: configure HOST" ;
156         echo ;
157         echo "Options: [defaults in brackets]" ;
158         echo " +ansi            configure w/ANSI library. [no ansi lib]" ;
159         echo " +destdir=MYDIR   configure for installation into MYDIR. [/usr/local]" ;
160         echo " +subdirs         configure in subdirectories.  [in source directories]" ;
161         echo " +lang=LANG       configure to build LANG. [gcc]" ;
162         echo " +help            print this message. [normal config]" ;
163         echo " +gas             configure the compilers for use with gas. [native as]" ;
164         echo " +nfp             configure the compilers default to soft floating point. [hard float]" ;
165         echo " +norecurse       configure this directory only. [recurse]" ;
166         echo " +rm              remove this configuration. [build a configuration]" ;
167         echo " +target=TARGET   configure for TARGET.  [TARGET = HOST]" ;
168         echo " +template=TEM    rebuild configure using TEM. [normal config]" ;
169         echo ;
170         echo "Where HOST and TARGET are something like \"vax\", \"sun3\", \"encore\", etc." ;
171         echo "Asking for more than one \"+target\" implies \"+subdirs\".  Any other" ;
172         echo "options given will apply to all targets.") 1>&2
173
174         if [ -r config.status ] ; then
175                 cat config.status
176         fi
177
178         exit 1
179 fi
180
181 #### configure.in common parts come in here.
182 # This file is a shell script that supplies the information necessary
183 # to tailor a template configure script into the configure script
184 # appropriate for this directory.  For more information, check any
185 # existing configure script.
186
187 srctrigger=libbfd.c
188 srcname="bfd"
189
190 ## end of common part.
191
192 # are we rebuilding config itself?
193 if [ -n "${template}" ] ; then
194         if [ ! -r ${template} ] ; then
195                 echo '***' "Can't find template ${template}." 1>&2
196                 exit 1
197         fi
198
199 # prep the template
200         sed -e '/^#### configure.in common parts come in here.$/,/^## end of common part.$/c\
201 #### configure.in common parts come in here.\
202 ## end of common part.' \
203         -e '/^#### configure.in per-host parts come in here.$/,/^## end of per-host part.$/c\
204 #### configure.in per-host parts come in here.\
205 ## end of per-host part.' \
206         -e '/^#### configure.in per-target parts come in here.$/,/^## end of per-target part.$/c\
207 #### configure.in per-target parts come in here.\
208 ## end of per-target part.' \
209         -e '/^#### configure.in post-target parts come in here.$/,/^## end of post-target part.$/c\
210 #### configure.in post-target parts come in here.\
211 ## end of post-target part.' \
212         < ${template} > template.new
213
214         if [ -r configure.in ] ; then
215                 if [ -z "`grep '^# per\-host:' configure.in`" ] ; then
216                         echo '***' `pwd`/configure.in has no "per-host:" line. 1>&2
217                         exit 1
218                 fi
219
220                 if [ -z "`grep '^# per\-target:' configure.in`" ] ; then
221                         echo '***' `pwd`/configure.in has no "per-target:" line. 1>&2
222                         exit 1
223                 fi
224
225                 # split configure.in into common, per-host, per-target,
226                 # and post-target parts.  Post-target is optional.
227                 sed -e '/^# per\-host:/,$d' configure.in > configure.com
228                 sed -e '1,/^# per\-host:/d' -e '/^# per\-target:/,$d' configure.in > configure.hst
229                 if grep -s '^# post-target:' configure.in ; then
230                   sed -e '1,/^# per\-target:/d' -e '/^# post\-target:/,$d' configure.in > configure.tgt
231                   sed -e '1,/^# post\-target:/d' configure.in > configure.pos
232                 else
233                   sed -e '1,/^# per\-target:/d' configure.in > configure.tgt
234                   echo >configure.pos
235                 fi
236
237                 # and insert them
238                 sed -e '/^#### configure.in common parts come in here.$/  r configure.com' \
239                         -e '/^#### configure.in per\-host parts come in here.$/  r configure.hst' \
240                         -e '/^#### configure.in per\-target parts come in here.$/  r configure.tgt' \
241                         -e '/^#### configure.in post\-target parts come in here.$/  r configure.pos' \
242                         template.new > configure.new
243
244                 rm -f configure.com configure.tgt configure.hst configure.pos
245         else
246                 echo Warning: no configure.in in `pwd`
247                 cat ${template} >> configure
248         fi
249
250         chmod a+x configure.new
251         rm template.new
252 #       mv configure configure.old
253         mv configure.new configure
254
255         if [ -n "${verbose}" ] ; then
256                 echo Rebuilt configure in `pwd`
257         fi
258
259         # Now update config.sub from the template directory.
260         if echo "$template" | grep -s 'configure$' ; then
261                 cp `echo "$template" | sed s/configure$/config.sub/` ./config.sub.new
262         #       mv config.sub config.sub.old
263                 mv config.sub.new config.sub
264
265                 if [ -n "${verbose}" ] ; then
266                         echo Rebuilt config.sub in `pwd`
267                 fi
268         fi
269
270         if [ -z "${norecurse}" ] ; then
271                 # If template is relative path, make it absolute for recursing.
272                 if echo "${template}" | grep -s '^/' ; then
273                    true
274                 else
275                    template=`pwd`/${template}
276                 fi
277
278                 while [ -n "${configdirs}" ] ; do
279                         # set configdir to car of configdirs, configdirs to cdr of configdirs
280                         set ${configdirs}; configdir=$1; shift; configdirs=$*
281
282                         if [ "`echo ${configdir}.*`" != "${configdir}.*" ] ; then
283                                 targetspecificdirs=${configdir}.*
284                         else
285                                 targetspecificdirs=
286                         fi
287
288                         for i in ${configdir} ${targetspecificdirs} ; do
289                                 if [ -d $i ] ; then
290                                         if [ -r $i/configure ] ; then
291                                                 (cd $i ;
292                                                         ./configure +template=${template} ${verbose})
293                                         else
294                                                 echo Warning: No configure script in `pwd`/$i
295                                         fi
296                                 else
297                                         if [ -n "${verbose}" ] ; then
298                                           echo Warning: directory $i is missing.
299                                         fi
300                                 fi
301                         done
302                 done
303         fi
304
305         exit 0
306 fi
307
308 # some sanity checks on configure.in
309 if [ -z "${srctrigger}" ] ; then
310         echo Warning: srctrigger not set in configure.in. `pwd` not configured.
311         exit 1
312 fi
313
314 for host in ${hosts} ; do
315         # Default other arg
316         if [ -z "${targets}" -o -n "${defaulttargets}" ] ; then
317                 targets=${host}
318                 defaulttargets=true
319         fi
320
321         result=`/bin/sh ./config.sub ${host}`
322         host_cpu=`echo $result | sed 's/^\(.*\)-\(.*\)-\(.*\)$/\1/'`
323         host_vendor=`echo $result | sed 's/^\(.*\)-\(.*\)-\(.*\)$/\2/'`
324         host_os=`echo $result | sed 's/^\(.*\)-\(.*\)-\(.*\)$/\3/'`
325         host=${host_cpu}-${host_vendor}-${host_os}
326         host_makefile_frag=config/hmake-${host}
327
328 #### configure.in per-host parts come in here.
329
330 if [ "${host_os}" = "posix" ] ; then
331         bfd_host=posix
332 else
333         case "${host_cpu}" in
334         rs6000) bfd_host=aix ;;
335         mips)
336                 case "${host_vendor}" in
337                 dec)    bfd_host=dec3100 ;;
338                 sgi)    bfd_host=irix3 ;;
339                 esac
340                 ;;
341         m88k)
342                 case "${host_vendor}" in
343                 *)
344                         case "${host_os}" in
345                         dgux)   bfd_host=dgux ;;
346                         esac
347                         ;;
348                 esac
349                 ;;
350
351         m68k)
352                 case "${host_vendor}" in
353                 hp)     
354                         case "${host_os}" in
355                         hpux)   bfd_host=hp9000 ;;
356                         bsd)    bfd_host=hp300bsd ;;
357                         esac
358                         ;;
359                 sony)   bfd_host=news ;;
360                 sun)    bfd_host=sun3 ;;
361                 esac
362                 ;;
363
364         i386)
365                 case "${host_vendor}" in
366                 *)
367                         case "${host_os}" in
368                         sysv)   bfd_host=i386v ;;
369                         esac
370                         ;;
371                 esac
372                 ;;
373
374         sparc)
375                 case "${host_vendor}" in
376                 sun)    bfd_host=sun4 ;;
377                 esac
378                 ;;
379
380         rtpc)   bfd_host=rtbsd
381                 ;;
382
383         a29k)   bfd_host=ultra3
384                 ;;
385
386         tahoe | vax)
387                 bfd_host=${host_cpu}
388                 ;;
389         esac
390 fi
391
392 if [ ! -f config/h-${bfd_host} ] ; then
393         echo '***' BFD does not support host ${host}: no file config/h-${bfd_host}
394         exit 1
395 fi
396
397 host_makefile_frag=config/h-${bfd_host}
398
399 ## end of per-host part.
400
401         for target in ${targets} ; do
402
403                 result=`/bin/sh ./config.sub ${target}`
404                 target_cpu=`echo $result | sed 's/^\(.*\)-\(.*\)-\(.*\)$/\1/'`
405                 target_vendor=`echo $result | sed 's/^\(.*\)-\(.*\)-\(.*\)$/\2/'`
406                 target_os=`echo $result | sed 's/^\(.*\)-\(.*\)-\(.*\)$/\3/'`
407                 target=${target_cpu}-${target_vendor}-${target_os}
408                 target_makefile_frag=config/tmake-${target}
409
410 #### configure.in per-target parts come in here.
411
412 case "${target_vendor}" in
413 aout | coff | bout) bfd_target=${target_cpu}-${target_vendor} ;;
414 sony)   bfd_target=news ;;
415 intel)  bfd_target=${target_cpu}-coff ;;        
416 wrs)
417         case "${target_cpu}" in
418         i960) bfd_target=i960-bout ;;
419         m68k) bfd_target=m68k-aout ;;
420         esac
421         ;;
422 sun)
423         case "${target_cpu}" in
424         m68k)   bfd_target=m68k-aout ;;
425         sparc)  bfd_target=sparc-aout ;;
426         esac
427         ;;
428 dec)
429         case "${target_cpu}" in
430         mips) bfd_target=dec3100 ;;
431         esac
432         ;;
433 hp)
434         case "${target_cpu}" in
435         m68k)
436                 case "${target_os}" in
437                 hpux)   bfd_target=hp9000 ;;
438                 bsd)    bfd_target=hp300bsd ;;
439                 esac
440                 ;;
441         esac
442         ;;
443 sgi)
444         case "${target_cpu}" in
445         mips)
446                 bfd_target=irix3 ;;
447         esac
448         ;;
449
450 hitachi)
451         case "${target_cpu}" in
452         h8300) bfd_target=h8300-ieee ;;
453         *) echo "bad hitachi cpu" ;;
454         esac
455         ;;
456
457
458 none|nyu)
459         case "${target_cpu}" in
460         i386) bfd_target=i386-coff ;;
461         a29k) case "${target_os}" in
462                 aout) bfd_target=a29k-aout ;;
463                 coff) bfd_target=a29k-coff ;;
464                 sym1) bfd_target=a29k-coff ;;
465                esac
466                ;;
467         esac
468         ;;
469 *)
470         case "${target_cpu}" in
471         tahoe | vax) bfd_target=${target_cpu} ;;
472         esac
473         ;;
474 esac
475
476 if [ ! -f config/t-${bfd_target} ] ; then
477         echo '***' BFD does not support target ${target}: no file config/t-${bfd_target}
478         exit 1
479 fi
480
481 target_makefile_frag=config/t-${bfd_target}
482
483 files=
484 links=
485 ## end of per-target part.
486
487                 # Temporarily, we support only direct subdir builds.
488                 hostsubdir=Host-${host}
489                 targetsubdir=Target-${target}
490
491                 if [ -n "${removing}" ] ; then
492                         if [ -n "${subdirs}" ] ; then
493                                 if [ -d "${hostsubdir}" ] ; then
494                                         rm -rf ${hostsubdir}/${targetsubdir}
495
496                                         if [ -z "`(ls ${hostsubdir}) 2>&1 | grep Target- | grep -v Target-independent`" ] ; then
497                                                 rm -rf ${hostsubdir}
498                                         fi
499                                 else
500                                         echo Warning: no `pwd`/${hostsubdir} to remove.
501                                 fi
502                         else
503                                 rm -f ${Makefile} config.status ${links}
504                         fi
505                 else
506                         if [ -n "${subdirs}" ] ; then
507                                 # check for existing status before allowing forced subdirs.
508                                 if [ -f ${Makefile} ] ; then
509                                         echo '***' "${Makefile} already exists in source directory.  `pwd` not configured." 1>&2
510                                         exit 1
511                                 fi
512
513                                 if [ ! -d ${hostsubdir} ] ; then mkdir ${hostsubdir} ; fi
514                                 cd ${hostsubdir}
515
516                                 if [ ! -d ${targetsubdir} ] ; then
517                                         if [ -z "${commontargets}" ] ; then
518                                                 mkdir ${targetsubdir}
519                                         else
520                                                 if [ ! -d Target-independent ] ; then
521                                                         mkdir Target-independent
522                                                 fi
523
524                                                 ${symbolic_link} Target-independent ${targetsubdir}
525                                         fi # if target independent
526                                 fi # if no target dir yet
527
528                                 cd ${targetsubdir}
529
530                                 srcdir=../..
531                         else
532                                 # if not subdir builds, then make sure none exist.
533                                 if [ -n "`(ls .) 2>&1 | grep Host-`" ] ; then
534                                         echo '***' "Configured subdirs exist.  `pwd` not configured." 1>&2
535                                         exit 1
536                                 fi
537                         fi
538
539                         # Find the source files, if location was not specified.
540                         if [ -z "${srcdir}" ] ; then
541                                 srcdirdefaulted=1
542                                 srcdir=.
543                                 if [ -n "${srctrigger}" -a ! -r ${srctrigger} ] ; then
544                                         srcdir=..
545                                 fi
546                         fi
547
548                         if [ -n "${srctrigger}" -a ! -r ${srcdir}/${srctrigger} ] ; then
549                                 if [ -z "${srcdirdefaulted}" ] ; then
550                                         echo '***' "${progname}: Can't find ${srcname} sources in `pwd`/${srcdir}" 1>&2
551                                 else
552                                         echo '***' "${progname}: Can't find ${srcname} sources in `pwd`/. or `pwd`/.." 1>&2
553                                 fi
554
555                                 echo '***' \(At least ${srctrigger} is missing.\) 1>&2
556                                 exit 1
557                         fi
558
559                         # Set up the list of links to be made.
560                         # ${links} is the list of link names, and ${files} is the list of names to link to.
561
562                         # Make the links.
563                         while [ -n "${files}" ] ; do
564                                 # set file to car of files, files to cdr of files
565                                 set ${files}; file=$1; shift; files=$*
566                                 set ${links}; link=$1; shift; links=$*
567
568                                 if [ ! -r ${srcdir}/${file} ] ; then
569                                         echo '***' "${progname}: cannot create a link \"${link}\"," 1>&2
570                                         echo '***' "since the file \"${file}\" does not exist." 1>&2
571                                         exit 1
572                                 fi
573
574                                 ${remove} -f ${link}
575                                 rm -f config.status
576                                 # Make a symlink if possible, otherwise try a hard link
577                                 ${symbolic_link} ${srcdir}/${file} ${link} 2>/dev/null || ${hard_link} ${srcdir}/${file} ${link}
578
579                                 if [ ! -r ${link} ] ; then
580                                         echo '***' "${progname}: unable to link \"${link}\" to \"${srcdir}/${file}\"." 1>&2
581                                         exit 1
582                                 fi
583
584                                 if [ -n "${verbose}" ] ; then
585                                         echo "Linked \"${link}\" to \"${srcdir}/${file}\"."
586                                 fi
587                         done
588
589                         # Create a .gdbinit file which runs the one in srcdir
590                         # and tells GDB to look there for source files.
591
592                         case ${srcdir} in
593                         .)
594                                 ;;
595                         *)
596                                 echo "dir ." > .gdbinit
597                                 echo "dir ${srcdir}" >> .gdbinit
598                                 echo "source ${srcdir}/.gdbinit" >> .gdbinit
599                                 ;;
600                         esac
601
602                         # Install a makefile, and make it set VPATH
603                         # if necessary so that the sources are found.
604                         # Also change its value of srcdir.
605
606                 # FIXME-someday: This business of always writing to .tem and mv back
607                 # is so that I don't screw things up while developing.  Once this
608                 # template is stable, these should be optimized. xoxorich.
609
610                         # Define macro CROSS_COMPILE in compilation if this is a cross-compiler.
611                         if [ "${host}" != "${target}" ] ; then
612                                 echo "CROSS=-DCROSS_COMPILE" > ${Makefile}
613                                 echo "ALL=start.encap" >> ${Makefile}
614                         else
615                                 echo "ALL=all.internal" > ${Makefile}
616                         fi
617
618                         # set target, host, VPATH
619                         echo "host = ${host}" >> ${Makefile}
620                         echo "target = ${target}" >> ${Makefile}
621
622                         if [ -n "${subdirs}" ] ; then
623                                 echo "subdir = /${hostsubdir}/${targetsubdir}" >> ${Makefile}
624                         else
625                                 echo "subdir =" >> ${Makefile}
626                         fi
627
628                 #       echo "workdir = `pwd`" >> ${Makefile}
629                         echo "VPATH = ${srcdir}" >> ${Makefile}
630
631                         # add "Makefile.in" (or whatever it's called)
632                         cat ${srcdir}/${Makefile_in} >> ${Makefile}
633
634                         # Conditionalize the makefile for this host.
635                         if [ -f ${srcdir}/${host_makefile_frag} ] ; then
636                                 sed -e "/^####/  r ${srcdir}/${host_makefile_frag}" ${Makefile} > Makefile.tem
637                                 mv Makefile.tem ${Makefile}
638                         fi
639
640                         # Conditionalize the makefile for this target.
641                         if [ -f ${srcdir}/${target_makefile_frag} ] ; then
642                                 sed -e "/^####/  r ${srcdir}/${target_makefile_frag}" ${Makefile} > Makefile.tem
643                                 mv Makefile.tem ${Makefile}
644                         fi
645
646                         # set srcdir
647                         sed "s@^srcdir = \.@srcdir = ${srcdir}@" ${Makefile} > Makefile.tem
648                         mv Makefile.tem ${Makefile}
649
650                         # set destdir
651                         if [ -n "${destdir}" ] ; then
652                                 sed "s:^destdir =.*$:destdir = ${destdir}:" ${Makefile} > Makefile.tem
653                                 mv Makefile.tem ${Makefile}
654                         fi
655
656                         # reset SUBDIRS
657                         sed "s:^SUBDIRS =.*$:SUBDIRS = ${configdirs}:" ${Makefile} > Makefile.tem
658                         mv Makefile.tem ${Makefile}
659
660                         # reset NONSUBDIRS
661                         sed "s:^NONSUBDIRS =.*$:NONSUBDIRS = ${noconfigdirs}:" ${Makefile} > Makefile.tem
662                         mv Makefile.tem ${Makefile}
663
664                         using=
665                         if [ -f ${srcdir}/${host_makefile_frag} ] ; then
666                                 using=" using \"${host_makefile_frag}\""
667                         fi
668
669                         if [ -f ${srcdir}/${target_makefile_frag} ] ; then
670                                 if [ -z "${using}" ] ; then
671                                         andusing=" using \"${target_makefile_frag}\""
672                                 else
673                                         andusing="${using} and \"${target_makefile_frag}\""
674                                 fi
675                         else
676                                 andusing=${using}
677                         fi
678
679                         if [ -n "${verbose}" -o -z "${recursing}" ] ; then
680                                 echo "Created \"${Makefile}\"" in `pwd`${andusing}.
681                         fi
682
683 #### configure.in post-target parts come in here.
684
685 ## end of post-target part.
686
687                         if [ "${host}" = "${target}" ] ; then
688                                 echo "Links are now set up for use with a ${target}." \
689                                         > config.status
690                 #                       | tee ${srcdir}/config.status
691                         else
692                                 echo "Links are now set up for host ${host} and target ${target}." \
693                                         > config.status
694                 #                       | tee ${srcdir}/config.status
695                         fi
696
697                         originaldir=`pwd`
698                         cd ${srcdir}
699                 fi
700
701                 # If there are subdirectories, then recurse. 
702                 if [ -z "${norecurse}" -a -n "${configdirs}" ] ; then 
703                         for configdir in ${configdirs} ; do
704                                 if [ -n "${verbose}" ] ; then
705                                         echo Configuring ${configdir}...
706                                 fi
707
708                                 if [ -d ${configdir} ] ; then
709                                         (cd ${configdir} ;
710                                                 ./configure -recursing ${host} +target=${target} \
711                                                         ${verbose} ${subdirs} ${removing} +destdir=${destdir}) \
712                                                 | sed 's/^/     /'
713                                 else
714                                         if [ -n "${verbose}" ] ; then
715                                                 echo Warning: directory \"${configdir}\" is missing.
716                                         fi
717                                 fi
718                         done
719                 fi
720         done # for each target
721
722         # Now build a Makefile for this host.
723         if [ -n "${subdirs}" -a ! -n "${removing}" ] ; then
724                 cd ${hostsubdir}
725                 cat > GNUmakefile << E!O!F
726 # Makefile generated by configure for host ${host}.
727
728 ALL := $(shell ls -d Target-*)
729
730 %:
731         $(foreach subdir,$(ALL),$(MAKE) -C $(subdir) \$@ &&) true
732
733 all:
734 E!O!F
735                 cd ..
736         fi
737 done # for each host
738
739 exit 0
740
741 #
742 # $Log$
743 # Revision 1.28  1991/10/01 03:55:37  steve
744 # Insert the incidentals and things I forgot to ci last time, same log message:
745 #
746 # Mon Sep 30 15:13:46 1991  Steve Chamberlain  (steve at cygnus.com)
747 #
748 #       * cpu-a29k.c, cpu-i386.c, cpu-m68k.c, cpu-mips.c, cpu-vax.c,
749 #       cpu-h8300.c, cpu-i960.c, cpu-m88k.c, cpu-sparc.c: added. These
750 #       files will eventually contain processor specific bits for bfd,
751 #       like strange relocation information and dis/assembly.  So far only
752 #       the H8 has been even partially done.  This work also ties in with
753 #       the change in handling architectures.
754 #
755 #       * amdcoff.c: (a29k_reloc) fix error message.
756 #
757 #       * aout-f1.h: (choose_reloc_size) now calls bfd_get_arch to
758 #       discover the architecture of the bfd. (sunos4_callback) calls the
759 #       function bfd_set_arch_mach rather than stuffing stuff directly
760 #       into the bfd. (sunos4_write_object_contents), changed names of
761 #       accessor functions.
762 #
763 #       * aoutx.h: (set_arch_mach) now calls bfd_default_set_arch_mach to
764 #       setup the environment.
765 #
766 #       * archive.c: (bfd_slurp_coff_armap) coff archives always have the
767 #       headers in big endian format, regardless of the endianess of the
768 #       host or target.
769 #
770 #       * archures.c: totally changed. Now an architecture is represented
771 #       with a pointer to an info structure rather than an enumerated type
772 #       and a long. The old info is available as two elements in the
773 #       structure.  Future enhancements to architecure support will
774 #       involve pointers to methods being placed into the info structure.
775 #
776 #       * bfd.c: changed the definition of the bfd structure for the new
777 #       architecture stuff.
778 #
779 #       * bout.c: (b_out_set_arch_mach) changed to use the new
780 #       architecture mechanism.
781 #
782 #       * coffcode.h: (coff_set_arch_mach, coff_set_flags) changed to use
783 #       the new architecture mechanism.
784 #
785 #       * configure.in: added h8 stuff.
786 #
787 #       * ieee.c: too many changes to note.  Now ieee files written with
788 #       bfd gas and ld can be read by gld and ieee only linkers and
789 #       simulators.
790 #
791 #       * libbfd.c, libbfd.h: changed prototype of bfd_write.
792 #
793 #       * newsos3.c: (newos3_callback) now calls bfd_set_arch_mach rather
794 #       than fixing the structure directly.
795 #
796 #       * oasys.c: (oasys_object_p) now calls bfd_default_set_arch_mach rather
797 #       than fixing the structure directly.
798 #
799 #       * opncls.c: (new_bfd) makes sure that bfd_init has been called
800 #       before opening a bfd.
801 #
802 #       * srec.c: (srec_set_arch_mach) now calls bfd_default_set_arch_mach
803 #       rather than fixing the structure directly.
804 #
805 #       * targets.c: (target_vector) now by defining SELECT_VECS (perhaps
806 #       in the t/hmake file) a user can select which backends they want
807 #       linked with bfd without changing the source.
808 #
809 #       * init.c: new, looks after initializing modules.
810 #
811 #       * howto.c: for future use, will allow an application to work out
812 #       what cookie to use as a handle on a relcoatio howto.
813 #
814 # Revision 1.27  1991/09/17  00:36:44  rich
815 # Updated from configure.in.
816 #
817 # Revision 1.26  1991/09/13  02:19:42  gnu
818 # Propagate
819 #
820 # Revision 1.37  1991/09/12  00:33:18  rich
821 # Add gdbm.
822 #
823 # Revision 1.36  1991/08/31  03:54:36  rich
824 # Welcome emacs to the mess.
825 #
826 # Revision 1.35  1991/08/26  04:29:31  rich
827 # Welcome cvs to the big time.
828 #
829 # Revision 1.34  1991/08/25  23:40:23  rich
830 # rcs enters the soup.
831 #
832 # Revision 1.33  1991/08/25  21:48:38  rich
833 # Adding diff to the fray.
834 #
835 # Revision 1.32  1991/08/25  20:18:20  rich
836 # Adding grep to the fray.
837 #
838 # Revision 1.31  1991/08/23  04:50:57  rich
839 # Minor config polish.
840 #
841 # Revision 1.22  1991/08/23  03:31:43  rich
842 # Minor polish & config mapping.
843 #
844 # Revision 1.30  1991/08/22  07:15:51  rich
845 # Three part names, etc.
846 #
847 # Revision 1.29  1991/08/20  04:56:51  rich
848 # revisiting error messages
849 #
850 # Revision 1.28  1991/08/16  19:22:17  rich
851 # This is the commontargets change and should be considered
852 # experimental.
853 #
854 # Revision 1.27  1991/08/08  01:14:13  rich
855 # allow +f to stand in for +subdirs
856 #
857 # Revision 1.26  1991/08/07  19:21:32  rich
858 # +forcesubdirs -> +subdirs
859 #
860 # Revision 1.25  1991/08/07  07:05:30  rich
861 # Added make.
862 #
863 # Revision 1.24  1991/08/06  19:26:01  rich
864 # revised option parsing.
865 #
866 # Revision 1.23  1991/08/06  19:12:32  rich
867 # Host-level GNUmakefiles.
868 #
869 # Revision 1.22  1991/07/20  01:22:30  rich
870 # propogate gdb changes and destdir fix
871 #
872 # Revision 1.21  1991/07/20  00:55:20  gnu
873 # Roll in new configure that handles GDB.  Make sure that the "configure"
874 # that is checked-in reflects the latest "configure.in", which includes gdb.
875 #
876 # Revision 1.9  1991/07/06  04:35:51  gnu
877 # Fix bug in configure when iterating targets.
878 # Depend on alldeps.mak, not ${srcdir}/alldeps.mak, so it can be found
879 # in either spot.
880 #
881 # Revision 1.8  1991/07/05  00:04:58  gnu
882 # Thu Jul  4 14:47:06 1991  John Gilmore  (gnu at cygint.cygnus.com)
883 #
884 #         * configure.in, Makefile.in:  Avoid rebuilding "depend" as much.
885 #         Avoid declaring Makefile dependencies, because GNU Make stupidly
886 #         tries to update it if we do.
887 #
888 #         * coffread.c:  Revise for minor changes to bfd internal coff
889 #         indexes.
890 #
891 #         * configure:  If -template= is given a relative path, make it
892 #         absolute before recurring in subdirectories.
893 #
894 # Revision 1.7  1991/07/04  15:59:46  gnu
895 # Make gdb work with configure.  Only thing that doesn't work is the -list
896 # option (as far as I know).
897 #
898 # Revision 1.6  1991/06/04  07:28:16  gnu
899 # Change GDB over to GNU General Public License version 2.
900 #
901 # Revision 1.5  1991/05/19  07:26:54  rich
902 # configure changes and -opcode.h movement.
903 #
904 # Revision 1.4  1991/05/19  00:16:45  rich
905 # Configure for gdb.
906 #
907 # Revision 1.10  1991/05/04  00:58:38  rich
908 # Fix program name bug.
909 #
910 # Revision 1.9  1991/05/03  19:14:18  rich
911 # Changed getopt to libiberty, commented out an aborted attempt at host
912 # level Makefiles because it caused errors on +rm, add a warning for
913 # directories expected to be removed on +rm but that don't exist.
914 #
915 # Revision 1.8  1991/04/24  16:50:59  rich
916 # Three staging checkpoint.
917 #
918 # Revision 1.7  1991/04/17  01:34:47  rich
919 # Added getopt for binutils, fixed problem with host dependancies in
920 # configure.template.
921 #
922 # Revision 1.6  1991/04/16  00:18:44  rich
923 # Now handles multiple hosts and targets.
924 #
925 # Revision 1.5  1991/04/15  23:43:44  rich
926 # Now handles multiple hosts and targets.
927 #
928 # Revision 1.4  1991/04/13  02:11:03  rich
929 # Config cut 3.  We now almost install a29k.
930 #
931 # Revision 1.3  1991/04/11  02:41:54  rich
932 # Cut 2 config.  Subdirs.
933 #
934 #
935 #
936
937 #
938 # Local Variables:
939 # fill-column: 131
940 # End:
941 #
942
943 # end of configure.template