2.5-18.1
[jlayton/glibc.git] / sysdeps / unix / sysv / linux / configure
1 # This file is generated from configure.in by Autoconf.  DO NOT EDIT!
2  # Local configure fragment for sysdeps/unix/sysv/linux.
3
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       SYSINCLUDES="-I $sysheaders"
13 fi
14
15 # Don't bother trying to generate any glue code to be compatible with the
16 # existing system library, because we are the only system library.
17 inhibit_glue=yes
18
19 if test -n "$sysheaders"; then
20   OLD_CPPFLAGS=$CPPFLAGS
21   CPPFLAGS="$CPPFLAGS $SYSINCLUDES"
22 fi
23
24
25 echo "$as_me:$LINENO: checking for egrep" >&5
26 echo $ECHO_N "checking for egrep... $ECHO_C" >&6
27 if test "${ac_cv_prog_egrep+set}" = set; then
28   echo $ECHO_N "(cached) $ECHO_C" >&6
29 else
30   if echo a | (grep -E '(a|b)') >/dev/null 2>&1
31     then ac_cv_prog_egrep='grep -E'
32     else ac_cv_prog_egrep='egrep'
33     fi
34 fi
35 echo "$as_me:$LINENO: result: $ac_cv_prog_egrep" >&5
36 echo "${ECHO_T}$ac_cv_prog_egrep" >&6
37  EGREP=$ac_cv_prog_egrep
38
39
40 echo "$as_me:$LINENO: checking installed Linux kernel header files" >&5
41 echo $ECHO_N "checking installed Linux kernel header files... $ECHO_C" >&6
42 if test "${libc_cv_linux2010+set}" = set; then
43   echo $ECHO_N "(cached) $ECHO_C" >&6
44 else
45   cat >conftest.$ac_ext <<_ACEOF
46 /* confdefs.h.  */
47 _ACEOF
48 cat confdefs.h >>conftest.$ac_ext
49 cat >>conftest.$ac_ext <<_ACEOF
50 /* end confdefs.h.  */
51 #include <linux/version.h>
52 #if !defined LINUX_VERSION_CODE || LINUX_VERSION_CODE <  (2 *65536+ 0 *256+ 10) /* 2.0.10 */
53 eat flaming death
54 #endif
55 _ACEOF
56 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
57   $EGREP "eat flaming death" >/dev/null 2>&1; then
58   libc_cv_linux2010='TOO OLD!'
59 else
60   libc_cv_linux2010='2.0.10 or later'
61 fi
62 rm -f conftest*
63
64 fi
65 echo "$as_me:$LINENO: result: $libc_cv_linux2010" >&5
66 echo "${ECHO_T}$libc_cv_linux2010" >&6
67 if test "$libc_cv_linux2010" != '2.0.10 or later'; then
68   { { echo "$as_me:$LINENO: error: GNU libc requires kernel header files from
69 Linux 2.0.10 or later to be installed before configuring.
70 The kernel header files are found usually in /usr/include/asm and
71 /usr/include/linux; make sure these directories use files from
72 Linux 2.0.10 or later.  This check uses <linux/version.h>, so
73 make sure that file was built correctly when installing the kernel header
74 files.  To use kernel headers not from /usr/include/linux, use the
75 configure option --with-headers." >&5
76 echo "$as_me: error: GNU libc requires kernel header files from
77 Linux 2.0.10 or later to be installed before configuring.
78 The kernel header files are found usually in /usr/include/asm and
79 /usr/include/linux; make sure these directories use files from
80 Linux 2.0.10 or later.  This check uses <linux/version.h>, so
81 make sure that file was built correctly when installing the kernel header
82 files.  To use kernel headers not from /usr/include/linux, use the
83 configure option --with-headers." >&2;}
84    { (exit 1); exit 1; }; }
85 fi
86
87 # If the user gave a minimal version number test whether the available
88 # kernel headers are young enough.  Additionally we have minimal
89 # kernel versions for some architectures.  If a previous configure fragment
90 # set arch_minimum_kernel already, let that override our defaults here.
91 # Note that we presume such a fragment has set libc_cv_gcc_unwind_find_fde
92 # if appropriate too.
93 test -n "$arch_minimum_kernel" ||
94 case "$machine" in
95   alpha*)
96     arch_minimum_kernel=2.1.100
97     libc_cv_gcc_unwind_find_fde=yes
98     ;;
99   arm*)
100     arch_minimum_kernel=2.0.10
101     libc_cv_gcc_unwind_find_fde=yes
102     ;;
103   i386*)
104     libc_cv_gcc_unwind_find_fde=yes
105     arch_minimum_kernel=2.0.10
106     ;;
107   ia64*)
108     arch_minimum_kernel=2.4.0
109     ;;
110   hppa*)
111     libc_cv_gcc_unwind_find_fde=yes
112     arch_minimum_kernel=2.4.19
113     ;;
114   m68k*)
115     arch_minimum_kernel=2.0.10
116     libc_cv_gcc_unwind_find_fde=yes
117     ;;
118   powerpc/powerpc32)
119     libc_cv_gcc_unwind_find_fde=yes
120     arch_minimum_kernel=2.0.10
121     ;;
122   powerpc/powerpc64)
123     arch_minimum_kernel=2.4.19
124     ;;
125   s390/s390-32)
126     libc_cv_gcc_unwind_find_fde=yes
127     arch_minimum_kernel=2.2.10
128     ;;
129   s390/s390-64)
130     libc_cv_gcc_unwind_find_fde=yes
131     arch_minimum_kernel=2.4.0
132     ;;
133   sh*)
134     arch_minimum_kernel=2.3.99
135     libc_cv_gcc_unwind_find_fde=yes
136     ;;
137   sparc/sparc64*)
138     libc_cv_gcc_unwind_find_fde=yes
139     arch_minimum_kernel=2.4.21
140     ;;
141   sparc*)
142     libc_cv_gcc_unwind_find_fde=yes
143     arch_minimum_kernel=2.0.10
144     ;;
145   x86_64*)
146     arch_minimum_kernel=2.4.0
147     ;;
148   *)
149     arch_minimum_kernel=2.0.10
150     ;;
151 esac
152 if test -n "$minimum_kernel"; then
153
154   user_version=$((`echo "$minimum_kernel.0.0.0" | sed 's/\([0-9]*\)\.\([0-9]*\)\.\([0-9]*\).*/\1 \* 65536 + \2 \* 256 + \3/'`))
155   arch_version=$((`echo "$arch_minimum_kernel.0.0.0" | sed 's/\([0-9]*\)\.\([0-9]*\)\.\([0-9]*\).*/\1 \* 65536 + \2 \* 256 + \3/'`))
156
157   if test $user_version -lt $arch_version; then
158     { echo "$as_me:$LINENO: WARNING: minimum kernel version reset to $arch_minimum_kernel" >&5
159 echo "$as_me: WARNING: minimum kernel version reset to $arch_minimum_kernel" >&2;}
160     minimum_kernel=$arch_minimum_kernel
161   fi
162 else
163   if test $arch_minimum_kernel != '2.0.10'; then
164     minimum_kernel=$arch_minimum_kernel
165   fi
166 fi
167
168 if test -n "$minimum_kernel"; then
169   echo "$as_me:$LINENO: checking for kernel header at least $minimum_kernel" >&5
170 echo $ECHO_N "checking for kernel header at least $minimum_kernel... $ECHO_C" >&6
171   decnum=`echo "$minimum_kernel.0.0.0" | sed 's/\([0-9]*\)\.\([0-9]*\)\.\([0-9]*\).*/(\1 * 65536 + \2 * 256 + \3)/'`;
172   abinum=`echo "$minimum_kernel.0.0.0" | sed 's/\([0-9]*\)\.\([0-9]*\)\.\([0-9]*\).*/\1,\2,\3/'`;
173   cat >conftest.$ac_ext <<_ACEOF
174 /* confdefs.h.  */
175 _ACEOF
176 cat confdefs.h >>conftest.$ac_ext
177 cat >>conftest.$ac_ext <<_ACEOF
178 /* end confdefs.h.  */
179 #include <linux/version.h>
180 #if LINUX_VERSION_CODE < $decnum
181 eat flaming death
182 #endif
183 _ACEOF
184 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
185   $EGREP "eat flaming death" >/dev/null 2>&1; then
186   libc_minimum_kernel='too old!'
187 else
188   libc_minimum_kernel=ok
189 fi
190 rm -f conftest*
191
192   echo "$as_me:$LINENO: result: $libc_minimum_kernel" >&5
193 echo "${ECHO_T}$libc_minimum_kernel" >&6
194   if test "$libc_minimum_kernel" = ok; then
195     cat >>confdefs.h <<_ACEOF
196 #define __LINUX_KERNEL_VERSION $decnum
197 _ACEOF
198
199     cat >>confdefs.h <<_ACEOF
200 #define __ABI_TAG_VERSION $abinum
201 _ACEOF
202
203   else
204     { { echo "$as_me:$LINENO: error: *** The available kernel headers are older than the requested
205 *** compatible kernel version" >&5
206 echo "$as_me: error: *** The available kernel headers are older than the requested
207 *** compatible kernel version" >&2;}
208    { (exit 1); exit 1; }; }
209   fi
210 fi
211
212 # The result of the above test for the use of the FDE code is invalid if
213 # the user overrides the decision about the minimum ABI.
214 if test "$oldest_abi" != default && test "2.2.4" \< "$oldest_abi"; then
215   libc_cv_gcc_unwind_find_fde=no
216 fi
217
218 if test -n "$sysheaders"; then
219   CPPFLAGS=$OLD_CPPFLAGS
220 fi
221 # The Linux filesystem standard prescribes where to place "essential"
222 # files.  I.e., when the installation prefix is "/usr" we have to place
223 # shared library objects and the configuration files on the root partition
224 # in /lib and /etc.
225 case "$prefix" in
226 /usr | /usr/)
227   # 64-bit libraries on bi-arch platforms go in /lib64 instead of /lib.
228   # Allow earlier configure scripts to handle libc_cv_slibdir, libdir,
229   # and libc_cv_localedir.
230   test -n "$libc_cv_slibdir" || \
231   case $machine in
232   sparc/sparc64 | x86_64 | powerpc/powerpc64 | s390/s390-64)
233     libc_cv_slibdir="/lib64"
234     if test "$libdir" = '${exec_prefix}/lib'; then
235       libdir='${exec_prefix}/lib64';
236       # Locale data can be shared between 32bit and 64bit libraries
237       libc_cv_localedir='${exec_prefix}/lib/locale'
238     fi
239     ;;
240   *)
241     libc_cv_slibdir="/lib"
242     ;;
243   esac
244   # Allow the user to override the path with --sysconfdir
245   if test $sysconfdir = '${prefix}/etc'; then
246     libc_cv_sysconfdir=/etc
247   else
248     libc_cv_sysconfdir=$sysconfdir
249    fi
250   libc_cv_rootsbindir="/sbin"
251   ;;
252 esac
253
254 # Under Linux the NPTL add-on should be available.
255 case $add_ons in
256   # It is available.  Good.
257   *nptl*)
258     nptl_missing=
259     ;;
260   *)
261     nptl_missing=yes
262     ;;
263 esac
264
265 if test "$nptl_missing"; then
266   if test $enable_sanity = yes; then
267     echo "\
268 *** On GNU/Linux systems it is normal to compile GNU libc with the
269 *** \`nptl' add-on.  Without that, the library will be
270 *** incompatible with normal GNU/Linux systems.
271 *** If you really mean to not use this add-on, run configure again
272 *** using the extra parameter \`--disable-sanity-checks'."
273     exit 1
274   else
275     echo "\
276 *** WARNING: Are you sure you do not want to use the \`nptl'
277 *** add-on?"
278   fi
279 fi
280
281 if test "$prefix" = "/usr/local" -o "$prefix" = "/usr/local/" -o "$prefix" = "NONE"; then
282   if test $enable_sanity = yes; then
283     echo "\
284 *** On GNU/Linux systems the GNU C Library should not be installed into
285 *** /usr/local since this might make your system totally unusable.
286 *** We strongly advise to use a different prefix.  For details read the FAQ.
287 *** If you really mean to do this, run configure again using the extra
288 *** parameter \`--disable-sanity-checks'."
289     exit 1
290   else
291     echo "\
292 *** WARNING: Do you really want to install the GNU C Library into /usr/local?
293 *** This might make your system totally unusable, for details read the FAQ."
294   fi
295 fi
296
297
298 # One Linux we use ldconfig.
299 use_ldconfig=yes
300
301 # We need some extensions to the `ldd' script.
302
303 case "$machine" in
304   i[3456]86* | m68*)
305     ldd_rewrite_script=../sysdeps/unix/sysv/linux/ldd-rewrite.sed
306     ;;
307   ia64*)
308     ldd_rewrite_script=../sysdeps/unix/sysv/linux/ia64/ldd-rewrite.sed
309     ;;
310   s390*)
311     ldd_rewrite_script=../sysdeps/unix/sysv/linux/s390/ldd-rewrite.sed
312     ;;
313   sparc*)
314     ldd_rewrite_script=../sysdeps/unix/sysv/linux/sparc/ldd-rewrite.sed
315     ;;
316   x86_64*)
317     ldd_rewrite_script=../sysdeps/unix/sysv/linux/x86_64/ldd-rewrite.sed
318     ;;
319   powerpc*)
320     ldd_rewrite_script=../sysdeps/unix/sysv/linux/powerpc/ldd-rewrite.sed
321     ;;
322   *)
323     ;;
324 esac
325
326
327 if test $host = $build; then
328   # If $prefix/include/{net,scsi} are symlinks, make install will
329   # clobber what they're linked to (probably a kernel tree).
330   # test -L ought to work on all Linux boxes.
331   if test "x$prefix" != xNONE; then
332     ac_prefix=$prefix
333   else
334     ac_prefix=$ac_default_prefix
335   fi
336   echo "$as_me:$LINENO: checking for symlinks in ${ac_prefix}/include" >&5
337 echo $ECHO_N "checking for symlinks in ${ac_prefix}/include... $ECHO_C" >&6
338   ac_message=
339   if test -L ${ac_prefix}/include/net; then
340     ac_message="$ac_message
341    ${ac_prefix}/include/net is a symlink"
342   fi
343   if test -L ${ac_prefix}/include/scsi; then
344     ac_message="$ac_message
345    ${ac_prefix}/include/scsi is a symlink"
346   fi
347   if test -n "$ac_message"; then
348     { { echo "$as_me:$LINENO: error: $ac_message
349 \`make install' will destroy the target of the link(s).
350 Delete the links and re-run configure, or better still, move the entire
351 ${ac_prefix}/include directory out of the way." >&5
352 echo "$as_me: error: $ac_message
353 \`make install' will destroy the target of the link(s).
354 Delete the links and re-run configure, or better still, move the entire
355 ${ac_prefix}/include directory out of the way." >&2;}
356    { (exit 1); exit 1; }; }
357   else
358     echo "$as_me:$LINENO: result: ok" >&5
359 echo "${ECHO_T}ok" >&6
360   fi
361 fi
362
363 # We have inlined syscalls.
364 cat >>confdefs.h <<\_ACEOF
365 #define HAVE_INLINED_SYSCALLS 1
366 _ACEOF
367