]> git.ipfire.org Git - thirdparty/glibc.git/blobdiff - configure.ac
Use “copy "es_BO"” in LC_TIME of es_CU, es_CL, and es_EC
[thirdparty/glibc.git] / configure.ac
index 195e81acfd05a719a4597b6cefb1b3af177f9ac4..ca1282a6b3f8c5369c133a47f5c8239c3f2d32b5 100644 (file)
@@ -1,6 +1,6 @@
 dnl Process this file with autoconf to produce a configure script.
 dnl Note we do not use AC_PREREQ here!  See aclocal.m4 for what we use instead.
-AC_INIT([GNU C Library], [(see version.h)], [http://sourceware.org/bugzilla/], [glibc])
+AC_INIT([GNU C Library], [(see version.h)], [https://sourceware.org/bugzilla/], [glibc])
 AC_CONFIG_SRCDIR([include/features.h])
 AC_CONFIG_HEADERS([config.h])
 AC_CONFIG_AUX_DIR([scripts])
@@ -19,7 +19,7 @@ AC_DEFUN([_AC_INCLUDES_DEFAULT_REQUIREMENTS],
 
 # 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>.
+# <https://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
@@ -36,7 +36,7 @@ AC_SUBST(CPP)dnl
 
 # 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>.
+# <https://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.
@@ -127,12 +127,6 @@ libgd-LDFLAGS = $libgd_ldflags"
 fi
 
 dnl Arguments to specify presence of other packages/features.
-AC_ARG_WITH([fp],
-           AC_HELP_STRING([--with-fp],
-                          [if using floating-point hardware @<:@default=yes@:>@]),
-           [with_fp=$withval],
-           [with_fp=yes])
-AC_SUBST(with_fp)
 AC_ARG_WITH([binutils],
            AC_HELP_STRING([--with-binutils=PATH],
                           [specify location of binutils (as and ld)]),
@@ -176,6 +170,11 @@ AC_ARG_ENABLE([profile],
                             [build profiled library @<:@default=no@:>@]),
              [profile=$enableval],
              [profile=no])
+AC_ARG_ENABLE([static-pie],
+             AC_HELP_STRING([--enable-static-pie],
+                            [enable static PIE support and use it in the testsuite @<:@default=no@:>@]),
+             [static_pie=$enableval],
+             [static_pie=no])
 AC_ARG_ENABLE([timezone-tools],
              AC_HELP_STRING([--disable-timezone-tools],
                             [do not install timezone tools @<:@default=install@:>@]),
@@ -199,16 +198,6 @@ if test "$enable_stackguard_randomize" = yes; then
   AC_DEFINE(ENABLE_STACKGUARD_RANDOMIZE)
 fi
 
-AC_ARG_ENABLE([lock-elision],
-             AC_HELP_STRING([--enable-lock-elision[=yes/no]],
-                            [Enable lock elision for pthread mutexes by default]),
-             [enable_lock_elision=$enableval],
-             [enable_lock_elision=no])
-AC_SUBST(enable_lock_elision)
-if test "$enable_lock_elision" = yes ; then
-  AC_DEFINE(ENABLE_LOCK_ELISION)
-fi
-
 AC_ARG_ENABLE([hidden-plt],
              AC_HELP_STRING([--disable-hidden-plt],
                             [do not hide internal function calls to avoid PLT]),
@@ -499,6 +488,11 @@ AC_ARG_WITH([cpu],
 # check below.
 libc_config_ok=no
 
+# A preconfigure script for a system that may or may not use fpu
+# sysdeps directories sets this to a preprocessor conditional for
+# whether to use such directories.
+with_fp_cond=1
+
 dnl Let sysdeps/*/preconfigure act here.
 LIBC_PRECONFIGURE([$srcdir], [for sysdeps])
 
@@ -527,6 +521,24 @@ fi
 test -n "$base_machine" || base_machine=$machine
 AC_SUBST(base_machine)
 
+# Determine whether to use fpu or nofpu sysdeps directories.
+AC_CACHE_CHECK([for use of fpu sysdeps directories],
+              libc_cv_with_fp, [dnl
+cat > conftest.c <<EOF
+#if $with_fp_cond
+int dummy;
+#else
+# error "no hardware floating point"
+#endif
+EOF
+libc_cv_with_fp=no
+if ${CC-cc} $CFLAGS $CPPFLAGS -S conftest.c -o conftest.s \
+   1>&AS_MESSAGE_LOG_FD 2>&AS_MESSAGE_LOG_FD ; then
+  libc_cv_with_fp=yes
+fi
+rm -f conftest*])
+AC_SUBST(libc_cv_with_fp)
+
 AC_CACHE_CHECK(for -fstack-protector, libc_cv_ssp, [dnl
 LIBC_TRY_CC_OPTION([$CFLAGS $CPPFLAGS -Werror -fstack-protector],
                   [libc_cv_ssp=yes],
@@ -634,6 +646,26 @@ if ${CC-cc} -c conftest.c -o conftest.o 1>&AS_MESSAGE_LOG_FD \
 fi
 rm -f conftest*])
 
+# Check if gcc warns about alias for function with incompatible types.
+AC_CACHE_CHECK([if compiler warns about alias for function with incompatible types],
+              libc_cv_gcc_incompatible_alias, [dnl
+cat > conftest.c <<EOF
+int __redirect_foo (const void *s, int c);
+
+__typeof (__redirect_foo) *foo_impl (void) __asm__ ("foo");
+__typeof (__redirect_foo) *foo_impl (void)
+{
+  return 0;
+}
+
+extern __typeof (__redirect_foo) foo_alias __attribute__ ((alias ("foo")));
+EOF
+libc_cv_gcc_incompatible_alias=yes
+if ${CC-cc} -Werror -c conftest.c -o conftest.o 1>&AS_MESSAGE_LOG_FD 2>&AS_MESSAGE_LOG_FD ; then
+  libc_cv_gcc_incompatible_alias=no
+fi
+rm -f conftest*])
+
 if test x"$libc_cv_ld_gnu_indirect_function" != xyes; then
   if test x"$multi_arch" = xyes; then
     AC_MSG_ERROR([--enable-multi-arch support requires assembler and linker support])
@@ -641,10 +673,21 @@ if test x"$libc_cv_ld_gnu_indirect_function" != xyes; then
     multi_arch=no
   fi
 fi
-if test x"$libc_cv_gcc_indirect_function" != xyes &&
-   test x"$multi_arch" = xyes; then
-  AC_MSG_WARN([--enable-multi-arch support recommends a gcc with gnu-indirect-function support.
+if test x"$libc_cv_gcc_indirect_function" != xyes; then
+  # GCC 8+ emits a warning for alias with incompatible types and it might
+  # fail to build ifunc resolvers aliases to either weak or internal
+  # symbols.  Disables multiarch build in this case.
+  if test x"$libc_cv_gcc_incompatible_alias" == xyes; then
+    AC_MSG_WARN([gcc emits a warning for alias between functions of incompatible types])
+    if test x"$multi_arch" = xyes; then
+      AC_MSG_ERROR([--enable-multi-arch support requires a gcc with gnu-indirect-function support])
+    fi
+    AC_MSG_WARN([Multi-arch is disabled.])
+    multi_arch=no
+  elif test x"$multi_arch" = xyes; then
+    AC_MSG_WARN([--enable-multi-arch support recommends a gcc with gnu-indirect-function support.
 Please use a gcc which supports it by default or configure gcc with --enable-gnu-indirect-function])
+  fi
 fi
 multi_arch_d=
 if test x"$multi_arch" != xno; then
@@ -699,7 +742,7 @@ tail=$machine${submachine:+/$submachine}
 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
+  if test "$libc_cv_with_fp" = yes; then
     maybe_fpu=/fpu
   else
     maybe_fpu=/nofpu
@@ -908,6 +951,9 @@ AC_CHECK_PROG_VER(SED, sed, --version,
 AC_CHECK_PROG_VER(AWK, gawk, --version,
   [GNU Awk[^0-9]*\([0-9][0-9.]*\)],
   [3.1.[2-9]*|3.[2-9]*|[4-9]*], critic_missing="$critic_missing gawk")
+AC_CHECK_PROG_VER(BISON, bison, --version,
+  [bison (GNU Bison) \([0-9]*\.[0-9.]*\)],
+  [2.7*|[3-9].*|[1-9][0-9]*], critic_missing="$critic_missing bison")
 
 AC_CACHE_CHECK([if $CC is sufficient to build libc], libc_cv_compiler_ok, [
 AC_TRY_COMPILE([], [
@@ -1039,10 +1085,6 @@ if test "$PERL" != no &&
 fi
 AC_PATH_PROG(INSTALL_INFO, install-info, no,
             $PATH:/usr/local/bin:/usr/local/sbin:/usr/bin:/usr/sbin:/bin:/sbin)
-AC_CHECK_PROG_VER(BISON, bison, --version,
-                 [bison (GNU Bison) \([0-9]*\.[0-9.]*\)],
-                 [2.7*|[3-9].*|[1-9][0-9]*],
-                 BISON=no)
 
 AC_CACHE_CHECK(for .set assembler directive, libc_cv_asm_set_directive, [dnl
 cat > conftest.s <<EOF
@@ -1250,6 +1292,19 @@ LIBC_LINKER_FEATURE([-z execstack], [-Wl,-z,execstack],
                    [libc_cv_z_execstack=yes], [libc_cv_z_execstack=no])
 AC_SUBST(libc_cv_z_execstack)
 
+LIBC_LINKER_FEATURE([--no-dynamic-linker],
+                   [-Wl,--no-dynamic-linker],
+                   [libc_cv_no_dynamic_linker=yes],
+                   [libc_cv_no_dynamic_linker=no])
+LIBC_CONFIG_VAR([have-no-dynamic-linker], [$libc_cv_no_dynamic_linker])
+
+AC_CACHE_CHECK(for -static-pie, libc_cv_static_pie, [dnl
+LIBC_TRY_CC_OPTION([-static-pie],
+                  [libc_cv_static_pie=yes],
+                  [libc_cv_static_pie=no])
+])
+LIBC_CONFIG_VAR([have-static-pie], [$libc_cv_static_pie])
+
 AC_CACHE_CHECK(for -fpie, libc_cv_fpie, [dnl
 LIBC_TRY_CC_OPTION([-fpie], [libc_cv_fpie=yes], [libc_cv_fpie=no])
 ])
@@ -1739,19 +1794,37 @@ fi
 rm -f conftest.*])
 AC_SUBST(libc_cv_pic_default)
 
-AC_CACHE_CHECK([whether -fPIE is default], libc_cv_pie_default,
-[libc_cv_pie_default=yes
+AC_CACHE_CHECK([whether -fPIE is default], libc_cv_cc_pie_default,
+[libc_cv_cc_pie_default=yes
 cat > conftest.c <<EOF
 #if defined __PIE__ || defined __pie__ || defined PIE || defined pie
 # error PIE is default.
 #endif
 EOF
 if eval "${CC-cc} -S conftest.c 2>&AS_MESSAGE_LOG_FD 1>&AS_MESSAGE_LOG_FD"; then
-  libc_cv_pie_default=no
+  libc_cv_cc_pie_default=no
 fi
 rm -f conftest.*])
+libc_cv_pie_default=$libc_cv_cc_pie_default
+AC_SUBST(libc_cv_cc_pie_default)
 AC_SUBST(libc_cv_pie_default)
 
+# Set the `multidir' variable by grabbing the variable from the compiler.
+# We do it once and save the result in a generated makefile.
+libc_cv_multidir=`${CC-cc} $CFLAGS $CPPFLAGS -print-multi-directory`
+AC_SUBST(libc_cv_multidir)
+
+if test "$static_pie" = yes; then
+  # The linker must support --no-dynamic-linker.
+  if test "$libc_cv_no_dynamic_linker" != yes; then
+    AC_MSG_ERROR([linker support for --no-dynamic-linker needed])
+  fi
+  # Default to PIE.
+  libc_cv_pie_default=yes
+  AC_DEFINE(ENABLE_STATIC_PIE)
+fi
+LIBC_CONFIG_VAR([enable-static-pie], [$static_pie])
+
 AC_SUBST(profile)
 AC_SUBST(static_nss)