]> Git Repo - binutils.git/blob - bfd/configure
Initial revision
[binutils.git] / bfd / 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 ### end of configure.in
589
590 # are we rebuilding config itself?
591 if [ -n "$template" ]
592 then
593         if [ ! -r $template ]
594         then
595                 echo "Can't find template ${template}."
596                 exit 1
597         fi
598
599         mv configure configure.old
600         echo "#!/bin/sh" > configure
601         echo "# Do not edit this file.  It is generated automatically from configure.in" >> configure
602         echo "# and a configure template." >> configure
603         echo "configdirs=" >> configure
604         echo >> configure
605
606         if [ -r configure.in ]
607         then
608                 sed -e "/^####/  r configure.in" $template >> configure
609         else
610                 cat $template >> configure
611         fi
612
613         chmod a+x configure
614         rm configure.old
615 #       echo Rebuilt configure in `pwd` from ${template}.
616         echo Rebuilt configure in `pwd`
617
618         if [ x$norecurse = x ]
619         then
620                 while [ -n "$configdirs" ]
621                 do
622                         # set configdir to car of configdirs, configdirs to cdr of configdirs
623                         set $configdirs; configdir=$1; shift; configdirs=$*
624
625                         if [ "`echo ${configdir}.*`" != "${configdir}.*" ]
626                         then
627                                 targetspecificdirs=${configdir}.*
628                         else
629                                 targetspecificdirs=
630                         fi
631
632                         for i in ${configdir} ${targetspecificdirs}
633                         do
634                                 if [ -r $i/configure ]
635                                 then
636                                         (cd $i ;
637                                                 configure +template=${template})
638                                 else
639                                         echo No configure script in `pwd`/$i
640                                 fi
641                         done
642                 done
643         fi
644
645         exit 0
646 fi
647
648 # Temporarily, we support only direct subdir builds.
649 hostsubdir=Host-$host
650 targetsubdir=Target-$target
651
652 if [ -n "$removing" ]
653 then
654         rm -rf $hostsubdir/$targetsubdir
655
656         if [ -z "`(ls $hostsubdir) 2>&1 | grep Target-`" ]
657         then
658                 rm -rf $hostsubdir
659         fi
660 else
661         if [ ! -d $hostsubdir ] ; then mkdir $hostsubdir ; fi
662         cd $hostsubdir
663
664         if [ ! -d $targetsubdir ] ; then mkdir $targetsubdir ; fi
665         cd $targetsubdir
666
667         srcdir=../..
668
669         ## Find the source files, if location was not specified.
670         #if [ x$srcdir = x ]
671         #then
672         #       srcdirdefaulted=1
673         #       srcdir=.
674         #       if [ ! -r ${srctrigger} ]
675         #       then
676         #               srcdir=..
677         #       fi
678         #fi
679         #
680         #if [ ! -r ${srcdir}/${srctrigger} ]
681         #then
682         #       if [ x$srcdirdefaulted = x ]
683         #       then
684         #         echo "$progname: Can't find ${srcname} sources in \`${srcdir}'." 1>&2
685         #       else
686         #         echo "$progname: Can't find ${srcname} sources in \`.' or \`..'." 1>&2
687         #       fi
688         #       exit 1
689         #fi
690
691
692
693         # Set up the list of links to be made.
694         # $links is the list of link names, and $files is the list of names to link to.
695
696         # Make the links.
697         while [ -n "$files" ]
698         do
699                 # set file to car of files, files to cdr of files
700                 set $files; file=$1; shift; files=$*
701                 set $links; link=$1; shift; links=$*
702
703                 if [ ! -r ${srcdir}/config/$file ]
704                 then
705                         echo "$progname: cannot create a link \`$link'," 1>&2
706                         echo "since the file \`config/$file' does not exist." 1>&2
707                         exit 1
708                 fi
709
710                 $remove -f $link
711                 rm -f config.status
712                 # Make a symlink if possible, otherwise try a hard link
713                 $symbolic_link ${srcdir}/config/$file $link 2>/dev/null || $hard_link ${srcdir}/config/$file $link
714
715                 if [ ! -r $link ]
716                 then
717                         echo "$progname: unable to link \`$link' to \`${srcdir}/config/$file'." 1>&2
718                         exit 1
719                 fi
720                 echo "Linked \`$link' to \`${srcdir}/config/$file'."
721         done
722
723         # Install a makefile, and make it set VPATH
724         # if necessary so that the sources are found.
725         # Also change its value of srcdir.
726         # Also create a .gdbinit file which runs the one in srcdir
727         # and tells GDB to look there for source files.
728         case $srcdir in
729         .)
730                 ;;
731         *)
732                 echo "VPATH = ${srcdir}" > x
733                 cat x ${srcdir}/Makefile.in | sed "s@^srcdir = \.@srcdir = ${srcdir}@" > Makefile.in
734                 rm x
735                 echo "dir ." > .gdbinit
736                 echo "dir ${srcdir}" >> .gdbinit
737                 echo "source ${srcdir}/.gdbinit" >> .gdbinit
738                 ;;
739         esac
740
741         host_var_file=hmake-${host}
742         target_var_file=tmake-${target}
743
744         # Conditionalize the makefile for this machine.
745         if [ -f ${srcdir}/config/${host_var_file} ]
746         then
747                 sed -e "/^####/  r ${srcdir}/config/${host_var_file}" Makefile.in > Makefile.tem
748         else
749                 cp Makefile.in Makefile.tem
750         fi
751
752         if [ -f ${srcdir}/config/${target_var_file} ]
753         then
754                 sed -e "/^####/  r ${srcdir}/config/${target_var_file}" Makefile.tem > Makefile.tem1
755                 mv Makefile.tem1 Makefile.tem
756         fi
757
758         # Remove all formfeeds, since some Makes get confused by them.
759         sed "s/\f//" Makefile.tem >> Makefile.tem1
760         mv Makefile.tem1 Makefile.tem
761
762         # reset SUBDIRS
763         sed "s:^SUBDIRS =.*$:SUBDIRS = ${configdirs}:" Makefile.tem > Makefile.tem1
764         mv Makefile.tem1 Makefile.tem
765
766         # reset NONSUBDIRS
767         sed "s:^NONSUBDIRS =.*$:NONSUBDIRS = ${noconfigdirs}:" Makefile.tem > Makefile.tem1
768         mv Makefile.tem1 Makefile.tem
769
770         # Delete the intermediate files
771         if [ x$srcdir != x. ] ; then rm Makefile.in ; fi
772
773         rm -f Makefile
774
775         # Define macro CROSS_COMPILE in compilation if this is a cross-compiler.
776         if [ x$host != x$target ]
777         then
778                 echo "CROSS=-DCROSS_COMPILE" > Makefile
779                 echo "ALL=start.encap" >> Makefile
780         else
781                 echo "ALL=all.internal" > Makefile
782         fi
783
784         # set target and host
785         echo "host = $host" >> Makefile
786         echo "target = $target" >> Makefile
787
788         cat Makefile.tem >> Makefile
789         rm Makefile.tem
790
791         using=
792         if [ -f ${srcdir}/config/${host_var_file} ]
793         then
794                 using=" using \"${host_var_file}\""
795         fi
796
797         if [ -f ${srcdir}/config/${target_var_file} ]
798         then
799                 if [ -z "${using}" ]
800                 then
801                         andusing=" using \"${target_var_file}\""
802                 else
803                         andusing="${using} and \"${target_var_file}\""
804                 fi
805         else
806                 andusing=${using}
807         fi
808
809         echo "Created \"Makefile\""${andusing}.
810
811         if [ x$host = x$target ]
812         then
813                 echo "Links are now set up for use with a $target." \
814                         | tee ${srcdir}/config.status
815         else
816                 echo "Links are now set up for host $host and target $target." \
817                         | tee ${srcdir}/config.status
818         fi
819
820         cd ${srcdir}
821 fi
822
823 # If there are subdirectories, then recurse. 
824
825 if [ x$norecurse != x ] ; then exit 0 ; fi
826
827 while [ -n "$configdirs" ]
828 do
829         # set configdir to car of configdirs, configdirs to cdr of configdirs
830         set $configdirs; configdir=$1; shift; configdirs=$*
831
832         # check for target override
833         targetspecificdir=${configdir}.${target}
834         if [ -d ${targetspecificdir} ]
835         then
836                 configdir=${targetspecificdir}
837         fi
838
839         echo Configuring ${configdir}...
840         (cd ${configdir} ;
841                 configure +host=${host} ${target} ${removing}) \
842                 | sed 's/^/     /'
843 done
844
845 exit 0
This page took 0.073612 seconds and 4 git commands to generate.