Update.
[glibc.git] / sysdeps / unix / sysv / linux / configure.in
blob7a38bfda0ce05904749bdbb9cc437c6d4998794a
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.
10 inhibit_glue=yes
12 define([LIBC_LINUX_VERSION],[2.0.10])dnl
13 if test -n "$sysheaders"; then
14   OLD_CFLAGS=$CFLAGS
15   CFLAGS="$CFLAGS $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_TRY_COMPILE([#include <linux/version.h>],
20 [#if LINUX_VERSION_CODE < ]dnl
21 patsubst(LIBC_LINUX_VERSION,[^\([^.]*\)\.\([^.]*\)\.\([^.]*\)$],dnl
22 [ (\1 *65536+ \2 *256+ \3) /* \1.\2.\3 */])[
23 eat flaming death
24 #endif],
25                libc_cv_linuxVER='LIBC_LINUX_VERSION or later',
26                libc_cv_linuxVER='TOO OLD!')])
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.])
37 if test -n "$sysheaders"; then
38   CFLAGS=$OLD_CFLAGS
40 # The Linux filesystem standard prescribes where to place "essential"
41 # files.  I.e., when the installation prefix is "/usr" we have to place
42 # shared library objects and the configuration files on the root partition
43 # in /lib and /etc.
44 if test "$prefix" = "/usr"; then
45   libc_cv_slibdir="/lib"
46   libc_cv_sysconfdir="/etc"
47   libc_cv_rootsbindir="/sbin"
50 # Under Linux the LinuxThreads and crypt add-on should be available.
51 case $add_ons in
52   # Both are available.  Good.
53   *linuxthreads*crypt* | *crypt*linuxthreads*)
54     message=
55     ;;
56   *linuxthreads*)
57     message="\
58 *** WARNING:
59 *** Are you sure you do not want to use the \`crypt' add-on?"
60     ;;
61   *crypt*)
62     message="\
63 *** WARNING:
64 *** Are you sure you do not want to use the \`linuxthread' add-on?"
65     ;;
66   *)
67     message="\
68 *** WARNING: Are you sure you do not want to use the \`linuxthreads'
69 *** and \`crypt' add-ons?"
70     ;;
71 esac
73 if test "$message"; then
74   if test $enable_sanity = yes; then
75     echo "\
76 *** You should not compile the GNU libc without the \`linuxthreads' and
77 *** \`crypt' add-on.  Not using them risks to be incompatible with the
78 *** libraries of other systems.  Consider getting the add-ons and restart
79 *** the configuration.
80 *** If you really mean to avoid those add-ons run configure again, now
81 *** using the extra parameter \`--disable-sanity-checks'."
82     exit 1
83   else
84     echo "$message"
85   fi
88 # Check whether `ldconfig' sources are available.  This will go away as soon
89 # as ldconfig is available in GNU libc.
90 if test -f $srcdir/elf/ldconfig.c; then
91   has_ldconfig=yes
94 # We need some extensions to the `ldd' script.
95 changequote(,)
96 case "$machine" in
97   i[3456]86* | m68* | sparc/sparc32)
98     ldd_rewrite_script=../sysdeps/unix/sysv/linux/ldd-rewrite.sed
99     ;;
100   *)
101     ;;
102 esac
103 changequote([,])
105 # If $prefix/include/{net,scsi} are symlinks, make install will
106 # clobber what they're linked to (probably a kernel tree).
107 # test -L ought to work on all Linux boxes.
108 echo $ac_n "checking for symlinks in ${prefix}/include...$ac_c"
109 if test -L ${prefix}/include/net
110 then message="   ${prefix}/include/net is a symlink"
112 if test -L ${prefix}/include/scsi
113 then message="$message
114    ${prefix}/include/scsi is a symlink"
116 if test -n "$message"; then
117 echo "
118 *** error:
119 $message
120 \`make install' will destroy the target of the link(s).
121 Delete the links and re-run configure, or better still, move the entire
122 ${prefix}/include directory out of the way."
123 exit 1
124 else
125 echo " ok"