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 # The Linux kernel headers can be found in
6 # /lib/modules/$(uname -r)/build/include
7 # Check whether this directory is available.
8 if test -z "$sysheaders" &&
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.
52 arch_minimum_kernel=2.1.100
53 libc_cv_gcc_unwind_find_fde=yes
56 arch_minimum_kernel=2.0.10
57 libc_cv_gcc_unwind_find_fde=yes
60 libc_cv_gcc_unwind_find_fde=yes
61 arch_minimum_kernel=2.0.10
64 arch_minimum_kernel=2.4.0
67 arch_minimum_kernel=2.3.99
70 arch_minimum_kernel=2.0.10
71 libc_cv_gcc_unwind_find_fde=yes
74 arch_minimum_kernel=2.4.0
75 libc_cv_gcc_unwind_find_fde=yes
78 libc_cv_gcc_unwind_find_fde=yes
79 arch_minimum_kernel=2.0.10
82 arch_minimum_kernel=2.4.19
85 libc_cv_gcc_unwind_find_fde=yes
86 arch_minimum_kernel=2.2.10
89 libc_cv_gcc_unwind_find_fde=yes
90 arch_minimum_kernel=2.4.0
93 arch_minimum_kernel=2.3.99
94 libc_cv_gcc_unwind_find_fde=yes
97 libc_cv_gcc_unwind_find_fde=yes
98 arch_minimum_kernel=2.0.10
101 arch_minimum_kernel=2.4.0
104 arch_minimum_kernel=2.0.10
107 if test -n "$minimum_kernel"; then
109 user_version=$((`echo "$minimum_kernel.0.0.0" | sed 's/\([0-9]*\)\.\([0-9]*\)\.\([0-9]*\).*/\1 \* 65536 + \2 \* 256 + \3/'`))
110 arch_version=$((`echo "$arch_minimum_kernel.0.0.0" | sed 's/\([0-9]*\)\.\([0-9]*\)\.\([0-9]*\).*/\1 \* 65536 + \2 \* 256 + \3/'`))
112 if test $user_version -lt $arch_version; then
113 AC_MSG_WARN([minimum kernel version reset to $arch_minimum_kernel])
114 minimum_kernel=$arch_minimum_kernel
117 if test $arch_minimum_kernel != '2.0.10'; then
118 minimum_kernel=$arch_minimum_kernel
122 if test -n "$minimum_kernel"; then
123 AC_MSG_CHECKING(for kernel header at least $minimum_kernel)
125 decnum=`echo "$minimum_kernel.0.0.0" | sed 's/\([0-9]*\)\.\([0-9]*\)\.\([0-9]*\).*/(\1 * 65536 + \2 * 256 + \3)/'`;
126 abinum=`echo "$minimum_kernel.0.0.0" | sed 's/\([0-9]*\)\.\([0-9]*\)\.\([0-9]*\).*/\1,\2,\3/'`;
128 AC_EGREP_CPP([eat flaming death], [#include <linux/version.h>
129 #if LINUX_VERSION_CODE < $decnum
131 #endif], libc_minimum_kernel='too old!', libc_minimum_kernel=ok)
132 AC_MSG_RESULT($libc_minimum_kernel)
133 if test "$libc_minimum_kernel" = ok; then
134 AC_DEFINE_UNQUOTED(__LINUX_KERNEL_VERSION, $decnum)
135 AC_DEFINE_UNQUOTED(__ABI_TAG_VERSION, $abinum)
137 AC_MSG_ERROR([*** The available kernel headers are older than the requested
138 *** compatible kernel version])
142 # The result of the above test for the use of the FDE code is invalid if
143 # the user overrides the decision about the minimum ABI.
144 if test "$oldest_abi" != default && test "2.2.4" \< "$oldest_abi"; then
145 libc_cv_gcc_unwind_find_fde=no
148 if test -n "$sysheaders"; then
149 CPPFLAGS=$OLD_CPPFLAGS
151 # The Linux filesystem standard prescribes where to place "essential"
152 # files. I.e., when the installation prefix is "/usr" we have to place
153 # shared library objects and the configuration files on the root partition
155 if test "$prefix" = "/usr" -o "$prefix" = "/usr/"; then
156 # 64bit libraries on sparc go to /lib64 and not /lib
157 if test "$machine" = "sparc/sparc64" -o "$machine" = "x86_64" \
158 -o "$machine" = "powerpc/powerpc64"; then
159 libc_cv_slibdir="/lib64"
160 if test "$libdir" = '${exec_prefix}/lib'; then
161 libdir='${exec_prefix}/lib64';
162 # Locale data can be shared between 32bit and 64bit libraries
163 libc_cv_localedir='${exec_prefix}/lib/locale'
166 libc_cv_slibdir="/lib"
168 # Allow the user to override the path with --sysconfdir
169 if test $sysconfdir = '${prefix}/etc'; then
170 libc_cv_sysconfdir=/etc
172 libc_cv_sysconfdir=$sysconfdir
174 libc_cv_rootsbindir="/sbin"
177 # Under Linux the LinuxThreads add-on should be available.
179 # It is available. Good.
181 linuxthreads_missing=
184 linuxthreads_missing=yes
188 if test "$linuxthreads_missing"; then
189 if test $enable_sanity = yes; then
191 *** On GNU/Linux systems it is normal to compile GNU libc with the
192 *** \`linuxthreads' add-on. Without that, the library will be
193 *** incompatible with normal GNU/Linux systems.
194 *** If you really mean to not use this add-on, run configure again
195 *** using the extra parameter \`--disable-sanity-checks'."
199 *** WARNING: Are you sure you do not want to use the \`linuxthreads'
204 if test "$prefix" = "/usr/local" -o "$prefix" = "/usr/local/" -o "$prefix" = "NONE"; then
205 if test $enable_sanity = yes; then
207 *** On GNU/Linux systems the GNU C Library should not be installed into
208 *** /usr/local since this might make your system totally unusable.
209 *** We strongly advise to use a different prefix. For details read the FAQ.
210 *** If you really mean to do this, run configure again using the extra
211 *** parameter \`--disable-sanity-checks'."
215 *** WARNING: Do you really want to install the GNU C Library into /usr/local?
216 *** This might make your system totally unusable, for details read the FAQ."
221 # One Linux we use ldconfig.
224 # We need some extensions to the `ldd' script.
228 ldd_rewrite_script=../sysdeps/unix/sysv/linux/ldd-rewrite.sed
231 ldd_rewrite_script=../sysdeps/unix/sysv/linux/ia64/ldd-rewrite.sed
234 ldd_rewrite_script=../sysdeps/unix/sysv/linux/s390/ldd-rewrite.sed
237 ldd_rewrite_script=../sysdeps/unix/sysv/linux/sparc/ldd-rewrite.sed
240 ldd_rewrite_script=../sysdeps/unix/sysv/linux/x86_64/ldd-rewrite.sed
243 ldd_rewrite_script=../sysdeps/unix/sysv/linux/powerpc/ldd-rewrite.sed
250 if test $host = $build; then
251 # If $prefix/include/{net,scsi} are symlinks, make install will
252 # clobber what they're linked to (probably a kernel tree).
253 # test -L ought to work on all Linux boxes.
254 if test "x$prefix" != xNONE; then
257 ac_prefix=$ac_default_prefix
259 AC_MSG_CHECKING([for symlinks in ${ac_prefix}/include])
261 if test -L ${ac_prefix}/include/net; then
262 ac_message="$ac_message
263 ${ac_prefix}/include/net is a symlink"
265 if test -L ${ac_prefix}/include/scsi; then
266 ac_message="$ac_message
267 ${ac_prefix}/include/scsi is a symlink"
269 if test -n "$ac_message"; then
270 AC_MSG_ERROR([$ac_message
271 \`make install' will destroy the target of the link(s).
272 Delete the links and re-run configure, or better still, move the entire
273 ${ac_prefix}/include directory out of the way.])