# Determine the host, build, and target systems
AC_CANONICAL_SYSTEM
+# Determine the noncanonical target name, for directory use.
+_GCC_TOPLEV_NONCANONICAL_TARGET
+
# Determine the target- and build-specific subdirectories
GCC_TOPLEV_SUBDIRS
stabs="$with_stabs",
stabs=no)
-# With ELF
-AC_ARG_WITH(elf,
-[ --with-elf arrange to use ELF instead of host debug format],
-elf="$with_elf",
-elf=no)
-
# Determine whether or not multilibs are enabled.
AC_ARG_ENABLE(multilib,
[ --enable-multilib enable library support for multiple ABIs],
[ --enable-threads enable thread usage for target GCC
--enable-threads=LIB use LIB thread package for target GCC],,
enable_threads='')
-
+# Save in case it gets overwritten in config.gcc
enable_threads_flag=$enable_threads
-# Check if a valid thread package
-case x${enable_threads_flag} in
- x | xno)
- # No threads
- target_thread_file='single'
- ;;
- xyes)
- # default
- target_thread_file=''
- ;;
- xdecosf1 | xirix | xmach | xos2 | xposix | xpthreads | xsingle | \
- xsolaris | xwin32 | xdce | xrtems| xvxworks | xaix | xgnat)
- target_thread_file=$enable_threads_flag
- ;;
- *)
- echo "$enable_threads is an unknown thread package" 1>&2
- exit 1
- ;;
-esac
AC_ARG_ENABLE(objc-gc,
[ --enable-objc-gc enable the use of Boehm's garbage collector with
[ --with-sysroot[=DIR] Search for usr/lib, usr/include, et al, within DIR.],
[
case ${with_sysroot} in
- yes) TARGET_SYSTEM_ROOT='${exec_prefix}/${target_alias}/sys-root' ;;
+ yes) TARGET_SYSTEM_ROOT='${exec_prefix}/${target_noncanonical}/sys-root' ;;
*) TARGET_SYSTEM_ROOT=$with_sysroot ;;
esac
gcc_AC_FUNC_MMAP_BLACKLIST
case "${host}" in
-*-*-uwin*)
- AC_MSG_ERROR([
-*** UWIN may not be used as a host platform because
-*** linking with posix.dll is not allowed by the GNU GPL])
- ;;
*-*-*vms*)
- # Under VMS, vfork works very different than on Unix. The standard test
+ # Under VMS, vfork works very differently than on Unix. The standard test
# won't work, and it isn't easily adaptable. It makes more sense to
# just force it.
ac_cv_func_vfork_works=yes
AC_DEFINE_UNQUOTED(CONFIG_SJLJ_EXCEPTIONS, $sjlj,
[Define 0/1 to force the choice for exception handling model.])])
-AC_CHECK_LIB(unwind, main, use_libunwind_default=yes, use_libunwind_default=no)
+if test x$host = x$target; then
+ AC_CHECK_LIB(unwind, main, use_libunwind_default=yes, use_libunwind_default=no)
+else
+ use_libunwind_default=no
+fi
# Use libunwind based exception handling.
AC_ARG_ENABLE(libunwind-exceptions,
[ --enable-libunwind-exceptions force use libunwind for exceptions],
target_gtfiles=
# Collect target-machine-specific information.
-for machine in $target ; do
- . ${srcdir}/config.gcc
-done
+. ${srcdir}/config.gcc
extra_objs="${host_extra_objs} ${extra_objs}"
fi
fi
-if test x$thread_file = x; then
- if test x$target_thread_file != x; then
- thread_file=$target_thread_file
- else
- thread_file='single'
- fi
+# Check if a valid thread package
+case ${enable_threads_flag} in
+ "" | no)
+ # No threads
+ target_thread_file='single'
+ ;;
+ yes)
+ # default
+ target_thread_file='single'
+ ;;
+ aix | dce | gnat | irix | posix | rtems | \
+ single | solaris | vxworks | win32 )
+ target_thread_file=${enable_threads_flag}
+ ;;
+ *)
+ echo "${enable_threads_flag} is an unknown thread package" 1>&2
+ exit 1
+ ;;
+esac
+
+if test x${thread_file} = x; then
+ # No thread file set by target-specific clauses in config.gcc,
+ # so use file chosen by default logic above
+ thread_file=${target_thread_file}
fi
if test x$enable___cxa_atexit = xyes || \
AC_DEFINE_UNQUOTED(EXTRA_MODES_FILE, "config/$extra_modes",
[Define to the name of a file containing a list of extra machine modes
for this architecture.])
- AC_DEFINE(EXTRA_CC_MODES, 1,
- [Define if the target architecture needs extra machine modes to represent
- the results of comparisons.])
fi
# auto-host.h is the file containing items generated by autoconf and is
else
gcc_config_arguments="$TOPLEVEL_CONFIGURE_ARGUMENTS"
fi
+
+# Double all backslashes and backslash all quotes to turn
+# gcc_config_arguments into a C string.
+sed -e 's/\\/\\\\/g; s/"/\\"/g' <<EOF >conftest.out
+$gcc_config_arguments
+EOF
+gcc_config_arguments_str=`cat conftest.out`
+rm -f conftest.out
+
cat > configargs.h <<EOF
/* Generated automatically. */
-static const char configuration_arguments[] = "$gcc_config_arguments";
+static const char configuration_arguments[] = "$gcc_config_arguments_str";
static const char thread_model[] = "$thread_file";
static const struct {
BUILD_CFLAGS='$(ALL_CFLAGS)' AC_SUBST(BUILD_CFLAGS)
STMP_FIXINC=stmp-fixinc AC_SUBST(STMP_FIXINC)
-STMP_FIXPROTO=stmp-fixproto AC_SUBST(STMP_FIXPROTO)
+
+# Possibly disable fixproto, on a per-target basis.
+case ${use_fixproto} in
+ no)
+ STMP_FIXPROTO=
+ ;;
+ yes)
+ STMP_FIXPROTO=stmp-fixproto
+ ;;
+esac
+AC_SUBST(STMP_FIXPROTO)
# And these apply if build != host, or we are generating coverage data
if test x$build != x$host || test "x$coverage_flags" != x
# Expand extra_headers to include complete path.
# This substitutes for lots of t-* files.
extra_headers_list=
-if test "x$extra_headers" = x
-then true
-else
- # Prepend ${srcdir}/config/${cpu_type}/ to every entry in extra_headers.
- for file in $extra_headers;
- do
- extra_headers_list="${extra_headers_list} \$(srcdir)/config/${cpu_type}/${file}"
- done
-fi
+# Prepend $(srcdir)/config/${cpu_type}/ to every entry in extra_headers.
+for file in ${extra_headers} ; do
+ extra_headers_list="${extra_headers_list} \$(srcdir)/config/${cpu_type}/${file}"
+done
# Add a definition of USE_COLLECT2 if system wants one.
case $use_collect2 in
gcc_cv_as=`echo as | sed ${program_transform_name}`$host_exeext
fi
- test_dirs="$test_prefix/lib/gcc-lib/$target_alias/$gcc_version \
- $test_prefix/lib/gcc-lib/$target_alias \
- /usr/lib/gcc/$target_alias/$gcc_version \
- /usr/lib/gcc/$target_alias \
- $test_prefix/$target_alias/bin/$target_alias/$gcc_version \
- $test_prefix/$target_alias/bin"
+ test_dirs="$test_prefix/lib/gcc-lib/$target_noncanonical/$gcc_version \
+ $test_prefix/lib/gcc-lib/$target_noncanonical \
+ /usr/lib/gcc/$target_noncanonical/$gcc_version \
+ /usr/lib/gcc/$target_noncanonical \
+ $test_prefix/$target_noncanonical/bin/$target_noncanonical/$gcc_version \
+ $test_prefix/$target_noncanonical/bin"
if test x$host = x$target; then
test_dirs="$test_dirs \
gcc_cv_ld=`echo ld | sed ${program_transform_name}`$host_exeext
fi
- test_dirs="$test_prefix/lib/gcc-lib/$target_alias/$gcc_version \
- $test_prefix/lib/gcc-lib/$target_alias \
- /usr/lib/gcc/$target_alias/$gcc_version \
- /usr/lib/gcc/$target_alias \
- $test_prefix/$target_alias/bin/$target_alias/$gcc_version \
- $test_prefix/$target_alias/bin"
+ test_dirs="$test_prefix/lib/gcc-lib/$target_noncanonical/$gcc_version \
+ $test_prefix/lib/gcc-lib/$target_noncanonical \
+ /usr/lib/gcc/$target_noncanonical/$gcc_version \
+ /usr/lib/gcc/$target_noncanonical \
+ $test_prefix/$target_noncanonical/bin/$target_noncanonical/$gcc_version \
+ $test_prefix/$target_noncanonical/bin"
if test x$host = x$target; then
test_dirs="$test_dirs \
fi
else
gcc_cv_ld_hidden=yes
- ld_ver=`$gcc_cv_ld --version 2>/dev/null | head -1`
+ ld_ver=`$gcc_cv_ld --version 2>/dev/null | sed 1q`
if echo "$ld_ver" | grep GNU > /dev/null; then
changequote(,)dnl
ld_vers=`echo $ld_ver | sed -n \
fi
else
# non-GNU linkers don't seem to support .hidden yet
- if test x"$gnu_ld_flag" = x"no"; then
- gcc_cv_ld_hidden=no
- fi
+ gcc_cv_ld_hidden=no
fi
fi])
libgcc_visibility=no
# ??? There exists an elf-specific test that will crash
# the assembler. Perhaps it's better to figure out whether
# arbitrary sections are supported and try the test.
- as_ver=`$gcc_cv_as --version 2>/dev/null | head -1`
+ as_ver=`$gcc_cv_as --version 2>/dev/null | sed 1q`
if echo "$as_ver" | grep GNU > /dev/null; then
changequote(,)dnl
as_ver=`echo $as_ver | sed -e 's/GNU assembler \([0-9.][0-9.]*\).*/\1/'`
gcc_GAS_CHECK_FEATURE(section merging support, gcc_cv_as_shf_merge,
[elf,2,12,0], [--fatal-warnings],
- [.section .rodata.str, "aMS", @progbits, 1],,
- [AC_DEFINE(HAVE_GAS_SHF_MERGE, 1,
-[Define if your assembler supports marking sections with SHF_MERGE flag.])])
+ [.section .rodata.str, "aMS", @progbits, 1])
+AC_DEFINE_UNQUOTED(HAVE_GAS_SHF_MERGE,
+ [`if test $gcc_cv_as_shf_merge = yes; then echo 1; else echo 0; fi`],
+[Define 0/1 if your assembler supports marking sections with SHF_MERGE flag.])
# Thread-local storage - the check is heavily parametrized.
conftest_s=
tls_first_minor=13
;;
i[34567]86-*-*)
-changequote([,])dnl
conftest_s='
.section ".tdata","awT",@progbits
foo: .long 25
tls_first_minor=14
tls_as_opt="-m64 -Aesame"
;;
+ sh-*-* | sh[34]-*-*)
+ conftest_s='
+ .section ".tdata","awT",@progbits
+foo: .long 25
+ .text
+ .long foo@TLSGD
+ .long foo@TLSLDM
+ .long foo@DTPOFF
+ .long foo@GOTTPOFF
+ .long foo@TPOFF'
+ tls_first_major=2
+ tls_first_minor=13
+ ;;
+ sparc*-*-*)
+ conftest_s='
+ .section ".tdata","awT",@progbits
+foo: .long 25
+ .text
+ sethi %tgd_hi22(foo), %o0
+ add %o0, %tgd_lo10(foo), %o1
+ add %l7, %o1, %o0, %tgd_add(foo)
+ call __tls_get_addr, %tgd_call(foo)
+ sethi %tldm_hi22(foo), %l1
+ add %l1, %tldm_lo10(foo), %l2
+ add %l7, %l2, %o0, %tldm_add(foo)
+ call __tls_get_addr, %tldm_call(foo)
+ sethi %tldo_hix22(foo), %l3
+ xor %l3, %tldo_lox10(foo), %l4
+ add %o0, %l4, %l5, %tldo_add(foo)
+ sethi %tie_hi22(foo), %o3
+ add %o3, %tie_lo10(foo), %o3
+ ld [%l7 + %o3], %o2, %tie_ld(foo)
+ add %g7, %o2, %o4, %tie_add(foo)
+ sethi %tle_hix22(foo), %l1
+ xor %l1, %tle_lox10(foo), %o5
+ ld [%g7 + %o5], %o1'
+ tls_first_major=2
+ tls_first_minor=14
+ tls_as_opt=-32
+ ;;
+changequote([,])dnl
esac
if test -z "$tls_first_major"; then
: # If we don't have a check, assume no support.
else
test_prefix=$exec_prefix
fi
- for f in $gcc_cv_libgloss_srcdir/mips/idt.ld $test_prefix/$target_alias/lib/idt.ld
+ for f in $gcc_cv_libgloss_srcdir/mips/idt.ld $test_prefix/$target_noncanonical/lib/idt.ld
do
if grep '^STARTUP' $f > /dev/null 2>&1; then
gcc_cv_mips_libgloss_startup=yes
check_languages="$check_languages check-$language"
done
-# Since we can't use `::' targets, we link each language in
-# with a set of hooks, reached indirectly via lang.${target}.
+# We link each language in with a set of hooks, reached indirectly via
+# lang.${target}.
rm -f Make-hooks
touch Make-hooks
target_list="all.build all.cross start.encap rest.encap tags \
- info dvi generated-manpages \
install-normal install-common install-info install-man \
uninstall \
mostlyclean clean distclean extraclean maintainer-clean \
# make and thus we'd get different behavior depending on where we built the
# sources.
if test x$exec_prefix = xNONE -o x$exec_prefix = x$prefix; then
- gcc_tooldir='$(libsubdir)/$(unlibsubdir)/../$(target_alias)'
+ gcc_tooldir='$(libsubdir)/$(unlibsubdir)/../$(target_noncanonical)'
else
changequote(<<, >>)dnl
# An explanation of the sed strings:
# /foo /foo/bar/ugg ../../
#
dollar='$$'
- gcc_tooldir="\$(libsubdir)/\$(unlibsubdir)/\`echo \$(exec_prefix) | sed -e 's|^\$(prefix)||' -e 's|/\$(dollar)||' -e 's|^[^/]|/|' -e 's|/[^/]*|../|g'\`\$(target_alias)"
+ gcc_tooldir="\$(libsubdir)/\$(unlibsubdir)/\`echo \$(exec_prefix) | sed -e 's|^\$(prefix)||' -e 's|/\$(dollar)||' -e 's|^[^/]|/|' -e 's|/[^/]*|../|g'\`\$(target_noncanonical)"
changequote([, ])dnl
fi
AC_SUBST(gcc_tooldir)
AC_SUBST(xm_file_list)
AC_SUBST(xm_include_list)
AC_SUBST(xm_defines)
-AC_SUBST(target_alias)
+AC_SUBST(target_noncanonical)
AC_SUBST(c_target_objs)
AC_SUBST(cxx_target_objs)
AC_SUBST(target_cpu_default)