2 ##############################################################################
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.
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.
14 ## For more information on these two systems, check out the documentation
15 ## for 'Autoconf' (autoconf.texi) and 'Configure' (configure.texi).
17 # Copyright (C) 1992, 93, 94, 95, 96, 97, 98, 1999
18 # Free Software Foundation, Inc.
20 # This file is free software; you can redistribute it and/or modify it
21 # under the terms of the GNU General Public License as published by
22 # the Free Software Foundation; either version 2 of the License, or
23 # (at your option) any later version.
25 # This program is distributed in the hope that it will be useful, but
26 # WITHOUT ANY WARRANTY; without even the implied warranty of
27 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
28 # General Public License for more details.
30 # You should have received a copy of the GNU General Public License
31 # along with this program; if not, write to the Free Software
32 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
34 ##############################################################################
36 ### To add a new directory to the tree, first choose whether it is a target
37 ### or a host dependent tool. Then put it into the appropriate list
38 ### (library or tools, host or target), doing a dependency sort. For
39 ### example, gdb requires that byacc (or bison) be built first, so it is in
40 ### the ${host_tools} list after byacc and bison.
43 # these libraries are used by various programs built for the host environment
45 host_libs="intl mmalloc libiberty opcodes bfd readline gash db tcl tk tcl8.1 tk8.1 tclX itcl tix libgui"
47 if [ "${enable_gdbgui}" = "yes" ] ; then
48 host_libs="${host_libs} libgui"
51 # these tools are built for the host environment
52 # Note, the powerpc-eabi build depends on sim occurring before gdb in order to
53 # know that we are building the simulator.
54 host_tools="byacc flex bison binutils ld gas gcc sim gdb make patch prms send-pr gprof gdbtest tgas etc expect dejagnu ash bash bzip2 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 zip"
56 # these libraries are built for the target environment, and are built after
57 # the host libraries and the host tools (which may be a cross compiler)
59 target_libs="target-libiberty \
67 # these tools are built using the target libs, and are intended to run only
68 # in the target environment
70 # note: any program that *uses* libraries that are in the "target_libs"
71 # list belongs in this list. those programs are also very likely
72 # candidates for the "native_only" list which follows
74 target_tools="target-examples target-groff target-gperf"
76 ################################################################################
78 ## These two lists are of directories that are to be removed from the
79 ## ${configdirs} list for either cross-compilations or for native-
80 ## compilations. For example, it doesn't make that much sense to
81 ## cross-compile Emacs, nor is it terribly useful to compile target-libiberty in
82 ## a native environment.
84 # directories to be built in the native environment only
86 # This must be a single line because of the way it is searched by grep in
88 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 bzip2 prms snavigator gnuserv target-gperf"
90 # directories to be built in a cross environment only
92 cross_only="target-libgloss target-newlib target-cygmon target-opcodes target-libstub"
94 ## All tools belong in one of the four categories, and are assigned above
95 ## We assign ${configdirs} this way to remove all embedded newlines. This
96 ## is important because configure will choke if they ever get through.
97 ## ${configdirs} is directories we build using the host tools.
98 ## ${target_configdirs} is directories we build using the target tools.
100 configdirs=`echo ${host_libs} ${host_tools}`
101 target_configdirs=`echo ${target_libs} ${target_tools}`
103 ################################################################################
105 srctrigger=move-if-change
106 srcname="gnu development package"
108 # This gets set non-empty for some net releases of packages.
113 # Work in distributions that contain no compiler tools, like Autoconf.
114 if [ -d ${srcdir}/config ]; then
117 host_makefile_frag="${host_makefile_frag} config/mh-hp300"
120 host_makefile_frag="${host_makefile_frag} config/mh-apollo68"
123 host_makefile_frag="${host_makefile_frag} config/mh-a68bsd"
126 host_makefile_frag="${host_makefile_frag} config/mh-dgux"
129 host_makefile_frag="${host_makefile_frag} config/mh-cxux"
132 host_makefile_frag="${host_makefile_frag} config/mh-delta88"
135 host_makefile_frag="${host_makefile_frag} config/mh-decstation"
138 host_makefile_frag="${host_makefile_frag} config/mh-necv4"
141 host_makefile_frag="${host_makefile_frag} config/mh-irix6"
144 host_makefile_frag="${host_makefile_frag} config/mh-irix5"
147 host_makefile_frag="${host_makefile_frag} config/mh-irix4"
150 host_makefile_frag="${host_makefile_frag} config/mh-sysv"
153 host_makefile_frag="${host_makefile_frag} config/mh-sysv4"
156 host_makefile_frag="${host_makefile_frag} config/mh-riscos"
159 host_makefile_frag="${host_makefile_frag} config/mh-sysv5"
162 host_makefile_frag="${host_makefile_frag} config/mh-dgux386"
164 i[3456]86-ncr-sysv4.3*)
165 host_makefile_frag="${host_makefile_frag} config/mh-ncrsvr43"
167 i[3456]86-ncr-sysv4*)
168 host_makefile_frag="${host_makefile_frag} config/mh-ncr3000"
170 i[3456]86-*-sco3.2v5*)
171 host_makefile_frag="${host_makefile_frag} config/mh-sysv"
174 host_makefile_frag="${host_makefile_frag} config/mh-sco"
177 host_makefile_frag="${host_makefile_frag} config/mh-sysv5"
180 host_makefile_frag="${host_makefile_frag} config/mh-sysv"
182 i[3456]86-*-solaris2*)
183 host_makefile_frag="${host_makefile_frag} config/mh-sysv4"
186 host_makefile_frag="${host_makefile_frag} config/mh-aix386"
189 host_makefile_frag="${host_makefile_frag} config/mh-go32"
191 i[3456]86-*-msdosdjgpp*)
192 host_makefile_frag="${host_makefile_frag} config/mh-go32"
195 host_makefile_frag="${host_makefile_frag} config/mh-cygwin"
198 host_makefile_frag="${host_makefile_frag} config/mh-mingw32"
201 host_makefile_frag="${host_makefile_frag} config/mh-windows"
204 host_makefile_frag="${host_makefile_frag} config/mh-vaxult2"
207 host_makefile_frag="${host_makefile_frag} config/mh-solaris"
210 host_makefile_frag="${host_makefile_frag} config/mh-sun3"
213 host_makefile_frag="${host_makefile_frag} config/mh-hpux8"
216 host_makefile_frag="${host_makefile_frag} config/mh-hpux"
219 host_makefile_frag="${host_makefile_frag} config/mh-hpux"
222 host_makefile_frag="${host_makefile_frag} config/mh-lynxrs6k"
225 host_makefile_frag="${host_makefile_frag} config/mh-lynxos"
227 *-*-aix4.[3456789]* | *-*-aix[56789].*)
228 host_makefile_frag="${host_makefile_frag} config/mh-aix43"
231 host_makefile_frag="${host_makefile_frag} config/mh-sysv4"
234 host_makefile_frag="${host_makefile_frag} config/mh-sysv"
239 # If we aren't going to be using gcc, see if we can extract a definition
240 # of CC from the fragment.
241 if [ -z "${CC}" ] && [ "${build}" = "${host}" ]; then
242 IFS="${IFS= }"; save_ifs="$IFS"; IFS="${IFS}:"
245 test -z "$dir" && dir=.
246 if test -f $dir/gcc; then
252 if [ -z "${found}" ] && [ -n "${host_makefile_frag}" ] && [ -f "${srcdir}/${host_makefile_frag}" ]; then
253 xx=`sed -n -e 's/^[ ]*CC[ ]*=[ ]*\(.*\)$/\1/p' < ${srcdir}/${host_makefile_frag}`
254 if [ -n "${xx}" ] ; then
260 # We default to --with-shared on platforms where -fpic is meaningless.
261 # Well, we don't yet, but we will.
262 if false && [ "${host}" = "${target}" ] && [ x${enable_shared} = x ]; then
264 alpha*-dec-osf*) enable_shared=yes ;;
265 alpha*-*-linux*) enable_shared=yes ;;
266 mips-sgi-irix5*) enable_shared=yes ;;
267 *) enable_shared=no ;;
271 case "${enable_shared}" in
278 if [ x${shared} = xyes ]; then
281 host_makefile_frag="${host_makefile_frag} config/mh-papic"
284 # We don't want -fPIC on Cygwin.
287 host_makefile_frag="${host_makefile_frag} config/mh-x86pic"
290 host_makefile_frag="${host_makefile_frag} config/mh-sparcpic"
293 host_makefile_frag="${host_makefile_frag} config/mh-ppcpic"
296 host_makefile_frag="${host_makefile_frag} config/mh-elfalphapic"
299 if test -f ${srcdir}/config/mh-${host_cpu}pic; then
300 host_makefile_frag="${host_makefile_frag} config/mh-${host_cpu}pic"
307 if [ -n "${host_makefile_frag}" ] ; then
308 for f in ${host_makefile_frag}
310 cat ${srcdir}/$f >> mh-frag
312 host_makefile_frag=mh-frag
319 target_makefile_frag="${target_makefile_frag} config/mt-v810"
321 i[3456]86-*-netware*)
322 target_makefile_frag="${target_makefile_frag} config/mt-netware"
325 target_makefile_frag="${target_makefile_frag} config/mt-netware"
328 target_makefile_frag="${target_makefile_frag} config/mt-linux"
332 # If --enable-target-optspace always use -Os instead of -O2 to build
333 # the target libraries, similarly if it is not specified, use -Os
334 # on selected platforms.
335 case "${enable_target_optspace}:${target}" in
337 target_makefile_frag="${target_makefile_frag} config/mt-ospace"
339 # CYGNUS LOCAL d10v, d30v, fr30
340 :m32r-* | :d10v-* | :d30v-* | :fr30-*)
341 target_makefile_frag="${target_makefile_frag} config/mt-ospace"
346 echo "*** bad value \"${enable_target_optspace}\" for --enable-target-optspace flag; ignored" 1>&2
355 # some tools are so dependent upon X11 that if we're not building with X,
356 # it's not even worth trying to configure, much less build, that tool.
359 yes | "") # the default value for this tree is that X11 is available
362 skipdirs="${skipdirs} tk libgui gash"
365 echo "*** bad value \"${with_x}\" for -with-x flag; ignored" 1>&2
369 # Some tools are only suitable for building in a "native" situation.
370 # Those are added when we have a host==target configuration. For cross
371 # toolchains, we add some directories that should only be useful in a
376 if [ x"${host}" = x"${target}" ] ; then
377 # when doing a native toolchain, don't build the targets
378 # that are in the 'cross only' list
379 skipdirs="${skipdirs} ${cross_only}"
382 # similarly, don't build the targets in the 'native only'
383 # list when building a cross compiler
384 skipdirs="${skipdirs} ${native_only}"
385 is_cross_compiler=yes
388 # We always want to use the same name for this directory, so that dejagnu
389 # can reliably find it.
390 target_subdir=${target_alias}
392 if [ ! -d ${target_subdir} ] ; then
393 if mkdir ${target_subdir} ; then true
395 echo "'*** could not make ${PWD=`pwd`}/${target_subdir}" 1>&2
402 # Handle --with-headers=XXX. The contents of the named directory are
403 # copied to $(tooldir)/sys-include.
404 if [ x"${with_headers}" != x ]; then
405 if [ x${is_cross_compiler} = xno ]; then
406 echo 1>&2 '***' --with-headers is only supported when cross compiling
409 case "${exec_prefixoption}" in
411 *) x=${exec_prefix} ;;
413 copy_dirs="${copy_dirs} ${with_headers} $x/${target_alias}/sys-include"
416 # Handle --with-libs=XXX. Multiple directories are permitted. The
417 # contents are copied to $(tooldir)/lib.
418 if [ x"${with_libs}" != x ]; then
419 if [ x${is_cross_compiler} = xno ]; then
420 echo 1>&2 '***' --with-libs is only supported when cross compiling
423 # Copy the libraries in reverse order, so that files in the first named
424 # library override files in subsequent libraries.
425 case "${exec_prefixoption}" in
427 *) x=${exec_prefix} ;;
429 for l in ${with_libs}; do
430 copy_dirs="$l $x/${target_alias}/lib ${copy_dirs}"
434 # If both --with-headers and --with-libs are specified, default to
436 if [ x"${with_headers}" != x ] && [ x"${with_libs}" != x ]; then
437 if [ x"${with_newlib}" = x ]; then
442 # Recognize --with-newlib/--without-newlib.
443 if [ x${with_newlib} = xno ]; then
444 skipdirs="${skipdirs} target-newlib"
445 elif [ x${with_newlib} = xyes ]; then
446 skipdirs=`echo " ${skipdirs} " | sed -e 's/ target-newlib / /'`
449 # Default to using --with-stabs for certain targets.
450 if [ x${with_stabs} = x ]; then
454 mips*-*-* | alpha*-*-osf*)
456 withoptions="${withoptions} --with-stabs"
461 # Handle ${copy_dirs}
462 set fnord ${copy_dirs}
464 while [ $# != 0 ]; do
465 if [ -f $2/COPIED ] && [ x"`cat $2/COPIED`" = x"$1" ]; then
468 echo Copying $1 to $2
470 # Use the install script to create the directory and all required
471 # parent directories.
476 ${srcdir}/install-sh -c -m 644 config.temp $2/COPIED
479 # Copy the directory, assuming we have tar.
480 # FIXME: Should we use B in the second tar? Not all systems support it.
481 (cd $1; tar -cf - .) | (cd $2; tar -xpf -)
483 # It is the responsibility of the user to correctly adjust all
484 # symlinks. If somebody can figure out how to handle them correctly
485 # here, feel free to add the code.
492 # Configure extra directories which are host specific
496 configdirs="$configdirs dosrel" ;;
497 i[3456]86-*-mingw32*)
498 configdirs="$configdirs dosrel" ;;
500 configdirs="$configdirs libtermcap dosrel" ;;
503 # Remove more programs from consideration, based on the host or
504 # target this usually means that a port of the program doesn't
511 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"
513 i[3456]86-*-go32* | i[3456]86-*-msdosdjgpp*)
514 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"
516 i[3456]86-*-mingw32*)
517 # 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"
518 noconfigdirs="expect dejagnu cvs autoconf automake send-pr gprof rcs guile perl texinfo apache inet libtool"
521 noconfigdirs="autoconf automake send-pr gprof rcs guile perl texinfo apache inet"
524 # This is only used to build WinGDB...
525 # note that powerpc-eabi depends on sim configured before gdb.
526 configdirs="bfd libiberty opcodes readline sim gdb"
533 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"
540 noconfigdirs="$noconfigdirs target-libg++ target-libstdc++ target-librx target-newlib target-libiberty target-libgloss"
543 noconfigdirs="$noconfigdirs target-libgloss"
546 noconfigdirs="$noconfigdirs target-newlib target-libgloss"
549 # ld works, but does not support shared libraries. emacs doesn't
550 # work. newlib is not 64 bit ready. I'm not sure about fileutils.
551 # gas doesn't generate exception information.
552 noconfigdirs="$noconfigdirs gas ld emacs fileutils target-newlib target-libgloss"
555 noconfigdirs="$noconfigdirs gdb ld target-newlib target-libgloss"
558 # newlib is not 64 bit ready
559 noconfigdirs="$noconfigdirs target-newlib target-libgloss"
560 # linux has rx in libc
561 skipdirs="$skipdirs target-librx"
564 # newlib is not 64 bit ready
565 noconfigdirs="$noconfigdirs target-newlib target-libgloss"
568 noconfigdirs="$noconfigdirs target-libgloss"
571 noconfigdirs="$noconfigdirs target-libgloss"
574 noconfigdirs="$noconfigdirs target-libgloss"
577 noconfigdirs="$noconfigdirs target-libgloss"
578 if [ x${is_cross_compiler} != xno ] ; then
579 target_configdirs="${target_configdirs} target-bsp target-libstub target-cygmon"
583 noconfigdirs="$noconfigdirs target-libgloss"
584 if [ x${is_cross_compiler} != xno ] ; then
585 target_configdirs="${target_configdirs} target-bsp target-libstub target-cygmon"
589 noconfigdirs="$noconfigdirs target-libg++ target-libstdc++ target-libio target-librx target-libgloss"
592 noconfigdirs="$noconfigdirs target-libgloss"
594 # CYGNUS LOCAL clm/arm-elf
596 noconfigdirs="$noconfigdirs target-libgloss"
599 noconfigdirs="$noconfigdirs target-libgloss"
602 # CYGNUS LOCAL nickc/strongarm
604 noconfigdirs="$noconfigdirs target-libgloss"
605 if [ x${is_cross_compiler} != xno ] ; then
606 target_configdirs="${target_configdirs} target-bsp target-libstub target-cygmon"
610 noconfigdirs="$noconfigdirs target-libgloss"
613 thumb-*-pe) # CYGNUS LOCAL nickc/thumb
614 noconfigdirs="$noconfigdirs target-libgloss"
617 noconfigdirs="$noconfigdirs ld target-libgloss"
620 noconfigdirs="$noconfigdirs target-librx target-libg++ target-libstdc++ target-libio target-libgloss"
628 if [ x${is_cross_compiler} != xno ] ; then
629 target_configdirs="${target_configdirs} target-bsp target-libstub target-cygmon"
635 noconfigdirs="$noconfigdirs target-libg++ target-libstdc++ target-libio target-librx target-libgloss"
639 # Do configure ld/binutils/gas for this case.
642 # HP's C compiler doesn't handle Emacs correctly (but on BSD and Mach
643 # cc is gcc, and on any system a user should be able to link cc to
644 # whatever they want. FIXME, emacs emacs19).
646 "" | cc*) noconfigdirs="$noconfigdirs emacs emacs19" ;;
649 noconfigdirs="$noconfigdirs ld shellutils"
651 i[3456]86-*-coff | i[3456]86-*-elf)
652 if [ x${is_cross_compiler} != xno ] ; then
653 target_configdirs="${target_configdirs} target-libstub target-cygmon"
656 i[3456]86-*-go32* | i[3456]-*-msdosdjgpp*)
657 # but don't build gdb
658 noconfigdirs="$noconfigdirs gdb target-libg++ target-libstdc++ target-libio target-librx"
661 # linux has rx in libc
662 skipdirs="$skipdirs target-librx"
664 i[3456]86-*-mingw32*)
665 target_configdirs="$target_configdirs target-mingw"
666 noconfigdirs="$noconfigdirs expect target-libgloss"
668 # Can't build gdb for mingw32 if not native.
670 i[3456]86-*-mingw32) ;; # keep gdb tcl tk expect etc.
671 *) noconfigdirs="$noconfigdirs gdb tcl tk expect itcl tix db snavigator gnuserv"
676 target_configdirs="$target_configdirs target-libtermcap target-winsup"
677 noconfigdirs="$noconfigdirs target-libgloss"
678 # always build newlib.
679 skipdirs=`echo " ${skipdirs} " | sed -e 's/ target-newlib / /'`
681 # Can't build gdb for Cygwin if not native.
683 *-*-cygwin*) ;; # keep gdb tcl tk expect etc.
684 *) noconfigdirs="$noconfigdirs gdb tcl tk expect itcl tix libgui db snavigator gnuserv"
689 noconfigdirs="$noconfigdirs target-libg++ target-libstdc++ target-libio target-librx target-libgloss"
691 i[3456]86-*-sco3.2v5*)
692 # The linker does not yet know about weak symbols in COFF,
693 # and is not configured to handle mixed ELF and COFF.
694 noconfigdirs="$noconfigdirs ld target-libgloss"
697 noconfigdirs="$noconfigdirs gprof target-libgloss"
699 i[3456]86-*-solaris2*)
700 noconfigdirs="$noconfigdirs target-libgloss"
703 # The SYSV4 C compiler doesn't handle Emacs correctly
705 "" | cc*) noconfigdirs="$noconfigdirs emacs emacs19" ;;
708 # but that's okay since emacs doesn't work anyway
709 noconfigdirs="$noconfigdirs emacs emacs19 target-libgloss"
712 if [ x${is_cross_compiler} != xno ] ; then
713 target_configdirs="${target_configdirs} target-bsp target-libstub target-cygmon"
717 noconfigdirs="$noconfigdirs"
718 if [ x${is_cross_compiler} != xno ] ; then
719 target_configdirs="${target_configdirs} target-libstub target-cygmon"
723 noconfigdirs="$noconfigdirs"
724 if [ x${is_cross_compiler} != xno ] ; then
725 target_configdirs="${target_configdirs} target-bsp target-libstub target-cygmon"
729 # copied from rs6000-*-* entry
730 noconfigdirs="$noconfigdirs gprof cvssrc target-libgloss"
731 # This is needed until gcc and ld are fixed to work together.
734 powerpc*-*-winnt* | powerpc*-*-pe* | ppc*-*-pe)
735 target_configdirs="$target_configdirs target-winsup"
736 noconfigdirs="$noconfigdirs gdb tcl tk make expect target-libgloss itcl tix db snavigator gnuserv"
737 # always build newlib.
738 skipdirs=`echo " ${skipdirs} " | sed -e 's/ target-newlib / /'`
740 # This is temporary until we can link against shared libraries
741 powerpcle-*-solaris*)
742 noconfigdirs="$noconfigdirs gdb sim make tcl tk expect itcl tix db snavigator gnuserv"
745 if [ x${is_cross_compiler} != xno ] ; then
746 target_configdirs="${target_configdirs} target-bsp target-libstub target-cygmon"
750 # The CVS server code doesn't work on the RS/6000
751 # Newlib makes problems for libg++ in crosses.
752 noconfigdirs="$noconfigdirs target-newlib gprof cvssrc"
755 noconfigdirs="$noconfigdirs gprof"
756 # This is needed until gcc and ld are fixed to work together.
760 noconfigdirs="$noconfigdirs gprof"
763 noconfigdirs="$noconfigdirs ld binutils gprof target-libgloss"
766 # The GNU linker does not support shared libraries.
767 # emacs is emacs 18, which does not work on Irix 5 (emacs19 does work)
768 noconfigdirs="$noconfigdirs ld gprof emacs target-libgloss"
771 # The GNU assembler and linker do not support IRIX 6.
772 # emacs is emacs 18, which does not work on Irix 5 (emacs19 does work)
773 noconfigdirs="$noconfigdirs ld gas gprof emacs target-libgloss"
776 noconfigdirs="$noconfigdirs gprof target-libgloss"
779 noconfigdirs="$noconfigdirs gprof target-libgloss"
782 noconfigdirs="$noconfigdirs gprof" # same as generic mips
783 target_configdirs="${target_configdirs} target-bsp target-libstub target-cygmon"
786 noconfigdirs="$noconfigdirs gprof"
789 noconfigdirs="$noconfigdirs bfd binutils ld gas opcodes target-libgloss"
793 i[3456]86-*-vsta) ;; # don't add gprof back in
794 i[3456]86-*-go32*) ;; # don't add gprof back in
795 i[3456]86-*-msdosdjgpp*) ;; # don't add gprof back in
796 *) skipdirs=`echo " ${skipdirs} " | sed -e 's/ gprof / /'` ;;
798 noconfigdirs="$noconfigdirs target-libgloss"
801 if [ x${is_cross_compiler} != xno ] ; then
802 target_configdirs="${target_configdirs} target-libstub target-cygmon"
806 if [ x${is_cross_compiler} != xno ] ; then
807 target_configdirs="${target_configdirs} target-libstub target-cygmon"
811 if [ x${is_cross_compiler} != xno ] ; then
812 target_configdirs="${target_configdirs} target-libstub target-cygmon"
816 if [ x${is_cross_compiler} != xno ] ; then
817 noconfigdirs="$noconfigdirs gdb gdbtest target-newlib target-libgloss"
823 noconfigdirs="$noconfigdirs bfd binutils gas gcc gdb ld target-libio target-libg++ target-libstdc++ opcodes target-libgloss"
826 noconfigdirs="$noconfigdirs target-libgloss"
828 v850e-*-*) # CYGNUS LOCAL v850e
829 noconfigdirs="$noconfigdirs target-libgloss"
832 noconfigdirs="$noconfigdirs target-libgloss"
833 ;; # END CYGNUS LOCAL
835 noconfigdirs="$noconfigdirs bfd binutils gdb ld target-newlib opcodes target-libgloss"
838 noconfigdirs="$noconfigdirs target-newlib target-libgloss"
841 # Newlib makes problems for libg++ in crosses.
842 noconfigdirs="$noconfigdirs target-newlib target-libgloss"
846 # Macs want a resource compiler.
847 configdirs="$configdirs grez"
851 # If we aren't building newlib, then don't build libgloss, since libgloss
852 # depends upon some newlib header files.
853 case "${noconfigdirs}" in
854 *target-libgloss*) ;;
855 *target-newlib*) noconfigdirs="$noconfigdirs target-libgloss" ;;
858 # Make sure we don't let GNU ld be added if we didn't want it.
859 if [ x$with_gnu_ld = xno ]; then
861 noconfigdirs="$noconfigdirs ld"
864 # Make sure we don't let GNU as be added if we didn't want it.
865 if [ x$with_gnu_as = xno ]; then
867 noconfigdirs="$noconfigdirs gas"
870 # Remove the entries in $skipdirs and $noconfigdirs from $configdirs and
871 # $target_configdirs.
872 # If we have the source for $noconfigdirs entries, add them to $notsupp.
875 for dir in . $skipdirs $noconfigdirs ; do
876 dirname=`echo $dir | sed -e s/target-//g`
877 if [ $dir != . ] && echo " ${configdirs} " | grep " ${dir} " >/dev/null 2>&1; then
878 configdirs=`echo " ${configdirs} " | sed -e "s/ ${dir} / /"`
879 if [ -r $srcdir/$dirname/configure ] \
880 || [ -r $srcdir/$dirname/configure.in ]; then
881 if echo " ${skipdirs} " | grep " ${dir} " >/dev/null 2>&1; then
884 notsupp="$notsupp $dir"
888 if [ $dir != . ] && echo " ${target_configdirs} " | grep " ${dir} " >/dev/null 2>&1; then
889 target_configdirs=`echo " ${target_configdirs} " | sed -e "s/ ${dir} / /"`
890 if [ -r $srcdir/$dirname/configure ] \
891 || [ -r $srcdir/$dirname/configure.in ]; then
892 if echo " ${skipdirs} " | grep " ${dir} " >/dev/null 2>&1; then
895 notsupp="$notsupp $dir"
901 # Sometimes the tools are distributed with libiberty but with no other
902 # libraries. In that case, we don't want to build target-libiberty.
903 if [ -n "${target_configdirs}" ]; then
905 for i in `echo ${target_configdirs} | sed -e s/target-//g` ; do
906 if [ "$i" != "libiberty" ]; then
907 if [ -r $srcdir/$i/configure ] || [ -r $srcdir/$i/configure.in ]; then
913 if [ -z "${others}" ]; then
918 # Deconfigure all subdirectories, in case we are changing the
919 # configuration from one where a subdirectory is supported to one where it
921 if [ -z "${norecursion}" ] && [ -n "${configdirs}" ]; then
922 for i in `echo ${configdirs} | sed -e s/target-//g` ; do
926 if [ -z "${norecursion}" ] && [ -n "${target_configdirs}" ]; then
927 for i in `echo ${target_configdirs} | sed -e s/target-//g` ; do
928 rm -f ${target_subdir}/$i/Makefile
932 # Produce a warning message for the subdirs we can't configure.
933 # This isn't especially interesting in the Cygnus tree, but in the individual
934 # FSF releases, it's important to let people know when their machine isn't
935 # supported by the one or two programs in a package.
937 if [ -n "${notsupp}" ] && [ -z "${norecursion}" ]; then
938 # If $appdirs is non-empty, at least one of those directories must still
939 # be configured, or we error out. (E.g., if the gas release supports a
940 # specified target in some subdirs but not the gas subdir, we shouldn't
941 # pretend that all is well.)
942 if [ -n "$appdirs" ]; then
943 for dir in $appdirs ; do
944 if [ -r $dir/Makefile.in ]; then
945 if echo " ${configdirs} " | grep " ${dir} " >/dev/null 2>&1; then
949 if echo " ${target_configdirs} " | grep " ${dir} " >/dev/null 2>&1; then
955 if [ -n "$appdirs" ]; then
956 echo "*** This configuration is not supported by this package." 1>&2
960 # Okay, some application will build, or we don't care to check. Still
961 # notify of subdirs not getting built.
962 echo "*** This configuration is not supported in the following subdirectories:" 1>&2
963 echo " ${notsupp}" 1>&2
964 echo " (Any other directories should still work fine.)" 1>&2
967 # Set with_gnu_as and with_gnu_ld as appropriate.
969 # This is done by determining whether or not the appropriate directory
970 # is available, and by checking whether or not specific configurations
971 # have requested that this magic not happen.
973 # The command line options always override the explicit settings in
974 # configure.in, and the settings in configure.in override this magic.
976 # If the default for a toolchain is to use GNU as and ld, and you don't
977 # want to do that, then you should use the --without-gnu-as and
978 # --without-gnu-ld options for the configure script.
980 if [ x${use_gnu_as} = x ] ; then
981 if [ x${with_gnu_as} != xno ] && echo " ${configdirs} " | grep " ${gasdir} " > /dev/null 2>&1 && [ -d ${srcdir}/${gasdir} ] ; then
983 withoptions="$withoptions --with-gnu-as"
987 if [ x${use_gnu_ld} = x ] ; then
988 if [ x${with_gnu_ld} != xno ] && echo " ${configdirs} " | grep " ld " > /dev/null 2>&1 && [ -d ${srcdir}/ld ] ; then
990 withoptions="$withoptions --with-gnu-ld"
994 # If using newlib, add --with-newlib to the withoptions so that gcc/configure
995 # can detect this case.
997 if [ x${with_newlib} != xno ] && echo " ${target_configdirs} " | grep " target-newlib " > /dev/null 2>&1 && [ -d ${srcdir}/newlib ] ; then
999 withoptions="$withoptions --with-newlib"
1002 if [ x${shared} = xyes ]; then
1005 target_makefile_frag="${target_makefile_frag} config/mt-papic"
1008 target_makefile_frag="${target_makefile_frag} config/mt-x86pic"
1011 target_makefile_frag="${target_makefile_frag} config/mt-ppcpic"
1014 target_makefile_frag="${target_makefile_frag} config/mt-elfalphapic"
1017 if test -f ${srcdir}/config/mt-${target_cpu}pic; then
1018 target_makefile_frag="${target_makefile_frag} config/mt-${target_cpu}pic"
1025 if [ -n "${target_makefile_frag}" ] ; then
1026 for f in ${target_makefile_frag}
1028 cat ${srcdir}/$f >> mt-frag
1030 target_makefile_frag=mt-frag
1035 # Make sure that the compiler is able to generate an executable. If it
1036 # can't, we are probably in trouble. We don't care whether we can run the
1037 # executable--we might be using a cross compiler--we only care whether it
1038 # can be created. At this point the main configure script has set CC.
1039 echo "int main () { return 0; }" > conftest.c
1040 ${CC} -o conftest ${CFLAGS} ${CPPFLAGS} ${LDFLAGS} conftest.c
1041 if [ $? = 0 ] && [ -s conftest -o -s conftest.exe ]; then
1044 echo 1>&2 "*** The command '${CC} -o conftest ${CFLAGS} ${CPPFLAGS} ${LDFLAGS} conftest.c' failed."
1045 echo 1>&2 "*** You must set the environment variable CC to a working compiler."
1051 # The Solaris /usr/ucb/cc compiler does not appear to work.
1053 sparc-sun-solaris2*)
1054 CCBASE="`echo ${CC-cc} | sed 's/ .*$//'`"
1055 if [ "`/usr/bin/which $CCBASE`" = "/usr/ucb/cc" ] ; then
1057 [ -d /opt/SUNWspro/bin ] && could_use="/opt/SUNWspro/bin"
1058 if [ -d /opt/cygnus/bin ] ; then
1059 if [ "$could_use" = "" ] ; then
1060 could_use="/opt/cygnus/bin"
1062 could_use="$could_use or /opt/cygnus/bin"
1065 if [ "$could_use" = "" ] ; then
1066 echo "Warning: compilation may fail because you're using"
1067 echo "/usr/ucb/cc. You should change your PATH or CC "
1068 echo "variable and rerun configure."
1070 echo "Warning: compilation may fail because you're using"
1071 echo "/usr/ucb/cc, when you should use the C compiler from"
1072 echo "$could_use. You should change your"
1073 echo "PATH or CC variable and rerun configure."
1079 # If --enable-shared was set, we must set LD_LIBRARY_PATH so that the
1080 # binutils tools will find libbfd.so.
1081 if [ "${shared}" = "yes" ]; then
1082 sed -e 's/^SET_LIB_PATH[ ]*=.*$/SET_LIB_PATH = $(REALLY_SET_LIB_PATH)/' \
1083 Makefile > Makefile.tem
1085 mv -f Makefile.tem Makefile
1089 sed -e 's/^RPATH_ENVVAR[ ]*=.*$/RPATH_ENVVAR = SHLIB_PATH/' \
1090 Makefile > Makefile.tem
1092 mv -f Makefile.tem Makefile
1097 # Record target_configdirs and the configure arguments in Makefile.
1098 target_configdirs=`echo "${target_configdirs}" | sed -e 's/target-//g'`
1099 targargs=`echo "${arguments}" | \
1100 sed -e 's/--no[^ ]*//' \
1101 -e 's/--cache[a-z-]*=[^ ]*//' \
1102 -e 's/--ho[a-z-]*=[^ ]*//' \
1103 -e 's/--bu[a-z-]*=[^ ]*//' \
1104 -e 's/--ta[a-z-]*=[^ ]*//'`
1106 # Passing a --with-cross-host argument lets the target libraries know
1107 # whether they are being built with a cross-compiler or being built
1108 # native. However, it would be better to use other mechanisms to make the
1109 # sorts of decisions they want to make on this basis. Please consider
1110 # this option to be deprecated. FIXME.
1111 if [ x${is_cross_compiler} = xyes ]; then
1112 targargs="--with-cross-host=${host_alias} ${targargs}"
1115 # Default to --enable-multilib.
1116 if [ x${enable_multilib} = x ]; then
1117 targargs="--enable-multilib ${targargs}"
1120 # Pass --with-newlib if appropriate. Note that target_configdirs has
1121 # changed from the earlier setting of with_newlib.
1122 if [ x${with_newlib} != xno ] && echo " ${target_configdirs} " | grep " newlib " > /dev/null 2>&1 && [ -d ${srcdir}/newlib ] ; then
1123 targargs="--with-newlib ${targargs}"
1126 targargs="--host=${target_alias} --build=${build_alias} ${targargs}"
1127 sed -e "s:^TARGET_CONFIGDIRS[ ]*=.*$:TARGET_CONFIGDIRS = ${target_configdirs}:" \
1128 -e "s%^CONFIG_ARGUMENTS[ ]*=.*$%CONFIG_ARGUMENTS = ${targargs}%" \
1129 -e "s%^TARGET_SUBDIR[ ]*=.*$%TARGET_SUBDIR = ${target_subdir}%" \
1130 Makefile > Makefile.tem
1132 mv -f Makefile.tem Makefile