Update sparc ULPs.
[jlayton/glibc.git] / configure.in
index 7c059039a69956866dcc3a4127c681c8e5c75f06..bbdf156b094bbaea2a6febdfe7c31df4a8f3f436 100644 (file)
@@ -17,6 +17,28 @@ AC_DEFUN([_AC_INCLUDES_DEFAULT_REQUIREMENTS],
   [m4_divert_text([DEFAULTS],
     [ac_includes_default='/* none */'])])
 
+# We require GCC, and by default use its preprocessor.  Override AC_PROG_CPP
+# here to work around the Autoconf issue discussed in
+# <http://sourceware.org/ml/libc-alpha/2013-01/msg00721.html>.
+AC_DEFUN([AC_PROG_CPP],
+[AC_REQUIRE([AC_PROG_CC])dnl
+AC_ARG_VAR([CPP],      [C preprocessor])dnl
+_AC_ARG_VAR_CPPFLAGS()dnl
+# On Suns, sometimes $CPP names a directory.
+if test -n "$CPP" && test -d "$CPP"; then
+  CPP=
+fi
+if test -z "$CPP"; then
+  CPP="$CC -E"
+fi
+AC_SUBST(CPP)dnl
+])# AC_PROG_CPP
+
+# We require GCC.  Override _AC_PROG_CC_C89 here to work around the Autoconf
+# issue discussed in
+# <http://sourceware.org/ml/libc-alpha/2013-01/msg00757.html>.
+AC_DEFUN([_AC_PROG_CC_C89], [[$1]])
+
 dnl This is here so we can set $subdirs directly based on configure fragments.
 AC_CONFIG_SUBDIRS()
 
@@ -146,6 +168,13 @@ else
 fi
 AC_SUBST(oldest_abi)
 
