]> sourceware.org Git - glibc.git/blame - sysdeps/unix/sysv/linux/configure
Internal support stuff for complete soft float.
[glibc.git] / sysdeps / unix / sysv / linux / configure
CommitLineData
f65fd747
UD
1 # Local configure fragment for sysdeps/unix/sysv/linux.
2
79c38d7f
UD
3# The Linux kernel headers can be found in
4# /lib/modules/$(uname -r)/build/include
5# Check whether this directory is available.
6if test -z "$sysheaders" &&
7 test -d /lib/modules/`uname -r`/build/include; then
8 sysheaders="/lib/modules/`uname -r`/build/include"
9 ccheaders=`$CC -print-file-name=include`
10 SYSINCLUDES="-I $sysheaders"
11fi
12
f65fd747
UD
13# Don't bother trying to generate any glue code to be compatible with the
14# existing system library, because we are the only system library.
15inhibit_glue=yes
16
14a44a69 17if test -n "$sysheaders"; then
c1ed883f
GK
18 OLD_CPPFLAGS=$CPPFLAGS
19 CPPFLAGS="$CPPFLAGS $SYSINCLUDES"
14a44a69 20fi
f65fd747 21echo $ac_n "checking installed Linux kernel header files""... $ac_c" 1>&6
79c38d7f 22echo "configure:23: checking installed Linux kernel header files" >&5
63f791d3 23if eval "test \"`echo '$''{'libc_cv_linux2010'+set}'`\" = set"; then
f65fd747
UD
24 echo $ac_n "(cached) $ac_c" 1>&6
25else
26 cat > conftest.$ac_ext <<EOF
79c38d7f 27#line 28 "configure"
f65fd747
UD
28#include "confdefs.h"
29#include <linux/version.h>
0ea554bf 30#if !defined LINUX_VERSION_CODE || LINUX_VERSION_CODE < (2 *65536+ 0 *256+ 10) /* 2.0.10 */
f65fd747
UD
31eat flaming death
32#endif
f65fd747 33EOF
0ea554bf
UD
34if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
35 egrep "eat flaming death" >/dev/null 2>&1; then
564210fe 36 rm -rf conftest*
0ea554bf 37 libc_cv_linux2010='TOO OLD!'
564210fe
RM
38else
39 rm -rf conftest*
0ea554bf 40 libc_cv_linux2010='2.0.10 or later'
564210fe
RM
41fi
42rm -f conftest*
0ea554bf 43
564210fe
RM
44fi
45
f65fd747 46echo "$ac_t""$libc_cv_linux2010" 1>&6
6b3a2224 47if test "$libc_cv_linux2010" != '2.0.10 or later'; then
036cc82f 48 { echo "configure: error: GNU libc requires kernel header files from
6b3a2224 49Linux 2.0.10 or later to be installed before configuring.
036cc82f
RM
50The kernel header files are found usually in /usr/include/asm and
51/usr/include/linux; make sure these directories use files from
6b3a2224 52Linux 2.0.10 or later. This check uses <linux/version.h>, so
036cc82f 53make sure that file was built correctly when installing the kernel header
14a44a69
UD
54files. To use kernel headers not from /usr/include/linux, use the
55configure option --with-headers." 1>&2; exit 1; }
56fi
958f238f
UD
57
58# If the user gave a minimal version number test whether the available
003a02c6
UD
59# kernel headers are young enough. Additionally we have minimal
60# kernel versions for some architectures.
48d0c5d8 61case "$machine" in
7f2826c8
AJ
62 alpha*)
63 arch_minimum_kernel=2.1.100
74bd2300
UD
64 libc_cv_gcc_unwind_find_fde=yes
65 ;;
0295d266
UD
66 arm*)
67 arch_minimum_kernel=2.0.10
68 libc_cv_gcc_unwind_find_fde=yes
69 ;;
74bd2300
UD
70 i386*)
71 libc_cv_gcc_unwind_find_fde=yes
72 arch_minimum_kernel=2.0.10
48d0c5d8
UD
73 ;;
74 ia64*)
75 arch_minimum_kernel=2.4.0
76 ;;
b15cb495
UD
77 hppa*)
78 arch_minimum_kernel=2.3.99
79 ;;
39b690cb
AS
80 m68k*)
81 arch_minimum_kernel=2.0.10
82 libc_cv_gcc_unwind_find_fde=yes
83 ;;
7f2826c8 84 mips*)
a99bfa85 85 arch_minimum_kernel=2.4.0
74bd2300
UD
86 libc_cv_gcc_unwind_find_fde=yes
87 ;;
a8a20be0 88 powerpc/powerpc32)
74bd2300
UD
89 libc_cv_gcc_unwind_find_fde=yes
90 arch_minimum_kernel=2.0.10
7f2826c8 91 ;;
a8a20be0
UD
92 powerpc/powerpc64)
93 arch_minimum_kernel=2.4.19
94 ;;
dffd1003
AJ
95 s390/s390-32)
96 libc_cv_gcc_unwind_find_fde=yes
97 arch_minimum_kernel=2.2.10
98 ;;
99 s390/s390-64)
100 libc_cv_gcc_unwind_find_fde=yes
101 arch_minimum_kernel=2.4.0
102 ;;
7f2826c8
AJ
103 sh*)
104 arch_minimum_kernel=2.3.99
74bd2300
UD
105 libc_cv_gcc_unwind_find_fde=yes
106 ;;
107 sparc*)
108 libc_cv_gcc_unwind_find_fde=yes
109 arch_minimum_kernel=2.0.10
7f2826c8 110 ;;
85458ce9
AJ
111 x86_64*)
112 arch_minimum_kernel=2.4.0
113 ;;
48d0c5d8
UD
114 *)
115 arch_minimum_kernel=2.0.10
116 ;;
117esac
003a02c6 118if test -n "$minimum_kernel"; then
48d0c5d8
UD
119
120 user_version=$((`echo "$minimum_kernel.0.0.0" | sed 's/\([0-9]*\)\.\([0-9]*\)\.\([0-9]*\).*/\1 \* 65536 + \2 \* 256 + \3/'`))
121 arch_version=$((`echo "$arch_minimum_kernel.0.0.0" | sed 's/\([0-9]*\)\.\([0-9]*\)\.\([0-9]*\).*/\1 \* 65536 + \2 \* 256 + \3/'`))
122
123 if test $user_version -lt $arch_version; then
003a02c6
UD
124 echo "configure: warning: minimum kernel version reset to $arch_minimum_kernel" 1>&2
125 minimum_kernel=$arch_minimum_kernel
126 fi
127else
48d0c5d8
UD
128 if test $arch_minimum_kernel != '2.0.10'; then
129 minimum_kernel=$arch_minimum_kernel
130 fi
003a02c6
UD
131fi
132
958f238f
UD
133if test -n "$minimum_kernel"; then
134 echo $ac_n "checking for kernel header at least $minimum_kernel""... $ac_c" 1>&6
a8a20be0 135echo "configure:136: checking for kernel header at least $minimum_kernel" >&5
0ea554bf 136 decnum=`echo "$minimum_kernel.0.0.0" | sed 's/\([0-9]*\)\.\([0-9]*\)\.\([0-9]*\).*/(\1 * 65536 + \2 * 256 + \3)/'`;
a986484f 137 abinum=`echo "$minimum_kernel.0.0.0" | sed 's/\([0-9]*\)\.\([0-9]*\)\.\([0-9]*\).*/\1,\2,\3/'`;
958f238f 138 cat > conftest.$ac_ext <<EOF
a8a20be0 139#line 140 "configure"
0ea554bf 140#include "confdefs.h"
958f238f 141#include <linux/version.h>
958f238f
UD
142#if LINUX_VERSION_CODE < $decnum
143eat flaming death
144#endif
958f238f 145EOF
0ea554bf
UD
146if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
147 egrep "eat flaming death" >/dev/null 2>&1; then
148 rm -rf conftest*
149 libc_minimum_kernel='too old!'
150else
151 rm -rf conftest*
152 libc_minimum_kernel=ok
153fi
154rm -f conftest*
155
156 echo "$ac_t""$libc_minimum_kernel" 1>&6
157 if test "$libc_minimum_kernel" = ok; then
958f238f
UD
158 cat >> confdefs.h <<EOF
159#define __LINUX_KERNEL_VERSION $decnum
a986484f
UD
160EOF
161
162 cat >> confdefs.h <<EOF
163#define __ABI_TAG_VERSION $abinum
958f238f
UD
164EOF
165
958f238f 166 else
0ea554bf 167 { echo "configure: error: *** The available kernel headers are older than the requested
958f238f
UD
168*** compatible kernel version" 1>&2; exit 1; }
169 fi
958f238f
UD
170fi
171
74bd2300
UD
172# The result of the above test for the use of the FDE code is invalid if
173# the user overrides the decision about the minimum ABI.
174if test "$oldest_abi" != default && test "2.2.4" \< "$oldest_abi"; then
175 libc_cv_gcc_unwind_find_fde=no
176fi
177
14a44a69 178if test -n "$sysheaders"; then
c1ed883f 179 CPPFLAGS=$OLD_CPPFLAGS
564210fe 180fi
84384f5b
UD
181# The Linux filesystem standard prescribes where to place "essential"
182# files. I.e., when the installation prefix is "/usr" we have to place
6d52618b 183# shared library objects and the configuration files on the root partition
84384f5b 184# in /lib and /etc.
abe7b661
RM
185case "$prefix" in
186/usr | /usr/)
187 # 64-bit libraries on bi-arch platforms go in /lib64 instead of /lib
188 case $machine in
189 sparc/sparc64 | x86_64 | powerpc/powerpc64 | s390/s390-64 )
1c25bcac
UD
190 libc_cv_slibdir="/lib64"
191 if test "$libdir" = '${exec_prefix}/lib'; then
192 libdir='${exec_prefix}/lib64';
a1d84548
UD
193 # Locale data can be shared between 32bit and 64bit libraries
194 libc_cv_localedir='${exec_prefix}/lib/locale'
1c25bcac 195 fi
abe7b661
RM
196 ;;
197 *)
1c25bcac 198 libc_cv_slibdir="/lib"
abe7b661
RM
199 ;;
200 esac
cee49e0c
AJ
201 # Allow the user to override the path with --sysconfdir
202 if test $sysconfdir = '${prefix}/etc'; then
203 libc_cv_sysconfdir=/etc
204 else
205 libc_cv_sysconfdir=$sysconfdir
206 fi
1ef32c3d 207 libc_cv_rootsbindir="/sbin"
abe7b661
RM
208 ;;
209esac
c6645251 210
b4d8d06a 211# Under Linux the LinuxThreads or NPTL add-on should be available.
c6645251 212case $add_ons in
b4d8d06a
UD
213 # Only one of the add-ons should be available.
214 *linuxthreads*nptl*|*nptl*linuxthreads*)
215 echo "\
216*** LinuxThreads and NPTL add-ons are both available. Only one must be used."
217 exit 1
218 ;;
003a02c6 219 # It is available. Good.
c6645251 220 *linuxthreads*)
7f2826c8 221 linuxthreads_missing=
c6645251 222 ;;
b4d8d06a
UD
223 *nptl*)
224 linuxthreads_missing=
225 ;;
c6645251 226 *)
7f2826c8 227 linuxthreads_missing=yes
c6645251
UD
228 ;;
229esac
a18f587d 230
7f2826c8 231if test "$linuxthreads_missing"; then
a18f587d
UD
232 if test $enable_sanity = yes; then
233 echo "\
7f2826c8
AJ
234*** On GNU/Linux systems it is normal to compile GNU libc with the
235*** \`linuxthreads' add-on. Without that, the library will be
236*** incompatible with normal GNU/Linux systems.
63f791d3 237*** If you really mean to not use this add-on, run configure again
a18f587d
UD
238*** using the extra parameter \`--disable-sanity-checks'."
239 exit 1
240 else
7f2826c8
AJ
241 echo "\
242*** WARNING: Are you sure you do not want to use the \`linuxthreads'
243*** add-on?"
a18f587d
UD
244 fi
245fi
1ef32c3d 246
43ac1905
AJ
247if test "$prefix" = "/usr/local" -o "$prefix" = "/usr/local/" -o "$prefix" = "NONE"; then
248 if test $enable_sanity = yes; then
249 echo "\
250*** On GNU/Linux systems the GNU C Library should not be installed into
251*** /usr/local since this might make your system totally unusable.
252*** We strongly advise to use a different prefix. For details read the FAQ.
79c38d7f 253*** If you really mean to do this, run configure again using the extra
43ac1905
AJ
254*** parameter \`--disable-sanity-checks'."
255 exit 1
256 else
257 echo "\
258*** WARNING: Do you really want to install the GNU C Library into /usr/local?
259*** This might make your system totally unusable, for details read the FAQ."
260 fi
261fi
262
263
b43b13ac
UD
264# One Linux we use ldconfig.
265use_ldconfig=yes
cb343854
UD
266
267# We need some extensions to the `ldd' script.
268
269case "$machine" in
a381d207 270 i[3456]86* | m68*)
cb343854
UD
271 ldd_rewrite_script=../sysdeps/unix/sysv/linux/ldd-rewrite.sed
272 ;;
9596d0dd
UD
273 ia64*)
274 ldd_rewrite_script=../sysdeps/unix/sysv/linux/ia64/ldd-rewrite.sed
275 ;;
276 s390*)
277 ldd_rewrite_script=../sysdeps/unix/sysv/linux/s390/ldd-rewrite.sed
278 ;;
3a8599b2 279 sparc*)
a381d207
UD
280 ldd_rewrite_script=../sysdeps/unix/sysv/linux/sparc/ldd-rewrite.sed
281 ;;
85458ce9
AJ
282 x86_64*)
283 ldd_rewrite_script=../sysdeps/unix/sysv/linux/x86_64/ldd-rewrite.sed
284 ;;
a8a20be0
UD
285 powerpc*)
286 ldd_rewrite_script=../sysdeps/unix/sysv/linux/powerpc/ldd-rewrite.sed
287 ;;
cb343854
UD
288 *)
289 ;;
290esac
291
0fea0021 292
eeabe877
UD
293if test $host = $build; then
294 # If $prefix/include/{net,scsi} are symlinks, make install will
295 # clobber what they're linked to (probably a kernel tree).
296 # test -L ought to work on all Linux boxes.
297 if test "x$prefix" != xNONE; then
298 ac_prefix=$prefix
299 else
300 ac_prefix=$ac_default_prefix
301 fi
302 echo $ac_n "checking for symlinks in ${ac_prefix}/include""... $ac_c" 1>&6
abe7b661 303echo "configure:304: checking for symlinks in ${ac_prefix}/include" >&5
fcb7e0a5 304 ac_message=
eeabe877 305 if test -L ${ac_prefix}/include/net; then
fcb7e0a5
UD
306 ac_message="$ac_message
307 ${ac_prefix}/include/net is a symlink"
eeabe877
UD
308 fi
309 if test -L ${ac_prefix}/include/scsi; then
fcb7e0a5 310 ac_message="$ac_message
eeabe877
UD
311 ${ac_prefix}/include/scsi is a symlink"
312 fi
fcb7e0a5
UD
313 if test -n "$ac_message"; then
314 { echo "configure: error: $ac_message
0fea0021
UD
315\`make install' will destroy the target of the link(s).
316Delete the links and re-run configure, or better still, move the entire
eeabe877
UD
317${ac_prefix}/include directory out of the way." 1>&2; exit 1; }
318 else
319 echo "$ac_t""ok" 1>&6
320 fi
0fea0021 321fi
This page took 0.315773 seconds and 5 git commands to generate.