Remove pre-2.4 Linux kernel support.
[platform/upstream/glibc.git] / configure.in
index 2363015..38b55a6 100644 (file)
@@ -104,14 +104,6 @@ AC_ARG_ENABLE([sanity-checks],
              [enable_sanity=$enableval],
              [enable_sanity=yes])
 
-AC_SUBST(enable_check_abi)
-AC_ARG_ENABLE([check-abi],
-             AC_HELP_STRING([--enable-check-abi],
-                            [do "make check-abi" in "make check" (no/warn/yes)
-                             @<:@default=no@:>@]),
-             [enable_check_abi=$enableval],
-             [enable_check_abi=no])
-
 AC_ARG_ENABLE([shared],
              AC_HELP_STRING([--enable-shared],
                             [build shared library @<:@default=yes if GNU ld@:>@]),
@@ -260,6 +252,17 @@ else
 fi
 AC_SUBST(libc_cv_nss_crypt)
 
+AC_ARG_ENABLE([obsolete-rpc],
+              AC_HELP_STRING([--enable-obsolete-rpc],
+                             [build and install the obsolete RPC code for link-time usage]),
+              [link_obsolete_rpc=$enableval],
+              [link_obsolete_rpc=no])
+AC_SUBST(link_obsolete_rpc)
+
+if test "$link_obsolete_rpc" = yes; then
+  AC_DEFINE(LINK_OBSOLETE_RPC)
+fi
+
 # The way shlib-versions is used to generate soversions.mk uses a
 # fairly simplistic model for name recognition that can't distinguish
 # i486-pc-linux-gnu fully from i486-pc-gnu.  So we mutate a $host_os
@@ -463,7 +466,7 @@ AC_SUBST(add_on_subdirs)
 ###
 if test -z "$enable_hacker_mode" && test x"$libc_config_ok" != xyes; then
   case "$machine-$host_os" in
-  *-linux* | *-gnu* | arm*-none*)
+  *-linux* | *-gnu*)
     ;;
   *)
     echo "*** The GNU C library is currently not available for this platform."
@@ -615,18 +618,8 @@ os="`echo $os | sed 's/\([0-9A-Z]\)[v_]\([0-9A-Z]\)/\1.\2/g'`"
 test "x$base_os" != x || case "$os" in
 gnu*)
   base_os=mach/hurd ;;
-netbsd* | 386bsd* | freebsd* | bsdi*)
-  base_os=unix/bsd/bsd4.4 ;;
-osf* | sunos* | ultrix* | newsos* | dynix* | *bsd*)
-  base_os=unix/bsd ;;
-sysv* | isc* | esix* | sco* | minix* | irix4* | linux*)
+linux*)
   base_os=unix/sysv ;;
-irix6*)
-  base_os=unix/sysv/irix6/$os ;;
-solaris[2-9]*)
-  base_os=unix/sysv/sysv4 ;;
-none)
-  base_os=standalone ;;
 esac
 
 # For sunos4.1.1, try sunos4.1.1, then sunos4.1, then sunos4, then sunos.
@@ -743,23 +736,6 @@ AC_SUBST(submachine)
 
 # We have now validated the configuration.
 
-
-# Look for an `elf' subdirectory of each machine directory.
-# We prepend these rather than inserting them whereever the machine appears
-# because things specified by the machine's ELF ABI should override
-# OS-specific things, and should always be the same for any OS on the
-# machine (otherwise what's the point of an ABI?).
-elf_dirs=
-for d in $add_ons_pfx ''; do
-  for m in $mach; do
-    if test -d $srcdir/${d}sysdeps$m/elf; then
-      elf_dirs="$elf_dirs ${d}sysdeps$m/elf"
-    fi
-  done
-done
-sysnames="`echo $elf_dirs | sed -e 's,//,/,g'` $sysnames"
-
-
 # Expand the list of system names into a full list of directories
 # from each element's parent name and Implies file (if present).
 set $sysnames
@@ -785,41 +761,42 @@ while test $# -gt 0; do
   test -n "$enable_debug_configure" &&
   echo "[DEBUG]: name/Implies $xsrcdir$name/Implies" >&2
 
