1 GLIBC_PROVIDES dnl See aclocal.m4 in the top level source directory.
2 # Local configure fragment for sysdeps/unix/sysv/linux.
4 # The Linux kernel headers can be found in
5 # /lib/modules/$(uname -r)/build/include
6 # Check whether this directory is available.
7 if test -z "$sysheaders" &&
8 test "x$cross_compiling" = xno &&
9 test -d /lib/modules/`uname -r`/build/include; then
10 sysheaders="/lib/modules/`uname -r`/build/include"
11 ccheaders=`$CC -print-file-name=include`
12 dnl We don't have to use -nostdinc. We just want one more directory
14 SYSINCLUDES="-I $sysheaders"
17 # Don't bother trying to generate any glue code to be compatible with the
18 # existing system library, because we are the only system library.
21 define([LIBC_LINUX_VERSION],[2.0.10])dnl
22 if test -n "$sysheaders"; then
23 OLD_CPPFLAGS=$CPPFLAGS
24 CPPFLAGS="$CPPFLAGS $SYSINCLUDES"
26 define([libc_cv_linuxVER], [libc_cv_linux]patsubst(LIBC_LINUX_VERSION,[\.]))dnl
27 AC_CACHE_CHECK(installed Linux kernel header files, libc_cv_linuxVER, [dnl
28 AC_EGREP_CPP([eat flaming death], [#include <linux/version.h>
29 #if !defined LINUX_VERSION_CODE || LINUX_VERSION_CODE < ]dnl
30 patsubst(LIBC_LINUX_VERSION,[^\([^.]*\)\.\([^.]*\)\.\([^.]*\)$],dnl
31 [ (\1 *65536+ \2 *256+ \3) /* \1.\2.\3 */])[
34 libc_cv_linuxVER='TOO OLD!',
35 libc_cv_linuxVER='LIBC_LINUX_VERSION or later')])
36 if test "$libc_cv_linuxVER" != 'LIBC_LINUX_VERSION or later'; then
37 AC_MSG_ERROR([GNU libc requires kernel header files from
38 Linux LIBC_LINUX_VERSION or later to be installed before configuring.
39 The kernel header files are found usually in /usr/include/asm and
40 /usr/include/linux; make sure these directories use files from
41 Linux LIBC_LINUX_VERSION or later. This check uses <linux/version.h>, so
42 make sure that file was built correctly when installing the kernel header
43 files. To use kernel headers not from /usr/include/linux, use the
44 configure option --with-headers.])
47 # If the user gave a minimal version number test whether the available
48 # kernel headers are young enough. Additionally we have minimal
49 # kernel versions for some architectures. If a previous configure fragment
50 # set arch_minimum_kernel already, let that override our defaults here.
51 # Note that we presume such a fragment has set libc_cv_gcc_unwind_find_fde
53 test -n "$arch_minimum_kernel" ||
56 arch_minimum_kernel=2.1.100
57 libc_cv_gcc_unwind_find_fde=yes
60 arch_minimum_kernel=2.0.10
61 libc_cv_gcc_unwind_find_fde=yes
64 libc_cv_gcc_unwind_find_fde=yes
65 arch_minimum_kernel=2.0.10
68 arch_minimum_kernel=2.4.0
71 libc_cv_gcc_unwind_find_fde=yes
72 arch_minimum_kernel=2.4.19
75 arch_minimum_kernel=2.0.10
76 libc_cv_gcc_unwind_find_fde=yes
79 libc_cv_gcc_unwind_find_fde=yes
80 arch_minimum_kernel=2.0.10
83 arch_minimum_kernel=2.4.21
86 libc_cv_gcc_unwind_find_fde=yes
87 arch_minimum_kernel=2.2.10
90 libc_cv_gcc_unwind_find_fde=yes
91 arch_minimum_kernel=2.4.0
94 arch_minimum_kernel=2.3.99
95 libc_cv_gcc_unwind_find_fde=yes
98 libc_cv_gcc_unwind_find_fde=yes
99 arch_minimum_kernel=2.4.21
102 libc_cv_gcc_unwind_find_fde=yes
103 arch_minimum_kernel=2.0.10
106 arch_minimum_kernel=2.4.0
109 arch_minimum_kernel=2.0.10
112 if test -n "$minimum_kernel"; then
114 user_version=$((`echo "$minimum_kernel.0.0.0" | sed 's/\([0-9]*\)\.\([0-9]*\)\.\([0-9]*\).*/\1 \* 65536 + \2 \* 256 + \3/'`))
115 arch_version=$((`echo "$arch_minimum_kernel.0.0.0" | sed 's/\([0-9]*\)\.\([0-9]*\)\.\([0-9]*\).*/\1 \* 65536 + \2 \* 256 + \3/'`))
117 if test $user_version -lt $arch_version; then
118 AC_MSG_WARN([minimum kernel version reset to $arch_minimum_kernel])
119 minimum_kernel=$arch_minimum_kernel
122 if test $arch_minimum_kernel != '2.0.10'; then
123 minimum_kernel=$arch_minimum_kernel
127 if test -n "$minimum_kernel"; then
128 AC_MSG_CHECKING(for kernel header at least $minimum_kernel)
130 decnum=`echo "$minimum_kernel.0.0.0" | sed 's/\([0-9]*\)\.\([0-9]*\)\.\([0-9]*\).*/(\1 * 65536 + \2 * 256 + \3)/'`;
131 abinum=`echo "$minimum_kernel.0.0.0" | sed 's/\([0-9]*\)\.\([0-9]*\)\.\([0-9]*\).*/\1,\2,\3/'`;
133 AC_EGREP_CPP([eat flaming death], [#include <linux/version.h>
134 #if LINUX_VERSION_CODE < $decnum
136 #endif], libc_minimum_kernel='too old!', libc_minimum_kernel=ok)
137 AC_MSG_RESULT($libc_minimum_kernel)
138 if test "$libc_minimum_kernel" = ok; then
139 AC_DEFINE_UNQUOTED(__LINUX_KERNEL_VERSION, $decnum)
140 AC_DEFINE_UNQUOTED(__ABI_TAG_VERSION, $abinum)
142 AC_MSG_ERROR([*** The available kernel headers are older than the requested
143 *** compatible kernel version])
147 # The result of the above test for the use of the FDE code is invalid if
148 # the user overrides the decision about the minimum ABI.
149 if test "$oldest_abi" != default && test "2.2.4" \< "$oldest_abi"; then
150 libc_cv_gcc_unwind_find_fde=no
153 if test -n "$sysheaders"; then
154 CPPFLAGS=$OLD_CPPFLAGS
156 # The Linux filesystem standard prescribes where to place "essential"
157 # files. I.e., when the installation prefix is "/usr" we have to place
158 # shared library objects and the configuration files on the root partition
162 # 64-bit libraries on bi-arch platforms go in /lib64 instead of /lib.
163 # Allow earlier configure scripts to handle libc_cv_slibdir, libdir,
164 # and libc_cv_localedir.
165 test -n "$libc_cv_slibdir" || \
167 sparc/sparc64 | x86_64 | powerpc/powerpc64 | s390/s390-64)
168 libc_cv_slibdir="/lib64"
169 if test "$libdir" = '${exec_prefix}/lib'; then
170 libdir='${exec_prefix}/lib64';
171 # Locale data can be shared between 32bit and 64bit libraries
172 libc_cv_localedir='${exec_prefix}/lib/locale'
176 libc_cv_slibdir="/lib"
179 # Allow the user to override the path with --sysconfdir
180 if test $sysconfdir = '${prefix}/etc'; then
181 libc_cv_sysconfdir=/etc
183 libc_cv_sysconfdir=$sysconfdir
185 libc_cv_rootsbindir="/sbin"
189 # Under Linux the NPTL add-on should be available.
191 # It is available. Good.
200 if test "$nptl_missing"; then
201 if test $enable_sanity = yes; then
203 *** On GNU/Linux systems it is normal to compile GNU libc with the
204 *** \`nptl' add-on. Without that, the library will be
205 *** incompatible with normal GNU/Linux systems.
206 *** If you really mean to not use this add-on, run configure again
207 *** using the extra parameter \`--disable-sanity-checks'."
211 *** WARNING: Are you sure you do not want to use the \`nptl'
216 if test "$prefix" = "/usr/local" -o "$prefix" = "/usr/local/" -o "$prefix" = "NONE"; then
217 if test $enable_sanity = yes; then
219 *** On GNU/Linux systems the GNU C Library should not be installed into
220 *** /usr/local since this might make your system totally unusable.
221 *** We strongly advise to use a different prefix. For details read the FAQ.
222 *** If you really mean to do this, run configure again using the extra
223 *** parameter \`--disable-sanity-checks'."
227 *** WARNING: Do you really want to install the GNU C Library into /usr/local?
228 *** This might make your system totally unusable, for details read the FAQ."
233 # One Linux we use ldconfig.
236 # We need some extensions to the `ldd' script.
240 ldd_rewrite_script=../sysdeps/unix/sysv/linux/ldd-rewrite.sed
243 ldd_rewrite_script=../sysdeps/unix/sysv/linux/ia64/ldd-rewrite.sed
246 ldd_rewrite_script=../sysdeps/unix/sysv/linux/s390/ldd-rewrite.sed
249 ldd_rewrite_script=../sysdeps/unix/sysv/linux/sparc/ldd-rewrite.sed
252 ldd_rewrite_script=../sysdeps/unix/sysv/linux/x86_64/ldd-rewrite.sed
255 ldd_rewrite_script=../sysdeps/unix/sysv/linux/powerpc/ldd-rewrite.sed
262 if test $host = $build; then
263 # If $prefix/include/{net,scsi} are symlinks, make install will
264 # clobber what they're linked to (probably a kernel tree).
265 # test -L ought to work on all Linux boxes.
266 if test "x$prefix" != xNONE; then
269 ac_prefix=$ac_default_prefix
271 AC_MSG_CHECKING([for symlinks in ${ac_prefix}/include])
273 if test -L ${ac_prefix}/include/net; then
274 ac_message="$ac_message
275 ${ac_prefix}/include/net is a symlink"
277 if test -L ${ac_prefix}/include/scsi; then
278 ac_message="$ac_message
279 ${ac_prefix}/include/scsi is a symlink"
281 if test -n "$ac_message"; then
282 AC_MSG_ERROR([$ac_message
283 \`make install' will destroy the target of the link(s).
284 Delete the links and re-run configure, or better still, move the entire
285 ${ac_prefix}/include directory out of the way.])
291 # We have inlined syscalls.
292 AC_DEFINE(HAVE_INLINED_SYSCALLS)