]> git.ipfire.org Git - thirdparty/glibc.git/blob - sysdeps/unix/sysv/linux/configure
Update.
[thirdparty/glibc.git] / sysdeps / unix / sysv / linux / configure
1 # Local configure fragment for sysdeps/unix/sysv/linux.
2
3 # On Linux, the default is to use libio instead of stdio.
4 test $stdio = default && stdio=libio
5
6 # Don't bother trying to generate any glue code to be compatible with the
7 # existing system library, because we are the only system library.
8 inhibit_glue=yes
9
10 if test -n "$sysheaders"; then
11 OLD_CFLAGS=$CFLAGS
12 CFLAGS="$CFLAGS $SYSINCLUDES"
13 fi
14 echo $ac_n "checking installed Linux kernel header files""... $ac_c" 1>&6
15 echo "configure:16: checking installed Linux kernel header files" >&5
16 if eval "test \"\${libc_cv_linux2010+set}\" = set"; then
17 echo $ac_n "(cached) $ac_c" 1>&6
18 else
19 cat > conftest.$ac_ext <<EOF
20 #line 21 "configure"
21 #include "confdefs.h"
22 #include <linux/version.h>
23 #if !defined LINUX_VERSION_CODE || LINUX_VERSION_CODE < (2 *65536+ 0 *256+ 10) /* 2.0.10 */
24 eat flaming death
25 #endif
26 EOF
27 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
28 egrep "eat flaming death" >/dev/null 2>&1; then
29 rm -rf conftest*
30 libc_cv_linux2010='TOO OLD!'
31 else
32 rm -rf conftest*
33 libc_cv_linux2010='2.0.10 or later'
34 fi
35 rm -f conftest*
36
37 fi
38
39 echo "$ac_t""$libc_cv_linux2010" 1>&6
40 if test "$libc_cv_linux2010" != '2.0.10 or later'; then
41 { echo "configure: error: GNU libc requires kernel header files from
42 Linux 2.0.10 or later to be installed before configuring.
43 The kernel header files are found usually in /usr/include/asm and
44 /usr/include/linux; make sure these directories use files from
45 Linux 2.0.10 or later. This check uses <linux/version.h>, so
46 make sure that file was built correctly when installing the kernel header
47 files. To use kernel headers not from /usr/include/linux, use the
48 configure option --with-headers." 1>&2; exit 1; }
49 fi
50
51 # If the user gave a minimal version number test whether the available
52 # kernel headers are young enough.
53 if test -n "$minimum_kernel"; then
54 echo $ac_n "checking for kernel header at least $minimum_kernel""... $ac_c" 1>&6
55 echo "configure:56: checking for kernel header at least $minimum_kernel" >&5
56 decnum=`echo "$minimum_kernel.0.0.0" | sed 's/\([0-9]*\)\.\([0-9]*\)\.\([0-9]*\).*/(\1 * 65536 + \2 * 256 + \3)/'`;
57 cat > conftest.$ac_ext <<EOF
58 #line 59 "configure"
59 #include "confdefs.h"
60 #include <linux/version.h>
61 #if LINUX_VERSION_CODE < $decnum
62 eat flaming death
63 #endif
64 EOF
65 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
66 egrep "eat flaming death" >/dev/null 2>&1; then
67 rm -rf conftest*
68 libc_minimum_kernel='too old!'
69 else
70 rm -rf conftest*
71 libc_minimum_kernel=ok
72 fi
73 rm -f conftest*
74
75 echo "$ac_t""$libc_minimum_kernel" 1>&6
76 if test "$libc_minimum_kernel" = ok; then
77 cat >> confdefs.h <<EOF
78 #define __LINUX_KERNEL_VERSION $decnum
79 EOF
80
81 else
82 { echo "configure: error: *** The available kernel headers are older than the requested
83 *** compatible kernel version" 1>&2; exit 1; }
84 fi
85 fi
86
87 if test -n "$sysheaders"; then
88 CFLAGS=$OLD_CFLAGS
89 fi
90 # The Linux filesystem standard prescribes where to place "essential"
91 # files. I.e., when the installation prefix is "/usr" we have to place
92 # shared library objects and the configuration files on the root partition
93 # in /lib and /etc.
94 if test "$prefix" = "/usr"; then
95 # 64bit libraries on sparc go to /lib64 and not /lib
96 if test "$machine" = "sparc/sparc64"; then
97 libc_cv_slibdir="/lib64"
98 if test "$libdir" = '${exec_prefix}/lib'; then
99 libdir='${exec_prefix}/lib64';
100 fi
101 else
102 libc_cv_slibdir="/lib"
103 fi
104 libc_cv_sysconfdir="/etc"
105 libc_cv_rootsbindir="/sbin"
106 fi
107
108 # Under Linux the LinuxThreads and crypt add-on should be available.
109 case $add_ons in
110 # Both are available. Good.
111 *linuxthreads*crypt* | *crypt*linuxthreads*)
112 message=
113 ;;
114 *linuxthreads*)
115 message="\
116 *** WARNING:
117 *** Are you sure you do not want to use the \`crypt' add-on?"
118 ;;
119 *crypt*)
120 message="\
121 *** WARNING:
122 *** Are you sure you do not want to use the \`linuxthread' add-on?"
123 ;;
124 *)
125 message="\
126 *** WARNING: Are you sure you do not want to use the \`linuxthreads'
127 *** and \`crypt' add-ons?"
128 ;;
129 esac
130
131 if test "$message"; then
132 if test $enable_sanity = yes; then
133 echo "\
134 *** You should not compile the GNU libc without the \`linuxthreads' and
135 *** \`crypt' add-on. Not using them risks to be incompatible with the
136 *** libraries of other systems. Consider getting the add-ons and restart
137 *** the configuration.
138 *** If you really mean to avoid those add-ons run configure again, now
139 *** using the extra parameter \`--disable-sanity-checks'."
140 exit 1
141 else
142 echo "$message"
143 fi
144 fi
145
146 # One Linux we use ldconfig.
147 use_ldconfig=yes
148
149 # We need some extensions to the `ldd' script.
150
151 case "$machine" in
152 i[3456]86* | m68*)
153 ldd_rewrite_script=../sysdeps/unix/sysv/linux/ldd-rewrite.sed
154 ;;
155 sparc*)
156 ldd_rewrite_script=../sysdeps/unix/sysv/linux/sparc/ldd-rewrite.sed
157 ;;
158 *)
159 ;;
160 esac
161
162
163 if test $host = $build; then
164 # If $prefix/include/{net,scsi} are symlinks, make install will
165 # clobber what they're linked to (probably a kernel tree).
166 # test -L ought to work on all Linux boxes.
167 if test "x$prefix" != xNONE; then
168 ac_prefix=$prefix
169 else
170 ac_prefix=$ac_default_prefix
171 fi
172 echo $ac_n "checking for symlinks in ${ac_prefix}/include""... $ac_c" 1>&6
173 echo "configure:174: checking for symlinks in ${ac_prefix}/include" >&5
174 ac_message=
175 if test -L ${ac_prefix}/include/net; then
176 ac_message="$ac_message
177 ${ac_prefix}/include/net is a symlink"
178 fi
179 if test -L ${ac_prefix}/include/scsi; then
180 ac_message="$ac_message
181 ${ac_prefix}/include/scsi is a symlink"
182 fi
183 if test -n "$ac_message"; then
184 { echo "configure: error: $ac_message
185 \`make install' will destroy the target of the link(s).
186 Delete the links and re-run configure, or better still, move the entire
187 ${ac_prefix}/include directory out of the way." 1>&2; exit 1; }
188 else
189 echo "$ac_t""ok" 1>&6
190 fi
191 fi