-  if test -f $xsrcdir$name/Implies; then
-    # Collect more names from the `Implies' file (removing comments).
-    implied_candidate="`sed 's/#.*$//' < $xsrcdir$name/Implies`"
-    implied=
-    for x in $implied_candidate; do
-      found=no
-      if test -d $xsrcdir$name_base/$x; then
-       implied="$implied $name_base/$x";
-       found=yes
-      fi
-      for d in $add_ons_pfx ''; do
-       try="${d}sysdeps/$x"
-       case $d in
-        /*) try_srcdir= ;;
-        *) try_srcdir=$srcdir/ ;;
-       esac
-       test -n "$enable_debug_configure" &&
-        echo "[DEBUG]: $name implied $x try($d) {$try_srcdir}$try" >&2
-       if test $try != $xsrcdir$name_base/$x && test -d $try_srcdir$try;
-       then
-         implied="$implied $try"
+  for implies_file in Implies Implies-before Implies-after; do
+    implies_type=`echo $implies_file | sed s/-/_/`
+    eval ${implies_type}=
+    if test -f $xsrcdir$name/$implies_file; then
+      # Collect more names from the `Implies' file (removing comments).
+      implied_candidate="`sed 's/#.*$//' < $xsrcdir$name/$implies_file`"
+      for x in $implied_candidate; do
+       found=no
+       if test -d $xsrcdir$name_base/$x; then
+         eval "${implies_type}=\"\$${implies_type} \$name_base/\$x\""
          found=yes
-         case "$sysnames_add_ons" in
-         *" $d "*) ;;
-         *|'') sysnames_add_ons="$sysnames_add_ons $d" ;;
+       fi
+       for d in $add_ons_pfx ''; do
+         try="${d}sysdeps/$x"
+         case $d in
+          /*) try_srcdir= ;;
+          *) try_srcdir=$srcdir/ ;;
          esac
+         test -n "$enable_debug_configure" &&
+          echo "[DEBUG]: $name $implies_file $x try($d) {$try_srcdir}$try" >&2
+         if test $try != $xsrcdir$name_base/$x && test -d $try_srcdir$try;
+         then
+           eval "${implies_type}=\"\$${implies_type} \$try\""
+           found=yes
+           case "$sysnames_add_ons" in
+           *" $d "*) ;;
+           *|'') sysnames_add_ons="$sysnames_add_ons $d" ;;
+           esac
+         fi
+       done
+       if test $found = no; then
+         AC_MSG_WARN($name/$implies_file specifies nonexistent $x)
        fi
       done
-      if test $found = no; then
-       AC_MSG_WARN($name/Implies specifies nonexistent $x)
-      fi
-    done
-  else
-    implied=
-  fi
+    fi
+  done
 
   # Add NAME to the list of names.
   names="$names $name"
@@ -829,6 +806,10 @@ changequote(,)dnl
   parent="`echo $name | sed -n -e 's=/[^/]*$==' -e '/sysdeps$/q' -e p`"
 changequote([,])dnl
 
+  test -n "$enable_debug_configure" &&
+    echo "[DEBUG]: $name Implies='$Implies' rest='$*' parent='$parent' \
+Implies_before='$Implies_after' Implies_after='$Implies_after'" >&2
+
   # Add the names implied by NAME, and NAME's parent (if it has one), to
   # the list of names to be processed (the argument list).  We prepend the
   # implied names to the list and append the parent.  We want implied
@@ -836,12 +817,12 @@ changequote([,])dnl
   # configuration components; this ensures that for sysv4, unix/common
   # (implied by unix/sysv/sysv4) comes before unix/sysv (in ostry (here $*)
   # after sysv4).
-  sysnames="`echo $implied $* $parent`"
+  sysnames="`echo $Implies $* $Implies_before $parent $Implies_after`"
   test -n "$sysnames" && set $sysnames
 done
 
 # Add the default directories.
-default_sysnames="sysdeps/generic/elf sysdeps/generic"
+default_sysnames="sysdeps/generic"
 sysnames="$names $default_sysnames"
 AC_SUBST(sysnames)
 # The other names were emitted during the scan.
@@ -938,7 +919,7 @@ AC_CHECK_PROG_VER(MSGFMT, gnumsgfmt gmsgfmt msgfmt, --version,
   MSGFMT=: aux_missing="$aux_missing msgfmt")
 AC_CHECK_PROG_VER(MAKEINFO, makeinfo, --version,
   [GNU texinfo.* \([0-9][0-9.]*\)],
-  [4.*],
+  [4.[5-9]*|4.[1-9][0-9]*|[5-9].*],
   MAKEINFO=: aux_missing="$aux_missing makeinfo")
 AC_CHECK_PROG_VER(SED, sed, --version,
   [GNU sed version \([0-9]*\.[0-9.]*\)],
@@ -946,6 +927,7 @@ AC_CHECK_PROG_VER(SED, sed, --version,
   SED=: aux_missing="$aux_missing sed")
 
 AC_CHECK_TOOL(READELF, readelf, false)
+AC_CHECK_TOOL(NM, nm, false)
 
 AC_CHECK_PROGS(AUTOCONF, autoconf, no)
 case "x$AUTOCONF" in
@@ -1536,37 +1518,6 @@ fi
 rm -f conftest*])
 AC_SUBST(libc_cv_Bgroup)
 
-AC_CACHE_CHECK(for libgcc_s suffix,
-              libc_cv_libgcc_s_suffix, [dnl
-cat > conftest.c <<EOF
-int main (void) { return 0; }
-EOF
-changequote(,)dnl
-libc_cv_libgcc_s_suffix=`${CC-cc} $CFLAGS $CPPFLAGS $LDFLAGS \
-                          -fPIC -shared -shared-libgcc -o conftest.so \
-                          conftest.c -v 2>&1 >/dev/null \
-                          | sed -n 's/^.* -lgcc_s\([^ ]*\) .*$/\1/p'`
-changequote([,])dnl
-rm -f conftest*])
-AC_SUBST(libc_cv_libgcc_s_suffix)
-
-AC_CACHE_CHECK(for --as-needed option,
-              libc_cv_as_needed, [dnl
-cat > conftest.c <<EOF
-int main (void) { return 0; }
-EOF
-if AC_TRY_COMMAND([${CC-cc} $CFLAGS $CPPFLAGS $LDFLAGS
-                             -fPIC -shared -o conftest.so conftest.c
-                             -lgcc_s$libc_cv_libgcc_s_suffix -Wl,--as-needed
-                             -nostdlib 1>&AS_MESSAGE_LOG_FD])
-then
-  libc_cv_as_needed=yes
-else
-  libc_cv_as_needed=no
-fi
-rm -f conftest*])
-AC_SUBST(libc_cv_as_needed)
-
 ASFLAGS_config=
 AC_CACHE_CHECK(whether --noexecstack is desirable for .S files,
               libc_cv_as_noexecstack, [dnl
@@ -2086,6 +2037,62 @@ AC_CHECK_SIZEOF(long double, 0)
 sizeof_long_double=$ac_cv_sizeof_long_double
 AC_SUBST(sizeof_long_double)
 
+CPPUNDEFS=
+dnl Check for silly hacked compilers predefining _FORTIFY_SOURCE.
+dnl Since we are building the implementations of the fortified functions here,
+dnl having the macro defined interacts very badly.
+AC_CACHE_CHECK([for _FORTIFY_SOURCE predefine], libc_cv_predef_fortify_source,
+[AC_TRY_COMPILE([], [
+#ifdef _FORTIFY_SOURCE
+# error bogon
+#endif],
+               [libc_cv_predef_fortify_source=no],
+               [libc_cv_predef_fortify_source=yes])])
+if test $libc_cv_predef_fortify_source = yes; then
+  CPPUNDEFS="${CPPUNDEFS:+$CPPUNDEFS }-U_FORTIFY_SOURCE"
+fi
+AC_SUBST(CPPUNDEFS)
+
+dnl Check for silly hacked compilers inserting -fstack-protector.
+dnl This breaks badly for the early startup code we compile, since
+dnl the compiled code can refer to a magic machine-dependent location
+dnl for the canary value before we have sufficient setup for that to
+dnl work.  It's also questionable to build all of libc with this flag
+dnl even when you're doing that for most applications you build, since
+dnl libc's code is so heavily-used and performance-sensitive.  If we
+dnl ever really want to make that work, it should be enabled explicitly
+dnl in the libc build, not inherited from implicit compiler settings.
+AC_CACHE_CHECK([whether $CC implicitly enables -fstack-protector],
+              libc_cv_predef_stack_protector, [
+AC_TRY_COMPILE([extern void foobar (char *);],
+              [char large_array[2048]; foobar (large_array);], [
+libc_undefs=`$NM -u conftest.o |
+  LC_ALL=C $AWK '$1 == "U" { print $2 | "sort -u"; next } { exit(1) }' \
+    2>&AS_MESSAGE_LOG_FD` || {
+  AC_MSG_ERROR([confusing output from $NM -u])
+}
+echo >&AS_MESSAGE_LOG_FD "libc_undefs='$libc_undefs'"
+# On some architectures, there are architecture-specific undefined
+# symbols (resolved by the linker), so filter out unknown symbols.
+# This will fail to produce the correct result if the compiler
+# defaults to -fstack-protector but this produces an undefined symbol
+# other than __stack_chk_fail.  However, compilers like that have not
+# been encountered in practice.
+libc_undefs=`echo "$libc_undefs" | egrep '^(foobar|__stack_chk_fail)$'`
+case "$libc_undefs" in
+foobar) libc_cv_predef_stack_protector=no ;;
+'__stack_chk_fail
+foobar') libc_cv_predef_stack_protector=yes ;;
+*) AC_MSG_ERROR([unexpected symbols in test: $libc_undefs]) ;;
+esac],
+              [AC_MSG_ERROR([test compilation failed])])
+])
+libc_extra_cflags=
+if test $libc_cv_predef_stack_protector = yes; then
+  libc_extra_cflags=-fno-stack-protector
+fi
+AC_SUBST(libc_extra_cflags)
+
 ### End of automated tests.
 ### Now run sysdeps configure fragments.