1 GLIBC_PROVIDES dnl See aclocal.m4 in the top level source directory.
2 # Local configure fragment for sysdeps/unix/sysv/linux.
4 # Don't bother trying to generate any glue code to be compatible with the
5 # existing system library, because we are the only system library.
8 define([LIBC_LINUX_VERSION],[2.6.19])dnl
9 if test -n "$sysheaders"; then
10 OLD_CPPFLAGS=$CPPFLAGS
11 CPPFLAGS="$CPPFLAGS $SYSINCLUDES"
13 define([libc_cv_linuxVER], [libc_cv_linux]patsubst(LIBC_LINUX_VERSION,[\.]))dnl
14 AC_CACHE_CHECK(installed Linux kernel header files, libc_cv_linuxVER, [dnl
15 AC_EGREP_CPP([eat flaming death], [#include <linux/version.h>
16 #if !defined LINUX_VERSION_CODE || LINUX_VERSION_CODE < ]dnl
17 patsubst(LIBC_LINUX_VERSION,[^\([^.]*\)\.\([^.]*\)\.\([^.]*\)$],dnl
18 [ (\1 *65536+ \2 *256+ \3) /* \1.\2.\3 */])[
21 libc_cv_linuxVER='TOO OLD!',
22 libc_cv_linuxVER='LIBC_LINUX_VERSION or later')])
23 if test "$libc_cv_linuxVER" != 'LIBC_LINUX_VERSION or later'; then
24 AC_MSG_ERROR([GNU libc requires kernel header files from
25 Linux LIBC_LINUX_VERSION or later to be installed before configuring.
26 The kernel header files are found usually in /usr/include/asm and
27 /usr/include/linux; make sure these directories use files from
28 Linux LIBC_LINUX_VERSION or later. This check uses <linux/version.h>, so
29 make sure that file was built correctly when installing the kernel header
30 files. To use kernel headers not from /usr/include/linux, use the
31 configure option --with-headers.])
34 # If the user gave a minimal version number test whether the available
35 # kernel headers are young enough. Additionally we have minimal
36 # kernel versions for some architectures. If a previous configure fragment
37 # set arch_minimum_kernel already, let that override our defaults here.
38 # Note that we presume such a fragment has set libc_cv_gcc_unwind_find_fde
40 test -n "$arch_minimum_kernel" ||
43 libc_cv_gcc_unwind_find_fde=yes
44 arch_minimum_kernel=2.6.16
47 arch_minimum_kernel=3.4.0
50 libc_cv_gcc_unwind_find_fde=yes
51 arch_minimum_kernel=2.6.16
54 libc_cv_gcc_unwind_find_fde=yes
55 arch_minimum_kernel=2.6.16
58 libc_cv_gcc_unwind_find_fde=yes
59 arch_minimum_kernel=2.6.16
62 arch_minimum_kernel=2.6.16
63 libc_cv_gcc_unwind_find_fde=yes
66 libc_cv_gcc_unwind_find_fde=yes
67 arch_minimum_kernel=2.6.16
70 libc_cv_gcc_unwind_find_fde=yes
71 arch_minimum_kernel=2.6.16
74 arch_minimum_kernel=2.6.16
77 if test -n "$minimum_kernel"; then
79 user_version=$((`echo "$minimum_kernel.0.0.0" | sed 's/\([0-9]*\)\.\([0-9]*\)\.\([0-9]*\).*/\1 \* 65536 + \2 \* 256 + \3/'`))
80 arch_version=$((`echo "$arch_minimum_kernel.0.0.0" | sed 's/\([0-9]*\)\.\([0-9]*\)\.\([0-9]*\).*/\1 \* 65536 + \2 \* 256 + \3/'`))
82 if test $user_version -lt $arch_version; then
83 AC_MSG_WARN([minimum kernel version reset to $arch_minimum_kernel])
84 minimum_kernel=$arch_minimum_kernel
87 minimum_kernel=$arch_minimum_kernel
90 AC_MSG_CHECKING(for kernel header at least $minimum_kernel)
92 decnum=`echo "$minimum_kernel.0.0.0" | sed 's/\([0-9]*\)\.\([0-9]*\)\.\([0-9]*\).*/(\1 * 65536 + \2 * 256 + \3)/'`;
93 abinum=`echo "$minimum_kernel.0.0.0" | sed 's/\([0-9]*\)\.\([0-9]*\)\.\([0-9]*\).*/\1,\2,\3/'`;
95 AC_EGREP_CPP([eat flaming death], [#include <linux/version.h>
96 #if LINUX_VERSION_CODE < $decnum
98 #endif], libc_minimum_kernel='too old!', libc_minimum_kernel=ok)
99 AC_MSG_RESULT($libc_minimum_kernel)
100 if test "$libc_minimum_kernel" = ok; then
101 AC_DEFINE_UNQUOTED(__LINUX_KERNEL_VERSION, $decnum)
102 AC_DEFINE_UNQUOTED(__ABI_TAG_VERSION, $abinum)
104 AC_MSG_ERROR([*** The available kernel headers are older than the requested
105 *** compatible kernel version])
108 # The result of the above test for the use of the FDE code is invalid if
109 # the user overrides the decision about the minimum ABI.
110 if test "$oldest_abi" != default && test "2.2.4" \< "$oldest_abi"; then
111 libc_cv_gcc_unwind_find_fde=no
114 if test -n "$sysheaders"; then
115 CPPFLAGS=$OLD_CPPFLAGS
118 # Under Linux the NPTL add-on should be available.
120 # It is available. Good.
129 if test "$nptl_missing"; then
130 if test $enable_sanity = yes; then
132 *** On GNU/Linux systems it is normal to compile GNU libc with the
133 *** \`nptl' add-on. Without that, the library will be
134 *** incompatible with normal GNU/Linux systems.
135 *** If you really mean to not use this add-on, run configure again
136 *** using the extra parameter \`--disable-sanity-checks'."
140 *** WARNING: Are you sure you do not want to use the \`nptl'
145 if test "$prefix" = "/usr/local" -o "$prefix" = "/usr/local/" -o "$prefix" = "NONE"; then
146 if test $enable_sanity = yes; then
148 *** On GNU/Linux systems the GNU C Library should not be installed into
149 *** /usr/local since this might make your system totally unusable.
150 *** We strongly advise to use a different prefix. For details read the FAQ.
151 *** If you really mean to do this, run configure again using the extra
152 *** parameter \`--disable-sanity-checks'."
156 *** WARNING: Do you really want to install the GNU C Library into /usr/local?
157 *** This might make your system totally unusable, for details read the FAQ."
162 # One Linux we use ldconfig.
165 # We need some extensions to the `ldd' script.
169 ldd_rewrite_script=sysdeps/unix/sysv/linux/ldd-rewrite.sed
172 ldd_rewrite_script=sysdeps/unix/sysv/linux/s390/ldd-rewrite.sed
175 ldd_rewrite_script=sysdeps/unix/sysv/linux/sparc/ldd-rewrite.sed
178 ldd_rewrite_script=sysdeps/unix/sysv/linux/x86_64/ldd-rewrite.sed
181 ldd_rewrite_script=sysdeps/unix/sysv/linux/powerpc/ldd-rewrite.sed
188 if test $host = $build; then
189 # If $prefix/include/{net,scsi} are symlinks, make install will
190 # clobber what they're linked to (probably a kernel tree).
191 # test -L ought to work on all Linux boxes.
192 if test "x$prefix" != xNONE; then
195 ac_prefix=$ac_default_prefix
197 AC_MSG_CHECKING([for symlinks in ${ac_prefix}/include])
199 if test -L ${ac_prefix}/include/net; then
200 ac_message="$ac_message
201 ${ac_prefix}/include/net is a symlink"
203 if test -L ${ac_prefix}/include/scsi; then
204 ac_message="$ac_message
205 ${ac_prefix}/include/scsi is a symlink"
207 if test -n "$ac_message"; then
208 AC_MSG_ERROR([$ac_message
209 \`make install' will destroy the target of the link(s).
210 Delete the links and re-run configure, or better still, move the entire
211 ${ac_prefix}/include directory out of the way.])
217 # We have inlined syscalls.
218 AC_DEFINE(HAVE_INLINED_SYSCALLS)