Blame sysdeps/unix/sysv/linux/configure.ac

Packit 6c4009
GLIBC_PROVIDES dnl See aclocal.m4 in the top level source directory.
Packit 6c4009
# Local configure fragment for sysdeps/unix/sysv/linux.
Packit 6c4009
Packit 6c4009
define([LIBC_LINUX_VERSION],[3.2.0])dnl
Packit 6c4009
if test -n "$sysheaders"; then
Packit 6c4009
  OLD_CPPFLAGS=$CPPFLAGS
Packit 6c4009
  CPPFLAGS="$CPPFLAGS $SYSINCLUDES"
Packit 6c4009
fi
Packit 6c4009
define([libc_cv_linuxVER], [libc_cv_linux]patsubst(LIBC_LINUX_VERSION,[\.]))dnl
Packit 6c4009
AC_CACHE_CHECK(installed Linux kernel header files, libc_cv_linuxVER, [dnl
Packit 6c4009
AC_TRY_COMPILE([#include <linux/version.h>
Packit 6c4009
#if !defined LINUX_VERSION_CODE || LINUX_VERSION_CODE < ]dnl
Packit 6c4009
patsubst(LIBC_LINUX_VERSION,[^\([^.]*\)\.\([^.]*\)\.\([^.]*\)$],dnl
Packit 6c4009
[ (\1 *65536+ \2 *256+ \3) /* \1.\2.\3 */])[
Packit 6c4009
# error kernel headers missing or too old
Packit 6c4009
#endif], [],
Packit 6c4009
	       [libc_cv_linuxVER='LIBC_LINUX_VERSION or later'],
Packit 6c4009
	       [libc_cv_linuxVER='missing or too old!'])])
Packit 6c4009
if test "$libc_cv_linuxVER" != 'LIBC_LINUX_VERSION or later'; then
Packit 6c4009
  AC_MSG_ERROR([GNU libc requires kernel header files from
Packit 6c4009
Linux LIBC_LINUX_VERSION or later to be installed before configuring.
Packit 6c4009
The kernel header files are found usually in /usr/include/asm and
Packit 6c4009
/usr/include/linux; make sure these directories use files from
Packit 6c4009
Linux LIBC_LINUX_VERSION or later.  This check uses <linux/version.h>, so
Packit 6c4009
make sure that file was built correctly when installing the kernel header
Packit 6c4009
files.  To use kernel headers not from /usr/include/linux, use the
Packit 6c4009
configure option --with-headers.])
Packit 6c4009
fi
Packit 6c4009
Packit 6c4009
# If the user gave a minimal version number test whether the available
Packit 6c4009
# kernel headers are young enough.  Additionally we have minimal
Packit 6c4009
# kernel versions for some architectures.  If a previous configure fragment
Packit 6c4009
# set arch_minimum_kernel already, let that override our defaults here.
Packit 6c4009
# Note that we presume such a fragment has set libc_cv_gcc_unwind_find_fde
Packit 6c4009
# if appropriate too.
Packit 6c4009
test -n "$arch_minimum_kernel" || arch_minimum_kernel=3.2.0
Packit 6c4009
if test -n "$minimum_kernel"; then
Packit 6c4009
  changequote(,)
Packit 6c4009
  user_version=$((`echo "$minimum_kernel.0.0.0" | sed 's/\([0-9]*\)\.\([0-9]*\)\.\([0-9]*\).*/\1 \* 65536 + \2 \* 256 + \3/'`))
Packit 6c4009
  arch_version=$((`echo "$arch_minimum_kernel.0.0.0" | sed 's/\([0-9]*\)\.\([0-9]*\)\.\([0-9]*\).*/\1 \* 65536 + \2 \* 256 + \3/'`))
Packit 6c4009
  changequote([,])
Packit 6c4009
  if test $user_version -lt $arch_version; then
Packit 6c4009
    AC_MSG_WARN([minimum kernel version reset to $arch_minimum_kernel])
Packit 6c4009
    minimum_kernel=$arch_minimum_kernel
Packit 6c4009
  fi
Packit 6c4009
else
Packit 6c4009
  minimum_kernel=$arch_minimum_kernel
Packit 6c4009
fi
Packit 6c4009
Packit 6c4009
AC_MSG_CHECKING(for kernel header at least $minimum_kernel)
Packit 6c4009
changequote(,)dnl
Packit 6c4009
decnum=`echo "$minimum_kernel.0.0.0" | sed 's/\([0-9]*\)\.\([0-9]*\)\.\([0-9]*\).*/(\1 * 65536 + \2 * 256 + \3)/'`;
Packit 6c4009
abinum=`echo "$minimum_kernel.0.0.0" | sed 's/\([0-9]*\)\.\([0-9]*\)\.\([0-9]*\).*/\1,\2,\3/'`;
Packit 6c4009
changequote([,])dnl
Packit 6c4009
AC_TRY_COMPILE([#include <linux/version.h>
Packit 6c4009
#if LINUX_VERSION_CODE < $decnum
Packit 6c4009
# error kernel headers too old
Packit 6c4009
#endif], [], [libc_minimum_kernel=ok], [libc_minimum_kernel='too old!'])
Packit 6c4009
AC_MSG_RESULT($libc_minimum_kernel)
Packit 6c4009
if test "$libc_minimum_kernel" = ok; then
Packit 6c4009
  AC_DEFINE_UNQUOTED(__LINUX_KERNEL_VERSION, $decnum)
Packit 6c4009
  AC_DEFINE_UNQUOTED(__ABI_TAG_VERSION, $abinum)
Packit 6c4009
else
Packit 6c4009
  AC_MSG_ERROR([*** The available kernel headers are older than the requested
Packit 6c4009
*** compatible kernel version])
Packit 6c4009
fi
Packit 6c4009
Packit 6c4009
if test -n "$sysheaders"; then
Packit 6c4009
  CPPFLAGS=$OLD_CPPFLAGS
Packit 6c4009
fi
Packit 6c4009
Packit 6c4009
if test "$prefix" = "/usr/local" -o "$prefix" = "/usr/local/" -o "$prefix" = "NONE"; then
Packit 6c4009
  if test $enable_sanity = yes; then
Packit 6c4009
    echo "\
Packit 6c4009
*** On GNU/Linux systems the GNU C Library should not be installed into
Packit 6c4009
*** /usr/local since this might make your system totally unusable.
Packit 6c4009
*** We strongly advise to use a different prefix.  For details read the FAQ.
Packit 6c4009
*** If you really mean to do this, run configure again using the extra
Packit 6c4009
*** parameter \`--disable-sanity-checks'."
Packit 6c4009
    exit 1
Packit 6c4009
  else
Packit 6c4009
    echo "\
Packit 6c4009
*** WARNING: Do you really want to install the GNU C Library into /usr/local?
Packit 6c4009
*** This might make your system totally unusable, for details read the FAQ."
Packit 6c4009
  fi
Packit 6c4009
fi
Packit 6c4009
Packit 6c4009
Packit 6c4009
# One Linux we use ldconfig.
Packit 6c4009
use_ldconfig=yes
Packit 6c4009
Packit 6c4009
if test $host = $build; then
Packit 6c4009
  # If $prefix/include/{net,scsi} are symlinks, make install will
Packit 6c4009
  # clobber what they're linked to (probably a kernel tree).
Packit 6c4009
  # test -L ought to work on all Linux boxes.
Packit 6c4009
  if test "x$prefix" != xNONE; then
Packit 6c4009
    ac_prefix=$prefix
Packit 6c4009
  else
Packit 6c4009
    ac_prefix=$ac_default_prefix
Packit 6c4009
  fi
Packit 6c4009
  AC_MSG_CHECKING([for symlinks in ${ac_prefix}/include])
Packit 6c4009
  ac_message=
Packit 6c4009
  if test -L ${ac_prefix}/include/net; then
Packit 6c4009
    ac_message="$ac_message
Packit 6c4009
   ${ac_prefix}/include/net is a symlink"
Packit 6c4009
  fi
Packit 6c4009
  if test -L ${ac_prefix}/include/scsi; then
Packit 6c4009
    ac_message="$ac_message
Packit 6c4009
   ${ac_prefix}/include/scsi is a symlink"
Packit 6c4009
  fi
Packit 6c4009
  if test -n "$ac_message"; then
Packit 6c4009
    AC_MSG_ERROR([$ac_message
Packit 6c4009
\`make install' will destroy the target of the link(s).
Packit 6c4009
Delete the links and re-run configure, or better still, move the entire
Packit 6c4009
${ac_prefix}/include directory out of the way.])
Packit 6c4009
  else
Packit 6c4009
    AC_MSG_RESULT(ok)
Packit 6c4009
  fi
Packit 6c4009
fi
Packit 6c4009
Packit 6c4009
# We have inlined syscalls.
Packit 6c4009
AC_DEFINE(HAVE_INLINED_SYSCALLS)