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, 1998 Free Software Foundation, Inc.
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.
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.
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.
33 ##############################################################################
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.
42 # these libraries are used by various programs built for the host environment
44 host_libs="intl mmalloc libiberty opcodes bfd readline gash db tcl tk tclX itcl tix libgui"
46 host_libs="${host_libs} libide libidetcl"
48 # start-sanitize-cygnus
49 host_libs="${host_libs} flexlm"
52 if [ "${enable_gdbgui}" = "yes" ] ; then
53 host_libs="${host_libs} libgui"
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 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"
61 host_tools="${host_tools} ilu vmake jstools"
63 # start-sanitize-cygnus
64 host_tools="${host_tools} cgen"
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)
70 target_libs="target-libiberty \
79 ${start-sanitize-java}
86 # these tools are built using the target libs, and are intended to run only
87 # in the target environment
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
93 target_tools="target-examples target-groff target-gperf"
95 ################################################################################
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.
103 # directories to be built in the native environment only
105 # This must be a single line because of the way it is searched by grep in
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 bzip2 prms snavigator gnuserv target-gperf"
109 # directories to be built in a cross environment only
111 cross_only="target-libgloss target-newlib target-cygmon target-opcodes target-libstub"
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.
119 configdirs=`echo ${host_libs} ${host_tools}`
120 target_configdirs=`echo ${target_libs} ${target_tools}`
122 ################################################################################
124 srctrigger=move-if-change
125 srcname="gnu development package"
127 # This gets set non-empty for some net releases of packages.
132 # Work in distributions that contain no compiler tools, like Autoconf.
133 if [ -d ${srcdir}/config ]; then
136 host_makefile_frag="${host_makefile_frag} config/mh-hp300"
139 host_makefile_frag="${host_makefile_frag} config/mh-apollo68"
142 host_makefile_frag="${host_makefile_frag} config/mh-a68bsd"
145 host_makefile_frag="${host_makefile_frag} config/mh-dgux"
148 host_makefile_frag="${host_makefile_frag} config/mh-cxux"
151 host_makefile_frag="${host_makefile_frag} config/mh-delta88"
154 host_makefile_frag="${host_makefile_frag} config/mh-decstation"
157 host_makefile_frag="${host_makefile_frag} config/mh-necv4"
160 host_makefile_frag="${host_makefile_frag} config/mh-irix6"
163 host_makefile_frag="${host_makefile_frag} config/mh-irix5"
166 host_makefile_frag="${host_makefile_frag} config/mh-irix4"
169 host_makefile_frag="${host_makefile_frag} config/mh-sysv"
172 host_makefile_frag="${host_makefile_frag} config/mh-sysv4"
175 host_makefile_frag="${host_makefile_frag} config/mh-riscos"
178 host_makefile_frag="${host_makefile_frag} config/mh-sysv5"
181 host_makefile_frag="${host_makefile_frag} config/mh-dgux386"
183 i[3456]86-ncr-sysv4.3*)
184 host_makefile_frag="${host_makefile_frag} config/mh-ncrsvr43"
186 i[3456]86-ncr-sysv4*)
187 host_makefile_frag="${host_makefile_frag} config/mh-ncr3000"
189 i[3456]86-*-sco3.2v5*)
190 host_makefile_frag="${host_makefile_frag} config/mh-sysv"
193 host_makefile_frag="${host_makefile_frag} config/mh-sco"
196 host_makefile_frag="${host_makefile_frag} config/mh-sysv"
198 i[3456]86-*-solaris2*)
199 host_makefile_frag="${host_makefile_frag} config/mh-sysv4"
202 host_makefile_frag="${host_makefile_frag} config/mh-aix386"
205 host_makefile_frag="${host_makefile_frag} config/mh-go32"
207 i[3456]86-*-msdosdjgpp*)
208 host_makefile_frag="${host_makefile_frag} config/mh-go32"
211 host_makefile_frag="${host_makefile_frag} config/mh-cygwin32"
214 host_makefile_frag="${host_makefile_frag} config/mh-mingw32"
216 # start-sanitize-mswin
218 host_makefile_frag="${host_makefile_frag} config/mh-windows"
222 host_makefile_frag="${host_makefile_frag} config/mh-vaxult2"
225 host_makefile_frag="${host_makefile_frag} config/mh-solaris"
228 host_makefile_frag="${host_makefile_frag} config/mh-sun3"
231 host_makefile_frag="${host_makefile_frag} config/mh-hpux8"
234 host_makefile_frag="${host_makefile_frag} config/mh-hpux"
237 host_makefile_frag="${host_makefile_frag} config/mh-hpux"
240 host_makefile_frag="${host_makefile_frag} config/mh-lynxrs6k"
243 host_makefile_frag="${host_makefile_frag} config/mh-lynxos"
246 host_makefile_frag="${host_makefile_frag} config/mh-sysv4"
249 host_makefile_frag="${host_makefile_frag} config/mh-sysv"
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}:"
260 test -z "$dir" && dir=.
261 if test -f $dir/gcc; then
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
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
279 alpha*-dec-osf*) enable_shared=yes ;;
280 alpha*-*-linux*) enable_shared=yes ;;
281 mips-sgi-irix5*) enable_shared=yes ;;
282 *) enable_shared=no ;;
286 case "${enable_shared}" in
293 if [ x${shared} = xyes ]; then
296 host_makefile_frag="${host_makefile_frag} config/mh-papic"
298 i[3456]86-*-cygwin32*)
299 # We don't want -fPIC on cygwin32.
302 host_makefile_frag="${host_makefile_frag} config/mh-x86pic"
305 host_makefile_frag="${host_makefile_frag} config/mh-sparcpic"
308 host_makefile_frag="${host_makefile_frag} config/mh-ppcpic"
311 host_makefile_frag="${host_makefile_frag} config/mh-elfalphapic"
314 if test -f ${srcdir}/config/mh-${host_cpu}pic; then
315 host_makefile_frag="${host_makefile_frag} config/mh-${host_cpu}pic"
322 if [ -n "${host_makefile_frag}" ] ; then
323 for f in ${host_makefile_frag}
325 cat ${srcdir}/$f >> mh-frag
327 host_makefile_frag=mh-frag
334 target_makefile_frag="${target_makefile_frag} config/mt-v810"
336 i[3456]86-*-netware*)
337 target_makefile_frag="${target_makefile_frag} config/mt-netware"
340 target_makefile_frag="${target_makefile_frag} config/mt-netware"
344 target_makefile_frag="${target_makefile_frag} config/mt-r5900 config/mt-sky"
347 # start-sanitize-r5900
349 target_makefile_frag="${target_makefile_frag} config/mt-r5900"
353 target_makefile_frag="${target_makefile_frag} config/mt-linux"
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
362 target_makefile_frag="${target_makefile_frag} config/mt-ospace"
364 :m32r-* | :d10v-* | :d30v-*)
365 target_makefile_frag="${target_makefile_frag} config/mt-ospace"
370 echo "*** bad value \"${enable_target_optspace}\" for --enable-target-optspace flag; ignored" 1>&2
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.
383 yes | "") # the default value for this tree is that X11 is available
386 skipdirs="${skipdirs} tk libgui gash"
388 skipdirs="${skipdirs} libide libidetcl vmake jstools"
392 echo "*** bad value \"${with_x}\" for -with-x flag; ignored" 1>&2
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
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}"
408 # Default to --enable-multilib. See similar code below.
409 if [ x${enable_multilib} = xno ]; then
412 target_subdir=${target_alias}
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}
422 if [ ! -d ${target_subdir} ] ; then
423 if mkdir ${target_subdir} ; then true
425 echo "'*** could not make ${PWD=`pwd`}/${target_subdir}" 1>&2
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
439 case "${exec_prefixoption}" in
441 *) x=${exec_prefix} ;;
443 copy_dirs="${copy_dirs} ${with_headers} $x/${target_alias}/sys-include"
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
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
457 *) x=${exec_prefix} ;;
459 for l in ${with_libs}; do
460 copy_dirs="$l $x/${target_alias}/lib ${copy_dirs}"
464 # If both --with-headers and --with-libs are specified, default to
466 if [ x"${with_headers}" != x ] && [ x"${with_libs}" != x ]; then
467 if [ x"${with_newlib}" = x ]; then
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 / /'`
479 # Default to using --with-stabs for certain targets.
480 if [ x${with_stabs} = x ]; then
484 mips*-*-* | alpha*-*-osf* | i[3456]86*-*-sysv4* | i[3456]86*-*-unixware*)
486 withoptions="${withoptions} --with-stabs"
491 # Handle ${copy_dirs}
492 set fnord ${copy_dirs}
494 while [ $# != 0 ]; do
495 if [ -f $2/COPIED ] && [ x"`cat $2/COPIED`" = x"$1" ]; then
498 echo Copying $1 to $2
500 # Use the install script to create the directory and all required
501 # parent directories.
506 ${srcdir}/install-sh -c -m 644 config.temp $2/COPIED
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 -)
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.
522 # Configure extra directories which are host specific
526 configdirs="$configdirs dosrel" ;;
527 i[3456]86-*-mingw32*)
528 configdirs="$configdirs dosrel" ;;
530 configdirs="$configdirs dosrel" ;;
533 # Remove more programs from consideration, based on the host or
534 # target this usually means that a port of the program doesn't
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"
543 noconfigdirs="$noconfigdirs libide libidetcl vmake jstools"
545 # start-sanitize-cygnus
546 noconfigdirs="$noconfigdirs flexlm"
547 # end-sanitize-cygnus
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"
552 noconfigdirs="$noconfigdirs libide libidetcl vmake jstools"
554 # start-sanitize-cygnus
555 noconfigdirs="$noconfigdirs flexlm"
556 # end-sanitize-cygnus
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"
563 noconfigdirs="autoconf automake send-pr gprof rcs guile perl texinfo apache inet"
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"
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"
577 noconfigdirs="$noconfigdirs libide libidetcl vmake jstools"
579 # start-sanitize-cygnus
580 noconfigdirs="$noconfigdirs flexlm"
581 # end-sanitize-cygnus
583 # start-sanitize-beos
585 noconfigdirs="$noconfigdirs tk itcl tix libgui gdb"
593 noconfigdirs="$noconfigdirs target-libg++ target-libstdc++ target-librx target-newlib target-libiberty target-libgloss"
596 noconfigdirs="$noconfigdirs target-libgloss"
599 noconfigdirs="$noconfigdirs target-newlib target-libgloss"
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"
608 noconfigdirs="$noconfigdirs gdb ld target-newlib target-libgloss"
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"
617 # newlib is not 64 bit ready
618 noconfigdirs="$noconfigdirs target-newlib target-libgloss"
621 noconfigdirs="$noconfigdirs target-libgloss"
624 noconfigdirs="$noconfigdirs target-libgloss"
627 noconfigdirs="$noconfigdirs target-libgloss"
629 # CYGNUS LOCAL clm/arm-elf
631 noconfigdirs="$noconfigdirs target-libgloss"
635 noconfigdirs="$noconfigdirs target-libgloss"
637 # CYGNUS LOCAL clm/arm-elf
639 noconfigdirs="$noconfigdirs target-libgloss"
642 thumb-*-pe) # CYGNUS LOCAL nickc/thumb
643 noconfigdirs="$noconfigdirs target-libgloss"
646 noconfigdirs="$noconfigdirs ld target-libgloss"
649 noconfigdirs="$noconfigdirs target-librx target-libg++ target-libstdc++ target-libio target-libgloss"
655 noconfigdirs="$noconfigdirs target-libg++ target-libstdc++ target-libio target-librx target-libgloss"
659 # Do configure ld/binutils/gas for this case.
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).
666 "" | cc*) noconfigdirs="$noconfigdirs emacs emacs19" ;;
669 noconfigdirs="$noconfigdirs ld shellutils"
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"
675 i[3456]86-*-mingw32*)
676 target_configdirs="$target_configdirs target-mingw"
677 noconfigdirs="$noconfigdirs expect target-libgloss"
679 # Can't build gdb for mingw32 if not native.
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
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 / /'`
695 # Can't build gdb for cygwin32 if not native.
697 *-*-cygwin32*) ;; # keep gdb tcl tk expect etc.
698 *) noconfigdirs="$noconfigdirs gdb tcl tk expect itcl tix libgui db snavigator gnuserv"
700 noconfigdirs="$noconfigdirs libide libidetcl vmake jstools"
702 # start-sanitize-cygnus
703 noconfigdirs="$noconfigdirs flexlm"
704 # end-sanitize-cygnus
709 noconfigdirs="$noconfigdirs target-libg++ target-libstdc++ target-libio target-librx target-libgloss"
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"
717 noconfigdirs="$noconfigdirs gprof target-libgloss"
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"
726 # The SYSV4 C compiler doesn't handle Emacs correctly
728 "" | cc*) noconfigdirs="$noconfigdirs emacs emacs19" ;;
731 # but that's okay since emacs doesn't work anyway
732 noconfigdirs="$noconfigdirs emacs emacs19 target-libgloss"
735 noconfigdirs="$noconfigdirs"
736 if [ x${is_cross_compiler} != xno ] ; then
737 target_configdirs="${target_configdirs} target-libstub target-cygmon"
741 noconfigdirs="$noconfigdirs"
742 if [ x${is_cross_compiler} != xno ] ; then
743 target_configdirs="${target_configdirs} target-libstub target-cygmon"
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.
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"
756 noconfigdirs="$noconfigdirs libide libidetcl vmake jstools"
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 / /'`
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"
768 noconfigdirs="$noconfigdirs libide libidetcl vmake jstools"
770 # start-sanitize-cygnus
771 noconfigdirs="$noconfigdirs flexlm"
772 # end-sanitize-cygnus
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"
780 noconfigdirs="$noconfigdirs gprof"
781 # This is needed until gcc and ld are fixed to work together.
785 noconfigdirs="$noconfigdirs gprof"
788 noconfigdirs="$noconfigdirs ld binutils gprof target-libgloss"
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"
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"
801 noconfigdirs="$noconfigdirs gprof target-libgloss"
804 noconfigdirs="$noconfigdirs gprof target-libgloss"
807 noconfigdirs="$noconfigdirs gprof" # same as generic mips
808 target_configdirs="${target_configdirs} target-libstub target-cygmon"
811 mips64r5900-sky-elf*)
812 noconfigdirs="$noconfigdirs gprof"
813 extraconfigdirs="$extraconfigdirs gas,dvp-gas,dvp-elf"
817 noconfigdirs="$noconfigdirs gprof"
820 noconfigdirs="$noconfigdirs bfd binutils ld gas opcodes target-libgloss"
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 / /'` ;;
829 noconfigdirs="$noconfigdirs target-libgloss"
832 if [ x${is_cross_compiler} != xno ] ; then
833 target_configdirs="${target_configdirs} target-libstub target-cygmon"
837 if [ x${is_cross_compiler} != xno ] ; then
838 target_configdirs="${target_configdirs} target-libstub target-cygmon"
842 if [ x${is_cross_compiler} != xno ] ; then
843 target_configdirs="${target_configdirs} target-libstub target-cygmon"
847 if [ x${is_cross_compiler} != xno ] ; then
848 noconfigdirs="$noconfigdirs gdb gdbtest target-newlib target-libgloss"
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"
862 noconfigdirs="$noconfigdirs bfd binutils gas gcc gdb ld target-libio target-libg++ target-libstdc++ opcodes target-libgloss"
865 noconfigdirs="$noconfigdirs target-libgloss"
867 # start-sanitize-v850e
869 noconfigdirs="$noconfigdirs target-libgloss"
872 noconfigdirs="$noconfigdirs target-libgloss"
876 noconfigdirs="$noconfigdirs bfd binutils gdb ld target-newlib opcodes target-libgloss"
879 noconfigdirs="$noconfigdirs target-newlib target-libgloss"
882 # Newlib makes problems for libg++ in crosses.
883 noconfigdirs="$noconfigdirs target-newlib target-libgloss"
887 # Macs want a resource compiler.
888 configdirs="$configdirs grez"
890 # start-sanitize-beos
892 noconfigdirs="$noconfigdirs target-gperf"
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" ;;
904 # start-sanitize-cygnus
905 # Only configure cgen if --enable-cgen-maint.
906 if [ x$"enable_cgen_maint" != xyes ] ; then
907 noconfigdirs="$noconfigdirs cgen"
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
914 noconfigdirs="$noconfigdirs ld"
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
920 noconfigdirs="$noconfigdirs gas"
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.
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
937 notsupp="$notsupp $dir"
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
948 notsupp="$notsupp $dir"
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
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
966 if [ -z "${others}" ]; then
971 # Deconfigure all subdirectories, in case we are changing the
972 # configuration from one where a subdirectory is supported to one where it
974 if [ -z "${norecursion}" ] && [ -n "${configdirs}" ]; then
975 for i in `echo ${configdirs} | sed -e s/target-//g` ; do
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
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.
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
1002 if echo " ${target_configdirs} " | grep " ${dir} " >/dev/null 2>&1; then
1008 if [ -n "$appdirs" ]; then
1009 echo "*** This configuration is not supported by this package." 1>&2
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
1020 # Set with_gnu_as and with_gnu_ld as appropriate.
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.
1026 # The command line options always override the explicit settings in
1027 # configure.in, and the settings in configure.in override this magic.
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.
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
1036 withoptions="$withoptions --with-gnu-as"
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
1043 withoptions="$withoptions --with-gnu-ld"
1047 # If using newlib, add --with-newlib to the withoptions so that gcc/configure
1048 # can detect this case.
1050 if [ x${with_newlib} != xno ] && echo " ${target_configdirs} " | grep " target-newlib " > /dev/null 2>&1 && [ -d ${srcdir}/newlib ] ; then
1052 withoptions="$withoptions --with-newlib"
1055 if [ x${shared} = xyes ]; then
1058 target_makefile_frag="${target_makefile_frag} config/mt-papic"
1061 target_makefile_frag="${target_makefile_frag} config/mt-x86pic"
1064 target_makefile_frag="${target_makefile_frag} config/mt-ppcpic"
1067 target_makefile_frag="${target_makefile_frag} config/mt-elfalphapic"
1070 if test -f ${srcdir}/config/mt-${target_cpu}pic; then
1071 target_makefile_frag="${target_makefile_frag} config/mt-${target_cpu}pic"
1078 if [ -n "${target_makefile_frag}" ] ; then
1079 for f in ${target_makefile_frag}
1081 cat ${srcdir}/$f >> mt-frag
1083 target_makefile_frag=mt-frag
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
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."
1104 # The Solaris /usr/ucb/cc compiler does not appear to work.
1106 sparc-sun-solaris2*)
1107 CCBASE="`echo ${CC-cc} | sed 's/ .*$//'`"
1108 if [ "`/usr/bin/which $CCBASE`" = "/usr/ucb/cc" ] ; then
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"
1115 could_use="$could_use or /opt/cygnus/bin"
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."
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."
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
1138 mv -f Makefile.tem Makefile
1142 sed -e 's/^RPATH_ENVVAR[ ]*=.*$/RPATH_ENVVAR = SHLIB_PATH/' \
1143 Makefile > Makefile.tem
1145 mv -f Makefile.tem Makefile
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-]*=[^ ]*//'`
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}"
1168 # Default to --enable-multilib.
1169 if [ x${enable_multilib} = x ]; then
1170 targargs="--enable-multilib ${targargs}"
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}"
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
1185 mv -f Makefile.tem Makefile