]> git.ipfire.org Git - thirdparty/binutils-gdb.git/blob - gas/configure
Initial revision
[thirdparty/binutils-gdb.git] / gas / configure
1 #!/bin/sh
2 # Do not edit this file. It is generated automatically from configure.in
3 # and a configure template.
4 configdirs=
5
6 #!/bin/sh
7 # Do not edit this file. It is generated automatically from configure.in
8 # and a configure template.
9 configdirs=
10
11 # Configuration script template
12 # Copyright (C) 1988, 1990, 1991 Free Software Foundation, Inc.
13
14 #This file is part of GNU.
15
16 #GNU CC is free software; you can redistribute it and/or modify
17 #it under the terms of the GNU General Public License as published by
18 #the Free Software Foundation; either version 1, or (at your option)
19 #any later version.
20
21 #GNU CC is distributed in the hope that it will be useful,
22 #but WITHOUT ANY WARRANTY; without even the implied warranty of
23 #MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
24 #GNU General Public License for more details.
25
26 #You should have received a copy of the GNU General Public License
27 #along with GNU CC; see the file COPYING. If not, write to
28 #the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
29
30 #
31 # Shell script to create proper links to machine-dependent files in
32 # preparation for compiling gcc.
33 #
34 # Usage: configure [+srcdir=DIR] [+host=HOST] [+gas] [+nfp] TARGET
35 #
36 # If configure succeeds, it leaves its status in config.status.
37 # If configure fails after disturbing the status quo,
38 # config.status is removed.
39 #
40
41 progname=$0
42
43 remove=rm
44 hard_link=ln
45 symbolic_link='ln -s'
46
47 #for Test
48 #remove="echo rm"
49 #hard_link="echo ln"
50 #symbolic_link="echo ln -s"
51
52 # clear some things potentially inherited from environment.
53 target=
54 template=
55 removing=
56 norecurse=
57 ansi=
58
59 for arg in $*;
60 do
61 case $arg in
62 -ansi | +ansi)
63 ansi=true
64 ;;
65 -template=* | +template=*)
66 template=`echo $arg | sed 's/[+-]template=//'`
67 ;;
68 -norecurse | +norecurse)
69 norecurse=true
70 ;;
71 -rm | +rm)
72 removing=$arg
73 ;;
74 -srcdir=* | +srcdir=* | +srcdi=* | +srcd=* | +src=* | +sr=* | +s=*)
75 srcdir=`echo $arg | sed 's/[+-]s[a-z]*=//'`
76 ;;
77 -host=* | +host=* | +hos=* | +ho=* | +h=*)
78 host=`echo $arg | sed 's/[+-]h[a-z]*=//'`
79 ;;
80 -languages=* | +languages=* | -languag=* | +languag=* | langua=* \
81 | +langua=* | -langu=* | +langu=* | -lang=* | +lang=* | -lan=* \
82 | +lan=* | -la=* | +la=* | -l=* | +l=*)
83 languages="$languages `echo $arg | sed 's/[+-]l[a-z]*=//'`"
84 ;;
85 -gas | +gas | +ga | +g)
86 gas=yes
87 ;;
88 -nfp | +nfp | +nf | +n)
89 nfp=yes
90 ;;
91 *)
92 # Allow configure HOST TARGET
93 if [ x$host = x ] ; then host=$target ; fi
94 target=$arg
95 ;;
96 esac
97 done
98
99 # process host and target only if not rebuilding configure itself.
100 if [ -z "$template" ]
101 then
102 # Complain if an arg is missing
103 if [ x$target = x ]
104 then
105 echo "Usage: $progname [+srcdir=DIR] [+host=HOST] [+gas] [+nfp] TARGET"
106 echo -n "Where HOST and TARGET are something like "
107 echo "\`vax', \`sun3', \`encore', etc."
108 if [ -r config.status ]
109 then
110 cat config.status
111 fi
112 exit 1
113 fi
114
115 # Default other arg
116 if [ x$host = x ]
117 then
118 host=$target
119 fi
120
121 # Decode the host machine, then the target machine.
122 # For the host machine, we save the xm_file variable as host_xm_file;
123 # then we decode the target machine and forget everything else
124 # that came from the host machine.
125 for machine in $host $target; do
126
127 # Separate what the user gave into CPU/company and OS (if any).
128 basic_machine=`echo $machine | sed 's/-[^-]*$//'`
129 if [ $basic_machine != $machine ]
130 then os=`echo $machine | sed 's/[^-]*-/-/'`
131 else os=; fi
132
133 # Decode aliases for certain machine/company combinations.
134 case $basic_machine in
135 iris | iris4d)
136 basic_machine=mips/sgi
137 ;;
138 news | news800)
139 basic_machine=m68k/sony
140 ;;
141 3b1 | 7300 | 7300/att | att-7300)
142 basic_machine=m68k/att
143 ;;
144 delta | 3300 | motorola-3300 | motorola-delta \
145 | 3300/motorola | delta/motorola)
146 basic_machine=m68k/motorola
147 ;;
148 vax/dec)
149 basic_machine=vax
150 ;;
151 balance)
152 basic_machine=ns32k/sequent
153 ;;
154 symmetry)
155 basic_machine=i386/sequent
156 ;;
157 sun2)
158 basic_machine=m68000/sun
159 ;;
160 sun3)
161 basic_machine=m68k/sun
162 ;;
163 sun4)
164 basic_machine=sparc/sun
165 ;;
166 sun386 | sun386i)
167 basic_machine=i386/sun
168 ;;
169 ps2)
170 basic_machine=i386/ibm
171 ;;
172 next)
173 basic_machine=m68k/next
174 ;;
175 hp9k3[2-9][0-9])
176 basic_machine=m68k/hp
177 ;;
178 hp9k31[0-9] | hp9k2[0-9][0-9])
179 basic_machine=m68000/hp
180 ;;
181 isi68)
182 basic_machine=m68k/isi
183 ;;
184 apollo68)
185 basic_machine=m68k/apollo
186 ;;
187 altos | altos3068)
188 basic_machine=m68k/altos
189 ;;
190 miniframe)
191 basic_machine=m68000/convergent
192 ;;
193 tower | tower-32)
194 basic_machine=m68k/ncr
195 ;;
196 news-3600 | risc-news)
197 basic_machine=mips/sony
198 ;;
199 decstation | decstation-3100 | pmax)
200 basic_machine=mips/dec
201 ;;
202 gmicro)
203 basic_machine=tron
204 ;;
205 convex-c1)
206 basic_machine=c1/convex
207 ;;
208 convex-c2)
209 basic_machine=c2/convex
210 ;;
211 esac
212
213 # Decode manufacturer-specific aliases for certain operating systems.
214
215 case $os in
216 -newsos*)
217 os=-bsd
218 ;;
219 -ultrix*)
220 os=-bsd
221 ;;
222 -dynix*)
223 os=-bsd
224 ;;
225 -ctix*)
226 os=-sysv
227 ;;
228 esac
229
230 machine=$basic_machine$os
231
232 cpu_type=
233 xm_file=
234 tm_file=
235 make_var_file=
236
237 case $machine in
238 vax | vax-bsd*) # vaxen running BSD
239 ;;
240 vax-vms | vms) # vaxen running VMS
241 cpu_type=vax
242 xm_file=xm-vms.h
243 tm_file=tm-vms.h
244 ;;
245 vax-sysv* | vaxv) # vaxen running system V
246 cpu_type=vax
247 xm_file=xm-vaxv.h
248 tm_file=tm-vaxv.h
249 ;;
250 tahoe | tahoe-bsd*) # tahoe running BSD
251 ;;
252 tahoe/harris*) # Harris tahoe, using COFF.
253 cpu_type=tahoe
254 ;;
255 i386/sequent* | i386/sequent-bsd*) # 80386 from Sequent
256 cpu_type=i386
257 xm_file=xm-i386.h
258 tm_file=tm-seq386.h
259 ;;
260 i386-mach | i386/*-mach)
261 cpu_type=i386
262 xm_file=xm-i386.h
263 tm_file=tm-i386gas.h
264 ;;
265 i386/sco | i386/sco-sysv* | i386/*-sco) # 80386 running SCO system
266 cpu_type=i386
267 xm_file=xm-i386v.h
268 tm_file=tm-i386sco.h
269 make_var_file=make-i386sco
270 ;;
271 i386/isc | i386/isc-sysv* | i386/*-isc) # 80386 running ISC system
272 cpu_type=i386
273 xm_file=xm-i386v.h
274 tm_file=tm-i386isc.h
275 make_var_file=make-i386isc
276 ;;
277 i386/ibm | i386-aix | i386/ibm-aix) # IBM PS/2 running AIX
278 cpu_type=i386
279 tm_file=tm-i386v.h
280 xm_file=xm-i386v.h
281 make_var_file=make-i386v
282 ;;
283 i386/sun*)
284 cpu_type=i386
285 xm_file=xm-sun386i.h
286 tm_file=tm-sun386i.h
287 ;;
288 i386-sysv4 | i386/*-sysv4 | i386v4) # Intel 80386's running system V.4
289 cpu_type=i386
290 xm_file=xm-i386v.h
291 make_var_file=make-i386v
292 tm_file=tm-i386v4.h
293 ;;
294 i386-sysv* | i386/*-sysv* | i386v) # Intel 80386's running system V
295 cpu_type=i386
296 xm_file=xm-i386v.h
297 make_var_file=make-i386v
298 if [ x$gas = xyes ]
299 then
300 tm_file=tm-i386gas.h
301 else
302 tm_file=tm-i386v.h
303 fi
304 ;;
305 i860 | i860-sysv* | i860/*-sysv*)
306 cpu_type=i860
307 if [ x$gas = xyes ]
308 then
309 tm_file=tm-i860g.h
310 else
311 tm_file=tm-i860.h
312 fi
313 ;;
314 i860-bsd* | i860/*-bsd*)
315 cpu_type=i860
316 if [ x$gas = xyes ]
317 then
318 tm_file=tm-i860bsdg.h
319 else
320 tm_file=tm-i860bsd.h
321 fi
322 ;;
323 sparc | sparc/* | sparc-*os4 | sparc/*-*os4)
324 cpu_type=sparc
325 tm_file=tm-sparc.h
326 ;;
327 sparc-*os3 | sparc/*-*os3)
328 cpu_type=sparc
329 tm_file=tm-sun4os3.h
330 ;;
331 m68k/next)
332 cpu_type=m68k
333 tm_file=tm-next.h
334 out_file=out-next.c
335 xm_file=xm-next.h
336 ;;
337 m68k/sun-*os3)
338 cpu_type=m68k
339 if [ x$nfp = xyes ]
340 then
341 tm_file=tm-sun3os3nf.h
342 else
343 tm_file=tm-sun3os3.h
344 fi
345 ;;
346 m68k/sun-mach)
347 cpu_type=m68k
348 tm_file=tm-sun3mach.h
349 ;;
350 m68k/sun | m68k/sun-*os4)
351 cpu_type=m68k
352 if [ x$nfp = xyes ]
353 then
354 tm_file=tm-sun3nfp.h
355 else
356 tm_file=tm-sun3.h
357 fi
358 ;;
359 m68k/hp | m68k/hp-hpux*) # HP 9000 series 300
360 cpu_type=m68k
361 xm_file=xm-hp9k320.h
362 if [ x$gas = xyes ]
363 then
364 make_var_file=make-hp9k320g
365 tm_file=tm-hp9k320g.h
366 else
367 make_var_file=make-hp9k320
368 tm_file=tm-hp9k320.h
369 fi
370 ;;
371 m68k/hp-bsd*) # HP 9000/3xx running Berkeley Unix
372 cpu_type=m68k
373 tm_file=tm-hp9k3bsd.h
374 ;;
375 m68k/isi | m68k/isi-bsd*)
376 cpu_type=m68k
377 if [ x$nfp = xyes ]
378 then
379 tm_file=tm-isi68-nfp.h
380 else
381 tm_file=tm-isi68.h
382 fi
383 ;;
384 m68k/sony | m68k/sony-bsd*)
385 xm_file=xm-m68k.h
386 cpu_type=m68k
387 if [ x$gas = xyes ]
388 then
389 tm_file=tm-newsgas.h
390 else
391 tm_file=tm-news.h
392 fi
393 ;;
394 m68k/altos | m68k/altos-sysv*) # Altos 3068
395 cpu_type=m68k
396 if [ x$gas = xyes ]
397 then
398 xm_file=xm-altos3068.h
399 tm_file=tm-altos3068.h
400 else
401 echo "The Altos is supported only with the GNU assembler" 1>&2
402 exit 1
403 fi
404 ;;
405 m68k/motorola | m68k/motorola-sysv*)
406 cpu_type=m68k
407 tm_file=tm-mot3300.h
408 xm_file=xm-mot3300.h
409 ;;
410 m68k/crds | m68k/crds-unos | m68k-unos | crds | unos)
411 cpu_type=m68k
412 xm_file=xm-crds.h
413 make_var_file=make-crds
414 tm_file=tm-crds.h
415 ;;
416 m68k/apollo)
417 cpu_type=m68k
418 make_var_file=make-apollo68
419 tm_file=tm-apollo68.h
420 ;;
421 m68k/ncr | m68k/ncr-sysv*) # NCR Tower 32 SVR3
422 cpu_type=m68k
423 tm_file=tm-tower-as.h
424 xm_file=xm-tower.h
425 ;;
426 m68000/sun | m68000/sun-*os3)
427 cpu_type=m68k
428 tm_file=tm-sun2.h
429 ;;
430 m68000/sun-*os4)
431 cpu_type=m68k
432 tm_file=tm-sun2os4.h
433 ;;
434 m68000/hp | m68000/hp-hpux*) # HP 9000 series 300
435 cpu_type=m68k
436 xm_file=xm-hp9k310.h
437 if [ x$gas = xyes ]
438 then
439 make_var_file=make-hp9k320g
440 tm_file=tm-hp9k310g.h
441 else
442 make_var_file=make-hp9k320
443 tm_file=tm-hp9k310.h
444 fi
445 ;;
446 m68000/hp-bsd*) # HP 9000/200 running BSD
447 cpu_type=m68k
448 tm_file=tm-hp9k2bsd.h
449 make_var_file=make-hp9k2bsd
450 ;;
451 m68000/att | m68000/att-sysv*)
452 cpu_type=m68k
453 xm_file=xm-3b1.h
454 if [ x$gas = xyes ]
455 then
456 tm_file=tm-3b1g.h
457 else
458 tm_file=tm-3b1.h
459 fi
460 ;;
461 m68000/convergent | m68000/convergent-sysv*)
462 cpu_type=m68k
463 xm_file=xm-3b1.h
464 tm_file=tm-ctix.h
465 ;;
466 ns32k/sequent | ns32k/sequent-bsd*)
467 cpu_type=ns32k
468 tm_file=tm-sequent.h
469 ;;
470 ns32k/encore | ns32k/encore-bsd* | encore | encore-bsd*)
471 cpu_type=ns32k
472 tm_file=tm-encore.h
473 ;;
474 ns32k-genix* | ns32k/*-genix* | genix)
475 cpu_type=ns32k
476 xm_file=xm-genix.h
477 make_var_file=make-genix
478 tm_file=tm-genix.h
479 ;;
480 merlin)
481 cpu_type=ns32k
482 ;;
483 m88k/dg | m88k/dg-dgux* | m88k-dgux*)
484 cpu_type=m88k
485 xm_file=xm-m88kdgux.h
486 make_var_file=make-m88kdgux
487 tm_file=tm-m88kdgux.h
488 ;;
489 m88k-v88r32 | m88k/*-v88r32)
490 cpu_type=m88k
491 tm_file=tm-v88r32.h
492 xm_file=xm-v88r32.h
493 ;;
494 m88k-sysv* | m88k/*-sysv*)
495 cpu_type=m88k
496 tm_file=tm-m88ksvr4.h
497 xm_file=xm-m88ksvr4.h
498 ;;
499 alliant | alliant/alliant) # Alliant FX/8
500 cpu_type=alliant
501 tm_file=tm-alliant.h
502 ;;
503 c1/convex) # Convex C1
504 if [ -r /usr/include/stdlib.h ]
505 then
506 tm_file=tm-convex1.h
507 else
508 tm_file=tm-conv1os7.h
509 fi
510 cpu_type=convex
511 ;;
512 c2/convex) # Convex C2
513 if [ -r /usr/include/stdlib.h ]
514 then
515 tm_file=tm-convex2.h
516 else
517 tm_file=tm-conv2os7.h
518 fi
519 cpu_type=convex
520 ;;
521 mips/sgi | mips/sgi-sysv*) # Mostly like a MIPS.
522 cpu_type=mips
523 tm_file=tm-iris.h
524 xm_file=xm-iris.h
525 ;;
526 mips | mips/mips) # Default MIPS environment.
527 ;;
528 mips/dec | mips/dec-bsd*) # Decstation.
529 cpu_type=mips
530 tm_file=tm-decstatn.h
531 ;;
532 mips/sony | mips/sony-bsd*) # Sony NEWS 3600 or risc/news.
533 cpu_type=mips
534 tm_file=tm-mips-news.h
535 ;;
536 mips/*-sysv* | mips-sysv*) # SYSV variant of MIPS system.
537 cpu_type=mips
538 tm_file=tm-mips-sysv.h
539 ;;
540 mips/*-bsd* | mips-bsd*) # BSD 4.3 variant of MIPS system.
541 cpu_type=mips
542 tm_file=tm-mips-bsd.h
543 ;;
544 pyramid | pyramid/* | pyramid-*)
545 cpu_type=pyr
546 tm_file=tm-pyr.h
547 ;;
548 tron | tron/*)
549 cpu_type=gmicro
550 tm_file=tm_gmicro.h
551 ;;
552 a29k-bsd* | a29k/*-bsd*)
553 cpu_type=a29k
554 tm_file=tm-a29kunix.h
555 ;;
556 i960) # Default i960 environment.
557 ;;
558 # 370)
559 # ;;
560 esac
561 if [ x$pass1done = x ]
562 then
563 if [ x$cpu_type = x ]; then cpu_type=$host; fi
564 if [ x$xm_file = x ]; then host_xm_file=xm-$cpu_type.h
565 else host_xm_file=$xm_file
566 fi
567 if [ x$make_var_file = x ]
568 then make_var_file=make-$cpu_type; fi
569 host_make_var_file=$make_var_file
570 pass1done=yes
571 fi
572 done
573
574 # Default the machine-specific variables that were not explicitly set.
575 if [ x$cpu_type = x ]
576 then cpu_type=$target; fi
577
578 if [ x$tm_file = x ]
579 then tm_file=tm-$target.h; fi
580
581 md_file=${cpu_type}.md
582
583 if [ x$out_file = x ]
584 then out_file=out-$cpu_type.c; fi
585 fi
586
587 #### configure.in files go here.
588 # This file is a shell script that supplies the information necessary
589 # to tailor a template configure script into the configure script
590 # appropriate for this directory. For more information, check any
591 # existing configure script.
592
593 srctrigger=as.c
594 srcname="gas"
595
596 case $target in
597 *-coff)
598 obj_format=coff
599 ;;
600 *-bout)
601 obj_format=bout
602 ;;
603 *)
604 obj_format=aout
605 ;;
606 esac
607
608 case $target in
609 vax)
610 atof=vax
611 ;;
612 *)
613 atof=ieee
614 ;;
615 esac
616
617 files="ho-${host}.h tc-${cpu_type}.c tc-${cpu_type}.h te-generic.h obj-${obj_format}.h obj-${obj_format}.c atof-${atof}.c"
618 links="host.h targ-cpu.c targ-cpu.h targ-env.h obj-format.h obj-format.c atof-targ.c"
619 ### end of configure.in
620
621 # are we rebuilding config itself?
622 if [ -n "$template" ]
623 then
624 if [ ! -r $template ]
625 then
626 echo "Can't find template ${template}."
627 exit 1
628 fi
629
630 mv configure configure.old
631 echo "#!/bin/sh" > configure
632 echo "# Do not edit this file. It is generated automatically from configure.in" >> configure
633 echo "# and a configure template." >> configure
634 echo "configdirs=" >> configure
635 echo >> configure
636
637 if [ -r configure.in ]
638 then
639 sed -e "/^####/ r configure.in" $template >> configure
640 else
641 cat $template >> configure
642 fi
643
644 chmod a+x configure
645 rm configure.old
646 # echo Rebuilt configure in `pwd` from ${template}.
647 echo Rebuilt configure in `pwd`
648
649 if [ x$norecurse = x ]
650 then
651 while [ -n "$configdirs" ]
652 do
653 # set configdir to car of configdirs, configdirs to cdr of configdirs
654 set $configdirs; configdir=$1; shift; configdirs=$*
655
656 if [ "`echo ${configdir}.*`" != "${configdir}.*" ]
657 then
658 targetspecificdirs=${configdir}.*
659 else
660 targetspecificdirs=
661 fi
662
663 for i in ${configdir} ${targetspecificdirs}
664 do
665 if [ -r $i/configure ]
666 then
667 (cd $i ;
668 configure +template=${template})
669 else
670 echo No configure script in `pwd`/$i
671 fi
672 done
673 done
674 fi
675
676 exit 0
677 fi
678
679 # Temporarily, we support only direct subdir builds.
680 hostsubdir=Host-$host
681 targetsubdir=Target-$target
682
683 if [ -n "$removing" ]
684 then
685 rm -rf $hostsubdir/$targetsubdir
686
687 if [ -z "`(ls $hostsubdir) 2>&1 | grep Target-`" ]
688 then
689 rm -rf $hostsubdir
690 fi
691 else
692 if [ ! -d $hostsubdir ] ; then mkdir $hostsubdir ; fi
693 cd $hostsubdir
694
695 if [ ! -d $targetsubdir ] ; then mkdir $targetsubdir ; fi
696 cd $targetsubdir
697
698 srcdir=../..
699
700 ## Find the source files, if location was not specified.
701 #if [ x$srcdir = x ]
702 #then
703 # srcdirdefaulted=1
704 # srcdir=.
705 # if [ ! -r ${srctrigger} ]
706 # then
707 # srcdir=..
708 # fi
709 #fi
710 #
711 #if [ ! -r ${srcdir}/${srctrigger} ]
712 #then
713 # if [ x$srcdirdefaulted = x ]
714 # then
715 # echo "$progname: Can't find ${srcname} sources in \`${srcdir}'." 1>&2
716 # else
717 # echo "$progname: Can't find ${srcname} sources in \`.' or \`..'." 1>&2
718 # fi
719 # exit 1
720 #fi
721
722
723
724 # Set up the list of links to be made.
725 # $links is the list of link names, and $files is the list of names to link to.
726
727 # Make the links.
728 while [ -n "$files" ]
729 do
730 # set file to car of files, files to cdr of files
731 set $files; file=$1; shift; files=$*
732 set $links; link=$1; shift; links=$*
733
734 if [ ! -r ${srcdir}/config/$file ]
735 then
736 echo "$progname: cannot create a link \`$link'," 1>&2
737 echo "since the file \`config/$file' does not exist." 1>&2
738 exit 1
739 fi
740
741 $remove -f $link
742 rm -f config.status
743 # Make a symlink if possible, otherwise try a hard link
744 $symbolic_link ${srcdir}/config/$file $link 2>/dev/null || $hard_link ${srcdir}/config/$file $link
745
746 if [ ! -r $link ]
747 then
748 echo "$progname: unable to link \`$link' to \`${srcdir}/config/$file'." 1>&2
749 exit 1
750 fi
751 echo "Linked \`$link' to \`${srcdir}/config/$file'."
752 done
753
754 # Install a makefile, and make it set VPATH
755 # if necessary so that the sources are found.
756 # Also change its value of srcdir.
757 # Also create a .gdbinit file which runs the one in srcdir
758 # and tells GDB to look there for source files.
759 case $srcdir in
760 .)
761 ;;
762 *)
763 echo "VPATH = ${srcdir}" > x
764 cat x ${srcdir}/Makefile.in | sed "s@^srcdir = \.@srcdir = ${srcdir}@" > Makefile.in
765 rm x
766 echo "dir ." > .gdbinit
767 echo "dir ${srcdir}" >> .gdbinit
768 echo "source ${srcdir}/.gdbinit" >> .gdbinit
769 ;;
770 esac
771
772 host_var_file=hmake-${host}
773 target_var_file=tmake-${target}
774
775 # Conditionalize the makefile for this machine.
776 if [ -f ${srcdir}/config/${host_var_file} ]
777 then
778 sed -e "/^####/ r ${srcdir}/config/${host_var_file}" Makefile.in > Makefile.tem
779 else
780 cp Makefile.in Makefile.tem
781 fi
782
783 if [ -f ${srcdir}/config/${target_var_file} ]
784 then
785 sed -e "/^####/ r ${srcdir}/config/${target_var_file}" Makefile.tem > Makefile.tem1
786 mv Makefile.tem1 Makefile.tem
787 fi
788
789 # Remove all formfeeds, since some Makes get confused by them.
790 sed "s/\f//" Makefile.tem >> Makefile.tem1
791 mv Makefile.tem1 Makefile.tem
792
793 # reset SUBDIRS
794 sed "s:^SUBDIRS =.*$:SUBDIRS = ${configdirs}:" Makefile.tem > Makefile.tem1
795 mv Makefile.tem1 Makefile.tem
796
797 # reset NONSUBDIRS
798 sed "s:^NONSUBDIRS =.*$:NONSUBDIRS = ${noconfigdirs}:" Makefile.tem > Makefile.tem1
799 mv Makefile.tem1 Makefile.tem
800
801 # Delete the intermediate files
802 if [ x$srcdir != x. ] ; then rm Makefile.in ; fi
803
804 rm -f Makefile
805
806 # Define macro CROSS_COMPILE in compilation if this is a cross-compiler.
807 if [ x$host != x$target ]
808 then
809 echo "CROSS=-DCROSS_COMPILE" > Makefile
810 echo "ALL=start.encap" >> Makefile
811 else
812 echo "ALL=all.internal" > Makefile
813 fi
814
815 # set target and host
816 echo "host = $host" >> Makefile
817 echo "target = $target" >> Makefile
818
819 cat Makefile.tem >> Makefile
820 rm Makefile.tem
821
822 using=
823 if [ -f ${srcdir}/config/${host_var_file} ]
824 then
825 using=" using \"${host_var_file}\""
826 fi
827
828 if [ -f ${srcdir}/config/${target_var_file} ]
829 then
830 if [ -z "${using}" ]
831 then
832 andusing=" using \"${target_var_file}\""
833 else
834 andusing="${using} and \"${target_var_file}\""
835 fi
836 else
837 andusing=${using}
838 fi
839
840 echo "Created \"Makefile\""${andusing}.
841
842 if [ x$host = x$target ]
843 then
844 echo "Links are now set up for use with a $target." \
845 | tee ${srcdir}/config.status
846 else
847 echo "Links are now set up for host $host and target $target." \
848 | tee ${srcdir}/config.status
849 fi
850
851 cd ${srcdir}
852 fi
853
854 # If there are subdirectories, then recurse.
855
856 if [ x$norecurse != x ] ; then exit 0 ; fi
857
858 while [ -n "$configdirs" ]
859 do
860 # set configdir to car of configdirs, configdirs to cdr of configdirs
861 set $configdirs; configdir=$1; shift; configdirs=$*
862
863 # check for target override
864 targetspecificdir=${configdir}.${target}
865 if [ -d ${targetspecificdir} ]
866 then
867 configdir=${targetspecificdir}
868 fi
869
870 echo Configuring ${configdir}...
871 (cd ${configdir} ;
872 configure +host=${host} ${target} ${removing}) \
873 | sed 's/^/ /'
874 done
875
876 exit 0