chiark / gitweb /
eglibc (2.11.3-4+deb6u3) squeeze-lts; urgency=medium
[eglibc.git] / sysdeps / unix / sysv / linux / configure.in
1 GLIBC_PROVIDES dnl See aclocal.m4 in the top level source directory.
2 # Local configure fragment for sysdeps/unix/sysv/linux.
3
4 # Don't bother trying to generate any glue code to be compatible with the
5 # existing system library, because we are the only system library.
6 inhibit_glue=yes
7
8 define([LIBC_LINUX_VERSION],[2.0.10])dnl
9 if test -n "$sysheaders"; then
10   OLD_CPPFLAGS=$CPPFLAGS
11   CPPFLAGS="$CPPFLAGS $SYSINCLUDES"
12 fi
13 define([libc_cv_linuxVER], [libc_cv_linux]patsubst(LIBC_LINUX_VERSION,[\.]))dnl
14 AC_CACHE_CHECK(installed Linux kernel header files, libc_cv_linuxVER, [dnl
15 AC_EGREP_CPP([eat flaming death], [#include <linux/version.h>
16 #if !defined LINUX_VERSION_CODE || LINUX_VERSION_CODE < ]dnl
17 patsubst(LIBC_LINUX_VERSION,[^\([^.]*\)\.\([^.]*\)\.\([^.]*\)$],dnl
18 [ (\1 *65536+ \2 *256+ \3) /* \1.\2.\3 */])[
19 eat flaming death
20 #endif],
21              libc_cv_linuxVER='TOO OLD!',
22              libc_cv_linuxVER='LIBC_LINUX_VERSION or later')])
23 if test "$libc_cv_linuxVER" != 'LIBC_LINUX_VERSION or later'; then
24   AC_MSG_ERROR([GNU libc requires kernel header files from
25 Linux LIBC_LINUX_VERSION or later to be installed before configuring.
26 The kernel header files are found usually in /usr/include/asm and
27 /usr/include/linux; make sure these directories use files from
28 Linux LIBC_LINUX_VERSION or later.  This check uses <linux/version.h>, so
29 make sure that file was built correctly when installing the kernel header
30 files.  To use kernel headers not from /usr/include/linux, use the
31 configure option --with-headers.])
32 fi
33
34 # If the user gave a minimal version number test whether the available
35 # kernel headers are young enough.  Additionally we have minimal
36 # kernel versions for some architectures.  If a previous configure fragment
37 # set arch_minimum_kernel already, let that override our defaults here.
38 # Note that we presume such a fragment has set libc_cv_gcc_unwind_find_fde
39 # if appropriate too.
40 test -n "$arch_minimum_kernel" ||
41 case "$machine" in
42   alpha*)
43     arch_minimum_kernel=2.1.100
44     libc_cv_gcc_unwind_find_fde=yes
45     ;;
46   arm*)
47     arch_minimum_kernel=2.0.10
48     libc_cv_gcc_unwind_find_fde=yes
49     ;;
50   i386*)
51     libc_cv_gcc_unwind_find_fde=yes
52     arch_minimum_kernel=2.0.10
53     ;;
54   ia64*)
55     arch_minimum_kernel=2.4.0
56     ;;
57   hppa*)
58     libc_cv_gcc_unwind_find_fde=yes
59     arch_minimum_kernel=2.4.19
60     ;;
61   m68k*)
62     arch_minimum_kernel=2.0.10
63     libc_cv_gcc_unwind_find_fde=yes
64     ;;
65   powerpc/powerpc32)
66     libc_cv_gcc_unwind_find_fde=yes
67     arch_minimum_kernel=2.0.10
68     ;;
69   powerpc/powerpc64)
70     arch_minimum_kernel=2.4.21
71     ;;
72   s390/s390-32)
73     libc_cv_gcc_unwind_find_fde=yes
74     arch_minimum_kernel=2.2.10
75     ;;
76   s390/s390-64)
77     libc_cv_gcc_unwind_find_fde=yes
78     arch_minimum_kernel=2.4.0
79     ;;
80   sh*)
81     arch_minimum_kernel=2.3.99
82     libc_cv_gcc_unwind_find_fde=yes
83     ;;
84   sparc/sparc64*)
85     libc_cv_gcc_unwind_find_fde=yes
86     arch_minimum_kernel=2.4.21
87     ;;
88   sparc*)
89     libc_cv_gcc_unwind_find_fde=yes
90     arch_minimum_kernel=2.0.10
91     ;;
92   x86_64*)
93     arch_minimum_kernel=2.4.0
94     ;;
95   *)
96     arch_minimum_kernel=2.0.10
97     ;;
98 esac
99 if test -n "$minimum_kernel"; then
100   changequote(,)
101   user_version=$((`echo "$minimum_kernel.0.0.0" | sed 's/\([0-9]*\)\.\([0-9]*\)\.\([0-9]*\).*/\1 \* 65536 + \2 \* 256 + \3/'`))
102   arch_version=$((`echo "$arch_minimum_kernel.0.0.0" | sed 's/\([0-9]*\)\.\([0-9]*\)\.\([0-9]*\).*/\1 \* 65536 + \2 \* 256 + \3/'`))
103   changequote([,])
104   if test $user_version -lt $arch_version; then
105     AC_MSG_WARN([minimum kernel version reset to $arch_minimum_kernel])
106     minimum_kernel=$arch_minimum_kernel
107   fi
108 else
109   if test $arch_minimum_kernel != '2.0.10'; then
110     minimum_kernel=$arch_minimum_kernel
111   fi
112 fi
113
114 if test -n "$minimum_kernel"; then
115   AC_MSG_CHECKING(for kernel header at least $minimum_kernel)
116 changequote(,)dnl
117   decnum=`echo "$minimum_kernel.0.0.0" | sed 's/\([0-9]*\)\.\([0-9]*\)\.\([0-9]*\).*/(\1 * 65536 + \2 * 256 + \3)/'`;
118   abinum=`echo "$minimum_kernel.0.0.0" | sed 's/\([0-9]*\)\.\([0-9]*\)\.\([0-9]*\).*/\1,\2,\3/'`;
119 changequote([,])dnl
120   AC_EGREP_CPP([eat flaming death], [#include <linux/version.h>
121 #if LINUX_VERSION_CODE < $decnum
122 eat flaming death
123 #endif], libc_minimum_kernel='too old!', libc_minimum_kernel=ok)
124   AC_MSG_RESULT($libc_minimum_kernel)
125   if test "$libc_minimum_kernel" = ok; then
126     AC_DEFINE_UNQUOTED(__LINUX_KERNEL_VERSION, $decnum)
127     AC_DEFINE_UNQUOTED(__ABI_TAG_VERSION, $abinum)
128   else
129     AC_MSG_ERROR([*** The available kernel headers are older than the requested
130 *** compatible kernel version])
131   fi
132 fi
133
134 # The result of the above test for the use of the FDE code is invalid if
135 # the user overrides the decision about the minimum ABI.
136 if test "$oldest_abi" != default && test "2.2.4" \< "$oldest_abi"; then
137   libc_cv_gcc_unwind_find_fde=no
138 fi
139
140 if test -n "$sysheaders"; then
141   CPPFLAGS=$OLD_CPPFLAGS
142 fi
143 # The Linux filesystem standard prescribes where to place "essential"
144 # files.  I.e., when the installation prefix is "/usr" we have to place
145 # shared library objects and the configuration files on the root partition
146 # in /lib and /etc.
147 case "$prefix" in
148 /usr | /usr/)
149   # 64-bit libraries on bi-arch platforms go in /lib64 instead of /lib.
150   # Allow earlier configure scripts to handle libc_cv_slibdir, libdir,
151   # and libc_cv_localedir.
152   test -n "$libc_cv_slibdir" || \
153   case $machine in
154   sparc/sparc64 | x86_64 | powerpc/powerpc64 | s390/s390-64)
155     libc_cv_slibdir="/lib64"
156     if test "$libdir" = '${exec_prefix}/lib'; then
157       libdir='${exec_prefix}/lib64';
158       # Locale data can be shared between 32bit and 64bit libraries
159       libc_cv_localedir='${exec_prefix}/lib/locale'
160     fi
161     ;;
162   *)
163     libc_cv_slibdir="/lib"
164     ;;
165   esac
166   # Allow the user to override the path with --sysconfdir
167   if test $sysconfdir = '${prefix}/etc'; then
168     libc_cv_sysconfdir=/etc
169   else
170     libc_cv_sysconfdir=$sysconfdir
171    fi
172   libc_cv_rootsbindir="/sbin"
173   ;;
174 esac
175
176 # Under Linux the NPTL add-on should be available.
177 case $add_ons in
178   # It is available.  Good.
179   *nptl*)
180     nptl_missing=
181     ;;
182   *)
183     nptl_missing=yes
184     ;;
185 esac
186
187 if test "$nptl_missing"; then
188   if test $enable_sanity = yes; then
189     echo "\
190 *** On GNU/Linux systems it is normal to compile GNU libc with the
191 *** \`nptl' add-on.  Without that, the library will be
192 *** incompatible with normal GNU/Linux systems.
193 *** If you really mean to not use this add-on, run configure again
194 *** using the extra parameter \`--disable-sanity-checks'."
195     exit 1
196   else
197     echo "\
198 *** WARNING: Are you sure you do not want to use the \`nptl'
199 *** add-on?"
200   fi
201 fi
202
203 if test "$prefix" = "/usr/local" -o "$prefix" = "/usr/local/" -o "$prefix" = "NONE"; then
204   if test $enable_sanity = yes; then
205     echo "\
206 *** On GNU/Linux systems the GNU C Library should not be installed into
207 *** /usr/local since this might make your system totally unusable.
208 *** We strongly advise to use a different prefix.  For details read the FAQ.
209 *** If you really mean to do this, run configure again using the extra
210 *** parameter \`--disable-sanity-checks'."
211     exit 1
212   else
213     echo "\
214 *** WARNING: Do you really want to install the GNU C Library into /usr/local?
215 *** This might make your system totally unusable, for details read the FAQ."
216   fi
217 fi
218
219
220 # One Linux we use ldconfig.
221 use_ldconfig=yes
222
223 # We need some extensions to the `ldd' script.
224 changequote(,)
225 case "$machine" in
226   i[3456]86* | m68*)
227     ldd_rewrite_script=../sysdeps/unix/sysv/linux/ldd-rewrite.sed
228     ;;
229   ia64*)
230     ldd_rewrite_script=../sysdeps/unix/sysv/linux/ia64/ldd-rewrite.sed
231     ;;
232   s390*)
233     ldd_rewrite_script=../sysdeps/unix/sysv/linux/s390/ldd-rewrite.sed
234     ;;
235   sparc*)
236     ldd_rewrite_script=../sysdeps/unix/sysv/linux/sparc/ldd-rewrite.sed
237     ;;
238   x86_64*)
239     ldd_rewrite_script=../sysdeps/unix/sysv/linux/x86_64/ldd-rewrite.sed
240     ;;
241   powerpc*)
242     ldd_rewrite_script=../sysdeps/unix/sysv/linux/powerpc/ldd-rewrite.sed
243     ;;
244   *)
245     ;;
246 esac
247 changequote([,])
248
249 if test $host = $build; then
250   # If $prefix/include/{net,scsi} are symlinks, make install will
251   # clobber what they're linked to (probably a kernel tree).
252   # test -L ought to work on all Linux boxes.
253   if test "x$prefix" != xNONE; then
254     ac_prefix=$prefix
255   else
256     ac_prefix=$ac_default_prefix
257   fi
258   AC_MSG_CHECKING([for symlinks in ${ac_prefix}/include])
259   ac_message=
260   if test -L ${ac_prefix}/include/net; then
261     ac_message="$ac_message
262    ${ac_prefix}/include/net is a symlink"
263   fi
264   if test -L ${ac_prefix}/include/scsi; then
265     ac_message="$ac_message
266    ${ac_prefix}/include/scsi is a symlink"
267   fi
268   if test -n "$ac_message"; then
269     AC_MSG_ERROR([$ac_message
270 \`make install' will destroy the target of the link(s).
271 Delete the links and re-run configure, or better still, move the entire
272 ${ac_prefix}/include directory out of the way.])
273   else
274     AC_MSG_RESULT(ok)
275   fi
276 fi
277
278 # We have inlined syscalls.
279 AC_DEFINE(HAVE_INLINED_SYSCALLS)