+AC_ARG_ENABLE([hardcoded-path-in-tests],
+             AC_HELP_STRING([--enable-hardcoded-path-in-tests],
+                            [hardcode newly built glibc path in tests @<:@default=no@:>@]),
+             [hardcoded_path_in_tests=$enableval],
+             [hardcoded_path_in_tests=no])
+AC_SUBST(hardcoded_path_in_tests)
+
 AC_ARG_ENABLE([stackguard-randomization],
              AC_HELP_STRING([--enable-stackguard-randomization],
                             [initialize __stack_chk_guard canary with a random number at program start]),
@@ -577,7 +606,7 @@ fi
 # For the multi-arch option we need support in the assembler & linker.
 AC_CACHE_CHECK([for assembler and linker STT_GNU_IFUNC support],
               libc_cv_ld_gnu_indirect_function, [dnl
-cat > conftest.s <<EOF
+cat > conftest.S <<EOF
 .type foo,%gnu_indirect_function
 foo:
 .globl _start
@@ -585,12 +614,16 @@ _start:
 .globl __start
 __start:
 .data
+#ifdef _LP64
+.quad foo
+#else
 .long foo
+#endif
 EOF
 libc_cv_ld_gnu_indirect_function=no
 if ${CC-cc} $CFLAGS $CPPFLAGS $LDFLAGS \
            -nostartfiles -nostdlib \
-           -o conftest conftest.s 1>&AS_MESSAGE_LOG_FD 2>&AS_MESSAGE_LOG_FD; then
+           -o conftest conftest.S 1>&AS_MESSAGE_LOG_FD 2>&AS_MESSAGE_LOG_FD; then
   # Do a link to see if the backend supports IFUNC relocs.
   $READELF -r conftest 1>&AS_MESSAGE_LOG_FD
   LC_ALL=C $READELF -r conftest | grep 'no relocations' >/dev/null || {
@@ -622,6 +655,7 @@ if test x"$libc_cv_ld_gnu_indirect_function" != xyes; then
     multi_arch=no
   fi
 fi
+multi_arch_d=
 if test x"$multi_arch" != xno; then
   multi_arch_d=/multiarch
 fi
@@ -675,11 +709,16 @@ while m=`echo $tail | sed 's@^\(.*\)/\([^/]*\)$@& \1@'`; test -n "$m"; do
   set $m
   # Prepend the machine's FPU directory unless --without-fp.
   if test "$with_fp" = yes; then
-    mach="$mach /$1/fpu"
+    maybe_fpu=/fpu
   else
-    mach="$mach /$1/nofpu"
+    maybe_fpu=/nofpu
   fi
-  mach="$mach /$1"
+  # For each machine term, try it with and then without /multiarch.
+  for try_fpu in $maybe_fpu ''; do
+    for try_multi in $multi_arch_d ''; do
+      mach="$mach /$1$try_fpu$try_multi"
+    done
+  done
   tail="$2"
 done
 
@@ -695,15 +734,16 @@ for b in $base ''; do
       test "$v" = / && continue
       for o in /$ostry ''; do
        test "$o" = / && continue
-       for m in $multi_arch_d $mach ''; do
+       for m in $mach ''; do
          for d in $add_ons_pfx ''; do
            for a in $add_ons_sfx ''; do
-             if test -n "$m0$m0sub$b$v$o$m$msub"; then
+             try_suffix="$m0$b$v$o$m"
+             if test -n "$try_suffix"; then
                try_srcdir="${srcdir}/"
                case "$d" in
                /*) try_srcdir= ;;
                esac
-               try="${d}sysdeps$m0$m0sub$b$v$o$m$msub$a"
+               try="${d}sysdeps$try_suffix$a"
                test -n "$enable_debug_configure" &&
                echo "$0 [DEBUG]: try $try" >&2
                if test -d "$try_srcdir$try"; then
@@ -914,7 +954,6 @@ fi
 AC_PROG_LN_S
 
 LIBC_PROG_BINUTILS
-AC_SUBST(MIG)dnl Needed by sysdeps/mach/configure.in
 
 # Accept binutils 2.20 or newer.
 AC_CHECK_PROG_VER(AS, $AS, --version,
@@ -991,12 +1030,11 @@ if test -n "$sysheaders"; then
 -isystem `echo $sysheaders | sed 's/:/ -isystem /g'`"
   if test -n "$CXX"; then
     CXX_SYSINCLUDES=
-    cxxmachine=`$CXX -dumpmachine 2>&AS_MESSAGE_LOG_FD` &&
-    cxxheaders=`$CXX -v -S -x c++ /dev/null -o /dev/null 2>&1 \
-       | sed -n -e '1,/#include/d' -e '/^ \//{p;q;}' | sed 's/ //'`
-    test "x$cxxheaders" != x && test "x$i" != "x$cxxheaders" &&
-    CXX_SYSINCLUDES="$CXX_SYSINCLUDES -isystem $cxxheaders \
--isystem $cxxheaders/$cxxmachine -isystem $cxxheaders/backward"
+    for cxxheaders in `$CXX -v -S -x c++ /dev/null -o /dev/null 2>&1 \
+    | sed -n -e '1,/#include/d' -e 's/^ \(\/.*\/[cg]++\)/\1/p'`; do
+      test "x$cxxheaders" != x &&
+      CXX_SYSINCLUDES="$CXX_SYSINCLUDES -isystem $cxxheaders"
+    done
   fi
 fi
 AC_SUBST(SYSINCLUDES)
@@ -1405,53 +1443,17 @@ if test $libc_cv_cc_with_libunwind = yes; then
   AC_DEFINE(HAVE_CC_WITH_LIBUNWIND)
 fi
 
-AC_CACHE_CHECK(for -z nodelete option,
-              libc_cv_z_nodelete, [dnl
-cat > conftest.c <<EOF
-int _start (void) { return 42; }
-EOF
-if AC_TRY_COMMAND([${CC-cc} $CFLAGS $CPPFLAGS $LDFLAGS
-                  -fPIC -shared -o conftest.so conftest.c
-                  -nostartfiles -nostdlib
-                  -Wl,--enable-new-dtags,-z,nodelete 1>&AS_MESSAGE_LOG_FD])
-then
-  libc_cv_z_nodelete=yes
-else
-  AC_MSG_ERROR(linker with -z nodelete support required)
-fi
-rm -f conftest*])
+LIBC_LINKER_FEATURE([-z nodelete], [-Wl,--enable-new-dtags,-z,nodelete],
+                   [libc_cv_z_nodelete=yes],
+                   [AC_MSG_ERROR(linker with -z nodelete support required)])
 
-AC_CACHE_CHECK(for -z nodlopen option,
-              libc_cv_z_nodlopen, [dnl
-cat > conftest.c <<EOF
-int _start (void) { return 42; }
-EOF
-if AC_TRY_COMMAND([${CC-cc} $CFLAGS $CPPFLAGS $LDFLAGS
-                       -fPIC -shared -o conftest.so conftest.c
-                       -nostartfiles -nostdlib
-                       -Wl,--enable-new-dtags,-z,nodlopen 1>&AS_MESSAGE_LOG_FD])
-then
-  libc_cv_z_nodlopen=yes
-else
-  AC_MSG_ERROR(linker with -z nodlopen support required)
-fi
-rm -f conftest*])
+LIBC_LINKER_FEATURE([-z nodlopen], [-Wl,--enable-new-dtags,-z,nodlopen],
+                   [libc_cv_z_nodlopen=yes],
+                   [AC_MSG_ERROR(linker with -z nodlopen support required)])
 
-AC_CACHE_CHECK(for -z initfirst option,
-              libc_cv_z_initfirst, [dnl
-cat > conftest.c <<EOF
-int _start (void) { return 42; }
-EOF
-if AC_TRY_COMMAND([${CC-cc} $CFLAGS $CPPFLAGS $LDFLAGS
-                       -fPIC -shared -o conftest.so conftest.c
-                       -nostartfiles -nostdlib
-                       -Wl,--enable-new-dtags,-z,initfirst 1>&AS_MESSAGE_LOG_FD])
-then
-  libc_cv_z_initfirst=yes
-else
-  AC_MSG_ERROR(linker with -z initfirst support required)
-fi
-rm -f conftest*])
+LIBC_LINKER_FEATURE([-z initfirst], [-Wl,--enable-new-dtags,-z,initfirst],
+                   [libc_cv_z_initfirst=yes],
+                   [AC_MSG_ERROR(linker with -z initfirst support required)])
 
 # Add-on fragments can set these for other machines.
 libc_commonpagesize=${libc_commonpagesize:-no}
@@ -1589,21 +1591,8 @@ if test "$libc_cv_z_combreloc" = yes; then
 fi
 AC_SUBST(libc_cv_z_combreloc)
 
-AC_CACHE_CHECK(for -z execstack,
-              libc_cv_z_execstack, [dnl
-cat > conftest.c <<EOF
-int _start (void) { return 42; }
-EOF
-if AC_TRY_COMMAND([${CC-cc} $CFLAGS $CPPFLAGS $LDFLAGS
-                           -fPIC -shared -o conftest.so conftest.c
-                           -Wl,-z,execstack -nostdlib
-                           1>&AS_MESSAGE_LOG_FD])
-then
-  libc_cv_z_execstack=yes
-else
-  libc_cv_z_execstack=no
-fi
-rm -f conftest*])
+LIBC_LINKER_FEATURE([-z execstack], [-Wl,-z,execstack],
+                   [libc_cv_z_execstack=yes], [libc_cv_z_execstack=no])
 AC_SUBST(libc_cv_z_execstack)
 
 AC_CACHE_CHECK(for -fpie, libc_cv_fpie, [dnl
@@ -1958,6 +1947,7 @@ libc_cv_cc_nofma=
 for opt in -ffp-contract=off -mno-fused-madd; do
   LIBC_TRY_CC_OPTION([$opt], [libc_cv_cc_nofma=$opt; break])
 done])
+AC_SUBST(libc_cv_cc_nofma)
 
 if test -n "$submachine"; then
   AC_CACHE_CHECK([for compiler option for CPU variant],
@@ -2163,22 +2153,13 @@ fi
 AC_SUBST(old_glibc_headers)
 
 AC_SUBST(libc_cv_slibdir)
+AC_SUBST(libc_cv_rtlddir)
 AC_SUBST(libc_cv_localedir)
 AC_SUBST(libc_cv_sysconfdir)
 AC_SUBST(libc_cv_localstatedir)
 AC_SUBST(libc_cv_rootsbindir)
 AC_SUBST(libc_cv_forced_unwind)
 
-dnl sysdeps/CPU/configure.in checks set this via arch-specific asm tests
-AC_SUBST(libc_cv_cc_sse4)
-AC_SUBST(libc_cv_cc_avx)
-AC_SUBST(libc_cv_cc_sse2avx)
-AC_SUBST(libc_cv_cc_novzeroupper)
-AC_SUBST(libc_cv_cc_fma4)
-AC_SUBST(libc_cv_cc_nofma)
-AC_SUBST(libc_cv_as_i686)
-AC_SUBST(libc_cv_sparc_as_vis3)
-
 if test x$use_ldconfig = xyes; then
   AC_DEFINE(USE_LDCONFIG)
 fi