Updated to fedora-glibc-20060217T1609
[glibc.git] / sysdeps / unix / sysv / linux / configure.in
blobb90de065afa53aff1d80061dd8af0335ca50cf64
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
13   dnl to be used.
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.
19 inhibit_glue=yes
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 */])[
32 eat flaming death
33 #endif],
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
52 # if appropriate too.
53 test -n "$arch_minimum_kernel" ||
54 case "$machine" in
55   alpha*)
56     arch_minimum_kernel=2.1.100
57     libc_cv_gcc_unwind_find_fde=yes
58     ;;
59   arm*)
60     arch_minimum_kernel=2.0.10
61     libc_cv_gcc_unwind_find_fde=yes
62     ;;
63   i386*)
64     libc_cv_gcc_unwind_find_fde=yes
65     arch_minimum_kernel=2.0.10
66     ;;
67   ia64*)
68     arch_minimum_kernel=2.4.0
69     ;;
70   hppa*)
71     libc_cv_gcc_unwind_find_fde=yes
72     arch_minimum_kernel=2.4.19
73     ;;
74   m68k*)
75     arch_minimum_kernel=2.0.10
76     libc_cv_gcc_unwind_find_fde=yes
77     ;;
78   mips*)
79     arch_minimum_kernel=2.4.0
80     libc_cv_gcc_unwind_find_fde=yes
81     ;;
82   powerpc/powerpc32)
83     libc_cv_gcc_unwind_find_fde=yes
84     arch_minimum_kernel=2.0.10
85     ;;
86   powerpc/powerpc64)
87     arch_minimum_kernel=2.4.19
88     ;;
89   s390/s390-32)
90     libc_cv_gcc_unwind_find_fde=yes
91     arch_minimum_kernel=2.2.10
92     ;;
93   s390/s390-64)
94     libc_cv_gcc_unwind_find_fde=yes
95     arch_minimum_kernel=2.4.0
96     ;;
97   sh*)
98     arch_minimum_kernel=2.3.99
99     libc_cv_gcc_unwind_find_fde=yes
100     ;;
101   sparc/sparc64*)
102     libc_cv_gcc_unwind_find_fde=yes
103     arch_minimum_kernel=2.4.21
104     ;;
105   sparc*)
106     libc_cv_gcc_unwind_find_fde=yes
107     arch_minimum_kernel=2.0.10
108     ;;
109   x86_64*)
110     arch_minimum_kernel=2.4.0
111     ;;
112   *)
113     arch_minimum_kernel=2.0.10
114     ;;
115 esac
116 if test -n "$minimum_kernel"; then
117   changequote(,)
118   user_version=$((`echo "$minimum_kernel.0.0.0" | sed 's/\([0-9]*\)\.\([0-9]*\)\.\([0-9]*\).*/\1 \* 65536 + \2 \* 256 + \3/'`))
119   arch_version=$((`echo "$arch_minimum_kernel.0.0.0" | sed 's/\([0-9]*\)\.\([0-9]*\)\.\([0-9]*\).*/\1 \* 65536 + \2 \* 256 + \3/'`))
120   changequote([,])
121   if test $user_version -lt $arch_version; then
122     AC_MSG_WARN([minimum kernel version reset to $arch_minimum_kernel])
123     minimum_kernel=$arch_minimum_kernel
124   fi
125 else
126   if test $arch_minimum_kernel != '2.0.10'; then
127     minimum_kernel=$arch_minimum_kernel
128   fi
131 if test -n "$minimum_kernel"; then
132   AC_MSG_CHECKING(for kernel header at least $minimum_kernel)
133 changequote(,)dnl
134   decnum=`echo "$minimum_kernel.0.0.0" | sed 's/\([0-9]*\)\.\([0-9]*\)\.\([0-9]*\).*/(\1 * 65536 + \2 * 256 + \3)/'`;
135   abinum=`echo "$minimum_kernel.0.0.0" | sed 's/\([0-9]*\)\.\([0-9]*\)\.\([0-9]*\).*/\1,\2,\3/'`;
136 changequote([,])dnl
137   AC_EGREP_CPP([eat flaming death], [#include <linux/version.h>
138 #if LINUX_VERSION_CODE < $decnum
139 eat flaming death
140 #endif], libc_minimum_kernel='too old!', libc_minimum_kernel=ok)
141   AC_MSG_RESULT($libc_minimum_kernel)
142   if test "$libc_minimum_kernel" = ok; then
143     AC_DEFINE_UNQUOTED(__LINUX_KERNEL_VERSION, $decnum)
144     AC_DEFINE_UNQUOTED(__ABI_TAG_VERSION, $abinum)
145   else
146     AC_MSG_ERROR([*** The available kernel headers are older than the requested
147 *** compatible kernel version])
148   fi
151 # The result of the above test for the use of the FDE code is invalid if
152 # the user overrides the decision about the minimum ABI.
153 if test "$oldest_abi" != default && test "2.2.4" \< "$oldest_abi"; then
154   libc_cv_gcc_unwind_find_fde=no
157 if test -n "$sysheaders"; then
158   CPPFLAGS=$OLD_CPPFLAGS
160 # The Linux filesystem standard prescribes where to place "essential"
161 # files.  I.e., when the installation prefix is "/usr" we have to place
162 # shared library objects and the configuration files on the root partition
163 # in /lib and /etc.
164 case "$prefix" in
165 /usr | /usr/)
166   # 64-bit libraries on bi-arch platforms go in /lib64 instead of /lib
167   case $machine in
168   sparc/sparc64 | x86_64 | powerpc/powerpc64 | s390/s390-64 | \
169   mips/mips64/n64/* )
170     libc_cv_slibdir="/lib64"
171     if test "$libdir" = '${exec_prefix}/lib'; then
172       libdir='${exec_prefix}/lib64';
173       # Locale data can be shared between 32bit and 64bit libraries
174       libc_cv_localedir='${exec_prefix}/lib/locale'
175     fi
176     ;;
177   mips/mips64/n32/* )
178     libc_cv_slibdir="/lib32"
179     if test "$libdir" = '${exec_prefix}/lib'; then
180       libdir='${exec_prefix}/lib32';
181       # Locale data can be shared between 32bit and 64bit libraries
182       libc_cv_localedir='${exec_prefix}/lib/locale'
183     fi
184     ;;
185   *)
186     libc_cv_slibdir="/lib"
187     ;;
188   esac
189   # Allow the user to override the path with --sysconfdir
190   if test $sysconfdir = '${prefix}/etc'; then
191     libc_cv_sysconfdir=/etc
192   else
193     libc_cv_sysconfdir=$sysconfdir
194    fi
195   libc_cv_rootsbindir="/sbin"
196   ;;
197 esac
199 # Under Linux the NPTL add-on should be available.
200 case $add_ons in
201   # It is available.  Good.
202   *nptl*)
203     nptl_missing=
204     ;;
205   *)
206     nptl_missing=yes
207     ;;
208 esac
210 if test "$nptl_missing"; then
211   if test $enable_sanity = yes; then
212     echo "\
213 *** On GNU/Linux systems it is normal to compile GNU libc with the
214 *** \`nptl' add-on.  Without that, the library will be
215 *** incompatible with normal GNU/Linux systems.
216 *** If you really mean to not use this add-on, run configure again
217 *** using the extra parameter \`--disable-sanity-checks'."
218     exit 1
219   else
220     echo "\
221 *** WARNING: Are you sure you do not want to use the \`nptl'
222 *** add-on?"
223   fi
226 if test "$prefix" = "/usr/local" -o "$prefix" = "/usr/local/" -o "$prefix" = "NONE"; then
227   if test $enable_sanity = yes; then
228     echo "\
229 *** On GNU/Linux systems the GNU C Library should not be installed into
230 *** /usr/local since this might make your system totally unusable.
231 *** We strongly advise to use a different prefix.  For details read the FAQ.
232 *** If you really mean to do this, run configure again using the extra
233 *** parameter \`--disable-sanity-checks'."
234     exit 1
235   else
236     echo "\
237 *** WARNING: Do you really want to install the GNU C Library into /usr/local?
238 *** This might make your system totally unusable, for details read the FAQ."
239   fi
243 # One Linux we use ldconfig.
244 use_ldconfig=yes
246 # We need some extensions to the `ldd' script.
247 changequote(,)
248 case "$machine" in
249   i[3456]86* | m68*)
250     ldd_rewrite_script=../sysdeps/unix/sysv/linux/ldd-rewrite.sed
251     ;;
252   ia64*)
253     ldd_rewrite_script=../sysdeps/unix/sysv/linux/ia64/ldd-rewrite.sed
254     ;;
255   mips/*64*)
256     ldd_rewrite_script=../sysdeps/unix/sysv/linux/mips/mips64/ldd-rewrite.sed
257     ;;
258   s390*)
259     ldd_rewrite_script=../sysdeps/unix/sysv/linux/s390/ldd-rewrite.sed
260     ;;
261   sparc*)
262     ldd_rewrite_script=../sysdeps/unix/sysv/linux/sparc/ldd-rewrite.sed
263     ;;
264   x86_64*)
265     ldd_rewrite_script=../sysdeps/unix/sysv/linux/x86_64/ldd-rewrite.sed
266     ;;
267   powerpc*)
268     ldd_rewrite_script=../sysdeps/unix/sysv/linux/powerpc/ldd-rewrite.sed
269     ;;
270   *)
271     ;;
272 esac
273 changequote([,])
275 if test $host = $build; then
276   # If $prefix/include/{net,scsi} are symlinks, make install will
277   # clobber what they're linked to (probably a kernel tree).
278   # test -L ought to work on all Linux boxes.
279   if test "x$prefix" != xNONE; then
280     ac_prefix=$prefix
281   else
282     ac_prefix=$ac_default_prefix
283   fi
284   AC_MSG_CHECKING([for symlinks in ${ac_prefix}/include])
285   ac_message=
286   if test -L ${ac_prefix}/include/net; then
287     ac_message="$ac_message
288    ${ac_prefix}/include/net is a symlink"
289   fi
290   if test -L ${ac_prefix}/include/scsi; then
291     ac_message="$ac_message
292    ${ac_prefix}/include/scsi is a symlink"
293   fi
294   if test -n "$ac_message"; then
295     AC_MSG_ERROR([$ac_message
296 \`make install' will destroy the target of the link(s).
297 Delete the links and re-run configure, or better still, move the entire
298 ${ac_prefix}/include directory out of the way.])
299   else
300     AC_MSG_RESULT(ok)
301   fi
304 # We have inlined syscalls.
305 AC_DEFINE(HAVE_INLINED_SYSCALLS)