+AC_MSG_CHECKING(linker position independent executable support)
+gcc_cv_ld_pie=no
+if test $in_tree_ld = yes ; then
+ if test "$gcc_cv_gld_major_version" -eq 2 -a "$gcc_cv_gld_minor_version" -ge 15 -o "$gcc_cv_gld_major_version" -gt 2 \
+ && test $in_tree_ld_is_elf = yes; then
+ gcc_cv_ld_pie=yes
+ fi
+elif test x$gcc_cv_ld != x; then
+ # Check if linker supports -pie option
+ if $gcc_cv_ld --help 2>/dev/null | grep -- -pie > /dev/null; then
+ gcc_cv_ld_pie=yes
+ fi
+fi
+if test x"$gcc_cv_ld_pie" = xyes; then
+ AC_DEFINE(HAVE_LD_PIE, 1,
+[Define if your linker supports -pie option.])
+fi
+AC_MSG_RESULT($gcc_cv_ld_pie)
+
+# Miscellaneous target-specific checks.
+case "$target" in
+ mips*-*-*)
+ AC_MSG_CHECKING(whether libgloss uses STARTUP directives consistently)
+ gcc_cv_mips_libgloss_startup=no
+ gcc_cv_libgloss_srcdir=`echo $srcdir | sed -e 's,/gcc$,,'`/libgloss
+ if test "x$exec_prefix" = xNONE; then
+ if test "x$prefix" = xNONE; then
+ test_prefix=/usr/local
+ else
+ test_prefix=$prefix
+ fi
+ else
+ test_prefix=$exec_prefix
+ fi
+ for f in $gcc_cv_libgloss_srcdir/mips/idt.ld $test_prefix/$target_alias/lib/idt.ld
+ do
+ if grep '^STARTUP' $f > /dev/null 2>&1; then
+ gcc_cv_mips_libgloss_startup=yes
+ break
+ fi
+ done
+ if test x"$gcc_cv_mips_libgloss_startup" = xyes; then
+ AC_DEFINE(HAVE_MIPS_LIBGLOSS_STARTUP_DIRECTIVES, 1,
+ [Define if your MIPS libgloss linker scripts consistently include STARTUP directives.])
+ fi
+ AC_MSG_RESULT($gcc_cv_mips_libgloss_startup)
+
+ AC_MSG_CHECKING(whether the assembler has explicit relocation support)
+ if test x$gcc_cv_mips_explicit_relocs = x; then
+ gcc_cv_mips_explicit_relocs=no
+ if test $in_tree_gas = yes; then
+ gcc_GAS_VERSION_GTE_IFELSE(2,14,0,[
+ gcc_cv_mips_explicit_relocs=yes
+ ])
+ elif test x$gcc_cv_as != x; then
+ echo ' lw $4,%gp_rel(foo)($4)' > conftest.s
+ if $gcc_cv_as conftest.s -o conftest.o > /dev/null 2>&1; then
+ gcc_cv_mips_explicit_relocs=yes
+ fi
+ rm -f conftest.s conftest.o
+ fi
+ fi
+ if test $gcc_cv_mips_explicit_relocs = yes; then
+ test x$target_cpu_default != x || target_cpu_default=0
+ target_cpu_default="(${target_cpu_default}|MASK_EXPLICIT_RELOCS)"
+ fi
+ AC_MSG_RESULT($gcc_cv_mips_explicit_relocs)
+ ;;
+esac
+
+if test x$with_sysroot = x && test x$host = x$target \
+ && test "$prefix" != "/usr" && test "x$prefix" != "x$local_prefix" ; then