Fri Sep 25 18:07:32 1998 Jeff Johnston <jjohnstn@cygnus.com>
[external/binutils.git] / configure.in
1 #! /bin/bash
2 ##############################################################################
3
4 ## This file is a shell script fragment that supplies the information
5 ## necessary to tailor a template configure script into the configure
6 ## script appropriate for this directory.  For more information, check
7 ## any existing configure script.  
8
9 ## Be warned, there are two types of configure.in files.  There are those
10 ## used by Autoconf, which are macros which are expanded into a configure
11 ## script by autoconf.  The other sort, of which this is one, is executed
12 ## by Cygnus configure.  
13
14 ## For more information on these two systems, check out the documentation
15 ## for 'Autoconf' (autoconf.texi) and 'Configure' (configure.texi).  
16
17 #   Copyright (C) 1992, 93, 94, 95, 96, 97, 1998 Free Software Foundation, Inc.
18 #
19 # This file is free software; you can redistribute it and/or modify it
20 # under the terms of the GNU General Public License as published by
21 # the Free Software Foundation; either version 2 of the License, or
22 # (at your option) any later version.
23 #
24 # This program is distributed in the hope that it will be useful, but
25 # WITHOUT ANY WARRANTY; without even the implied warranty of
26 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
27 # General Public License for more details.
28 #
29 # You should have received a copy of the GNU General Public License
30 # along with this program; if not, write to the Free Software
31 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
32
33 ##############################################################################
34
35 ### To add a new directory to the tree, first choose whether it is a target
36 ### or a host dependent tool.  Then put it into the appropriate list
37 ### (library or tools, host or target), doing a dependency sort.  For
38 ### example, gdb requires that byacc (or bison) be built first, so it is in
39 ### the ${host_tools} list after byacc and bison.  
40
41
42 # these libraries are used by various programs built for the host environment
43 #
44 host_libs="intl mmalloc libiberty opcodes bfd readline gash db tcl tk tclX itcl tix libgui"
45 # start-sanitize-ide
46 host_libs="${host_libs} libide libidetcl"
47 # end-sanitize-ide
48 # start-sanitize-cygnus
49 host_libs="${host_libs} flexlm"
50 # end-sanitize-cygnus
51
52 if [ "${enable_gdbgui}" = "yes" ] ; then
53         host_libs="${host_libs} libgui"
54 fi
55
56 # these tools are built for the host environment
57 # Note, the powerpc-eabi build depends on sim occurring before gdb in order to
58 # know that we are building the simulator.
59 host_tools="texinfo byacc flex bison binutils ld gas gcc sim gdb make patch prms send-pr gprof gdbtest tgas etc expect dejagnu ash bash m4 autoconf automake libtool ispell grep diff rcs cvssrc fileutils shellutils time textutils wdiff find emacs emacs19 uudecode hello tar gzip indent recode release sed utils guile perl apache inet gawk findutils snavigator libtool gettext"
60 # start-sanitize-ide
61 host_tools="${host_tools} ilu vmake jstools"
62 # end-sanitize-ide
63 # start-sanitize-cygnus
64 host_tools="${host_tools} cgen"
65 # end-sanitize-cygnus
66
67 # these libraries are built for the target environment, and are built after
68 # the host libraries and the host tools (which may be a cross compiler)
69 #
70 target_libs="target-libiberty \
71                 target-libgloss \
72                 target-newlib \
73                 ${start-sanitize-dsp}
74                 target-libdsp \
75                 ${end-sanitize-dsp}
76                 target-libio \
77                 target-librx \
78                 target-libstdc++ \
79                 ${start-sanitize-java}
80                 target-libjava \
81                 target-boehm-gc \
82                 target-qthreads \
83                 ${end-sanitize-java}
84                 target-libg++"
85
86 # these tools are built using the target libs, and are intended to run only
87 # in the target environment
88 #
89 # note: any program that *uses* libraries that are in the "target_libs"
90 # list belongs in this list.  those programs are also very likely
91 # candidates for the "native_only" list which follows
92 #
93 target_tools="target-examples target-groff target-gperf"
94
95 ################################################################################
96
97 ## These two lists are of directories that are to be removed from the
98 ## ${configdirs} list for either cross-compilations or for native-
99 ## compilations.  For example, it doesn't make that much sense to
100 ## cross-compile Emacs, nor is it terribly useful to compile target-libiberty in
101 ## a native environment.  
102
103 # directories to be built in the native environment only
104 #
105 # This must be a single line because of the way it is searched by grep in
106 # the code below.
107 native_only="autoconf automake libtool cvssrc emacs emacs19 fileutils find gawk gettext grep gzip hello indent ispell m4 rcs recode sed shellutils tar textutils gash uudecode wdiff gprof target-groff guile perl apache inet time ash bash prms snavigator gnuserv target-gperf"
108
109 # directories to be built in a cross environment only
110 #
111 cross_only="target-libgloss target-newlib target-cygmon target-opcodes target-libstub"
112
113 ## All tools belong in one of the four categories, and are assigned above
114 ## We assign ${configdirs} this way to remove all embedded newlines.  This
115 ## is important because configure will choke if they ever get through.
116 ## ${configdirs} is directories we build using the host tools.
117 ## ${target_configdirs} is directories we build using the target tools.
118 #
119 configdirs=`echo ${host_libs} ${host_tools}`
120 target_configdirs=`echo ${target_libs} ${target_tools}`
121
122 ################################################################################
123
124 srctrigger=move-if-change
125 srcname="gnu development package"
126
127 # This gets set non-empty for some net releases of packages.
128 appdirs=""
129
130 # per-host:
131
132 # Work in distributions that contain no compiler tools, like Autoconf.
133 if [ -d ${srcdir}/config ]; then
134 case "${host}" in
135   m68k-hp-hpux*)
136     host_makefile_frag="${host_makefile_frag} config/mh-hp300"
137     ;;
138   m68k-apollo-sysv*)
139     host_makefile_frag="${host_makefile_frag} config/mh-apollo68"
140     ;;
141   m68k-apollo-bsd*)
142     host_makefile_frag="${host_makefile_frag} config/mh-a68bsd"
143     ;;
144   m88k-dg-dgux*)
145     host_makefile_frag="${host_makefile_frag} config/mh-dgux"
146     ;;
147   m88k-harris-cxux*)
148     host_makefile_frag="${host_makefile_frag} config/mh-cxux"
149     ;;
150   m88k-motorola-sysv*)
151     host_makefile_frag="${host_makefile_frag} config/mh-delta88"
152     ;;
153   mips*-dec-ultrix*)
154     host_makefile_frag="${host_makefile_frag} config/mh-decstation"
155     ;;
156   mips*-nec-sysv4*)
157     host_makefile_frag="${host_makefile_frag} config/mh-necv4"
158     ;;
159   mips*-sgi-irix6*)
160     host_makefile_frag="${host_makefile_frag} config/mh-irix6"
161     ;;
162   mips*-sgi-irix5*)
163     host_makefile_frag="${host_makefile_frag} config/mh-irix5"
164     ;;
165   mips*-sgi-irix4*)
166     host_makefile_frag="${host_makefile_frag} config/mh-irix4"
167     ;;
168   mips*-sgi-irix3*)
169     host_makefile_frag="${host_makefile_frag} config/mh-sysv"
170     ;;
171   mips*-*-sysv4*)
172     host_makefile_frag="${host_makefile_frag} config/mh-sysv4"
173     ;;
174   mips*-*-sysv*)
175     host_makefile_frag="${host_makefile_frag} config/mh-riscos"
176     ;;
177   i[3456]86-*-sysv5*)
178     host_makefile_frag="${host_makefile_frag} config/mh-sysv5"
179     ;;
180   i[3456]86-*-dgux*)
181     host_makefile_frag="${host_makefile_frag} config/mh-dgux386"
182     ;;
183   i[3456]86-ncr-sysv4.3*)
184     host_makefile_frag="${host_makefile_frag} config/mh-ncrsvr43"
185     ;;
186   i[3456]86-ncr-sysv4*)
187     host_makefile_frag="${host_makefile_frag} config/mh-ncr3000"
188     ;;
189   i[3456]86-*-sco3.2v5*)
190     host_makefile_frag="${host_makefile_frag} config/mh-sysv"
191     ;;
192   i[3456]86-*-sco*)
193     host_makefile_frag="${host_makefile_frag} config/mh-sco"
194     ;;
195   i[3456]86-*-isc*)
196     host_makefile_frag="${host_makefile_frag} config/mh-sysv"
197     ;;
198   i[3456]86-*-solaris2*)
199     host_makefile_frag="${host_makefile_frag} config/mh-sysv4"
200     ;;
201   i[3456]86-*-aix*)
202     host_makefile_frag="${host_makefile_frag} config/mh-aix386"
203     ;;
204   i[3456]86-*-go32*)
205     host_makefile_frag="${host_makefile_frag} config/mh-go32"
206     ;;
207   i[3456]86-*-msdosdjgpp*)
208     host_makefile_frag="${host_makefile_frag} config/mh-go32"
209     ;;
210   *-cygwin32*)
211     host_makefile_frag="${host_makefile_frag} config/mh-cygwin32"
212     ;;
213   *-mingw32*)
214     host_makefile_frag="${host_makefile_frag} config/mh-mingw32"
215     ;;
216 # start-sanitize-mswin
217   *-windows*)
218     host_makefile_frag="${host_makefile_frag} config/mh-windows"
219     ;;
220 # end-sanitize-mswin
221   vax-*-ultrix2*)
222     host_makefile_frag="${host_makefile_frag} config/mh-vaxult2"
223     ;;
224   *-*-solaris2*)
225     host_makefile_frag="${host_makefile_frag} config/mh-solaris"
226     ;;
227   m68k-sun-sunos*)
228     host_makefile_frag="${host_makefile_frag} config/mh-sun3"
229     ;;
230   *-hp-hpux[78]*)
231     host_makefile_frag="${host_makefile_frag} config/mh-hpux8"
232     ;;
233   *-hp-hpux*)
234     host_makefile_frag="${host_makefile_frag} config/mh-hpux"
235     ;;
236   *-*-hiux*)
237     host_makefile_frag="${host_makefile_frag} config/mh-hpux"
238     ;;
239   rs6000-*-lynxos*)
240     host_makefile_frag="${host_makefile_frag} config/mh-lynxrs6k"
241     ;;
242   *-*-lynxos*)
243     host_makefile_frag="${host_makefile_frag} config/mh-lynxos"
244     ;;
245   *-*-sysv4*)
246     host_makefile_frag="${host_makefile_frag} config/mh-sysv4"
247     ;;
248   *-*-sysv*)
249     host_makefile_frag="${host_makefile_frag} config/mh-sysv"
250     ;;
251 esac
252 fi
253
254 # If we aren't going to be using gcc, see if we can extract a definition
255 # of CC from the fragment.
256 if [ -z "${CC}" ] && [ "${build}" = "${host}" ]; then
257   IFS="${IFS=   }"; save_ifs="$IFS"; IFS="${IFS}:"
258   found=
259   for dir in $PATH; do
260     test -z "$dir" && dir=.
261     if test -f $dir/gcc; then
262       found=yes
263       break
264     fi
265   done
266   IFS="$save_ifs"
267   if [ -z "${found}" ] && [ -n "${host_makefile_frag}" ] && [ -f "${srcdir}/${host_makefile_frag}" ]; then
268     xx=`sed -n -e 's/^[         ]*CC[   ]*=[    ]*\(.*\)$/\1/p' < ${srcdir}/${host_makefile_frag}`
269     if [ -n "${xx}" ] ; then
270       CC=$xx
271     fi
272   fi
273 fi
274
275 # We default to --with-shared on platforms where -fpic is meaningless.
276 # Well, we don't yet, but we will.
277 if false && [ "${host}" = "${target}" ] && [ x${enable_shared} = x ]; then
278   case "${target}" in
279     alpha*-dec-osf*)    enable_shared=yes ;;
280     alpha*-*-linux*)    enable_shared=yes ;;
281     mips-sgi-irix5*)    enable_shared=yes ;;
282     *)                  enable_shared=no ;;
283   esac
284 fi
285
286 case "${enable_shared}" in
287   yes) shared=yes ;;
288   no) shared=no ;;
289   "") shared=no ;;
290   *) shared=yes ;;
291 esac
292
293 if [ x${shared} = xyes ]; then
294   case "${host}" in
295     hppa*)
296       host_makefile_frag="${host_makefile_frag} config/mh-papic"
297       ;;
298     i[3456]86-*-cygwin32*)
299       # We don't want -fPIC on cygwin32.
300       ;;
301     i[3456]86-*)
302       host_makefile_frag="${host_makefile_frag} config/mh-x86pic"
303       ;;
304     sparc64-*)
305       host_makefile_frag="${host_makefile_frag} config/mh-sparcpic"
306       ;;
307     powerpc*-*)
308       host_makefile_frag="${host_makefile_frag} config/mh-ppcpic"
309       ;;
310     alpha*-*-linux*)
311       host_makefile_frag="${host_makefile_frag} config/mh-elfalphapic"
312       ;;
313     *)
314       if test -f ${srcdir}/config/mh-${host_cpu}pic; then
315         host_makefile_frag="${host_makefile_frag} config/mh-${host_cpu}pic"
316       fi
317       ;;
318   esac
319 fi
320
321 rm -f mh-frag
322 if [ -n "${host_makefile_frag}" ] ; then
323   for f in ${host_makefile_frag}
324   do
325     cat ${srcdir}/$f >> mh-frag
326   done
327   host_makefile_frag=mh-frag
328 fi
329
330 # per-target:
331
332 case "${target}" in
333   v810*)
334     target_makefile_frag="${target_makefile_frag} config/mt-v810"
335     ;;
336   i[3456]86-*-netware*)
337     target_makefile_frag="${target_makefile_frag} config/mt-netware"
338     ;;
339   powerpc-*-netware*)
340     target_makefile_frag="${target_makefile_frag} config/mt-netware"
341     ;;
342 # start-sanitize-sky
343   mips64r59*-sky-elf*)
344     target_makefile_frag="${target_makefile_frag} config/mt-r5900 config/mt-sky"
345     ;;
346 # end-sanitize-sky
347 # start-sanitize-r5900
348   mips64r59*)
349     target_makefile_frag="${target_makefile_frag} config/mt-r5900"
350     ;;
351 # end-sanitize-r5900
352   *-*-linux-gnu)
353     target_makefile_frag="${target_makefile_frag} config/mt-linux"
354     ;;
355 esac
356
357 # If --enable-target-optspace always use -Os instead of -O2 to build
358 # the target libraries, similarly if it is not specified, use -Os
359 # on selected platforms.
360 case "${enable_target_optspace}:${target}" in
361   yes:*)
362     target_makefile_frag="${target_makefile_frag} config/mt-ospace"
363     ;;
364   :m32r-* | :d10v-* | :d30v-*)
365     target_makefile_frag="${target_makefile_frag} config/mt-ospace"
366     ;;
367   no:* | :*)
368     ;;
369   *)
370     echo "*** bad value \"${enable_target_optspace}\" for --enable-target-optspace flag; ignored" 1>&2
371     ;;
372 esac
373
374 skipdirs=
375 gasdir=gas
376 use_gnu_ld=
377 use_gnu_as=
378
379 # some tools are so dependent upon X11 that if we're not building with X, 
380 # it's not even worth trying to configure, much less build, that tool.
381
382 case ${with_x} in
383   yes | "")  # the default value for this tree is that X11 is available
384         ;;
385   no)
386         skipdirs="${skipdirs} tk libgui gash"
387 # start-sanitize-ide
388         skipdirs="${skipdirs} libide libidetcl vmake jstools"
389 # end-sanitize-ide
390         ;;
391   *)
392         echo "*** bad value \"${with_x}\" for -with-x flag; ignored" 1>&2
393         ;;
394 esac
395
396 # Some tools are only suitable for building in a "native" situation.
397 # Those are added when we have a host==target configuration.  For cross
398 # toolchains, we add some directories that should only be useful in a
399 # cross-compiler.
400
401 is_cross_compiler=
402
403 if [ x"${host}" = x"${target}" ] ; then
404         # when doing a native toolchain, don't build the targets
405         # that are in the 'cross only' list
406         skipdirs="${skipdirs} ${cross_only}"
407         is_cross_compiler=no
408         # Default to --enable-multilib.  See similar code below.
409         if [ x${enable_multilib} = xno ]; then
410           target_subdir=.
411         else
412           target_subdir=${target_alias}
413         fi
414 else
415         # similarly, don't build the targets in the 'native only' 
416         # list when building a cross compiler
417         skipdirs="${skipdirs} ${native_only}"
418         is_cross_compiler=yes
419         target_subdir=${target_alias}
420 fi      
421
422 if [ ! -d ${target_subdir} ] ; then
423   if mkdir ${target_subdir} ; then true
424   else
425     echo "'*** could not make ${PWD=`pwd`}/${target_subdir}" 1>&2
426     exit 1
427   fi
428 fi
429
430 copy_dirs=
431
432 # Handle --with-headers=XXX.  The contents of the named directory are
433 # copied to $(tooldir)/sys-include.
434 if [ x"${with_headers}" != x ]; then
435   if [ x${is_cross_compiler} = xno ]; then
436     echo 1>&2 '***' --with-headers is only supported when cross compiling
437     exit 1
438   fi
439   case "${exec_prefixoption}" in
440   "") x=${prefix} ;;
441   *) x=${exec_prefix} ;;
442   esac
443   copy_dirs="${copy_dirs} ${with_headers} $x/${target_alias}/sys-include"
444 fi
445
446 # Handle --with-libs=XXX.  Multiple directories are permitted.  The
447 # contents are copied to $(tooldir)/lib.
448 if [ x"${with_libs}" != x ]; then
449   if [ x${is_cross_compiler} = xno ]; then
450     echo 1>&2 '***' --with-libs is only supported when cross compiling
451     exit 1
452   fi
453   # Copy the libraries in reverse order, so that files in the first named
454   # library override files in subsequent libraries.
455   case "${exec_prefixoption}" in
456   "") x=${prefix} ;;
457   *) x=${exec_prefix} ;;
458   esac
459   for l in ${with_libs}; do
460     copy_dirs="$l $x/${target_alias}/lib ${copy_dirs}"
461   done
462 fi
463
464 # If both --with-headers and --with-libs are specified, default to
465 # --without-newlib.
466 if [ x"${with_headers}" != x ] && [ x"${with_libs}" != x ]; then
467   if [ x"${with_newlib}" = x ]; then
468     with_newlib=no
469   fi
470 fi
471
472 # Recognize --with-newlib/--without-newlib.
473 if [ x${with_newlib} = xno ]; then
474   skipdirs="${skipdirs} target-newlib"
475 elif [ x${with_newlib} = xyes ]; then
476   skipdirs=`echo " ${skipdirs} " | sed -e 's/ target-newlib / /'`
477 fi
478
479 # Default to using --with-stabs for certain targets.
480 if [ x${with_stabs} = x ]; then
481   case "${target}" in
482   mips*-*-irix6*)
483     ;;
484   mips*-*-* | alpha*-*-osf* | i[3456]86*-*-sysv4* | i[3456]86*-*-unixware*)
485     with_stabs=yes;
486     withoptions="${withoptions} --with-stabs"
487     ;;
488   esac
489 fi
490
491 # Handle ${copy_dirs}
492 set fnord ${copy_dirs}
493 shift
494 while [ $# != 0 ]; do
495   if [ -f $2/COPIED ] && [ x"`cat $2/COPIED`" = x"$1" ]; then
496     :
497   else
498     echo Copying $1 to $2
499
500     # Use the install script to create the directory and all required
501     # parent directories.
502     if [ -d $2 ]; then
503       :
504     else
505       echo >config.temp
506       ${srcdir}/install-sh -c -m 644 config.temp $2/COPIED
507     fi
508
509     # Copy the directory, assuming we have tar.
510     # FIXME: Should we use B in the second tar?  Not all systems support it.
511     (cd $1; tar -cf - .) | (cd $2; tar -xpf -)
512
513     # It is the responsibility of the user to correctly adjust all
514     # symlinks.  If somebody can figure out how to handle them correctly
515     # here, feel free to add the code.
516
517     echo $1 > $2/COPIED
518   fi
519   shift; shift
520 done
521
522 # Configure extra directories which are host specific
523
524 case "${host}" in
525         i[3456]86-*-go32*)
526           configdirs="$configdirs dosrel" ;;
527         i[3456]86-*-mingw32*)
528           configdirs="$configdirs dosrel" ;;
529         *-cygwin32*)
530           configdirs="$configdirs dosrel" ;;
531 esac
532
533 # Remove more programs from consideration, based on the host or 
534 # target this usually means that a port of the program doesn't
535 # exist yet.
536
537 noconfigdirs=""
538
539 case "${host}" in
540   i[3456]86-*-vsta)
541     noconfigdirs="tcl expect dejagnu make texinfo bison patch flex byacc send-pr gprof uudecode dejagnu diff guile perl apache inet itcl tix db snavigator gnuserv gettext"
542 # start-sanitize-ide
543     noconfigdirs="$noconfigdirs libide libidetcl vmake jstools"
544 # end-sanitize-ide
545 # start-sanitize-cygnus
546     noconfigdirs="$noconfigdirs flexlm"
547 # end-sanitize-cygnus
548     ;;
549   i[3456]86-*-go32* | i[3456]86-*-msdosdjgpp*)
550     noconfigdirs="tcl tk expect dejagnu make texinfo bison patch flex byacc send-pr uudecode dejagnu diff guile perl apache inet itcl tix db snavigator gnuserv gettext"
551 # start-sanitize-ide
552     noconfigdirs="$noconfigdirs libide libidetcl vmake jstools"
553 # end-sanitize-ide
554 # start-sanitize-cygnus
555     noconfigdirs="$noconfigdirs flexlm"
556 # end-sanitize-cygnus
557         ;;
558   i[3456]86-*-mingw32*)
559     # noconfigdirs="tcl tk expect dejagnu make texinfo bison patch flex byacc send-pr uudecode dejagnu diff guile perl apache inet itcl tix db snavigator gnuserv"
560      noconfigdirs="expect dejagnu cvs autoconf automake send-pr gprof rcs guile perl texinfo apache inet libtool"
561         ;;
562   *-*-cygwin32)
563      noconfigdirs="autoconf automake send-pr gprof rcs guile perl texinfo apache inet"
564     ;;
565   *-*-windows*)
566 # This is only used to build WinGDB...
567 # note that powerpc-eabi depends on sim configured before gdb.
568      configdirs="bfd libiberty opcodes readline sim gdb"
569      target_configdirs=
570     ;;
571   *-*-netbsd*)
572     noconfigdirs="rcs"
573     ;;
574   ppc*-*-pe)
575      noconfigdirs="patch diff make tk tcl expect dejagnu cvssrc autoconf automake texinfo bison send-pr gprof rcs guile perl apache inet itcl tix db snavigator gnuserv"
576 # start-sanitize-ide
577      noconfigdirs="$noconfigdirs libide libidetcl vmake jstools"
578 # end-sanitize-ide
579 # start-sanitize-cygnus
580      noconfigdirs="$noconfigdirs flexlm"
581 # end-sanitize-cygnus
582     ;;
583 # start-sanitize-beos
584   i[3456]86-*-beos)
585      noconfigdirs="$noconfigdirs tk itcl tix libgui gdb"
586      ;;
587 # end-sanitize-beos
588 esac
589
590
591 case "${target}" in
592   *-*-netware)
593     noconfigdirs="$noconfigdirs target-libg++ target-libstdc++ target-librx target-newlib target-libiberty target-libgloss"
594     ;;
595   *-*-rtems*)
596     noconfigdirs="$noconfigdirs target-libgloss"
597     ;;
598   *-*-vxworks*)
599     noconfigdirs="$noconfigdirs target-newlib target-libgloss"
600     ;;
601   alpha*-dec-osf*)
602     # ld works, but does not support shared libraries.  emacs doesn't
603     # work.  newlib is not 64 bit ready.  I'm not sure about fileutils.
604     # gas doesn't generate exception information.
605     noconfigdirs="$noconfigdirs gas ld emacs fileutils target-newlib target-libgloss"
606     ;;
607   alpha*-*-*vms*)
608     noconfigdirs="$noconfigdirs gdb ld target-newlib target-libgloss"
609     ;;
610   alpha*-*-linux*)
611     # newlib is not 64 bit ready
612     noconfigdirs="$noconfigdirs target-newlib target-libgloss"
613     # linux has rx in libc
614     skipdirs="$skipdirs target-librx"
615     ;;
616   alpha*-*-*)
617     # newlib is not 64 bit ready
618     noconfigdirs="$noconfigdirs target-newlib target-libgloss"
619     ;;
620   arc-*-*)
621     noconfigdirs="$noconfigdirs target-libgloss"
622     ;;
623   arm-*-pe*)
624     noconfigdirs="$noconfigdirs target-libgloss"
625     ;;
626   arm-*-coff*)
627     noconfigdirs="$noconfigdirs target-libgloss"
628     ;;
629 # start-sanitize-armelf
630   arm-*-elf*)
631     noconfigdirs="$noconfigdirs target-libgloss"
632     ;;
633 # end-sanitize-armelf
634   thumb-*-coff)
635     noconfigdirs="$noconfigdirs target-libgloss"
636     ;;
637 # start-sanitize-armelf
638   thumb-*-elf)
639     noconfigdirs="$noconfigdirs target-libgloss"
640     ;;
641 # end-sanitize-armelf
642   thumb-*-pe) # CYGNUS LOCAL nickc/thumb
643     noconfigdirs="$noconfigdirs target-libgloss"
644     ;;
645   arm-*-riscix*)
646     noconfigdirs="$noconfigdirs ld target-libgloss"
647     ;;
648   d10v-*-*)
649     noconfigdirs="$noconfigdirs target-librx target-libg++ target-libstdc++ target-libio target-libgloss"
650     ;;
651   d30v-*-*)
652     ;;
653   h8300*-*-* | \
654   h8500-*-*)
655     noconfigdirs="$noconfigdirs target-libg++ target-libstdc++ target-libio target-librx target-libgloss"
656     ;;
657   hppa*-*-*elf* | \
658   hppa*-*-lites*)
659     # Do configure ld/binutils/gas for this case.
660     ;;
661   hppa*-*-*)
662     # HP's C compiler doesn't handle Emacs correctly (but on BSD and Mach
663     # cc is gcc, and on any system a user should be able to link cc to
664     # whatever they want.  FIXME, emacs emacs19).
665     case "${CC}" in
666         "" | cc*) noconfigdirs="$noconfigdirs emacs emacs19" ;;
667         *) ;;
668     esac
669     noconfigdirs="$noconfigdirs ld shellutils"
670     ;;
671   i[3456]86-*-go32* | i[3456]-*-msdosdjgpp*)
672     # but don't build gdb
673     noconfigdirs="$noconfigdirs gdb target-libg++ target-libstdc++ target-libio target-librx"
674     ;;
675   i[3456]86-*-mingw32*)
676     target_configdirs="$target_configdirs target-mingw"
677     noconfigdirs="$noconfigdirs expect target-libgloss"
678
679     # Can't build gdb for mingw32 if not native.
680     case "${host}" in
681       i[3456]86-*-mingw32) ;; # keep gdb tcl tk expect etc.
682       *) noconfigdirs="$noconfigdirs gdb tcl tk expect itcl tix db snavigator gnuserv"
683 # start-sanitize-cygnus
684          noconfigdirs="$noconfigdirs flexlm"
685 # end-sanitize-cygnus
686          ;;
687     esac
688     ;;    
689   *-*-cygwin32*)
690     target_configdirs="$target_configdirs target-winsup"
691     noconfigdirs="$noconfigdirs target-gperf target-libgloss"
692     # always build newlib.
693     skipdirs=`echo " ${skipdirs} " | sed -e 's/ target-newlib / /'`
694
695     # Can't build gdb for cygwin32 if not native.
696     case "${host}" in
697       *-*-cygwin32*) ;; # keep gdb tcl tk expect etc.
698       *) noconfigdirs="$noconfigdirs gdb tcl tk expect itcl tix libgui db snavigator gnuserv"
699 # start-sanitize-ide
700          noconfigdirs="$noconfigdirs libide libidetcl vmake jstools"
701 # end-sanitize-ide
702 # start-sanitize-cygnus
703          noconfigdirs="$noconfigdirs flexlm"
704 # end-sanitize-cygnus
705          ;;
706     esac
707     ;;    
708   i[3456]86-*-pe)
709     noconfigdirs="$noconfigdirs target-libg++ target-libstdc++ target-libio target-librx target-libgloss"
710     ;;
711   i[3456]86-*-sco3.2v5*)
712     # The linker does not yet know about weak symbols in COFF,
713     # and is not configured to handle mixed ELF and COFF.
714     noconfigdirs="$noconfigdirs ld target-libgloss"
715     ;;
716   i[3456]86-*-sco*)
717     noconfigdirs="$noconfigdirs gprof target-libgloss"
718     ;;
719   i[3456]86-*-solaris2*)
720     # The linker does static linking correctly, but the Solaris C library
721     # has bugs such that some important functions won't work when statically
722     # linked.  (See man pages for getpwuid, for example.)
723     noconfigdirs="$noconfigdirs ld target-libgloss"
724     ;;
725   i[3456]86-*-sysv4*)
726     # The SYSV4 C compiler doesn't handle Emacs correctly
727     case "${CC}" in
728         "" | cc*) noconfigdirs="$noconfigdirs emacs emacs19" ;;
729         *) ;;
730     esac
731     # but that's okay since emacs doesn't work anyway
732     noconfigdirs="$noconfigdirs emacs emacs19 target-libgloss"
733     ;;
734   mn10200-*-*)
735     noconfigdirs="$noconfigdirs"
736     if [ x${is_cross_compiler} != xno ] ; then
737            target_configdirs="${target_configdirs} target-libstub target-cygmon"
738     fi
739     ;;
740   mn10300-*-*)
741     noconfigdirs="$noconfigdirs"
742     if [ x${is_cross_compiler} != xno ] ; then
743            target_configdirs="${target_configdirs} target-libstub target-cygmon"
744     fi
745     ;;
746   powerpc-*-aix*)
747     # copied from rs6000-*-* entry
748     noconfigdirs="$noconfigdirs gprof cvssrc target-libgloss"
749     # This is needed until gcc and ld are fixed to work together.
750     use_gnu_ld=no
751     ;;
752   powerpc*-*-winnt* | powerpc*-*-pe* | ppc*-*-pe)
753     target_configdirs="$target_configdirs target-winsup"
754     noconfigdirs="$noconfigdirs gdb tcl tk make expect target-libgloss itcl tix db snavigator gnuserv"
755 # start-sanitize-ide
756     noconfigdirs="$noconfigdirs libide libidetcl vmake jstools"
757 # end-sanitize-ide
758 # start-sanitize-cygnus
759     noconfigdirs="$noconfigdirs flexlm"
760 # end-sanitize-cygnus 
761     # always build newlib.
762     skipdirs=`echo " ${skipdirs} " | sed -e 's/ target-newlib / /'`
763     ;;
764     # This is temporary until we can link against shared libraries
765   powerpcle-*-solaris*)
766     noconfigdirs="$noconfigdirs gdb sim make tcl tk expect itcl tix db snavigator gnuserv"
767 # start-sanitize-ide
768     noconfigdirs="$noconfigdirs libide libidetcl vmake jstools"
769 # end-sanitize-ide
770 # start-sanitize-cygnus
771     noconfigdirs="$noconfigdirs flexlm"
772 # end-sanitize-cygnus
773     ;;
774   rs6000-*-lynxos*)
775     # The CVS server code doesn't work on the RS/6000
776     # Newlib makes problems for libg++ in crosses.
777     noconfigdirs="$noconfigdirs target-newlib gprof cvssrc"
778     ;;
779   rs6000-*-aix*)
780     noconfigdirs="$noconfigdirs gprof"
781     # This is needed until gcc and ld are fixed to work together.
782     use_gnu_ld=no
783     ;;
784   rs6000-*-*)
785     noconfigdirs="$noconfigdirs gprof"
786     ;;
787   m68k-apollo-*)
788     noconfigdirs="$noconfigdirs ld binutils gprof target-libgloss"
789     ;;
790   mips*-*-irix5*)
791     # The GNU linker does not support shared libraries.
792     # emacs is emacs 18, which does not work on Irix 5 (emacs19 does work)
793     noconfigdirs="$noconfigdirs ld gprof emacs target-libgloss"
794     ;;
795   mips*-*-irix6*)
796     # The GNU assembler and linker do not support IRIX 6.
797     # emacs is emacs 18, which does not work on Irix 5 (emacs19 does work)
798     noconfigdirs="$noconfigdirs ld gas gprof emacs target-libgloss"
799     ;;
800   mips*-dec-bsd*)
801     noconfigdirs="$noconfigdirs gprof target-libgloss"
802     ;;
803   mips*-*-bsd*)
804     noconfigdirs="$noconfigdirs gprof target-libgloss"
805     ;;
806   mipstx39-*-*)
807     noconfigdirs="$noconfigdirs gprof"   # same as generic mips
808     target_configdirs="${target_configdirs} target-libstub target-cygmon"
809    ;;
810 # start-sanitize-sky
811   mips64r5900-sky-elf*)
812     noconfigdirs="$noconfigdirs gprof"
813     extraconfigdirs="$extraconfigdirs gas,dvp-gas,dvp-elf"
814     ;;
815 # end-sanitize-sky
816   mips*-*-*)
817     noconfigdirs="$noconfigdirs gprof"
818     ;;
819   romp-*-*)
820     noconfigdirs="$noconfigdirs bfd binutils ld gas opcodes target-libgloss"
821     ;;
822   sh-*-*)
823     case "${host}" in
824       i[3456]86-*-vsta) ;; # don't add gprof back in
825       i[3456]86-*-go32*) ;; # don't add gprof back in
826       i[3456]86-*-msdosdjgpp*) ;; # don't add gprof back in
827       *) skipdirs=`echo " ${skipdirs} " | sed -e 's/ gprof / /'` ;;
828     esac
829     noconfigdirs="$noconfigdirs target-libgloss"
830     ;;
831   sparc-*-elf*)
832     if [ x${is_cross_compiler} != xno ] ; then
833            target_configdirs="${target_configdirs} target-libstub target-cygmon"
834     fi
835     ;;
836   sparc64-*-elf*)
837     if [ x${is_cross_compiler} != xno ] ; then
838            target_configdirs="${target_configdirs} target-libstub target-cygmon"
839     fi
840     ;;
841   sparclite-*-aout*)
842     if [ x${is_cross_compiler} != xno ] ; then
843            target_configdirs="${target_configdirs} target-libstub target-cygmon"
844     fi
845     ;;
846   sparc-*-sunos4*)
847     if [ x${is_cross_compiler} != xno ] ; then
848            noconfigdirs="$noconfigdirs gdb gdbtest target-newlib target-libgloss"
849     else
850            use_gnu_ld=no
851     fi
852     ;;
853 # start-sanitize-sky
854   dvp-*-elf*)
855     noconfigdirs="$noconfigdirs gcc gdb sim"
856     noconfigdirs="$noconfigdirs itcl libgui tk tix"
857     noconfigdirs="$noconfigdirs target-newlib target-libgloss target-libiberty"
858     noconfigdirs="$noconfigdirs target-librx target-libg++ target-libstdc++ target-libio"
859     ;;
860 # end-sanitize-sky
861   v810-*-*)
862     noconfigdirs="$noconfigdirs bfd binutils gas gcc gdb ld target-libio target-libg++ target-libstdc++ opcodes target-libgloss"
863     ;;
864   v850-*-*)
865     noconfigdirs="$noconfigdirs target-libgloss"
866     ;;
867 # start-sanitize-v850e
868   v850e-*-*)
869     noconfigdirs="$noconfigdirs target-libgloss"
870     ;;
871   v850ea-*-*)
872     noconfigdirs="$noconfigdirs target-libgloss"
873     ;;
874 # end-sanitize-v850e
875   vax-*-vms)
876     noconfigdirs="$noconfigdirs bfd binutils gdb ld target-newlib opcodes target-libgloss"
877     ;;
878   vax-*-*)
879     noconfigdirs="$noconfigdirs target-newlib target-libgloss"
880     ;;
881   *-*-lynxos*)
882     # Newlib makes problems for libg++ in crosses.
883     noconfigdirs="$noconfigdirs target-newlib target-libgloss"
884     ;; 
885   *-*-macos* | \
886   *-*-mpw*)
887     # Macs want a resource compiler.
888     configdirs="$configdirs grez"
889     ;;    
890 # start-sanitize-beos
891   i[3456]86-*-beos)
892      noconfigdirs="$noconfigdirs target-gperf"
893      ;;
894 # end-sanitize-beos
895 esac
896
897 # If we aren't building newlib, then don't build libgloss, since libgloss
898 # depends upon some newlib header files.
899 case "${noconfigdirs}" in
900   *target-libgloss*) ;;
901   *target-newlib*) noconfigdirs="$noconfigdirs target-libgloss" ;;
902 esac
903
904 # start-sanitize-cygnus
905 # Only configure cgen if --enable-cgen-maint.
906 if [ x$"enable_cgen_maint" != xyes ] ; then
907   noconfigdirs="$noconfigdirs cgen"
908 fi
909
910 # end-sanitize-cygnus
911 # Make sure we don't let GNU ld be added if we didn't want it.
912 if [ x$with_gnu_ld = xno ]; then
913   use_gnu_ld=no
914   noconfigdirs="$noconfigdirs ld"
915 fi
916
917 # Make sure we don't let GNU as be added if we didn't want it.
918 if [ x$with_gnu_as = xno ]; then
919   use_gnu_as=no
920   noconfigdirs="$noconfigdirs gas"
921 fi
922
923 # Remove the entries in $skipdirs and $noconfigdirs from $configdirs and
924 # $target_configdirs.
925 # If we have the source for $noconfigdirs entries, add them to $notsupp.
926
927 notsupp=""
928 for dir in . $skipdirs $noconfigdirs ; do
929   dirname=`echo $dir | sed -e s/target-//g`
930   if [ $dir != . ]  && echo " ${configdirs} " | grep " ${dir} " >/dev/null 2>&1; then
931     configdirs=`echo " ${configdirs} " | sed -e "s/ ${dir} / /"`
932     if [ -r $srcdir/$dirname/configure ] \
933         || [ -r $srcdir/$dirname/configure.in ]; then
934       if echo " ${skipdirs} " | grep " ${dir} " >/dev/null 2>&1; then
935         true
936       else
937         notsupp="$notsupp $dir"
938       fi
939     fi
940   fi
941   if [ $dir != . ]  && echo " ${target_configdirs} " | grep " ${dir} " >/dev/null 2>&1; then
942     target_configdirs=`echo " ${target_configdirs} " | sed -e "s/ ${dir} / /"`
943     if [ -r $srcdir/$dirname/configure ] \
944         || [ -r $srcdir/$dirname/configure.in ]; then
945       if echo " ${skipdirs} " | grep " ${dir} " >/dev/null 2>&1; then
946         true
947       else
948         notsupp="$notsupp $dir"
949       fi
950     fi
951   fi
952 done
953
954 # Sometimes the tools are distributed with libiberty but with no other
955 # libraries.  In that case, we don't want to build target-libiberty.
956 if [ -n "${target_configdirs}" ]; then
957   others=
958   for i in `echo ${target_configdirs} | sed -e s/target-//g` ; do
959     if [ "$i" != "libiberty" ]; then
960       if [ -r $srcdir/$i/configure ] || [ -r $srcdir/$i/configure.in ]; then
961         others=yes;
962         break;
963       fi
964     fi
965   done
966   if [ -z "${others}" ]; then
967     target_configdirs=
968   fi
969 fi
970
971 # Deconfigure all subdirectories, in case we are changing the
972 # configuration from one where a subdirectory is supported to one where it
973 # is not.
974 if [ -z "${norecursion}" ] && [ -n "${configdirs}" ]; then
975   for i in `echo ${configdirs} | sed -e s/target-//g` ; do
976     rm -f $i/Makefile
977   done
978 fi
979 if [ -z "${norecursion}" ] && [ -n "${target_configdirs}" ]; then
980   for i in `echo ${target_configdirs} | sed -e s/target-//g` ; do
981     rm -f ${target_subdir}/$i/Makefile
982   done
983 fi
984
985 # Produce a warning message for the subdirs we can't configure.
986 # This isn't especially interesting in the Cygnus tree, but in the individual
987 # FSF releases, it's important to let people know when their machine isn't
988 # supported by the one or two programs in a package.
989
990 if [ -n "${notsupp}" ] && [ -z "${norecursion}" ]; then
991   # If $appdirs is non-empty, at least one of those directories must still
992   # be configured, or we error out.  (E.g., if the gas release supports a
993   # specified target in some subdirs but not the gas subdir, we shouldn't
994   # pretend that all is well.)
995   if [ -n "$appdirs" ]; then
996     for dir in $appdirs ; do
997       if [ -r $dir/Makefile.in ]; then
998         if echo " ${configdirs} " | grep " ${dir} " >/dev/null 2>&1; then
999           appdirs=""
1000           break
1001         fi
1002         if echo " ${target_configdirs} " | grep " ${dir} " >/dev/null 2>&1; then
1003           appdirs=""
1004           break
1005         fi
1006       fi
1007     done
1008     if [ -n "$appdirs" ]; then
1009       echo "*** This configuration is not supported by this package." 1>&2
1010       exit 1
1011     fi
1012   fi
1013   # Okay, some application will build, or we don't care to check.  Still
1014   # notify of subdirs not getting built.
1015   echo "*** This configuration is not supported in the following subdirectories:" 1>&2
1016   echo "    ${notsupp}" 1>&2
1017   echo "    (Any other directories should still work fine.)" 1>&2
1018 fi
1019
1020 # Set with_gnu_as and with_gnu_ld as appropriate.
1021 #
1022 # This is done by determining whether or not the appropriate directory
1023 # is available, and by checking whether or not specific configurations
1024 # have requested that this magic not happen.
1025
1026 # The command line options always override the explicit settings in 
1027 # configure.in, and the settings in configure.in override this magic.
1028 #
1029 # If the default for a toolchain is to use GNU as and ld, and you don't 
1030 # want to do that, then you should use the --without-gnu-as and
1031 # --without-gnu-ld options for the configure script.
1032
1033 if [ x${use_gnu_as} = x ] ; then
1034   if [ x${with_gnu_as} != xno ] && echo " ${configdirs} " | grep " ${gasdir} " > /dev/null 2>&1 && [ -d ${srcdir}/${gasdir} ] ; then
1035     with_gnu_as=yes
1036     withoptions="$withoptions --with-gnu-as"
1037   fi
1038 fi
1039
1040 if [ x${use_gnu_ld} = x ] ; then
1041   if [ x${with_gnu_ld} != xno ] && echo " ${configdirs} " | grep " ld " > /dev/null 2>&1 && [ -d ${srcdir}/ld ] ; then
1042     with_gnu_ld=yes
1043     withoptions="$withoptions --with-gnu-ld"
1044   fi
1045 fi
1046
1047 # If using newlib, add --with-newlib to the withoptions so that gcc/configure
1048 # can detect this case.
1049
1050 if [ x${with_newlib} != xno ] && echo " ${target_configdirs} " | grep " target-newlib " > /dev/null 2>&1 && [ -d ${srcdir}/newlib ] ; then
1051   with_newlib=yes
1052   withoptions="$withoptions --with-newlib"
1053 fi
1054
1055 if [ x${shared} = xyes ]; then
1056   case "${target}" in
1057     hppa*)
1058       target_makefile_frag="${target_makefile_frag} config/mt-papic"
1059       ;;
1060     i[3456]86-*)
1061       target_makefile_frag="${target_makefile_frag} config/mt-x86pic"
1062       ;;
1063     powerpc*-*)
1064       target_makefile_frag="${target_makefile_frag} config/mt-ppcpic"
1065       ;;
1066     alpha*-*-linux*)
1067       target_makefile_frag="${target_makefile_frag} config/mt-elfalphapic"
1068       ;;
1069     *)
1070       if test -f ${srcdir}/config/mt-${target_cpu}pic; then
1071         target_makefile_frag="${target_makefile_frag} config/mt-${target_cpu}pic"
1072       fi
1073       ;;
1074   esac
1075 fi
1076
1077 rm -f mt-frag
1078 if [ -n "${target_makefile_frag}" ] ; then
1079   for f in ${target_makefile_frag}
1080   do
1081     cat ${srcdir}/$f >> mt-frag
1082   done
1083   target_makefile_frag=mt-frag
1084 fi
1085
1086 # post-target:
1087
1088 # Make sure that the compiler is able to generate an executable.  If it
1089 # can't, we are probably in trouble.  We don't care whether we can run the
1090 # executable--we might be using a cross compiler--we only care whether it
1091 # can be created.  At this point the main configure script has set CC.
1092 echo "int main () { return 0; }" > conftest.c
1093 ${CC} -o conftest ${CFLAGS} ${CPPFLAGS} ${LDFLAGS} conftest.c
1094 if [ $? = 0 ] && [ -s conftest -o -s conftest.exe ]; then
1095   :
1096 else
1097   echo 1>&2 "*** The command '${CC} -o conftest ${CFLAGS} ${CPPFLAGS} ${LDFLAGS} conftest.c' failed."
1098   echo 1>&2 "*** You must set the environment variable CC to a working compiler."
1099   rm -f conftest*
1100   exit 1
1101 fi
1102 rm -f conftest*
1103
1104 # The Solaris /usr/ucb/cc compiler does not appear to work.
1105 case "${host}" in
1106   sparc-sun-solaris2*)
1107       CCBASE="`echo ${CC-cc} | sed 's/ .*$//'`"
1108       if [ "`/usr/bin/which $CCBASE`" = "/usr/ucb/cc" ] ; then
1109           could_use=
1110           [ -d /opt/SUNWspro/bin ] && could_use="/opt/SUNWspro/bin"
1111           if [ -d /opt/cygnus/bin ] ; then
1112               if [ "$could_use" = "" ] ; then
1113                   could_use="/opt/cygnus/bin"
1114               else
1115                   could_use="$could_use or /opt/cygnus/bin"
1116               fi
1117           fi
1118         if [ "$could_use" = "" ] ; then
1119             echo "Warning: compilation may fail because you're using"
1120             echo "/usr/ucb/cc.  You should change your PATH or CC "
1121             echo "variable and rerun configure."
1122         else
1123             echo "Warning: compilation may fail because you're using"
1124             echo "/usr/ucb/cc, when you should use the C compiler from"
1125             echo "$could_use.  You should change your"
1126             echo "PATH or CC variable and rerun configure."
1127         fi
1128       fi
1129   ;;
1130 esac
1131
1132 # If --enable-shared was set, we must set LD_LIBRARY_PATH so that the
1133 # binutils tools will find libbfd.so.
1134 if [ "${shared}" = "yes" ]; then
1135   sed -e 's/^SET_LIB_PATH[      ]*=.*$/SET_LIB_PATH = $(REALLY_SET_LIB_PATH)/' \
1136       Makefile > Makefile.tem
1137   rm -f Makefile
1138   mv -f Makefile.tem Makefile
1139
1140   case "${host}" in
1141   *-*-hpux*)
1142     sed -e 's/^RPATH_ENVVAR[    ]*=.*$/RPATH_ENVVAR = SHLIB_PATH/' \
1143         Makefile > Makefile.tem
1144     rm -f Makefile
1145     mv -f Makefile.tem Makefile
1146     ;;
1147   esac
1148 fi
1149
1150 # Record target_configdirs and the configure arguments in Makefile.
1151 target_configdirs=`echo "${target_configdirs}" | sed -e 's/target-//g'`
1152 targargs=`echo "${arguments}" | \
1153         sed -e 's/--no[^        ]*//' \
1154             -e 's/--cache[a-z-]*=[^     ]*//' \
1155             -e 's/--ho[a-z-]*=[^        ]*//' \
1156             -e 's/--bu[a-z-]*=[^        ]*//' \
1157             -e 's/--ta[a-z-]*=[^        ]*//'`
1158
1159 # Passing a --with-cross-host argument lets the target libraries know
1160 # whether they are being built with a cross-compiler or being built
1161 # native.  However, it would be better to use other mechanisms to make the
1162 # sorts of decisions they want to make on this basis.  Please consider
1163 # this option to be deprecated.  FIXME.
1164 if [ x${is_cross_compiler} = xyes ]; then
1165   targargs="--with-cross-host=${host_alias} ${targargs}"
1166 fi
1167
1168 # Default to --enable-multilib.
1169 if [ x${enable_multilib} = x ]; then
1170   targargs="--enable-multilib ${targargs}"
1171 fi
1172
1173 # Pass --with-newlib if appropriate.  Note that target_configdirs has
1174 # changed from the earlier setting of with_newlib.
1175 if [ x${with_newlib} != xno ] && echo " ${target_configdirs} " | grep " newlib " > /dev/null 2>&1 && [ -d ${srcdir}/newlib ] ; then
1176   targargs="--with-newlib ${targargs}"
1177 fi
1178
1179 targargs="--host=${target_alias} --build=${build_alias} ${targargs}"
1180 sed -e "s:^TARGET_CONFIGDIRS[   ]*=.*$:TARGET_CONFIGDIRS = ${target_configdirs}:" \
1181     -e "s%^CONFIG_ARGUMENTS[    ]*=.*$%CONFIG_ARGUMENTS = ${targargs}%" \
1182     -e "s%^TARGET_SUBDIR[       ]*=.*$%TARGET_SUBDIR = ${target_subdir}%" \
1183        Makefile > Makefile.tem
1184 rm -f Makefile
1185 mv -f Makefile.tem Makefile
1186
1187 #
1188 # Local Variables:
1189 # fill-column: 131
1190 # End:
1191 #