2 # Process this file with autoconf to generate a configuration script.
4 # Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002 Free Software Foundation, Inc.
6 #This file is part of GCC.
8 #GCC is free software; you can redistribute it and/or modify it under
9 #the terms of the GNU General Public License as published by the Free
10 #Software Foundation; either version 2, or (at your option) any later
13 #GCC is distributed in the hope that it will be useful, but WITHOUT
14 #ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
15 #FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
18 #You should have received a copy of the GNU General Public License
19 #along with GCC; see the file COPYING. If not, write to the Free
20 #Software Foundation, 59 Temple Place - Suite 330, Boston, MA
23 # Initialization and defaults
26 AC_CONFIG_HEADER(auto-host.h:config.in)
33 # Check for bogus environment variables.
34 # Test if LIBRARY_PATH contains the notation for the current directory
35 # since this would lead to problems installing/building glibc.
36 # LIBRARY_PATH contains the current directory if one of the following
38 # - one of the terminals (":" and ";") is the first or last sign
39 # - two terminals occur directly after each other
40 # - the path contains an element with a dot in it
41 AC_MSG_CHECKING(LIBRARY_PATH variable)
43 case ${LIBRARY_PATH} in
44 [:\;]* | *[:\;] | *[:\;][:\;]* | *[:\;]. | .[:\;]*| . | *[:\;].[:\;]* )
45 library_path_setting="contains current directory"
48 library_path_setting="ok"
52 AC_MSG_RESULT($library_path_setting)
53 if test "$library_path_setting" != "ok"; then
55 *** LIBRARY_PATH shouldn't contain the current directory when
56 *** building gcc. Please change the environment variable
57 *** and run configure again.])
60 # Test if GCC_EXEC_PREFIX contains the notation for the current directory
61 # since this would lead to problems installing/building glibc.
62 # GCC_EXEC_PREFIX contains the current directory if one of the following
64 # - one of the terminals (":" and ";") is the first or last sign
65 # - two terminals occur directly after each other
66 # - the path contains an element with a dot in it
67 AC_MSG_CHECKING(GCC_EXEC_PREFIX variable)
69 case ${GCC_EXEC_PREFIX} in
70 [:\;]* | *[:\;] | *[:\;][:\;]* | *[:\;]. | .[:\;]*| . | *[:\;].[:\;]* )
71 gcc_exec_prefix_setting="contains current directory"
74 gcc_exec_prefix_setting="ok"
78 AC_MSG_RESULT($gcc_exec_prefix_setting)
79 if test "$gcc_exec_prefix_setting" != "ok"; then
81 *** GCC_EXEC_PREFIX shouldn't contain the current directory when
82 *** building gcc. Please change the environment variable
83 *** and run configure again.])
86 # Check for additional parameters
90 [ --with-gnu-ld arrange to work with GNU ld.],
91 gnu_ld_flag="$with_gnu_ld",
96 [ --with-ld arrange to use the specified ld (full pathname)],
97 DEFAULT_LINKER="$with_ld")
98 if test x"${DEFAULT_LINKER+set}" = x"set"; then
99 if test ! -x "$DEFAULT_LINKER"; then
100 AC_MSG_WARN([cannot execute: $DEFAULT_LINKER: check --with-ld or env. var. DEFAULT_LINKER])
101 elif $DEFAULT_LINKER -v < /dev/null 2>&1 | grep GNU > /dev/null; then
104 AC_DEFINE_UNQUOTED(DEFAULT_LINKER,"$DEFAULT_LINKER",
105 [Define to enable the use of a default linker.])
110 [ --with-gnu-as arrange to work with GNU as],
111 gas_flag="$with_gnu_as",
115 [ --with-as arrange to use the specified as (full pathname)],
116 DEFAULT_ASSEMBLER="$with_as")
117 if test x"${DEFAULT_ASSEMBLER+set}" = x"set"; then
118 if test ! -x "$DEFAULT_ASSEMBLER"; then
119 AC_MSG_WARN([cannot execute: $DEFAULT_ASSEMBLER: check --with-as or env. var. DEFAULT_ASSEMBLER])
120 elif $DEFAULT_ASSEMBLER -v < /dev/null 2>&1 | grep GNU > /dev/null; then
123 AC_DEFINE_UNQUOTED(DEFAULT_ASSEMBLER,"$DEFAULT_ASSEMBLER",
124 [Define to enable the use of a default assembler.])
129 [ --with-stabs arrange to use stabs instead of host debug format],
135 [ --with-elf arrange to use ELF instead of host debug format],
139 # Specify the local prefix
141 AC_ARG_WITH(local-prefix,
142 [ --with-local-prefix=DIR specifies directory to put local include],
143 [case "${withval}" in
144 yes) AC_MSG_ERROR(bad value ${withval} given for local include directory prefix) ;;
146 *) local_prefix=$with_local_prefix ;;
149 # Default local prefix if it is empty
150 if test x$local_prefix = x; then
151 local_prefix=/usr/local
154 # Don't set gcc_gxx_include_dir to gxx_include_dir since that's only
155 # passed in by the toplevel make and thus we'd get different behavior
156 # depending on where we built the sources.
158 # Specify the g++ header file directory
159 AC_ARG_WITH(gxx-include-dir,
160 [ --with-gxx-include-dir=DIR
161 specifies directory to put g++ header files],
162 [case "${withval}" in
163 yes) AC_MSG_ERROR(bad value ${withval} given for g++ include directory) ;;
165 *) gcc_gxx_include_dir=$with_gxx_include_dir ;;
168 if test x${gcc_gxx_include_dir} = x; then
169 if test x${enable_version_specific_runtime_libs} = xyes; then
170 gcc_gxx_include_dir='${libsubdir}/include/c++'
172 topsrcdir=${srcdir}/.. . ${srcdir}/../config.if
173 changequote(<<, >>)dnl
174 gcc_gxx_include_dir="\$(libsubdir)/\$(unlibsubdir)/..\`echo \$(exec_prefix) | sed -e 's|^\$(prefix)||' -e 's|/[^/]*|/..|g'\`/include/"${libstdcxx_incdir}
179 # Determine the host, build, and target systems
182 # Set program_transform_name
185 # Find the native compiler
188 # autoconf is lame and doesn't give us any substitution variable for this.
189 if eval "test \"`echo '$ac_cv_prog_cc_'${ac_cc}_c_o`\" = no"; then
190 NO_MINUS_C_MINUS_O=yes
192 OUTPUT_OPTION='-o $@'
194 AC_SUBST(NO_MINUS_C_MINUS_O)
195 AC_SUBST(OUTPUT_OPTION)
197 # See if GNAT has been installed
200 AC_CACHE_CHECK(whether ${CC-cc} accepts -Wno-long-long,
201 ac_cv_prog_cc_no_long_long,
202 [save_CFLAGS="$CFLAGS"
203 CFLAGS="-Wno-long-long"
204 AC_TRY_COMPILE(,,ac_cv_prog_cc_no_long_long=yes,
205 ac_cv_prog_cc_no_long_long=no)
206 CFLAGS="$save_CFLAGS"])
208 if test x$have_gnat != xno ; then
209 AC_CACHE_CHECK(whether ${ADAC} accepts -Wno-long-long,
210 ac_cv_prog_adac_no_long_long,
211 [cat >conftest.adb <<EOF
212 procedure conftest is begin null; end conftest;
214 if $ADAC -Wno-long-long -c conftest.adb 1>&5 2>&5 ; then
215 ac_cv_prog_adac_no_long_long=yes
217 ac_cv_prog_adac_no_long_long=no
221 ac_cv_prog_adac_no_long_long=yes
225 if test $ac_cv_prog_cc_no_long_long = yes && \
226 test $ac_cv_prog_adac_no_long_long = yes ; then
227 strict1_warn="-pedantic -Wno-long-long"
229 AC_SUBST(strict1_warn)
239 # sizeof(char) is 1 by definition.
240 AC_COMPILE_CHECK_SIZEOF(short)
241 AC_COMPILE_CHECK_SIZEOF(int)
242 AC_COMPILE_CHECK_SIZEOF(long)
243 if test $ac_cv_c_long_long = yes; then
244 AC_COMPILE_CHECK_SIZEOF(long long)
246 if test $ac_cv_c___int64 = yes; then
247 AC_COMPILE_CHECK_SIZEOF(__int64)
252 # If the native compiler is GCC, we can enable warnings even in stage1.
253 # That's useful for people building cross-compilers, or just running a
256 if test "x$GCC" = "xyes"; then
257 warn_cflags='$(GCC_WARN_CFLAGS)'
259 AC_SUBST(warn_cflags)
261 # Determine whether or not multilibs are enabled.
262 AC_ARG_ENABLE(multilib,
263 [ --enable-multilib enable library support for multiple ABIs],
264 [], [enable_multilib=yes])
265 AC_SUBST(enable_multilib)
267 # Enable expensive internal checks
268 AC_ARG_ENABLE(checking,
269 [ --enable-checking[=LIST]
270 enable expensive run-time checks. With LIST,
271 enable only specific categories of checks.
272 Categories are: misc,tree,rtl,rtlflag,gc,gcac;
273 default is misc,tree,gc,rtlflag],
279 ac_gc_always_collect=
280 case "${enableval}" in
281 yes) ac_checking=1 ; ac_tree_checking=1 ; ac_gc_checking=1 ;
282 ac_rtlflag_checking=1 ;;
284 *) IFS="${IFS= }"; ac_save_IFS="$IFS"; IFS="$IFS,"
285 set fnord $enableval; shift
290 misc) ac_checking=1 ;;
291 tree) ac_tree_checking=1 ;;
292 rtlflag) ac_rtlflag_checking=1 ;;
293 rtl) ac_rtl_checking=1 ;;
294 gc) ac_gc_checking=1 ;;
295 gcac) ac_gc_always_collect=1 ;;
296 valgrind) ac_checking_valgrind=1 ;;
297 *) AC_MSG_ERROR(unknown check category $check) ;;
303 # Enable some checks by default for development versions of GCC
304 [ac_checking=1; ac_tree_checking=1; ac_gc_checking=1; ac_rtlflag_checking=1;])
306 if test x$ac_checking != x ; then
307 AC_DEFINE(ENABLE_CHECKING, 1,
308 [Define if you want more run-time sanity checks. This one gets a grab
309 bag of miscellaneous but relatively cheap checks.])
310 nocommon_flag=-fno-common
312 AC_SUBST(nocommon_flag)
313 if test x$ac_tree_checking != x ; then
314 AC_DEFINE(ENABLE_TREE_CHECKING, 1,
315 [Define if you want all operations on trees (the basic data
316 structure of the front ends) to be checked for dynamic type safety
317 at runtime. This is moderately expensive.])
319 if test x$ac_rtl_checking != x ; then
320 AC_DEFINE(ENABLE_RTL_CHECKING, 1,
321 [Define if you want all operations on RTL (the basic data structure
322 of the optimizer and back end) to be checked for dynamic type safety
323 at runtime. This is quite expensive.])
325 if test x$ac_rtlflag_checking != x ; then
326 AC_DEFINE(ENABLE_RTL_FLAG_CHECKING, 1,
327 [Define if you want RTL flag accesses to be checked against the RTL
328 codes that are supported for each access macro. This is relatively
331 if test x$ac_gc_checking != x ; then
332 AC_DEFINE(ENABLE_GC_CHECKING, 1,
333 [Define if you want the garbage collector to do object poisoning and
334 other memory allocation checks. This is quite expensive.])
336 if test x$ac_gc_always_collect != x ; then
337 AC_DEFINE(ENABLE_GC_ALWAYS_COLLECT, 1,
338 [Define if you want the garbage collector to operate in maximally
339 paranoid mode, validating the entire heap and collecting garbage at
340 every opportunity. This is extremely expensive.])
342 valgrind_path_defines=
344 if test x$ac_checking_valgrind != x ; then
345 # It is certainly possible that there's valgrind but no valgrind.h.
346 # GCC relies on making annotations so we must have both.
347 AC_CHECK_HEADER(valgrind.h, have_valgrind_h=yes, have_valgrind_h=no)
348 AM_PATH_PROG_WITH_TEST(valgrind_path, valgrind,
349 [$ac_dir/$ac_word --version | grep valgrind- >/dev/null 2>&1])
350 if test "x$valgrind_path" = "x" || test $have_valgrind_h = no; then
351 AC_MSG_ERROR([*** Can't find both valgrind and valgrind.h])
353 valgrind_path_defines=-DVALGRIND_PATH='\"'$valgrind_path'\"'
354 valgrind_command="$valgrind_path -q"
355 AC_DEFINE(ENABLE_VALGRIND_CHECKING, 1,
356 [Define if you want to run subprograms and generated programs
357 through valgrind (a memory checker). This is extremely expensive.])
359 AC_SUBST(valgrind_path_defines)
360 AC_SUBST(valgrind_command)
362 # Enable code coverage collection
363 AC_ARG_ENABLE(coverage,
364 [ --enable-coverage[=LEVEL]
365 enable compiler\'s code coverage collection.
366 Use to measure compiler performance and locate
367 unused parts of the compiler. With LEVEL, specify
368 optimization. Values are opt, noopt,
370 [case "${enableval}" in
372 coverage_flags="-fprofile-arcs -ftest-coverage -O0 -DSELF_COVERAGE=1"
375 coverage_flags="-fprofile-arcs -ftest-coverage -O2 -DSELF_COVERAGE=2"
378 AC_MSG_ERROR(unknown coverage setting $enableval)
382 AC_SUBST(coverage_flags)
384 AC_ARG_WITH(cpp_install_dir,
385 [ --with-cpp-install-dir=DIR
386 install the user visible C preprocessor in DIR
387 (relative to PREFIX) as well as PREFIX/bin],
388 [if test x$withval = xyes; then
389 AC_MSG_ERROR([option --with-cpp-install-dir requires an argument])
390 elif test x$withval != xno; then
391 cpp_install_dir=$withval
394 # Enable __cxa_atexit for C++.
395 AC_ARG_ENABLE(__cxa_atexit,
396 [ --enable-__cxa_atexit enable __cxa_atexit for C++],
398 if test x$enable___cxa_atexit = xyes; then
399 AC_DEFINE(DEFAULT_USE_CXA_ATEXIT, 1,
400 [Define if you want to use __cxa_atexit, rather than atexit, to
401 register C++ destructors for local statics and global objects.
402 This is essential for fully standards-compliant handling of
403 destructors, but requires __cxa_atexit in libc.])
406 # Enable Multibyte Characters for C/C++
407 AC_ARG_ENABLE(c-mbchar,
408 [ --enable-c-mbchar enable multibyte characters for C and C++],
409 if test x$enable_c_mbchar != xno; then
410 AC_DEFINE(MULTIBYTE_CHARS, 1,
411 [Define if you want the C and C++ compilers to support multibyte
412 character sets for source code.])
416 # Pass with no value to take the default
417 # Pass with a value to specify a thread package
418 AC_ARG_ENABLE(threads,
419 [ --enable-threads enable thread usage for target GCC
420 --enable-threads=LIB use LIB thread package for target GCC],,
423 enable_threads_flag=$enable_threads
424 # Check if a valid thread package
425 case x${enable_threads_flag} in
428 target_thread_file='single'
432 target_thread_file=''
434 xdecosf1 | xirix | xmach | xos2 | xposix | xpthreads | xsingle | \
435 xsolaris | xwin32 | xdce | xrtems| xvxworks | xaix)
436 target_thread_file=$enable_threads_flag
439 echo "$enable_threads is an unknown thread package" 1>&2
444 AC_ARG_ENABLE(objc-gc,
445 [ --enable-objc-gc enable the use of Boehm's garbage collector with
446 the GNU Objective-C runtime],
447 if test x$enable_objc_gc = xno; then
455 [ --with-dwarf2 force the default debug format to be DWARF 2],
456 dwarf2="$with_dwarf2",
459 AC_ARG_ENABLE(shared,
460 [ --disable-shared don't provide a shared libgcc],
462 case $enable_shared in
466 IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:,"
467 for pkg in $enableval; do
468 if test "X$pkg" = "Xgcc" || test "X$pkg" = "Xlibgcc"; then
475 ], [enable_shared=yes])
476 AC_SUBST(enable_shared)
479 [ --with-sysroot[=DIR] Search for usr/lib, usr/include, et al, within DIR.],
481 case ${with_sysroot} in
482 yes) TARGET_SYSTEM_ROOT='${gcc_tooldir}/sys-root' ;;
483 *) TARGET_SYSTEM_ROOT=$with_sysroot ;;
486 TARGET_SYSTEM_ROOT_DEFINE='-DTARGET_SYSTEM_ROOT=\"$(TARGET_SYSTEM_ROOT)\"'
487 CROSS_SYSTEM_HEADER_DIR='$(TARGET_SYSTEM_ROOT)$(NATIVE_SYSTEM_HEADER_DIR)'
490 TARGET_SYSTEM_ROOT_DEFINE='-DTARGET_SYSTEM_ROOT=0'
491 CROSS_SYSTEM_HEADER_DIR='$(gcc_tooldir)/sys-include'
493 AC_SUBST(TARGET_SYSTEM_ROOT)
494 AC_SUBST(TARGET_SYSTEM_ROOT_DEFINE)
495 AC_SUBST(CROSS_SYSTEM_HEADER_DIR)
497 # Stage specific cflags for build.
503 stage1_cflags="-Wa,-J"
509 # The spiffy cpp-precomp chokes on some legitimate constructs in GCC
510 # sources; use -no-cpp-precomp to get to GNU cpp.
511 # Apple's GCC has bugs in designated initializer handling, so disable
513 stage1_cflags="-no-cpp-precomp -DHAVE_DESIGNATED_INITIALIZERS=0"
516 AC_SUBST(stage1_cflags)
520 AC_MSG_CHECKING([whether a default assembler was specified])
521 if test x"${DEFAULT_ASSEMBLER+set}" = x"set"; then
522 if test x"$gas_flag" = x"no"; then
523 AC_MSG_RESULT([yes ($DEFAULT_ASSEMBLER)])
525 AC_MSG_RESULT([yes ($DEFAULT_ASSEMBLER - GNU as)])
531 AC_MSG_CHECKING([whether a default linker was specified])
532 if test x"${DEFAULT_LINKER+set}" = x"set"; then
533 if test x"$gnu_ld_flag" = x"no"; then
534 AC_MSG_RESULT([yes ($DEFAULT_LINKER)])
536 AC_MSG_RESULT([yes ($DEFAULT_LINKER - GNU ld)])
542 AC_MSG_CHECKING(for GNU C library)
543 AC_CACHE_VAL(gcc_cv_glibc,
545 [#include <features.h>],[
546 #if ! (defined __GLIBC__ || defined __GNU_LIBRARY__)
547 #error Not a GNU C library system
551 AC_MSG_RESULT($gcc_cv_glibc)
552 if test $gcc_cv_glibc = yes; then
553 AC_DEFINE(_GNU_SOURCE, 1, [Always define this when using the GNU C Library])
556 # Find some useful tools
565 gcc_AC_HEADER_STDBOOL
568 AC_CHECK_HEADERS(limits.h stddef.h string.h strings.h stdlib.h time.h \
569 fcntl.h unistd.h sys/file.h sys/time.h \
570 sys/resource.h sys/param.h sys/times.h sys/stat.h \
571 direct.h malloc.h langinfo.h)
573 # Check for thread headers.
574 AC_CHECK_HEADER(thread.h, [have_thread_h=yes], [have_thread_h=])
575 AC_CHECK_HEADER(pthread.h, [have_pthread_h=yes], [have_pthread_h=])
577 # These tests can't be done till we know if we have limits.h.
580 gcc_AC_C_FLOAT_FORMAT
582 # See if we have the mktemp command.
583 AC_CHECK_PROG(have_mktemp_command, mktemp, yes, no)
585 # Do we have a single-tree copy of texinfo?
586 if test -f $srcdir/../texinfo/Makefile.in; then
587 MAKEINFO='$(objdir)/../texinfo/makeinfo/makeinfo'
588 gcc_cv_prog_makeinfo_modern=yes
589 AC_MSG_RESULT([Using makeinfo from the unified source tree.])
591 # See if makeinfo has been installed and is modern enough
592 # that we can use it.
593 gcc_AC_CHECK_PROG_VER(MAKEINFO, makeinfo, --version,
594 [GNU texinfo.* \([0-9][0-9.]*\)],
598 if test $gcc_cv_prog_makeinfo_modern = no; then
600 *** Makeinfo is missing or too old.
601 *** Info documentation will not be built.])
604 BUILD_INFO=info AC_SUBST(BUILD_INFO)
607 # Is pod2man recent enough to regenerate manpages?
608 AC_MSG_CHECKING([for recent Pod::Man])
609 if (perl -e 'use 1.10 Pod::Man') >/dev/null 2>&1; then
611 GENERATED_MANPAGES=generated-manpages AC_SUBST(GENERATED_MANPAGES)
618 dnl Don't use AC_PROG_LEX; we insist on flex.
619 dnl LEXLIB is not useful in gcc.
620 if test -f $srcdir/../flex/skel.c; then
621 FLEX='$(objdir)/../flex/flex'
623 AC_CHECK_PROG(FLEX, flex, flex, ${CONFIG_SHELL-/bin/sh} ${srcdir}/../missing flex)
627 # The -L switch is so bison can find its skeleton file.
628 if test -f $srcdir/../bison/bison.simple; then
629 BISON='$(objdir)/../bison/bison -L $(srcdir)/../bison/'
631 AC_CHECK_PROG(BISON, bison, bison, ${CONFIG_SHELL-/bin/sh} ${srcdir}/../missing bison)
634 # These libraries may be used by collect2.
635 # We may need a special search path to get them linked.
636 AC_CACHE_CHECK(for collect2 libraries, gcc_cv_collect2_libs,
638 for libs in '' -lld -lmld \
639 '-L/usr/lib/cmplrs/cc2.11 -lmld' \
640 '-L/usr/lib/cmplrs/cc3.11 -lmld'
643 AC_TRY_LINK_FUNC(ldopen,
644 [gcc_cv_collect2_libs="$libs"; break])
647 test -z "$gcc_cv_collect2_libs" && gcc_cv_collect2_libs='none required'])
648 case $gcc_cv_collect2_libs in
650 *) COLLECT2_LIBS=$gcc_cv_collect2_libs ;;
652 AC_SUBST(COLLECT2_LIBS)
654 # When building Ada code on Alpha, we need exc_resume which is usually in
655 # -lexc. So test for it.
658 AC_SEARCH_LIBS(exc_resume, exc)
661 AC_SUBST(GNAT_LIBEXC)
663 # See if the stage1 system preprocessor understands the ANSI C
664 # preprocessor stringification operator. (Used by symcat.h.)
667 # Use <inttypes.h> only if it exists,
668 # doesn't clash with <sys/types.h>, and declares intmax_t.
669 AC_MSG_CHECKING(for inttypes.h)
670 AC_CACHE_VAL(gcc_cv_header_inttypes_h,
672 [#include <sys/types.h>
673 #include <inttypes.h>],
675 [gcc_cv_header_inttypes_h=yes],
676 gcc_cv_header_inttypes_h=no)])
677 AC_MSG_RESULT($gcc_cv_header_inttypes_h)
678 if test $gcc_cv_header_inttypes_h = yes; then
679 AC_DEFINE(HAVE_INTTYPES_H, 1,
680 [Define if you have a working <inttypes.h> header file.])
683 dnl Disabled until we have a complete test for buggy enum bitfields.
684 dnl gcc_AC_C_ENUM_BF_UNSIGNED
686 AC_CHECK_FUNCS(times clock dup2 kill getrlimit setrlimit atoll atoq \
687 sysconf strsignal putc_unlocked fputc_unlocked fputs_unlocked \
688 fwrite_unlocked fprintf_unlocked getrusage nl_langinfo lstat \
691 AC_CHECK_TYPE(ssize_t, int)
693 # Try to determine the array type of the second argument of getgroups
694 # for the target system (int or gid_t).
696 if test "${target}" = "${build}"; then
697 TARGET_GETGROUPS_T=$ac_cv_type_getgroups
700 # This condition may need some tweaking. It should include all
701 # targets where the array type of the second argument of getgroups
702 # is int and the type of gid_t is not equivalent to int.
703 *-*-sunos* | *-*-ultrix*)
704 TARGET_GETGROUPS_T=int
707 TARGET_GETGROUPS_T=gid_t
711 AC_SUBST(TARGET_GETGROUPS_T)
713 gcc_AC_FUNC_PRINTF_PTR
718 *** UWIN may not be used as a host platform because
719 *** linking with posix.dll is not allowed by the GNU GPL])
722 # Under VMS, vfork works very different than on Unix. The standard test
723 # won't work, and it isn't easily adaptable. It makes more sense to
725 ac_cv_func_vfork_works=yes
729 AC_FUNC_MMAP_ANYWHERE
734 # We will need to find libiberty.h and ansidecl.h
735 saved_CFLAGS="$CFLAGS"
736 CFLAGS="$CFLAGS -I${srcdir} -I${srcdir}/../include"
737 gcc_AC_CHECK_DECLS(getenv atol sbrk abort atof getcwd getwd \
738 strsignal putc_unlocked fputs_unlocked fwrite_unlocked \
739 fprintf_unlocked strstr errno vasprintf \
740 malloc realloc calloc free basename getopt clock, , ,[
741 #include "ansidecl.h"
742 #include "system.h"])
744 gcc_AC_CHECK_DECLS(getrlimit setrlimit getrusage, , ,[
745 #include "ansidecl.h"
747 #ifdef HAVE_SYS_RESOURCE_H
748 #include <sys/resource.h>
752 gcc_AC_CHECK_DECLS(times, , ,[
753 #include "ansidecl.h"
755 #ifdef HAVE_SYS_TIMES_H
756 #include <sys/times.h>
760 # More time-related stuff.
761 AC_CACHE_CHECK(for struct tms, ac_cv_struct_tms, [
763 #include "ansidecl.h"
765 #ifdef HAVE_SYS_TIMES_H
766 #include <sys/times.h>
768 ], [struct tms tms;], ac_cv_struct_tms=yes, ac_cv_struct_tms=no)])
769 if test $ac_cv_struct_tms = yes; then
770 AC_DEFINE(HAVE_STRUCT_TMS, 1,
771 [Define if <sys/times.h> defines struct tms.])
774 # use gcc_cv_* here because this doesn't match the behavior of AC_CHECK_TYPE.
775 # revisit after autoconf 2.50.
776 AC_CACHE_CHECK(for clock_t, gcc_cv_type_clock_t, [
778 #include "ansidecl.h"
780 ], [clock_t x;], gcc_cv_type_clock_t=yes, gcc_cv_type_clock_t=no)])
781 if test $gcc_cv_type_clock_t = yes; then
782 AC_DEFINE(HAVE_CLOCK_T, 1,
783 [Define if <time.h> defines clock_t.])
786 AC_ARG_ENABLE(initfini-array,
787 [ --enable-initfini-array use .init_array/.fini_array sections],
788 gcc_cv_initfinit_array=$enableval, [gcc_AC_INITFINI_ARRAY])
790 # Restore CFLAGS from before the gcc_AC_NEED_DECLARATIONS tests.
791 CFLAGS="$saved_CFLAGS"
793 # mkdir takes a single argument on some systems.
794 gcc_AC_FUNC_MKDIR_TAKES_ONE_ARG
802 # With Setjmp/Longjmp based exception handling.
803 AC_ARG_ENABLE(sjlj-exceptions,
804 [ --enable-sjlj-exceptions
805 arrange to use setjmp/longjmp exception handling],
806 [sjlj=`if test $enableval = yes; then echo 1; else echo 0; fi`
807 AC_DEFINE_UNQUOTED(CONFIG_SJLJ_EXCEPTIONS, $sjlj,
808 [Define 0/1 to force the choice for exception handling model.])])
810 AC_CHECK_LIB(unwind, main, use_libunwind_default=yes, use_libunwind_default=no)
811 # Use libunwind based exception handling.
812 AC_ARG_ENABLE(libunwind-exceptions,
813 [ --enable-libunwind-exceptions force use libunwind for exceptions],
814 use_libunwind_exceptions=$enableval,
815 use_libunwind_exceptions=$use_libunwind_default)
816 if test x"$use_libunwind_exceptions" = xyes; then
817 AC_DEFINE(USE_LIBUNWIND_EXCEPTIONS, 1,
818 [Define if gcc should use -lunwind.])
824 build_install_headers_dir=install-headers-tar
829 host_truncate_target=
832 # Decode the host machine, then the target machine.
833 # For the host machine, we save the xm_file variable as host_xm_file;
834 # then we decode the target machine and forget everything else
835 # that came from the host machine.
836 for machine in $build $host $target; do
837 . ${srcdir}/config.gcc
840 extra_objs="${host_extra_objs} ${extra_objs}"
842 # Default the target-machine variables that were not explicitly set.
843 if test x"$tm_file" = x
844 then tm_file=$cpu_type/$cpu_type.h; fi
846 if test x"$extra_headers" = x
847 then extra_headers=; fi
849 if test x$md_file = x
850 then md_file=$cpu_type/$cpu_type.md; fi
852 if test x$out_file = x
853 then out_file=$cpu_type/$cpu_type.c; fi
855 if test x"$tmake_file" = x
856 then tmake_file=$cpu_type/t-$cpu_type
859 if test x"$dwarf2" = xyes
860 then tm_file="$tm_file tm-dwarf2.h"
863 # Say what files are being used for the output code and MD file.
864 echo "Using \`$srcdir/config/$out_file' for machine-specific logic."
865 echo "Using \`$srcdir/config/$md_file' as machine description file."
867 # If any of the xm_file variables contain nonexistent files, warn
868 # about them and drop them.
871 for x in $build_xm_file; do
872 if test -f $srcdir/config/$x
874 else AC_MSG_WARN($srcdir/config/$x does not exist.)
880 for x in $host_xm_file; do
881 if test -f $srcdir/config/$x
883 else AC_MSG_WARN($srcdir/config/$x does not exist.)
889 for x in $xm_file; do
890 if test -f $srcdir/config/$x
892 else AC_MSG_WARN($srcdir/config/$x does not exist.)
898 for f in $tm_file; do
901 if test $count = ax; then
902 echo "Using \`$srcdir/config/$tm_file' as target machine macro file."
904 echo "Using the following target machine macro files:"
905 for f in $tm_file; do
906 echo " $srcdir/config/$f"
910 if test x$need_64bit_hwint = xyes; then
911 AC_DEFINE(NEED_64BIT_HOST_WIDE_INT, 1,
912 [Define to 1 if HOST_WIDE_INT must be 64 bits wide (see hwint.h).])
916 for f in $host_xm_file; do
919 if test $count = a; then
921 elif test $count = ax; then
922 echo "Using \`$srcdir/config/$host_xm_file' as host machine macro file."
924 echo "Using the following host machine macro files:"
925 for f in $host_xm_file; do
926 echo " $srcdir/config/$f"
930 if test "$host_xm_file" != "$build_xm_file"; then
932 for f in $build_xm_file; do
935 if test $count = a; then
937 elif test $count = ax; then
938 echo "Using \`$srcdir/config/$build_xm_file' as build machine macro file."
940 echo "Using the following build machine macro files:"
941 for f in $build_xm_file; do
942 echo " $srcdir/config/$f"
947 if test x$thread_file = x; then
948 if test x$target_thread_file != x; then
949 thread_file=$target_thread_file
955 # Look for a file containing extra machine modes.
956 if test -n "$extra_modes" && test -f $srcdir/config/$extra_modes; then
957 extra_modes_file='$(srcdir)'/config/${extra_modes}
958 AC_SUBST(extra_modes_file)
959 AC_DEFINE_UNQUOTED(EXTRA_MODES_FILE, "$extra_modes",
960 [Define to the name of a file containing a list of extra machine modes
961 for this architecture.])
962 AC_DEFINE(EXTRA_CC_MODES, 1,
963 [Define if the target architecture needs extra machine modes to represent
964 the results of comparisons.])
967 # auto-host.h is the file containing items generated by autoconf and is
968 # the first file included by config.h.
969 # If host=build, it is correct to have bconfig include auto-host.h
970 # as well. If host!=build, we are in error and need to do more
971 # work to find out the build config parameters.
972 if test x$host = x$build
974 build_auto=auto-host.h
977 # We create a subdir, then run autoconf in the subdir.
978 # To prevent recursion we set host and build for the new
979 # invocation of configure to the build for this invocation
986 /* | [A-Za-z]:[\\/]* ) realsrcdir=${srcdir};;
987 *) realsrcdir=../${srcdir};;
989 saved_CFLAGS="${CFLAGS}"
990 CC="${CC_FOR_BUILD}" CFLAGS="${CFLAGS_FOR_BUILD}" \
991 ${realsrcdir}/configure \
992 --target=$target_alias --host=$build_alias --build=$build_alias
993 CFLAGS="${saved_CFLAGS}"
995 # We just finished tests for the build machine, so rename
996 # the file auto-build.h in the gcc directory.
997 mv auto-host.h ../auto-build.h
1000 build_auto=auto-build.h
1001 FORBUILD=../build-$build_alias
1005 tm_file="${tm_file} defaults.h"
1006 tm_p_file="${tm_p_file} tm-preds.h"
1007 host_xm_file="auto-host.h ansidecl.h ${host_xm_file}"
1008 build_xm_file="${build_auto} ansidecl.h ${build_xm_file}"
1009 xm_file="ansidecl.h ${xm_file}"
1011 # Truncate the target if necessary
1012 if test x$host_truncate_target != x; then
1013 target=`echo $target | sed -e 's/\(..............\).*/\1/'`
1016 # Get the version trigger filename from the toplevel
1017 if test "${with_gcc_version_trigger+set}" = set; then
1018 gcc_version_trigger=$with_gcc_version_trigger
1020 gcc_version_trigger=${srcdir}/version.c
1023 gcc_version_full=`grep version_string ${gcc_version_trigger} | sed -e 's/.*"\([^"]*\)".*/\1/'`
1024 gcc_version=`echo ${gcc_version_full} | sed -e 's/\([^ ]*\) .*/\1/'`
1026 # Compile in configure arguments.
1027 if test -f configargs.h ; then
1028 # Being re-configured.
1029 gcc_config_arguments=`grep configuration_arguments configargs.h | sed -e 's/.*"\([^"]*\)".*/\1/'`
1030 gcc_config_arguments="$gcc_config_arguments : (reconfigured) $TOPLEVEL_CONFIGURE_ARGUMENTS"
1032 gcc_config_arguments="$TOPLEVEL_CONFIGURE_ARGUMENTS"
1034 cat > configargs.h <<EOF
1035 /* Generated automatically. */
1036 static const char configuration_arguments[] = "$gcc_config_arguments";
1037 static const char thread_model[] = "$thread_file";
1041 # Internationalization
1043 VERSION="$gcc_version"
1047 # Enable NLS support by default
1049 [ --enable-nls use Native Language Support (default)],
1052 # if cross compiling, disable NLS support.
1053 # It's not worth the trouble, at least for now.
1055 if test "${build}" != "${host}" && test "x$enable_nls" = "xyes"; then
1056 AC_MSG_WARN(Disabling NLS support for canadian cross compiler.)
1062 # Windows32 Registry support for specifying GCC installation paths.
1063 AC_ARG_ENABLE(win32-registry,
1064 [ --disable-win32-registry
1065 disable lookup of installation paths in the
1066 Registry on Windows hosts
1067 --enable-win32-registry enable registry lookup (default)
1068 --enable-win32-registry=KEY
1069 use KEY instead of GCC version as the last portion
1070 of the registry key],,)
1072 win32 | pe | cygwin* | mingw32* | uwin*)
1073 AC_MSG_CHECKING(whether windows registry support is requested)
1074 if test "x$enable_win32_registry" != xno; then
1075 AC_DEFINE(ENABLE_WIN32_REGISTRY, 1,
1076 [Define to 1 if installation paths should be looked up in Windows32
1077 Registry. Ignored on non windows32 hosts.])
1079 AC_SEARCH_LIBS(RegOpenKeyExA, advapi32)
1084 # Check if user specified a different registry key.
1085 case "x${enable_win32_registry}" in
1088 gcc_cv_win32_registry_key="$VERSION"
1091 # no registry lookup.
1092 gcc_cv_win32_registry_key=''
1095 # user-specified key.
1096 gcc_cv_win32_registry_key="$enable_win32_registry"
1100 if test "x$enable_win32_registry" != xno; then
1101 AC_MSG_CHECKING(registry key on windows hosts)
1102 AC_DEFINE_UNQUOTED(WIN32_REGISTRY_KEY, "$gcc_cv_win32_registry_key",
1103 [Define to be the last portion of registry key on windows hosts.])
1104 AC_MSG_RESULT($gcc_cv_win32_registry_key)
1109 # Get an absolute path to the GCC top-level source directory
1110 holddir=`${PWDCMD-pwd}`
1112 topdir=`${PWDCMD-pwd}`
1115 # Conditionalize the makefile for this host machine.
1116 # Make-host contains the concatenation of all host makefile fragments
1117 # [there can be more than one]. This file is built by configure.frag.
1118 host_overrides=Make-host
1119 dep_host_xmake_file=
1120 for f in .. ${host_xmake_file}
1122 if test -f ${srcdir}/config/$f
1124 dep_host_xmake_file="${dep_host_xmake_file} ${srcdir}/config/$f"
1128 # Conditionalize the makefile for this target machine.
1129 # Make-target contains the concatenation of all host makefile fragments
1130 # [there can be more than one]. This file is built by configure.frag.
1131 target_overrides=Make-target
1133 for f in .. ${tmake_file}
1135 if test -f ${srcdir}/config/$f
1137 dep_tmake_file="${dep_tmake_file} ${srcdir}/config/$f"
1141 # If the host doesn't support symlinks, modify CC in
1142 # FLAGS_TO_PASS so CC="stage1/xgcc -Bstage1/" works.
1143 # Otherwise, we can use "CC=$(CC)".
1145 if $symbolic_link $srcdir/gcc.c symtest.tem 2>/dev/null
1147 cc_set_by_configure="\$(CC)"
1148 quoted_cc_set_by_configure="\$(CC)"
1149 stage_prefix_set_by_configure="\$(STAGE_PREFIX)"
1150 quoted_stage_prefix_set_by_configure="\$(STAGE_PREFIX)"
1153 if cp -p $srcdir/gcc.c symtest.tem 2>/dev/null
1155 symbolic_link="cp -p"
1159 cc_set_by_configure="\`case '\$(CC)' in stage*) echo '\$(CC)' | sed -e 's|stage|../stage|g';; *) echo '\$(CC)';; esac\`"
1160 quoted_cc_set_by_configure="\\\`case '\\\$(CC)' in stage*) echo '\\\$(CC)' | sed -e 's|stage|../stage|g';; *) echo '\\\$(CC)';; esac\\\`"
1161 stage_prefix_set_by_configure="\`case '\$(STAGE_PREFIX)' in stage*) echo '\$(STAGE_PREFIX)' | sed -e 's|stage|../stage|g';; *) echo '\$(STAGE_PREFIX)';; esac\`"
1162 quoted_stage_prefix_set_by_configure="\\\`case '\\\$(STAGE_PREFIX)' in stage*) echo '\\\$(STAGE_PREFIX)' | sed -e 's|stage|../stage|g';; *) echo '\\\$(STAGE_PREFIX)';; esac\\\`"
1166 out_object_file=`basename $out_file .c`.o
1169 for f in $tm_file; do
1172 tm_file_list="${tm_file_list} \$(srcdir)/../include/ansidecl.h" ;;
1174 tm_file_list="${tm_file_list} \$(srcdir)/$f" ;;
1175 *) tm_file_list="${tm_file_list} \$(srcdir)/config/$f" ;;
1180 for f in $tm_p_file; do
1183 tm_p_file_list="${tm_p_file_list} $f" ;;
1184 *) tm_p_file_list="${tm_p_file_list} \$(srcdir)/config/$f" ;;
1189 for f in $host_xm_file; do
1192 host_xm_file_list="${host_xm_file_list} \$(srcdir)/../include/ansidecl.h" ;;
1194 host_xm_file_list="${host_xm_file_list} $f" ;;
1196 host_xm_file_list="${host_xm_file_list} \$(srcdir)/$f" ;;
1197 *) host_xm_file_list="${host_xm_file_list} \$(srcdir)/config/$f" ;;
1202 for f in $build_xm_file; do
1205 build_xm_file_list="${build_xm_file_list} \$(srcdir)/../include/ansidecl.h" ;;
1206 auto-build.h | auto-host.h )
1207 build_xm_file_list="${build_xm_file_list} $f" ;;
1209 host_xm_file_list="${host_xm_file_list} \$(srcdir)/$f" ;;
1210 *) build_xm_file_list="${build_xm_file_list} \$(srcdir)/config/$f" ;;
1214 # Define macro CROSS_COMPILE in compilation if this is a cross-compiler.
1215 # Also use all.cross instead of all.internal and adjust SYSTEM_HEADER_DIR.
1216 CROSS= AC_SUBST(CROSS)
1217 ALL=all.internal AC_SUBST(ALL)
1218 SYSTEM_HEADER_DIR='$(NATIVE_SYSTEM_HEADER_DIR)' AC_SUBST(SYSTEM_HEADER_DIR)
1219 if test x$host != x$target
1221 CROSS="-DCROSS_COMPILE"
1223 SYSTEM_HEADER_DIR='$(CROSS_SYSTEM_HEADER_DIR)'
1224 case "$host","$target" in
1225 i?86-*-*,x86_64-*-* \
1226 | powerpc*-*-*,powerpc64*-*-*)
1227 CROSS="$CROSS -DNATIVE_CROSS" ;;
1231 # If this is a cross-compiler that does not
1232 # have its own set of headers then define
1235 # If this is using newlib, then define inhibit_libc in LIBGCC2_CFLAGS.
1236 # This prevents libgcc2 from containing any code which requires libc
1239 if { test x$host != x$target && test "x$with_headers" = x &&
1240 test "x$with_sysroot" = x ; } || test x$with_newlib = xyes ; then
1241 inhibit_libc=-Dinhibit_libc
1243 AC_SUBST(inhibit_libc)
1245 # When building gcc with a cross-compiler, we need to adjust things so
1246 # that the generator programs are still built with the native compiler.
1247 # Also, we cannot run fixincludes or fix-header.
1249 # These are the normal (build=host) settings:
1250 BUILD_PREFIX= AC_SUBST(BUILD_PREFIX)
1251 BUILD_PREFIX_1=ignore- AC_SUBST(BUILD_PREFIX_1)
1252 BUILD_CC='$(CC)' AC_SUBST(BUILD_CC)
1253 BUILD_CFLAGS='$(ALL_CFLAGS)' AC_SUBST(BUILD_CFLAGS)
1255 STMP_FIXINC=stmp-fixinc AC_SUBST(STMP_FIXINC)
1256 STMP_FIXPROTO=stmp-fixproto AC_SUBST(STMP_FIXPROTO)
1258 # And these apply if build != host.
1259 if test x$build != x$host
1262 BUILD_PREFIX_1=build-
1263 BUILD_CC='$(CC_FOR_BUILD)'
1264 BUILD_CFLAGS='$(INTERNAL_CFLAGS) $(T_CFLAGS) $(CFLAGS_FOR_BUILD) $(XCFLAGS)'
1270 # Expand extra_headers to include complete path.
1271 # This substitutes for lots of t-* files.
1273 if test "x$extra_headers" = x
1276 # Prepend ${srcdir}/config/${cpu_type}/ to every entry in extra_headers.
1277 for file in $extra_headers;
1279 extra_headers_list="${extra_headers_list} \$(srcdir)/config/${cpu_type}/${file}"
1283 if test x$use_collect2 = xno; then
1287 # Add a definition of USE_COLLECT2 if system wants one.
1288 if test x$use_collect2 != x
1290 host_xm_defines="${host_xm_defines} USE_COLLECT2"
1291 xm_defines="${xm_defines} USE_COLLECT2"
1294 # If we have gas in the build tree, make a link to it.
1295 if test -f ../gas/Makefile; then
1296 rm -f as; $symbolic_link ../gas/as-new$host_exeext as$host_exeext 2>/dev/null
1299 # If we have nm and objdump in the build tree, make a link to them.
1300 if test -f ../binutils/Makefile; then
1301 rm -f nm; $symbolic_link ../binutils/nm-new$host_exeext nm$host_exeext 2>/dev/null
1302 rm -f objdump; $symbolic_link ../binutils/objdump$host_exeext objdump$host_exeext 2>/dev/null
1305 # If we have ld in the build tree, make a link to it.
1306 if test -f ../ld/Makefile; then
1307 rm -f collect-ld; $symbolic_link ../ld/ld-new$host_exeext collect-ld$host_exeext 2>/dev/null
1310 # Figure out what assembler we will be using.
1311 AC_MSG_CHECKING(what assembler to use)
1313 gcc_cv_gas_major_version=
1314 gcc_cv_gas_minor_version=
1315 gcc_cv_as_gas_srcdir=`echo $srcdir | sed -e 's,/gcc$,,'`/gas
1316 gcc_cv_as_bfd_srcdir=`echo $srcdir | sed -e 's,/gcc$,,'`/bfd
1317 if test -x "$DEFAULT_ASSEMBLER"; then
1318 gcc_cv_as="$DEFAULT_ASSEMBLER"
1319 elif test -x "$AS"; then
1321 elif test -x as$host_exeext; then
1322 # Build using assembler in the current directory.
1323 gcc_cv_as=./as$host_exeext
1324 elif test -f $gcc_cv_as_gas_srcdir/configure.in -a -f ../gas/Makefile; then
1325 # Single tree build which includes gas.
1326 for f in $gcc_cv_as_bfd_srcdir/configure $gcc_cv_as_gas_srcdir/configure $gcc_cv_as_gas_srcdir/configure.in $gcc_cv_as_gas_srcdir/Makefile.in
1329 gcc_cv_gas_version=`grep '^VERSION=[0-9]*\.[0-9]*' $f`
1331 if test x$gcc_cv_gas_version != x; then
1336 gcc_cv_gas_major_version=`expr "$gcc_cv_gas_version" : "VERSION=\([0-9]*\)"`
1337 gcc_cv_gas_minor_version=`expr "$gcc_cv_gas_version" : "VERSION=[0-9]*\.\([0-9]*\)"`
1338 gcc_cv_gas_patch_version=`expr "$gcc_cv_gas_version" : "VERSION=[0-9]*\.[0-9]*\.\([0-9]*\)"`
1342 if test "x$gcc_cv_as" = x; then
1343 # Search the same directories that the installed compiler will
1344 # search. Else we may find the wrong assembler and lose. If we
1345 # do not find a suitable assembler binary, then try the user's
1348 # Also note we have to check MD_EXEC_PREFIX before checking the
1349 # user's path. Unfortunately, there is no good way to get at the
1350 # value of MD_EXEC_PREFIX here. So we do a brute force search
1351 # through all the known MD_EXEC_PREFIX values. Ugh. This needs
1352 # to be fixed as part of the make/configure rewrite too.
1354 if test "x$exec_prefix" = xNONE; then
1355 if test "x$prefix" = xNONE; then
1356 test_prefix=/usr/local
1361 test_prefix=$exec_prefix
1364 # If the loop below does not find an assembler, then use whatever
1365 # one we can find in the users's path.
1367 if test "x$program_prefix" != xNONE; then
1368 gcc_cv_as=${program_prefix}as$host_exeext
1370 gcc_cv_as=`echo as | sed ${program_transform_name}`$host_exeext
1373 test_dirs="$test_prefix/lib/gcc-lib/$target_alias/$gcc_version \
1374 $test_prefix/lib/gcc-lib/$target_alias \
1375 /usr/lib/gcc/$target_alias/$gcc_version \
1376 /usr/lib/gcc/$target_alias \
1377 $test_prefix/$target_alias/bin/$target_alias/$gcc_version \
1378 $test_prefix/$target_alias/bin"
1380 if test x$host = x$target; then
1381 test_dirs="$test_dirs \
1386 /bsd43/usr/lib/cmplrs/cc \
1387 /usr/cross64/usr/bin \
1388 /usr/lib/cmplrs/cc \
1389 /sysv/usr/lib/cmplrs/cc \
1390 /svr4/usr/lib/cmplrs/cc \
1394 for dir in $test_dirs; do
1395 if test -x $dir/as$host_exeext; then
1396 gcc_cv_as=$dir/as$host_exeext
1401 if test x$gcc_cv_gas_major_version != x -a x$gcc_cv_gas_minor_version != x; then
1402 AC_MSG_RESULT("newly built gas")
1404 AC_MSG_RESULT($gcc_cv_as)
1407 # Figure out what linker we will be using.
1408 AC_MSG_CHECKING(what linker to use)
1410 gcc_cv_gld_major_version=
1411 gcc_cv_gld_minor_version=
1412 gcc_cv_ld_gld_srcdir=`echo $srcdir | sed -e 's,/gcc$,,'`/ld
1413 gcc_cv_ld_bfd_srcdir=`echo $srcdir | sed -e 's,/gcc$,,'`/bfd
1414 if test -x "$DEFAULT_LINKER"; then
1415 gcc_cv_ld="$DEFAULT_LINKER"
1416 elif test -x "$LD"; then
1418 elif test -x ld$host_exeext; then
1419 # Build using linker in the current directory.
1420 gcc_cv_ld=./ld$host_exeext
1421 elif test -f $gcc_cv_ld_gld_srcdir/configure.in -a -f ../ld/Makefile; then
1422 # Single tree build which includes ld.
1423 for f in $gcc_cv_ld_bfd_srcdir/configure $gcc_cv_ld_gld_srcdir/configure $gcc_cv_ld_gld_srcdir/configure.in $gcc_cv_ld_gld_srcdir/Makefile.in
1426 gcc_cv_gld_version=`grep '^VERSION=[0-9]*\.[0-9]*' $f`
1428 if test x$gcc_cv_gld_version != x; then
1433 gcc_cv_gld_major_version=`expr "$gcc_cv_gld_version" : "VERSION=\([0-9]*\)"`
1434 gcc_cv_gld_minor_version=`expr "$gcc_cv_gld_version" : "VERSION=[0-9]*\.\([0-9]*\)"`
1438 if test "x$gcc_cv_ld" = x; then
1439 # Search the same directories that the installed compiler will
1440 # search. Else we may find the wrong linker and lose. If we
1441 # do not find a suitable linker binary, then try the user's
1444 # Also note we have to check MD_EXEC_PREFIX before checking the
1445 # user's path. Unfortunately, there is no good way to get at the
1446 # value of MD_EXEC_PREFIX here. So we do a brute force search
1447 # through all the known MD_EXEC_PREFIX values. Ugh. This needs
1448 # to be fixed as part of the make/configure rewrite too.
1450 if test "x$exec_prefix" = xNONE; then
1451 if test "x$prefix" = xNONE; then
1452 test_prefix=/usr/local
1457 test_prefix=$exec_prefix
1460 # If the loop below does not find an linker, then use whatever
1461 # one we can find in the users's path.
1463 if test "x$program_prefix" != xNONE; then
1464 gcc_cv_ld=${program_prefix}ld$host_exeext
1466 gcc_cv_ld=`echo ld | sed ${program_transform_name}`$host_exeext
1469 test_dirs="$test_prefix/lib/gcc-lib/$target_alias/$gcc_version \
1470 $test_prefix/lib/gcc-lib/$target_alias \
1471 /usr/lib/gcc/$target_alias/$gcc_version \
1472 /usr/lib/gcc/$target_alias \
1473 $test_prefix/$target_alias/bin/$target_alias/$gcc_version \
1474 $test_prefix/$target_alias/bin"
1476 if test x$host = x$target; then
1477 test_dirs="$test_dirs \
1482 /bsd43/usr/lib/cmplrs/cc \
1483 /usr/cross64/usr/bin \
1484 /usr/lib/cmplrs/cc \
1485 /sysv/usr/lib/cmplrs/cc \
1486 /svr4/usr/lib/cmplrs/cc \
1490 for dir in $test_dirs; do
1491 if test -x $dir/ld$host_exeext; then
1492 gcc_cv_ld=$dir/ld$host_exeext
1497 if test x$gcc_cv_gld_major_version != x -a x$gcc_cv_gld_minor_version != x; then
1498 AC_MSG_RESULT("newly built ld")
1500 AC_MSG_RESULT($gcc_cv_ld)
1503 # Figure out what nm we will be using.
1504 AC_MSG_CHECKING(what nm to use)
1505 if test -x nm$host_exeext; then
1506 gcc_cv_nm=./nm$host_exeext
1507 elif test "x$program_prefix" != xNONE; then
1508 gcc_cv_nm=${program_prefix}nm$host_exeext
1510 gcc_cv_nm=`echo nm | sed ${program_transform_name}`$host_exeext
1512 AC_MSG_RESULT($gcc_cv_nm)
1514 # Figure out what objdump we will be using.
1515 AC_MSG_CHECKING(what objdump to use)
1516 if test -x objdump$host_exeext; then
1517 gcc_cv_objdump=./objdump$host_exeext
1518 elif test "x$program_prefix" != xNONE; then
1519 gcc_cv_objdump=${program_prefix}objdump$host_exeext
1521 gcc_cv_objdump=`echo objdump | sed ${program_transform_name}`$host_exeext
1523 AC_MSG_RESULT($gcc_cv_objdump)
1525 # Figure out what assembler alignment features are present.
1526 AC_MSG_CHECKING(assembler alignment features)
1527 gcc_cv_as_alignment_features=none
1528 if test x$gcc_cv_gas_major_version != x -a x$gcc_cv_gas_minor_version != x; then
1529 # Gas version 2.6 and later support for .balign and .p2align.
1530 # bytes to skip when using .p2align.
1531 if test "$gcc_cv_gas_major_version" -eq 2 -a "$gcc_cv_gas_minor_version" -ge 6 -o "$gcc_cv_gas_major_version" -gt 2; then
1532 gcc_cv_as_alignment_features=".balign and .p2align"
1533 AC_DEFINE(HAVE_GAS_BALIGN_AND_P2ALIGN)
1535 # Gas version 2.8 and later support specifying the maximum
1536 # bytes to skip when using .p2align.
1537 if test "$gcc_cv_gas_major_version" -eq 2 -a "$gcc_cv_gas_minor_version" -ge 8 -o "$gcc_cv_gas_major_version" -gt 2; then
1538 gcc_cv_as_alignment_features=".p2align including maximum skip"
1539 AC_DEFINE(HAVE_GAS_MAX_SKIP_P2ALIGN)
1541 elif test x$gcc_cv_as != x; then
1542 # Check if we have .balign and .p2align
1543 echo ".balign 4" > conftest.s
1544 echo ".p2align 2" >> conftest.s
1545 if $gcc_cv_as -o conftest.o conftest.s > /dev/null 2>&1; then
1546 gcc_cv_as_alignment_features=".balign and .p2align"
1547 AC_DEFINE(HAVE_GAS_BALIGN_AND_P2ALIGN)
1549 rm -f conftest.s conftest.o
1550 # Check if specifying the maximum bytes to skip when
1551 # using .p2align is supported.
1552 echo ".p2align 4,,7" > conftest.s
1553 if $gcc_cv_as -o conftest.o conftest.s > /dev/null 2>&1; then
1554 gcc_cv_as_alignment_features=".p2align including maximum skip"
1555 AC_DEFINE(HAVE_GAS_MAX_SKIP_P2ALIGN)
1557 rm -f conftest.s conftest.o
1559 AC_MSG_RESULT($gcc_cv_as_alignment_features)
1561 AC_MSG_CHECKING(assembler subsection support)
1562 gcc_cv_as_subsections=no
1563 if test x$gcc_cv_gas_major_version != x -a x$gcc_cv_gas_minor_version != x; then
1564 if test "$gcc_cv_gas_major_version" -eq 2 -a "$gcc_cv_gas_minor_version" -ge 9 -o "$gcc_cv_gas_major_version" -gt 2 && grep 'obj_format = elf' ../gas/Makefile > /dev/null; then
1565 gcc_cv_as_subsections="working .subsection -1"
1567 elif test x$gcc_cv_as != x; then
1568 # Check if we have .subsection
1569 echo ".subsection 1" > conftest.s
1570 if $gcc_cv_as -o conftest.o conftest.s > /dev/null 2>&1; then
1571 gcc_cv_as_subsections=".subsection"
1572 if test x$gcc_cv_nm != x; then
1573 cat > conftest.s <<EOF
1574 conftest_label1: .word 0
1576 conftest_label2: .word 0
1579 if $gcc_cv_as -o conftest.o conftest.s > /dev/null 2>&1; then
1580 $gcc_cv_nm conftest.o | grep conftest_label1 > conftest.nm1
1581 $gcc_cv_nm conftest.o | grep conftest_label2 | sed -e 's/label2/label1/' > conftest.nm2
1582 if cmp conftest.nm1 conftest.nm2 > /dev/null 2>&1; then
1585 gcc_cv_as_subsections="working .subsection -1"
1590 rm -f conftest.s conftest.o conftest.nm1 conftest.nm2
1592 if test x"$gcc_cv_as_subsections" = x"working .subsection -1"; then
1593 AC_DEFINE(HAVE_GAS_SUBSECTION_ORDERING, 1,
1594 [Define if your assembler supports .subsection and .subsection -1 starts
1595 emitting at the beginning of your section.])
1597 AC_MSG_RESULT($gcc_cv_as_subsections)
1599 AC_MSG_CHECKING(assembler weak support)
1601 if test x$gcc_cv_gas_major_version != x -a x$gcc_cv_gas_minor_version != x; then
1602 if test "$gcc_cv_gas_major_version" -eq 2 -a "$gcc_cv_gas_minor_version" -ge 2 -o "$gcc_cv_gas_major_version" -gt 2; then
1603 gcc_cv_as_weak="yes"
1605 elif test x$gcc_cv_as != x; then
1606 # Check if we have .weak
1607 echo " .weak foobar" > conftest.s
1608 if $gcc_cv_as -o conftest.o conftest.s > /dev/null 2>&1; then
1609 gcc_cv_as_weak="yes"
1611 rm -f conftest.s conftest.o conftest.nm1 conftest.nm2
1613 if test x"$gcc_cv_as_weak" = xyes; then
1614 AC_DEFINE(HAVE_GAS_WEAK, 1, [Define if your assembler supports .weak.])
1616 AC_MSG_RESULT($gcc_cv_as_weak)
1618 AC_MSG_CHECKING(assembler hidden support)
1620 if test x$gcc_cv_gas_major_version != x -a x$gcc_cv_gas_minor_version != x; then
1621 if test "$gcc_cv_gas_major_version" -eq 2 \
1622 -a "$gcc_cv_gas_minor_version" -eq 12 \
1623 -a "$gcc_cv_gas_patch_version" -ge 1 \
1624 -o "$gcc_cv_gas_major_version" -eq 2 \
1625 -a "$gcc_cv_gas_minor_version" -gt 12 \
1626 -o "$gcc_cv_gas_major_version" -gt 2 \
1627 && grep 'obj_format = elf' ../gas/Makefile > /dev/null; then
1628 gcc_cv_as_hidden="yes"
1630 elif test x$gcc_cv_as != x; then
1631 # Check if we have .hidden
1632 echo " .hidden foobar" > conftest.s
1633 echo "foobar:" >> conftest.s
1634 if $gcc_cv_as -o conftest.o conftest.s > /dev/null 2>&1; then
1635 gcc_cv_as_hidden="yes"
1637 rm -f conftest.s conftest.o conftest.nm1 conftest.nm2
1639 # GNU LD versions before 2.12.1 have buggy support for STV_HIDDEN.
1640 # This is irritatingly difficult to feature test for. Look for
1641 # the date string after the version number.
1642 ld_ver=`$gcc_cv_ld --version 2>/dev/null | head -1`
1643 if echo "$ld_ver" | grep GNU > /dev/null; then
1645 ld_vers=`echo $ld_ver | sed -n 's,^.*[ ]\([0-9][0-9]*\.[0-9][0-9]*\(\|\.[0-9][0-9]*\)\)\([ ].*\|\)$,\1,p'`
1646 ld_date=`echo $ld_ver | sed -n 's,^.*\([2-9][0-9][0-9][0-9]\)[-]*\([01][0-9]\)[-]*\([0-3][0-9]\).*$,\1\2\3,p'`
1647 if test 0"$ld_date" -lt 20020404; then
1648 if test -n "$ld_date"; then
1649 # If there was date string, but was earlier than 2002-04-04, fail
1650 gcc_cv_as_hidden="no"
1651 elif test -z "$ld_vers"; then
1652 # If there was no date string nor ld version number, something is wrong
1653 gcc_cv_as_hidden="no"
1655 ld_vers_major=`expr "$ld_vers" : '\([0-9]*\)'`
1656 ld_vers_minor=`expr "$ld_vers" : '[0-9]*\.\([0-9]*\)'`
1657 ld_vers_patch=`expr "$ld_vers" : '[0-9]*\.[0-9]*\.\([0-9]*\)'`
1658 test -z "$ld_vers_patch" && ld_vers_patch=0
1659 if test "$ld_vers_major" -lt 2; then
1660 gcc_cv_as_hidden="no"
1661 elif test "$ld_vers_major" -eq 2 -a "$ld_vers_minor" -lt 12; then
1662 gcc_cv_as_hidden="no"
1663 elif test "$ld_vers_major" -eq 2 -a "$ld_vers_minor" -eq 12 \
1664 -a "$ld_vers_patch" -eq 0; then
1665 gcc_cv_as_hidden="no"
1672 if test x"$gcc_cv_as_hidden" = xyes; then
1673 AC_DEFINE(HAVE_GAS_HIDDEN, 1,
1674 [Define if your assembler supports .hidden.])
1676 AC_MSG_RESULT($gcc_cv_as_hidden)
1677 libgcc_visibility=$gcc_cv_as_hidden
1680 if test x"$gnu_ld_flag" = x"no"; then
1681 # Even if using gas with .hidden support, the resulting object files
1682 # cannot be linked with the IRIX 6 O32 linker.
1683 libgcc_visibility=no
1687 AC_SUBST(libgcc_visibility)
1689 AC_MSG_CHECKING(assembler leb128 support)
1691 if test x$gcc_cv_gas_major_version != x -a x$gcc_cv_gas_minor_version != x; then
1692 if test "$gcc_cv_gas_major_version" -eq 2 -a "$gcc_cv_gas_minor_version" -ge 11 -o "$gcc_cv_gas_major_version" -gt 2 && grep 'obj_format = elf' ../gas/Makefile > /dev/null; then
1693 gcc_cv_as_leb128="yes"
1695 elif test x$gcc_cv_as != x; then
1696 # Check if we have .[us]leb128, and support symbol arithmetic with it.
1697 cat > conftest.s <<EOF
1705 if $gcc_cv_as -o conftest.o conftest.s > /dev/null 2>&1; then
1706 gcc_cv_as_leb128="yes"
1708 # GAS versions before 2.11 do not support uleb128,
1709 # despite appearing to.
1710 # ??? There exists an elf-specific test that will crash
1711 # the assembler. Perhaps it's better to figure out whether
1712 # arbitrary sections are supported and try the test.
1713 as_ver=`$gcc_cv_as --version 2>/dev/null | head -1`
1714 if echo "$as_ver" | grep GNU > /dev/null; then
1716 as_ver=`echo $as_ver | sed -e 's/GNU assembler \([0-9.][0-9.]*\).*/\1/'`
1717 as_major=`echo $as_ver | sed 's/\..*//'`
1718 as_minor=`echo $as_ver | sed 's/[^.]*\.\([0-9]*\).*/\1/'`
1720 if test $as_major -eq 2 -a $as_minor -lt 11; then
1721 gcc_cv_as_leb128="no"
1725 rm -f conftest.s conftest.o conftest.nm1 conftest.nm2
1727 if test x"$gcc_cv_as_leb128" = xyes; then
1728 AC_DEFINE(HAVE_AS_LEB128, 1,
1729 [Define if your assembler supports .uleb128.])
1731 AC_MSG_RESULT($gcc_cv_as_leb128)
1733 AC_MSG_CHECKING(assembler eh_frame optimization)
1734 gcc_cv_as_eh_frame=no
1735 if test x$gcc_cv_gas_major_version != x -a x$gcc_cv_gas_minor_version != x; then
1736 if test "$gcc_cv_gas_major_version" -eq 2 -a "$gcc_cv_gas_minor_version" -ge 12 -o "$gcc_cv_gas_major_version" -gt 2 && grep 'obj_format = elf' ../gas/Makefile > /dev/null; then
1737 gcc_cv_as_eh_frame="yes"
1739 elif test x$gcc_cv_as != x; then
1740 # Check if this is GAS.
1741 as_ver=`$gcc_cv_as --version < /dev/null 2> /dev/null | head -1`
1742 rm -f a.out 2> /dev/null
1743 if echo "$as_ver" | grep GNU > /dev/null; then
1744 # Versions up to and including 2.11.0 may mis-optimize
1745 # .eh_frame data. Try something.
1746 cat > conftest.s <<EOF
1753 .section .eh_frame,"aw",@progbits
1755 .4byte .LECIE1-.LSCIE1
1769 .4byte .LEFDE1-.LASFDE1
1771 .4byte .LASFDE1-__FRAME_BEGIN__
1780 cat > conftest.lit <<EOF
1781 0000 10000000 00000000 017a0001 781a0004 .........z..x...
1782 0010 01000000 12000000 18000000 00000000 ................
1783 0020 08000000 04080000 0044 .........D
1785 cat > conftest.big <<EOF
1786 0000 00000010 00000000 017a0001 781a0004 .........z..x...
1787 0010 00000001 00000012 00000018 00000000 ................
1788 0020 00000008 04000000 0844 .........D
1790 # If the assembler didn't choke, and we can objdump,
1791 # and we got the correct data, then succeed.
1792 if $gcc_cv_as -o conftest.o conftest.s > /dev/null 2>&1 \
1793 && $gcc_cv_objdump -s -j .eh_frame conftest.o 2>/dev/null \
1794 | tail -3 > conftest.got \
1795 && { cmp conftest.lit conftest.got > /dev/null 2>&1 \
1796 || cmp conftest.big conftest.got > /dev/null 2>&1; }
1798 gcc_cv_as_eh_frame="yes"
1800 gcc_cv_as_eh_frame="bad"
1801 if $gcc_cv_as -o conftest.o --traditional-format /dev/null; then
1802 AC_DEFINE(USE_AS_TRADITIONAL_FORMAT, 1,
1803 [Define if your assembler mis-optimizes .eh_frame data.])
1809 AC_MSG_RESULT($gcc_cv_as_eh_frame)
1811 AC_MSG_CHECKING(assembler section merging support)
1812 gcc_cv_as_shf_merge=no
1813 if test x$gcc_cv_gas_major_version != x -a x$gcc_cv_gas_minor_version != x; then
1814 if test "$gcc_cv_gas_major_version" -eq 2 -a "$gcc_cv_gas_minor_version" -ge 12 -o "$gcc_cv_gas_major_version" -gt 2 && grep 'obj_format = elf' ../gas/Makefile > /dev/null; then
1815 gcc_cv_as_shf_merge=yes
1817 elif test x$gcc_cv_as != x; then
1818 # Check if we support SHF_MERGE sections
1819 echo '.section .rodata.str, "aMS", @progbits, 1' > conftest.s
1820 if $gcc_cv_as --fatal-warnings -o conftest.o conftest.s > /dev/null 2>&1; then
1821 gcc_cv_as_shf_merge=yes
1823 rm -f conftest.s conftest.o
1825 if test x"$gcc_cv_as_shf_merge" = xyes; then
1826 AC_DEFINE(HAVE_GAS_SHF_MERGE, 1,
1827 [Define if your assembler supports marking sections with SHF_MERGE flag.])
1829 AC_MSG_RESULT($gcc_cv_as_shf_merge)
1831 AC_MSG_CHECKING(assembler thread-local storage support)
1840 .section ".tdata","awT",@progbits
1843 ldq $27,__tls_get_addr($29) !literal!1
1844 lda $16,foo($29) !tlsgd!1
1845 jsr $26,($27),__tls_get_addr !lituse_tlsgd!1
1846 ldq $27,__tls_get_addr($29) !literal!2
1847 lda $16,foo($29) !tlsldm!2
1848 jsr $26,($27),__tls_get_addr !lituse_tlsldm!2
1849 ldq $1,foo($29) !gotdtprel
1850 ldah $2,foo($29) !dtprelhi
1851 lda $3,foo($2) !dtprello
1852 lda $4,foo($29) !dtprel
1853 ldq $1,foo($29) !gottprel
1854 ldah $2,foo($29) !tprelhi
1855 lda $3,foo($2) !tprello
1856 lda $4,foo($29) !tprel'
1863 .section ".tdata","awT",@progbits
1867 leal foo@TLSGD(,%ebx,1), %eax
1868 leal foo@TLSLDM(%ebx), %eax
1869 leal foo@DTPOFF(%eax), %edx
1870 movl foo@GOTTPOFF(%ebx), %eax
1871 subl foo@GOTTPOFF(%ebx), %eax
1872 addl foo@GOTNTPOFF(%ebx), %eax
1873 movl foo@INDNTPOFF, %eax
1874 movl $foo@TPOFF, %eax
1875 subl $foo@TPOFF, %eax
1876 leal foo@NTPOFF(%ecx), %eax'
1882 .section ".tdata","awT",@progbits
1886 leaq foo@TLSGD(%rip), %rdi
1887 leaq foo@TLSLD(%rip), %rdi
1888 leaq foo@DTPOFF(%rax), %rdx
1889 movq foo@GOTTPOFF(%rip), %rax
1890 movq $foo@TPOFF, %rax'
1896 .section ".tdata","awT",@progbits
1899 addl r16 = @ltoff(@dtpmod(foo#)), gp
1900 addl r17 = @ltoff(@dtprel(foo#)), gp
1901 addl r18 = @ltoff(@tprel(foo#)), gp
1902 addl r19 = @dtprel(foo#), gp
1903 adds r21 = @dtprel(foo#), r13
1904 movl r23 = @dtprel(foo#)
1905 addl r20 = @tprel(foo#), gp
1906 adds r22 = @tprel(foo#), r13
1907 movl r24 = @tprel(foo#)'
1912 if test -z "$tls_first_major"; then
1914 elif test x$gcc_cv_gas_major_version != x -a x$gcc_cv_gas_minor_version != x
1916 if test "$gcc_cv_gas_major_version" -eq "$tls_first_major" \
1917 -a "$gcc_cv_gas_minor_version" -ge "$tls_first_minor" \
1918 -o "$gcc_cv_gas_major_version" -gt "$tls_first_major"; then
1921 elif test x$gcc_cv_as != x; then
1922 echo "$conftest_s" > conftest.s
1923 if $gcc_cv_as --fatal-warnings -o conftest.o conftest.s > /dev/null 2>&1
1927 rm -f conftest.s conftest.o
1929 if test "$gcc_cv_as_tls" = yes; then
1930 AC_DEFINE(HAVE_AS_TLS, 1,
1931 [Define if your assembler supports thread-local storage.])
1933 AC_MSG_RESULT($gcc_cv_as_tls)
1936 # All TARGET_ABI_OSF targets.
1937 alpha*-*-osf* | alpha*-*-linux* | alpha*-*-*bsd*)
1938 AC_CACHE_CHECK([assembler supports explicit relocations],
1939 gcc_cv_as_explicit_relocs, [
1940 gcc_cv_as_explicit_relocs=unknown
1941 if test x$gcc_cv_gas_major_version != x \
1942 -a x$gcc_cv_gas_minor_version != x
1944 if test "$gcc_cv_gas_major_version" -eq 2 \
1945 -a "$gcc_cv_gas_minor_version" -ge 12 \
1946 -o "$gcc_cv_gas_major_version" -gt 2; then
1947 gcc_cv_as_explicit_relocs=yes
1949 elif test x$gcc_cv_as != x; then
1950 cat > conftest.s << 'EOF'
1953 extbl $3, $2, $3 !lituse_bytoff!1
1954 ldq $2, a($29) !literal!1
1955 ldq $4, b($29) !literal!2
1956 ldq_u $3, 0($2) !lituse_base!1
1957 ldq $27, f($29) !literal!5
1958 jsr $26, ($27), f !lituse_jsr!5
1959 ldah $29, 0($26) !gpdisp!3
1960 lda $0, c($29) !gprel
1961 ldah $1, d($29) !gprelhigh
1962 lda $1, d($1) !gprellow
1963 lda $29, 0($29) !gpdisp!3
1965 if $gcc_cv_as -o conftest.o conftest.s > /dev/null 2>&1; then
1966 gcc_cv_as_explicit_relocs=yes
1968 gcc_cv_as_explicit_relocs=no
1970 rm -f conftest.s conftest.o
1973 if test "x$gcc_cv_as_explicit_relocs" = xyes; then
1974 AC_DEFINE(HAVE_AS_EXPLICIT_RELOCS, 1,
1975 [Define if your assembler supports explicit relocations.])
1979 AC_CACHE_CHECK([assembler .register pseudo-op support],
1980 gcc_cv_as_register_pseudo_op, [
1981 gcc_cv_as_register_pseudo_op=unknown
1982 if test x$gcc_cv_as != x; then
1983 # Check if we have .register
1984 echo ".register %g2, #scratch" > conftest.s
1985 if $gcc_cv_as -o conftest.o conftest.s > /dev/null 2>&1; then
1986 gcc_cv_as_register_pseudo_op=yes
1988 gcc_cv_as_register_pseudo_op=no
1990 rm -f conftest.s conftest.o
1993 if test "x$gcc_cv_as_register_pseudo_op" = xyes; then
1994 AC_DEFINE(HAVE_AS_REGISTER_PSEUDO_OP, 1,
1995 [Define if your assembler supports .register.])
1998 AC_CACHE_CHECK([assembler supports -relax],
1999 gcc_cv_as_relax_opt, [
2000 gcc_cv_as_relax_opt=unknown
2001 if test x$gcc_cv_as != x; then
2002 # Check if gas supports -relax
2003 echo ".text" > conftest.s
2004 if $gcc_cv_as -relax -o conftest.o conftest.s > /dev/null 2>&1; then
2005 gcc_cv_as_relax_opt=yes
2007 gcc_cv_as_relax_opt=no
2009 rm -f conftest.s conftest.o
2012 if test "x$gcc_cv_as_relax_opt" = xyes; then
2013 AC_DEFINE(HAVE_AS_RELAX_OPTION, 1,
2014 [Define if your assembler supports -relax option.])
2017 AC_CACHE_CHECK([assembler and linker support unaligned pc related relocs],
2018 gcc_cv_as_sparc_ua_pcrel, [
2019 gcc_cv_as_sparc_ua_pcrel=unknown
2020 if test x$gcc_cv_as != x -a x$gcc_cv_ld != x; then
2021 gcc_cv_as_sparc_ua_pcrel=no
2022 echo ".text; foo: nop; .data; .align 4; .byte 0; .uaword %r_disp32(foo)" > conftest.s
2023 if $gcc_cv_as -K PIC -o conftest.o conftest.s > /dev/null 2>&1 \
2024 && $gcc_cv_ld -o conftest conftest.o -G > /dev/null 2>&1; then
2025 gcc_cv_as_sparc_ua_pcrel=yes
2027 rm -f conftest.s conftest.o conftest
2030 if test "x$gcc_cv_as_sparc_ua_pcrel" = xyes; then
2031 AC_DEFINE(HAVE_AS_SPARC_UA_PCREL, 1,
2032 [Define if your assembler and linker support unaligned PC relative relocs.])
2035 AC_CACHE_CHECK([assembler and linker support unaligned pc related relocs against hidden symbols],
2036 gcc_cv_as_sparc_ua_pcrel_hidden, [
2037 if test "x$gcc_cv_as_sparc_ua_pcrel" = xyes; then
2038 gcc_cv_as_sparc_ua_pcrel_hidden=unknown
2039 if test x$gcc_cv_objdump != x; then
2040 gcc_cv_as_sparc_ua_pcrel_hidden=no
2041 echo ".data; .align 4; .byte 0x31; .uaword %r_disp32(foo)" > conftest.s
2042 echo ".byte 0x32, 0x33, 0x34; .global foo; .hidden foo" >> conftest.s
2043 echo "foo: .skip 4" >> conftest.s
2044 if $gcc_cv_as -K PIC -o conftest.o conftest.s > /dev/null 2>&1 \
2045 && $gcc_cv_ld -o conftest conftest.o -G > /dev/null 2>&1 \
2046 && $gcc_cv_objdump -s -j .data conftest 2> /dev/null \
2047 | grep ' 31000000 07323334' > /dev/null 2>&1; then
2048 if $gcc_cv_objdump -R conftest 2> /dev/null \
2049 | grep 'DISP32' > /dev/null 2>&1; then
2052 gcc_cv_as_sparc_ua_pcrel_hidden=yes
2056 rm -f conftest.s conftest.o conftest
2058 gcc_cv_as_sparc_ua_pcrel_hidden="$gcc_cv_as_sparc_ua_pcrel"
2061 if test "x$gcc_cv_as_sparc_ua_pcrel_hidden" = xyes; then
2062 AC_DEFINE(HAVE_AS_SPARC_UA_PCREL_HIDDEN, 1,
2063 [Define if your assembler and linker support unaligned PC relative relocs against hidden symbols.])
2066 AC_CACHE_CHECK([for assembler offsetable %lo() support],
2067 gcc_cv_as_offsetable_lo10, [
2068 gcc_cv_as_offsetable_lo10=unknown
2069 if test "x$gcc_cv_as" != x; then
2070 # Check if assembler has offsetable %lo()
2071 echo "or %g1, %lo(ab) + 12, %g1" > conftest.s
2072 echo "or %g1, %lo(ab + 12), %g1" > conftest1.s
2073 if $gcc_cv_as -xarch=v9 -o conftest.o conftest.s \
2075 $gcc_cv_as -xarch=v9 -o conftest1.o conftest1.s \
2076 > /dev/null 2>&1; then
2077 if cmp conftest.o conftest1.o > /dev/null 2>&1; then
2078 gcc_cv_as_offsetable_lo10=no
2080 gcc_cv_as_offsetable_lo10=yes
2083 gcc_cv_as_offsetable_lo10=no
2085 rm -f conftest.s conftest.o conftest1.s conftest1.o
2088 if test "x$gcc_cv_as_offsetable_lo10" = xyes; then
2089 AC_DEFINE(HAVE_AS_OFFSETABLE_LO10, 1,
2090 [Define if your assembler supports offsetable %lo().])
2096 i[34567]86-*-* | x86_64-*-*)
2098 AC_MSG_CHECKING(assembler instructions)
2099 gcc_cv_as_instructions=
2100 if test x$gcc_cv_gas_major_version != x -a x$gcc_cv_gas_minor_version != x; then
2101 if test "$gcc_cv_gas_major_version" -eq 2 -a "$gcc_cv_gas_minor_version" -ge 9 -o "$gcc_cv_gas_major_version" -gt 2; then
2102 gcc_cv_as_instructions="filds fists"
2104 elif test x$gcc_cv_as != x; then
2105 set "filds fists" "filds mem; fists mem"
2108 echo "$2" > conftest.s
2109 if $gcc_cv_as -o conftest.o conftest.s > /dev/null 2>&1; then
2110 gcc_cv_as_instructions=${gcc_cv_as_instructions}$1" "
2114 rm -f conftest.s conftest.o
2116 if test x"$gcc_cv_as_instructions" != x; then
2117 AC_DEFINE_UNQUOTED(HAVE_GAS_`echo "$gcc_cv_as_instructions" | sed -e 's/ $//' | tr '[a-z ]' '[A-Z_]'`)
2119 AC_MSG_RESULT($gcc_cv_as_instructions)
2121 AC_MSG_CHECKING(assembler GOTOFF in data directives)
2122 gcc_cv_as_gotoff_in_data=no
2123 if test x$gcc_cv_gas_major_version != x -a x$gcc_cv_gas_minor_version != x
2125 if test "$gcc_cv_gas_major_version" -eq 2 \
2126 -a "$gcc_cv_gas_minor_version" -ge 11 \
2127 -o "$gcc_cv_gas_major_version" -gt 2; then
2128 gcc_cv_as_gotoff_in_data=yes
2130 elif test x$gcc_cv_as != x; then
2131 cat > conftest.s <<EOF
2138 if $gcc_cv_as -o conftest.o conftest.s > /dev/null 2>&1; then
2139 gcc_cv_as_gotoff_in_data=yes
2142 AC_DEFINE_UNQUOTED(HAVE_AS_GOTOFF_IN_DATA,
2143 [`if test $gcc_cv_as_gotoff_in_data = yes; then echo 1; else echo 0; fi`],
2144 [Define true if the assembler supports '.long foo@GOTOFF'.])
2145 AC_MSG_RESULT($gcc_cv_as_gotoff_in_data)
2149 AC_MSG_CHECKING(assembler dwarf2 debug_line support)
2150 gcc_cv_as_dwarf2_debug_line=no
2151 # ??? Not all targets support dwarf2 debug_line, even within a version
2152 # of gas. Moreover, we need to emit a valid instruction to trigger any
2153 # info to the output file. So, as supported targets are added to gas 2.11,
2154 # add some instruction here to (also) show we expect this might work.
2155 # ??? Once 2.11 is released, probably need to add first known working
2156 # version to the per-target configury.
2158 i?86*-*-* | mips*-*-* | alpha*-*-* | powerpc*-*-* | sparc*-*-* | m68*-*-* \
2159 | x86_64*-*-* | hppa*-*-* | arm*-*-* | strongarm*-*-* | xscale*-*-*)
2166 if test x$gcc_cv_gas_major_version != x -a x$gcc_cv_gas_minor_version != x;
2168 if test "$gcc_cv_gas_major_version" -eq 2 \
2169 -a "$gcc_cv_gas_minor_version" -ge 11 \
2170 -o "$gcc_cv_gas_major_version" -gt 2 \
2171 && grep 'obj_format = elf' ../gas/Makefile > /dev/null \
2172 && test x"$insn" != x ; then
2173 gcc_cv_as_dwarf2_debug_line="yes"
2175 elif test x$gcc_cv_as != x -a x"$insn" != x ; then
2176 echo ' .file 1 "conftest.s"' > conftest.s
2177 echo ' .loc 1 3 0' >> conftest.s
2178 echo " $insn" >> conftest.s
2179 # ??? This fails with non-gnu grep.
2180 if $gcc_cv_as -o conftest.o conftest.s > /dev/null 2>&1 \
2181 && grep debug_line conftest.o > /dev/null 2>&1 ; then
2182 # The .debug_line file table must be in the exact order that
2183 # we specified the files, since these indices are also used
2184 # by DW_AT_decl_file. Approximate this test by testing if
2185 # the assembler bitches if the same index is assigned twice.
2186 echo ' .file 1 "foo.s"' > conftest.s
2187 echo ' .file 1 "bar.s"' >> conftest.s
2188 if $gcc_cv_as -o conftest.o conftest.s > /dev/null 2>&1
2190 gcc_cv_as_dwarf2_debug_line="no"
2192 gcc_cv_as_dwarf2_debug_line="yes"
2195 rm -f conftest.s conftest.o conftest.nm1 conftest.nm2
2197 if test x"$gcc_cv_as_dwarf2_debug_line" = xyes; then
2198 AC_DEFINE(HAVE_AS_DWARF2_DEBUG_LINE, 1,
2199 [Define if your assembler supports dwarf2 .file/.loc directives,
2200 and preserves file table indices exactly as given.])
2202 AC_MSG_RESULT($gcc_cv_as_dwarf2_debug_line)
2204 AC_MSG_CHECKING(assembler --gdwarf2 support)
2205 gcc_cv_as_gdwarf2_flag=no
2206 if test x$gcc_cv_gas_major_version != x -a x$gcc_cv_gas_minor_version != x;
2208 if test "$gcc_cv_gas_major_version" -eq 2 \
2209 -a "$gcc_cv_gas_minor_version" -ge 11 \
2210 -o "$gcc_cv_gas_major_version" -gt 2 \
2211 && grep 'obj_format = elf' ../gas/Makefile > /dev/null \
2212 && test x"$insn" != x ; then
2213 gcc_cv_as_gdwarf2_flag="yes"
2215 elif test x$gcc_cv_as != x -a x"$insn" != x ; then
2216 echo '' > conftest.s
2217 # ??? This fails with non-gnu grep.
2218 if $gcc_cv_as --gdwarf2 -o conftest.o conftest.s > /dev/null 2>&1
2220 gcc_cv_as_gdwarf2_flag="yes"
2222 rm -f conftest.s conftest.o
2224 if test x"$gcc_cv_as_gdwarf2_flag" = xyes; then
2225 AC_DEFINE(HAVE_AS_GDWARF2_DEBUG_FLAG, 1,
2226 [Define if your assembler supports the --gdwarf2 option.])
2228 AC_MSG_RESULT($gcc_cv_as_gdwarf2_flag)
2230 AC_MSG_CHECKING(assembler --gstabs support)
2231 gcc_cv_as_gstabs_flag=no
2232 if test x$gcc_cv_gas_major_version != x -a x$gcc_cv_gas_minor_version != x;
2234 if test "$gcc_cv_gas_major_version" -eq 2 \
2235 -a "$gcc_cv_gas_minor_version" -ge 11 \
2236 -o "$gcc_cv_gas_major_version" -gt 2 \
2237 && grep 'obj_format = elf' ../gas/Makefile > /dev/null \
2238 && test x"$insn" != x ; then
2239 gcc_cv_as_gstabs_flag="yes"
2241 elif test x$gcc_cv_as != x -a x"$insn" != x ; then
2242 echo '' > conftest.s
2243 # ??? This fails with non-gnu grep.
2244 if $gcc_cv_as --gstabs -o conftest.o conftest.s > /dev/null 2>&1 ; then
2245 gcc_cv_as_gstabs_flag="yes"
2247 rm -f conftest.s conftest.o
2249 if test x"$gcc_cv_as_gstabs_flag" = xyes; then
2250 AC_DEFINE(HAVE_AS_GSTABS_DEBUG_FLAG, 1,
2251 [Define if your assembler supports the --gstabs option.])
2253 AC_MSG_RESULT($gcc_cv_as_gstabs_flag)
2255 AC_MSG_CHECKING(linker read-only and read-write section mixing)
2256 gcc_cv_ld_ro_rw_mix=unknown
2257 if test x$gcc_cv_gld_major_version != x -a x$gcc_cv_gld_minor_version != x; then
2258 if test "$gcc_cv_gld_major_version" -eq 2 -a "$gcc_cv_gld_minor_version" -ge 10 -o "$gcc_cv_gld_major_version" -gt 2 && grep 'EMUL = elf' ../ld/Makefile > /dev/null; then
2259 gcc_cv_ld_ro_rw_mix=read-write
2261 elif test x$gcc_cv_as != x -a x$gcc_cv_ld != x -a x$gcc_cv_objdump != x ; then
2262 echo '.section "myfoosect", "a"' > conftest1.s
2263 echo '.section "myfoosect", "aw"' > conftest2.s
2264 echo '.byte 1' >> conftest2.s
2265 echo '.section "myfoosect", "a"' > conftest3.s
2266 echo '.byte 0' >> conftest3.s
2267 if $gcc_cv_as -o conftest1.o conftest1.s \
2268 && $gcc_cv_as -o conftest2.o conftest2.s \
2269 && $gcc_cv_as -o conftest3.o conftest3.s \
2270 && $gcc_cv_ld -shared -o conftest1.so conftest1.o \
2271 conftest2.o conftest3.o; then
2272 gcc_cv_ld_ro_rw_mix=`$gcc_cv_objdump -h conftest1.so \
2273 | grep -A1 myfoosect`
2274 if echo "$gcc_cv_ld_ro_rw_mix" | grep CONTENTS > /dev/null; then
2275 if echo "$gcc_cv_ld_ro_rw_mix" | grep READONLY > /dev/null; then
2276 gcc_cv_ld_ro_rw_mix=read-only
2278 gcc_cv_ld_ro_rw_mix=read-write
2283 rm -f conftest.* conftest[123].*
2286 if test x$gcc_cv_ld_ro_rw_mix = xread-write; then
2287 AC_DEFINE(HAVE_LD_RO_RW_SECTION_MIXING, 1,
2288 [Define if your linker links a mix of read-only
2289 and read-write sections into a read-write section.])
2291 AC_MSG_RESULT($gcc_cv_ld_ro_rw_mix)
2293 AC_MSG_CHECKING(linker PT_GNU_EH_FRAME support)
2294 gcc_cv_ld_eh_frame_hdr=no
2295 if test x$gcc_cv_gld_major_version != x -a x$gcc_cv_gld_minor_version != x; then
2296 if test "$gcc_cv_gld_major_version" -eq 2 -a "$gcc_cv_gld_minor_version" -ge 12 -o "$gcc_cv_gld_major_version" -gt 2 && grep 'EMUL = elf' ../ld/Makefile > /dev/null; then
2297 gcc_cv_ld_eh_frame_hdr=yes
2299 elif test x$gcc_cv_ld != x; then
2300 # Check if linker supports --eh-frame-hdr option
2301 if $gcc_cv_ld --help 2>/dev/null | grep eh-frame-hdr > /dev/null; then
2302 gcc_cv_ld_eh_frame_hdr=yes
2305 if test x"$gcc_cv_ld_eh_frame_hdr" = xyes; then
2306 AC_DEFINE(HAVE_LD_EH_FRAME_HDR, 1,
2307 [Define if your linker supports --eh-frame-hdr option.])
2309 AC_MSG_RESULT($gcc_cv_ld_eh_frame_hdr)
2311 # Miscellaneous target-specific checks.
2314 AC_MSG_CHECKING(whether libgloss uses STARTUP directives consistently)
2315 gcc_cv_mips_libgloss_startup=no
2316 gcc_cv_libgloss_srcdir=`echo $srcdir | sed -e 's,/gcc$,,'`/libgloss
2317 if test "x$exec_prefix" = xNONE; then
2318 if test "x$prefix" = xNONE; then
2319 test_prefix=/usr/local
2324 test_prefix=$exec_prefix
2326 for f in $gcc_cv_libgloss_srcdir/mips/idt.ld $test_prefix/$target_alias/lib/idt.ld
2328 if grep '^STARTUP' $f > /dev/null 2>&1; then
2329 gcc_cv_mips_libgloss_startup=yes
2333 if test x"$gcc_cv_mips_libgloss_startup" = xyes; then
2334 AC_DEFINE(HAVE_MIPS_LIBGLOSS_STARTUP_DIRECTIVES, 1,
2335 [Define if your MIPS libgloss linker scripts consistently include STARTUP directives.])
2337 AC_MSG_RESULT($gcc_cv_mips_libgloss_startup)
2341 if test "$prefix" != "/usr" && test "x$prefix" != "x$local_prefix" ; then
2342 AC_DEFINE_UNQUOTED(PREFIX_INCLUDE_DIR, "$prefix/include")
2345 # Figure out what language subdirectories are present.
2346 # Look if the user specified --enable-languages="..."; if not, use
2347 # the environment variable $LANGUAGES if defined. $LANGUAGES might
2349 # NB: embedded tabs in this IF block -- do not untabify
2350 if test x"${enable_languages+set}" != xset; then
2351 if test x"${LANGUAGES+set}" = xset; then
2352 enable_languages="${LANGUAGES}"
2353 AC_MSG_WARN([setting LANGUAGES is deprecated, use --enable-languages instead])
2356 enable_languages=all
2359 if test x"${enable_languages}" = x \
2360 || test x"${enable_languages}" = xyes;
2362 AC_MSG_ERROR([--enable-languages needs at least one language argument])
2365 enable_languages=`echo "${enable_languages}" | sed -e 's/[[ ,]][[ ,]]*/,/g' -e 's/,$//'`
2367 # First scan to see if an enabled language requires some other language.
2368 # We assume that a given config-lang.in will list all the language
2369 # front ends it requires, even if some are required indirectly.
2370 for lang in ${srcdir}/*/config-lang.in ..
2375 # The odd quoting in the next line works around
2376 # an apparent bug in bash 1.12 on linux.
2378 ${srcdir}/[*]/config-lang.in)
2381 lang_alias=`sed -n -e 's,^language=['"'"'"'"]\(.*\)["'"'"'"'].*$,\1,p' -e 's,^language=\([^ ]*\).*$,\1,p' $lang`
2382 this_lang_requires=`sed -n -e 's,^lang_requires=['"'"'"'"]\(.*\)["'"'"'"'].*$,\1,p' -e 's,^lang_requires=\([^ ]*\).*$,\1,p' $lang`
2383 for other in $this_lang_requires
2385 case ,${enable_languages}, in
2391 enable_languages="$enable_languages,$other"
2400 expected_languages=`echo ,${enable_languages}, | sed -e 's:,: :g' -e 's: *: :g' -e 's: *: :g' -e 's:^ ::' -e 's: $::'`
2403 for lang in ${srcdir}/*/config-lang.in ..
2407 # The odd quoting in the next line works around
2408 # an apparent bug in bash 1.12 on linux.
2410 ${srcdir}/[*]/config-lang.in) ;;
2412 lang_alias=`sed -n -e 's,^language=['"'"'"'"]\(.*\)["'"'"'"'].*$,\1,p' -e 's,^language=\([^ ]*\).*$,\1,p' $lang`
2413 this_lang_libs=`sed -n -e 's,^target_libs=['"'"'"'"]\(.*\)["'"'"'"'].*$,\1,p' -e 's,^target_libs=\([^ ]*\).*$,\1,p' $lang`
2414 build_by_default=`sed -n -e 's,^build_by_default=['"'"'"'"]\(.*\)["'"'"'"'].*$,\1,p' -e 's,^build_by_default=\([^ ]*\).*$,\1,p' $lang`
2415 if test "x$lang_alias" = x
2417 echo "$lang doesn't set \$language." 1>&2
2420 case ${build_by_default},${enable_languages}, in
2421 *,$lang_alias,*) add_this_lang=yes ;;
2422 no,*) add_this_lang=no ;;
2423 *,all,*) add_this_lang=yes ;;
2424 *) add_this_lang=no ;;
2426 found_languages="${found_languages} ${lang_alias}"
2427 if test x"${add_this_lang}" = xyes; then
2429 ${srcdir}/ada/config-lang.in)
2430 if test x$have_gnat = xyes ; then
2431 subdirs="$subdirs `echo $lang | sed -e 's,^.*/\([^/]*\)/config-lang.in$,\1,'`"
2435 subdirs="$subdirs `echo $lang | sed -e 's,^.*/\([^/]*\)/config-lang.in$,\1,'`"
2445 for expected_language in ${expected_languages} ..
2447 if test "${expected_language}" != ..; then
2448 missing_language="${expected_language}"
2449 if test "${expected_language}" = "c" \
2450 || test "${expected_language}" = "all"; then
2453 for found_language in ${found_languages} ..
2455 if test "${found_language}" != ..; then
2456 if test "${expected_language}" = "${found_language}"; then
2461 if test "x${missing_language}" != x; then
2462 missing_languages="${missing_languages} ${missing_language}"
2467 if test "x$missing_languages" != x; then
2469 The following requested languages were not found:${missing_languages}
2470 The following languages were available: c${found_languages}])
2473 # Make gthr-default.h if we have a thread file.
2475 if test $thread_file != single; then
2476 rm -f gthr-default.h
2477 echo "#include \"gthr-${thread_file}.h\"" > gthr-default.h
2478 gthread_flags=-DHAVE_GTHR_DEFAULT
2480 AC_SUBST(gthread_flags)
2482 # Find out what GC implementation we want, or may, use.
2484 [ --with-gc={simple,page} choose the garbage collection mechanism to use
2491 AC_MSG_ERROR([$withval is an invalid option to --with-gc])
2496 echo "Using $GGC for garbage collection."
2498 # Use the system's zlib library.
2500 zlibinc="-I\$(srcdir)/../zlib"
2501 AC_ARG_WITH(system-zlib,
2502 [ --with-system-zlib use installed libz],
2509 dnl Very limited version of automake's enable-maintainer-mode
2511 AC_MSG_CHECKING([whether to enable maintainer-specific portions of Makefiles])
2512 dnl maintainer-mode is disabled by default
2513 AC_ARG_ENABLE(maintainer-mode,
2514 [ --enable-maintainer-mode
2515 enable make rules and dependencies not useful
2516 (and sometimes confusing) to the casual installer],
2517 maintainer_mode=$enableval,
2520 AC_MSG_RESULT($maintainer_mode)
2522 if test "$maintainer_mode" = "yes"; then
2529 # Make empty files to contain the specs and options for each language.
2530 # Then add #include lines to for a compiler that has specs and/or options.
2535 for subdir in . $subdirs
2537 if test -f $srcdir/$subdir/lang-specs.h; then
2538 lang_specs_files="$lang_specs_files $srcdir/$subdir/lang-specs.h"
2540 if test -f $srcdir/$subdir/lang-options.h; then
2541 lang_options_files="$lang_options_files $srcdir/$subdir/lang-options.h"
2543 if test -f $srcdir/$subdir/$subdir-tree.def; then
2544 lang_tree_files="$lang_tree_files $srcdir/$subdir/$subdir-tree.def"
2548 # These (without "all_") are set in each config-lang.in.
2549 # `language' must be a single word so is spelled singularly.
2554 all_outputs='Makefile intl/Makefile fixinc/Makefile gccbug mklibgcc mkheaders'
2555 # List of language makefile fragments.
2557 # Files for gengtype
2558 all_gtfiles="$target_gtfiles"
2559 # Files for gengtype with language
2560 all_gtfiles_files_langs=
2561 all_gtfiles_files_files=
2563 # Add the language fragments.
2564 # Languages are added via two mechanisms. Some information must be
2565 # recorded in makefile variables, these are defined in config-lang.in.
2566 # We accumulate them and plug them into the main Makefile.
2567 # The other mechanism is a set of hooks for each of the main targets
2568 # like `clean', `install', etc.
2570 language_fragments="Make-lang"
2571 language_hooks="Make-hooks"
2573 for s in .. $subdirs
2583 . ${srcdir}/$s/config-lang.in
2584 if test "x$language" = x
2586 echo "${srcdir}/$s/config-lang.in doesn't set \$language." 1>&2
2589 all_lang_makefiles="$all_lang_makefiles ${srcdir}/$s/Make-lang.in"
2590 if test -f ${srcdir}/$s/Makefile.in
2591 then all_lang_makefiles="$all_lang_makefiles ${srcdir}/$s/Makefile.in"
2593 all_languages="$all_languages $language"
2594 if test "x$boot_language" = xyes
2596 all_boot_languages="$all_boot_languages $language"
2598 all_compilers="$all_compilers $compilers"
2599 all_stagestuff="$all_stagestuff $stagestuff"
2600 all_outputs="$all_outputs $outputs"
2601 all_gtfiles="$all_gtfiles $gtfiles"
2602 for f in .. $gtfiles
2606 all_gtfiles_files_langs="$all_gtfiles_files_langs ${s} "
2607 all_gtfiles_files_files="$all_gtfiles_files_files ${f} "
2613 # Pick up gtfiles for c
2616 . ${srcdir}/c-config-lang.in
2617 all_gtfiles="$all_gtfiles $gtfiles"
2618 for f in .. $gtfiles
2622 all_gtfiles_files_langs="$all_gtfiles_files_langs ${s} "
2623 all_gtfiles_files_files="$all_gtfiles_files_files ${f} "
2628 for language in .. $all_languages
2630 if test $language != ".."
2632 check_languages="$check_languages check-$language"
2636 # Since we can't use `::' targets, we link each language in
2637 # with a set of hooks, reached indirectly via lang.${target}.
2641 target_list="all.build all.cross start.encap rest.encap \
2642 info dvi generated-manpages \
2643 install-normal install-common install-info install-man \
2645 mostlyclean clean distclean extraclean maintainer-clean \
2646 stage1 stage2 stage3 stage4"
2647 for t in $target_list
2650 for lang in .. $all_languages
2652 if test $lang != ".."; then
2656 echo "lang.$t: $x" >> Make-hooks
2661 echo "dir ." > .gdbinit
2662 echo "dir ${srcdir}" >> .gdbinit
2663 if test x$gdb_needs_out_file_path = xyes
2665 echo "dir ${srcdir}/config/"`dirname ${out_file}` >> .gdbinit
2667 if test "x$subdirs" != x; then
2670 echo "dir ${srcdir}/$s" >> .gdbinit
2673 echo "source ${srcdir}/gdbinit.in" >> .gdbinit
2675 # Define variables host_canonical and build_canonical
2676 # because some Cygnus local changes in the Makefile depend on them.
2677 build_canonical=${build}
2678 host_canonical=${host}
2680 if test "${host}" != "${target}" ; then
2681 target_subdir=${target_alias}/
2683 AC_SUBST(build_canonical)
2684 AC_SUBST(host_canonical)
2685 AC_SUBST(target_subdir)
2687 # If $(exec_prefix) exists and is not the same as $(prefix), then compute an
2688 # absolute path for gcc_tooldir based on inserting the number of up-directory
2689 # movements required to get from $(exec_prefix) to $(prefix) into the basic
2690 # $(libsubdir)/@(unlibsubdir) based path.
2691 # Don't set gcc_tooldir to tooldir since that's only passed in by the toplevel
2692 # make and thus we'd get different behavior depending on where we built the
2694 if test x$exec_prefix = xNONE -o x$exec_prefix = x$prefix; then
2695 gcc_tooldir='$(libsubdir)/$(unlibsubdir)/../$(target_alias)'
2697 changequote(<<, >>)dnl
2698 # An explanation of the sed strings:
2699 # -e 's|^\$(prefix)||' matches and eliminates 'prefix' from 'exec_prefix'
2700 # -e 's|/$||' match a trailing forward slash and eliminates it
2701 # -e 's|^[^/]|/|' forces the string to start with a forward slash (*)
2702 # -e 's|/[^/]*|../|g' replaces each occurrence of /<directory> with ../
2704 # (*) Note this pattern overwrites the first character of the string
2705 # with a forward slash if one is not already present. This is not a
2706 # problem because the exact names of the sub-directories concerned is
2707 # unimportant, just the number of them matters.
2709 # The practical upshot of these patterns is like this:
2711 # prefix exec_prefix result
2712 # ------ ----------- ------
2714 # /foo/ /foo/bar ../
2715 # /foo /foo/bar/ ../
2716 # /foo/ /foo/bar/ ../
2717 # /foo /foo/bar/ugg ../../
2720 gcc_tooldir="\$(libsubdir)/\$(unlibsubdir)/\`echo \$(exec_prefix) | sed -e 's|^\$(prefix)||' -e 's|/\$(dollar)||' -e 's|^[^/]|/|' -e 's|/[^/]*|../|g'\`\$(target_alias)"
2721 changequote([, ])dnl
2723 AC_SUBST(gcc_tooldir)
2726 # Find a directory in which to install a shared libgcc.
2728 AC_ARG_ENABLE(version-specific-runtime-libs,
2729 [ --enable-version-specific-runtime-libs
2730 specify that runtime libraries should be
2731 installed in a compiler-specific directory])
2733 AC_ARG_WITH(slibdir,
2734 [ --with-slibdir=DIR shared libraries in DIR [LIBDIR]],
2735 slibdir="$with_slibdir",
2736 if test "${enable_version_specific_runtime_libs+set}" = set; then
2737 slibdir='$(libsubdir)'
2738 elif test "$host" != "$target"; then
2739 slibdir='$(build_tooldir)/lib'
2745 objdir=`${PWDCMD-pwd}`
2748 # Process the language and host/target makefile fragments.
2749 ${CONFIG_SHELL-/bin/sh} $srcdir/configure.frag $srcdir "$subdirs" "$dep_host_xmake_file" "$dep_tmake_file"
2751 # Substitute configuration variables
2754 AC_SUBST(all_boot_languages)
2755 AC_SUBST(all_compilers)
2756 AC_SUBST(all_gtfiles)
2757 AC_SUBST(all_gtfiles_files_langs)
2758 AC_SUBST(all_gtfiles_files_files)
2759 AC_SUBST(all_lang_makefiles)
2760 AC_SUBST(all_languages)
2761 AC_SUBST(all_stagestuff)
2762 AC_SUBST(build_exeext)
2763 AC_SUBST(build_install_headers_dir)
2764 AC_SUBST(build_xm_file_list)
2765 AC_SUBST(build_xm_file)
2766 AC_SUBST(build_xm_defines)
2767 AC_SUBST(check_languages)
2768 AC_SUBST(cc_set_by_configure)
2769 AC_SUBST(quoted_cc_set_by_configure)
2770 AC_SUBST(cpp_install_dir)
2771 AC_SUBST(dep_host_xmake_file)
2772 AC_SUBST(dep_tmake_file)
2773 AC_SUBST(extra_headers_list)
2774 AC_SUBST(extra_objs)
2775 AC_SUBST(extra_parts)
2776 AC_SUBST(extra_passes)
2777 AC_SUBST(extra_programs)
2778 AC_SUBST(float_h_file)
2779 AC_SUBST(gcc_config_arguments)
2780 AC_SUBST(gcc_gxx_include_dir)
2781 AC_SUBST(libstdcxx_incdir)
2782 AC_SUBST(gcc_version)
2783 AC_SUBST(gcc_version_full)
2784 AC_SUBST(gcc_version_trigger)
2785 AC_SUBST(host_exeext)
2786 AC_SUBST(host_extra_gcc_objs)
2787 AC_SUBST(host_xm_file_list)
2788 AC_SUBST(host_xm_file)
2789 AC_SUBST(host_xm_defines)
2791 AC_SUBST(lang_options_files)
2792 AC_SUBST(lang_specs_files)
2793 AC_SUBST(lang_tree_files)
2794 AC_SUBST(local_prefix)
2796 AC_SUBST(objc_boehm_gc)
2798 AC_SUBST(out_object_file)
2799 AC_SUBST(stage_prefix_set_by_configure)
2800 AC_SUBST(quoted_stage_prefix_set_by_configure)
2801 AC_SUBST(symbolic_link)
2802 AC_SUBST(thread_file)
2803 AC_SUBST(tm_file_list)
2805 AC_SUBST(tm_defines)
2806 AC_SUBST(tm_p_file_list)
2809 AC_SUBST(xm_defines)
2810 AC_SUBST(target_alias)
2811 AC_SUBST(c_target_objs)
2812 AC_SUBST(cxx_target_objs)
2813 AC_SUBST(target_cpu_default)
2815 AC_SUBST_FILE(target_overrides)
2816 AC_SUBST_FILE(host_overrides)
2817 AC_SUBST_FILE(language_fragments)
2818 AC_SUBST_FILE(language_hooks)
2820 # Echo that links are built
2821 if test x$host = x$target
2829 if test x$host != x$build
2831 str3=" on a $build system"
2834 if test "x$str2" != x || test "x$str3" != x
2839 echo "Links are now set up to build a ${str1}compiler for ${target}$str4" 1>&2
2841 if test "x$str2" != x || test "x$str3" != x
2843 echo " ${str2}${str3}." 1>&2
2846 # Truncate the target if necessary
2847 if test x$host_truncate_target != x; then
2848 target=`echo $target | sed -e 's/\(..............\).*/\1/'`
2851 # Configure the subdirectories
2852 # AC_CONFIG_SUBDIRS($subdirs)
2854 # Create the Makefile
2855 # and configure language subdirectories
2856 AC_OUTPUT($all_outputs,
2858 case x$CONFIG_HEADERS in
2859 xauto-host.h:config.in)
2862 # If the host supports symlinks, point stage[1234] at ../stage[1234] so
2863 # bootstrapping and the installation procedure can still use
2864 # CC="stage1/xgcc -Bstage1/". If the host doesn't support symlinks,
2865 # FLAGS_TO_PASS has been modified to solve the problem there.
2866 # This is virtually a duplicate of what happens in configure.lang; we do
2867 # an extra check to make sure this only happens if ln -s can be used.
2868 if test "$symbolic_link" = "ln -s"; then
2869 for d in .. ${subdirs} fixinc ; do
2870 if test $d != ..; then
2871 STARTDIR=`${PWDCMD-pwd}`
2873 for t in stage1 stage2 stage3 stage4 include
2876 $symbolic_link ../$t $t 2>/dev/null
2882 # Avoid having to add intl to our include paths.
2883 if test -f intl/libintl.h; then
2884 echo creating libintl.h
2885 echo '#include "intl/libintl.h"' >libintl.h
2889 symbolic_link='$symbolic_link'