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