1 sinclude(./aclocal.m4)dnl Autoconf lossage
2 GLIBC_PROVIDES dnl See aclocal.m4 in the top level source directory.
3 # Local configure fragment for sysdeps/unix/sysv/linux.
5 # On Linux, the default is to use libio instead of stdio.
6 test $stdio = default && stdio=libio
8 # Don't bother trying to generate any glue code to be compatible with the
9 # existing system library, because we are the only system library.
12 define([LIBC_LINUX_VERSION],[2.0.10])dnl
13 if test -n "$sysheaders"; then
14 OLD_CPPFLAGS=$CPPFLAGS
15 CPPFLAGS="$CPPFLAGS $SYSINCLUDES"
17 define([libc_cv_linuxVER], [libc_cv_linux]patsubst(LIBC_LINUX_VERSION,[\.]))dnl
18 AC_CACHE_CHECK(installed Linux kernel header files, libc_cv_linuxVER, [dnl
19 AC_EGREP_CPP([eat flaming death], [#include <linux/version.h>
20 #if !defined LINUX_VERSION_CODE || LINUX_VERSION_CODE < ]dnl
21 patsubst(LIBC_LINUX_VERSION,[^\([^.]*\)\.\([^.]*\)\.\([^.]*\)$],dnl
22 [ (\1 *65536+ \2 *256+ \3) /* \1.\2.\3 */])[
25 libc_cv_linuxVER='TOO OLD!',
26 libc_cv_linuxVER='LIBC_LINUX_VERSION or later')])
27 if test "$libc_cv_linuxVER" != 'LIBC_LINUX_VERSION or later'; then
28 AC_MSG_ERROR([GNU libc requires kernel header files from
29 Linux LIBC_LINUX_VERSION or later to be installed before configuring.
30 The kernel header files are found usually in /usr/include/asm and
31 /usr/include/linux; make sure these directories use files from
32 Linux LIBC_LINUX_VERSION or later. This check uses <linux/version.h>, so
33 make sure that file was built correctly when installing the kernel header
34 files. To use kernel headers not from /usr/include/linux, use the
35 configure option --with-headers.])
38 # If the user gave a minimal version number test whether the available
39 # kernel headers are young enough. Additionally we have minimal
40 # kernel versions for some architectures.
43 arch_minimum_kernel=2.2.15
46 arch_minimum_kernel=2.3.99
49 arch_minimum_kernel=2.4.0
52 arch_minimum_kernel=2.3.99
55 arch_minimum_kernel=2.0.10
58 if test -n "$minimum_kernel"; then
60 user_version=$((`echo "$minimum_kernel.0.0.0" | sed 's/\([0-9]*\)\.\([0-9]*\)\.\([0-9]*\).*/\1 \* 65536 + \2 \* 256 + \3/'`))
61 arch_version=$((`echo "$arch_minimum_kernel.0.0.0" | sed 's/\([0-9]*\)\.\([0-9]*\)\.\([0-9]*\).*/\1 \* 65536 + \2 \* 256 + \3/'`))
63 if test $user_version -lt $arch_version; then
64 AC_MSG_WARN([minimum kernel version reset to $arch_minimum_kernel])
65 minimum_kernel=$arch_minimum_kernel
68 if test $arch_minimum_kernel != '2.0.10'; then
69 minimum_kernel=$arch_minimum_kernel
73 if test -n "$minimum_kernel"; then
74 AC_MSG_CHECKING(for kernel header at least $minimum_kernel)
76 decnum=`echo "$minimum_kernel.0.0.0" | sed 's/\([0-9]*\)\.\([0-9]*\)\.\([0-9]*\).*/(\1 * 65536 + \2 * 256 + \3)/'`;
77 abinum=`echo "$minimum_kernel.0.0.0" | sed 's/\([0-9]*\)\.\([0-9]*\)\.\([0-9]*\).*/\1,\2,\3/'`;
79 AC_EGREP_CPP([eat flaming death], [#include <linux/version.h>
80 #if LINUX_VERSION_CODE < $decnum
82 #endif], libc_minimum_kernel='too old!', libc_minimum_kernel=ok)
83 AC_MSG_RESULT($libc_minimum_kernel)
84 if test "$libc_minimum_kernel" = ok; then
85 AC_DEFINE_UNQUOTED(__LINUX_KERNEL_VERSION, $decnum)
86 AC_DEFINE_UNQUOTED(__ABI_TAG_VERSION, $abinum)
88 AC_MSG_ERROR([*** The available kernel headers are older than the requested
89 *** compatible kernel version])
93 if test -n "$sysheaders"; then
94 CPPFLAGS=$OLD_CPPFLAGS
96 # The Linux filesystem standard prescribes where to place "essential"
97 # files. I.e., when the installation prefix is "/usr" we have to place
98 # shared library objects and the configuration files on the root partition
100 if test "$prefix" = "/usr" -o "$prefix" = "/usr/"; then
101 # 64bit libraries on sparc go to /lib64 and not /lib
102 if test "$machine" = "sparc/sparc64"; then
103 libc_cv_slibdir="/lib64"
104 if test "$libdir" = '${exec_prefix}/lib'; then
105 libdir='${exec_prefix}/lib64';
106 # Locale data can be shared between 32bit and 64bit libraries
107 libc_cv_localedir='${exec_prefix}/lib/locale'
110 libc_cv_slibdir="/lib"
112 # Allow the user to override the path with --sysconfdir
113 if test $sysconfdir = '${prefix}/etc'; then
114 libc_cv_sysconfdir=/etc
116 libc_cv_sysconfdir=$sysconfdir
118 libc_cv_rootsbindir="/sbin"
121 # Under Linux the LinuxThreads add-on should be available.
123 # It is available. Good.
129 *** WARNING: Are you sure you do not want to use the \`linuxthreads'
134 if test "$message"; then
135 if test $enable_sanity = yes; then
137 *** You should not compile the GNU libc without the \`linuxthreads'
138 *** add-on. Not using them risks being incompatible with the
139 *** libraries of other systems. Consider getting the add-on and restarting
140 *** the configuration.
141 *** If you really mean to not use this add-on, run configure again
142 *** using the extra parameter \`--disable-sanity-checks'."
149 # One Linux we use ldconfig.
152 # We need some extensions to the `ldd' script.
156 ldd_rewrite_script=../sysdeps/unix/sysv/linux/ldd-rewrite.sed
159 ldd_rewrite_script=../sysdeps/unix/sysv/linux/sparc/ldd-rewrite.sed
166 if test $host = $build; then
167 # If $prefix/include/{net,scsi} are symlinks, make install will
168 # clobber what they're linked to (probably a kernel tree).
169 # test -L ought to work on all Linux boxes.
170 if test "x$prefix" != xNONE; then
173 ac_prefix=$ac_default_prefix
175 AC_MSG_CHECKING([for symlinks in ${ac_prefix}/include])
177 if test -L ${ac_prefix}/include/net; then
178 ac_message="$ac_message
179 ${ac_prefix}/include/net is a symlink"
181 if test -L ${ac_prefix}/include/scsi; then
182 ac_message="$ac_message
183 ${ac_prefix}/include/scsi is a symlink"
185 if test -n "$ac_message"; then
186 AC_MSG_ERROR([$ac_message
187 \`make install' will destroy the target of the link(s).
188 Delete the links and re-run configure, or better still, move the entire
189 ${ac_prefix}/include directory out of the way.])