configure tweaks, support $libc_add_on_config_subdirs
[glibc.git] / sysdeps / unix / sysv / linux / configure
blob06105c7e690629ce924c505ccb6d198c6dd7d1ff
1 # This file is generated from configure.in by Autoconf.  DO NOT EDIT!
2  # Local configure fragment for sysdeps/unix/sysv/linux.
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
8 if test -n "$sysheaders"; then
9   OLD_CPPFLAGS=$CPPFLAGS
10   CPPFLAGS="$CPPFLAGS $SYSINCLUDES"
14 { $as_echo "$as_me:$LINENO: checking for grep that handles long lines and -e" >&5
15 $as_echo_n "checking for grep that handles long lines and -e... " >&6; }
16 if test "${ac_cv_path_GREP+set}" = set; then
17   $as_echo_n "(cached) " >&6
18 else
19   if test -z "$GREP"; then
20   ac_path_GREP_found=false
21   # Loop through the user's path and test for each of PROGNAME-LIST
22   as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
23 for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin
25   IFS=$as_save_IFS
26   test -z "$as_dir" && as_dir=.
27   for ac_prog in grep ggrep; do
28     for ac_exec_ext in '' $ac_executable_extensions; do
29       ac_path_GREP="$as_dir/$ac_prog$ac_exec_ext"
30       { test -f "$ac_path_GREP" && $as_test_x "$ac_path_GREP"; } || continue
31 # Check for GNU ac_path_GREP and select it if it is found.
32   # Check for GNU $ac_path_GREP
33 case `"$ac_path_GREP" --version 2>&1` in
34 *GNU*)
35   ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_found=:;;
37   ac_count=0
38   $as_echo_n 0123456789 >"conftest.in"
39   while :
40   do
41     cat "conftest.in" "conftest.in" >"conftest.tmp"
42     mv "conftest.tmp" "conftest.in"
43     cp "conftest.in" "conftest.nl"
44     $as_echo 'GREP' >> "conftest.nl"
45     "$ac_path_GREP" -e 'GREP$' -e '-(cannot match)-' < "conftest.nl" >"conftest.out" 2>/dev/null || break
46     diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break
47     ac_count=`expr $ac_count + 1`
48     if test $ac_count -gt ${ac_path_GREP_max-0}; then
49       # Best one so far, save it but keep looking for a better one
50       ac_cv_path_GREP="$ac_path_GREP"
51       ac_path_GREP_max=$ac_count
52     fi
53     # 10*(2^10) chars as input seems more than enough
54     test $ac_count -gt 10 && break
55   done
56   rm -f conftest.in conftest.tmp conftest.nl conftest.out;;
57 esac
59       $ac_path_GREP_found && break 3
60     done
61   done
62 done
63 IFS=$as_save_IFS
64   if test -z "$ac_cv_path_GREP"; then
65     { { $as_echo "$as_me:$LINENO: error: no acceptable grep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&5
66 $as_echo "$as_me: error: no acceptable grep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&2;}
67    { (exit 1); exit 1; }; }
68   fi
69 else
70   ac_cv_path_GREP=$GREP
74 { $as_echo "$as_me:$LINENO: result: $ac_cv_path_GREP" >&5
75 $as_echo "$ac_cv_path_GREP" >&6; }
76  GREP="$ac_cv_path_GREP"
79 { $as_echo "$as_me:$LINENO: checking for egrep" >&5
80 $as_echo_n "checking for egrep... " >&6; }
81 if test "${ac_cv_path_EGREP+set}" = set; then
82   $as_echo_n "(cached) " >&6
83 else
84   if echo a | $GREP -E '(a|b)' >/dev/null 2>&1
85    then ac_cv_path_EGREP="$GREP -E"
86    else
87      if test -z "$EGREP"; then
88   ac_path_EGREP_found=false
89   # Loop through the user's path and test for each of PROGNAME-LIST
90   as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
91 for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin
93   IFS=$as_save_IFS
94   test -z "$as_dir" && as_dir=.
95   for ac_prog in egrep; do
96     for ac_exec_ext in '' $ac_executable_extensions; do
97       ac_path_EGREP="$as_dir/$ac_prog$ac_exec_ext"
98       { test -f "$ac_path_EGREP" && $as_test_x "$ac_path_EGREP"; } || continue
99 # Check for GNU ac_path_EGREP and select it if it is found.
100   # Check for GNU $ac_path_EGREP
101 case `"$ac_path_EGREP" --version 2>&1` in
102 *GNU*)
103   ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_found=:;;
105   ac_count=0
106   $as_echo_n 0123456789 >"conftest.in"
107   while :
108   do
109     cat "conftest.in" "conftest.in" >"conftest.tmp"
110     mv "conftest.tmp" "conftest.in"
111     cp "conftest.in" "conftest.nl"
112     $as_echo 'EGREP' >> "conftest.nl"
113     "$ac_path_EGREP" 'EGREP$' < "conftest.nl" >"conftest.out" 2>/dev/null || break
114     diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break
115     ac_count=`expr $ac_count + 1`
116     if test $ac_count -gt ${ac_path_EGREP_max-0}; then
117       # Best one so far, save it but keep looking for a better one
118       ac_cv_path_EGREP="$ac_path_EGREP"
119       ac_path_EGREP_max=$ac_count
120     fi
121     # 10*(2^10) chars as input seems more than enough
122     test $ac_count -gt 10 && break
123   done
124   rm -f conftest.in conftest.tmp conftest.nl conftest.out;;
125 esac
127       $ac_path_EGREP_found && break 3
128     done
129   done
130 done
131 IFS=$as_save_IFS
132   if test -z "$ac_cv_path_EGREP"; then
133     { { $as_echo "$as_me:$LINENO: error: no acceptable egrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&5
134 $as_echo "$as_me: error: no acceptable egrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&2;}
135    { (exit 1); exit 1; }; }
136   fi
137 else
138   ac_cv_path_EGREP=$EGREP
141    fi
143 { $as_echo "$as_me:$LINENO: result: $ac_cv_path_EGREP" >&5
144 $as_echo "$ac_cv_path_EGREP" >&6; }
145  EGREP="$ac_cv_path_EGREP"
148 { $as_echo "$as_me:$LINENO: checking installed Linux kernel header files" >&5
149 $as_echo_n "checking installed Linux kernel header files... " >&6; }
150 if test "${libc_cv_linux2010+set}" = set; then
151   $as_echo_n "(cached) " >&6
152 else
153   cat >conftest.$ac_ext <<_ACEOF
154 /* confdefs.h.  */
155 _ACEOF
156 cat confdefs.h >>conftest.$ac_ext
157 cat >>conftest.$ac_ext <<_ACEOF
158 /* end confdefs.h.  */
159 #include <linux/version.h>
160 #if !defined LINUX_VERSION_CODE || LINUX_VERSION_CODE <  (2 *65536+ 0 *256+ 10) /* 2.0.10 */
161 eat flaming death
162 #endif
163 _ACEOF
164 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
165   $EGREP "eat flaming death" >/dev/null 2>&1; then
166   libc_cv_linux2010='TOO OLD!'
167 else
168   libc_cv_linux2010='2.0.10 or later'
170 rm -f conftest*
173 { $as_echo "$as_me:$LINENO: result: $libc_cv_linux2010" >&5
174 $as_echo "$libc_cv_linux2010" >&6; }
175 if test "$libc_cv_linux2010" != '2.0.10 or later'; then
176   { { $as_echo "$as_me:$LINENO: error: GNU libc requires kernel header files from
177 Linux 2.0.10 or later to be installed before configuring.
178 The kernel header files are found usually in /usr/include/asm and
179 /usr/include/linux; make sure these directories use files from
180 Linux 2.0.10 or later.  This check uses <linux/version.h>, so
181 make sure that file was built correctly when installing the kernel header
182 files.  To use kernel headers not from /usr/include/linux, use the
183 configure option --with-headers." >&5
184 $as_echo "$as_me: error: GNU libc requires kernel header files from
185 Linux 2.0.10 or later to be installed before configuring.
186 The kernel header files are found usually in /usr/include/asm and
187 /usr/include/linux; make sure these directories use files from
188 Linux 2.0.10 or later.  This check uses <linux/version.h>, so
189 make sure that file was built correctly when installing the kernel header
190 files.  To use kernel headers not from /usr/include/linux, use the
191 configure option --with-headers." >&2;}
192    { (exit 1); exit 1; }; }
195 # If the user gave a minimal version number test whether the available
196 # kernel headers are young enough.  Additionally we have minimal
197 # kernel versions for some architectures.  If a previous configure fragment
198 # set arch_minimum_kernel already, let that override our defaults here.
199 # Note that we presume such a fragment has set libc_cv_gcc_unwind_find_fde
200 # if appropriate too.
201 test -n "$arch_minimum_kernel" ||
202 case "$machine" in
203   alpha*)
204     arch_minimum_kernel=2.1.100
205     libc_cv_gcc_unwind_find_fde=yes
206     ;;
207   arm*)
208     arch_minimum_kernel=2.0.10
209     libc_cv_gcc_unwind_find_fde=yes
210     ;;
211   i386*)
212     libc_cv_gcc_unwind_find_fde=yes
213     arch_minimum_kernel=2.0.10
214     ;;
215   ia64*)
216     arch_minimum_kernel=2.4.0
217     ;;
218   hppa*)
219     libc_cv_gcc_unwind_find_fde=yes
220     arch_minimum_kernel=2.4.19
221     ;;
222   m68k*)
223     arch_minimum_kernel=2.0.10
224     libc_cv_gcc_unwind_find_fde=yes
225     ;;
226   powerpc/powerpc32)
227     libc_cv_gcc_unwind_find_fde=yes
228     arch_minimum_kernel=2.0.10
229     ;;
230   powerpc/powerpc64)
231     arch_minimum_kernel=2.4.21
232     ;;
233   s390/s390-32)
234     libc_cv_gcc_unwind_find_fde=yes
235     arch_minimum_kernel=2.2.10
236     ;;
237   s390/s390-64)
238     libc_cv_gcc_unwind_find_fde=yes
239     arch_minimum_kernel=2.4.0
240     ;;
241   sh*)
242     arch_minimum_kernel=2.3.99
243     libc_cv_gcc_unwind_find_fde=yes
244     ;;
245   sparc/sparc64*)
246     libc_cv_gcc_unwind_find_fde=yes
247     arch_minimum_kernel=2.4.21
248     ;;
249   sparc*)
250     libc_cv_gcc_unwind_find_fde=yes
251     arch_minimum_kernel=2.0.10
252     ;;
253   x86_64*)
254     arch_minimum_kernel=2.4.0
255     ;;
256   *)
257     arch_minimum_kernel=2.0.10
258     ;;
259 esac
260 if test -n "$minimum_kernel"; then
262   user_version=$((`echo "$minimum_kernel.0.0.0" | sed 's/\([0-9]*\)\.\([0-9]*\)\.\([0-9]*\).*/\1 \* 65536 + \2 \* 256 + \3/'`))
263   arch_version=$((`echo "$arch_minimum_kernel.0.0.0" | sed 's/\([0-9]*\)\.\([0-9]*\)\.\([0-9]*\).*/\1 \* 65536 + \2 \* 256 + \3/'`))
265   if test $user_version -lt $arch_version; then
266     { $as_echo "$as_me:$LINENO: WARNING: minimum kernel version reset to $arch_minimum_kernel" >&5
267 $as_echo "$as_me: WARNING: minimum kernel version reset to $arch_minimum_kernel" >&2;}
268     minimum_kernel=$arch_minimum_kernel
269   fi
270 else
271   if test $arch_minimum_kernel != '2.0.10'; then
272     minimum_kernel=$arch_minimum_kernel
273   fi
276 if test -n "$minimum_kernel"; then
277   { $as_echo "$as_me:$LINENO: checking for kernel header at least $minimum_kernel" >&5
278 $as_echo_n "checking for kernel header at least $minimum_kernel... " >&6; }
279   decnum=`echo "$minimum_kernel.0.0.0" | sed 's/\([0-9]*\)\.\([0-9]*\)\.\([0-9]*\).*/(\1 * 65536 + \2 * 256 + \3)/'`;
280   abinum=`echo "$minimum_kernel.0.0.0" | sed 's/\([0-9]*\)\.\([0-9]*\)\.\([0-9]*\).*/\1,\2,\3/'`;
281   cat >conftest.$ac_ext <<_ACEOF
282 /* confdefs.h.  */
283 _ACEOF
284 cat confdefs.h >>conftest.$ac_ext
285 cat >>conftest.$ac_ext <<_ACEOF
286 /* end confdefs.h.  */
287 #include <linux/version.h>
288 #if LINUX_VERSION_CODE < $decnum
289 eat flaming death
290 #endif
291 _ACEOF
292 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
293   $EGREP "eat flaming death" >/dev/null 2>&1; then
294   libc_minimum_kernel='too old!'
295 else
296   libc_minimum_kernel=ok
298 rm -f conftest*
300   { $as_echo "$as_me:$LINENO: result: $libc_minimum_kernel" >&5
301 $as_echo "$libc_minimum_kernel" >&6; }
302   if test "$libc_minimum_kernel" = ok; then
303     cat >>confdefs.h <<_ACEOF
304 #define __LINUX_KERNEL_VERSION $decnum
305 _ACEOF
307     cat >>confdefs.h <<_ACEOF
308 #define __ABI_TAG_VERSION $abinum
309 _ACEOF
311   else
312     { { $as_echo "$as_me:$LINENO: error: *** The available kernel headers are older than the requested
313 *** compatible kernel version" >&5
314 $as_echo "$as_me: error: *** The available kernel headers are older than the requested
315 *** compatible kernel version" >&2;}
316    { (exit 1); exit 1; }; }
317   fi
320 # The result of the above test for the use of the FDE code is invalid if
321 # the user overrides the decision about the minimum ABI.
322 if test "$oldest_abi" != default && test "2.2.4" \< "$oldest_abi"; then
323   libc_cv_gcc_unwind_find_fde=no
326 if test -n "$sysheaders"; then
327   CPPFLAGS=$OLD_CPPFLAGS
329 # The Linux filesystem standard prescribes where to place "essential"
330 # files.  I.e., when the installation prefix is "/usr" we have to place
331 # shared library objects and the configuration files on the root partition
332 # in /lib and /etc.
333 case "$prefix" in
334 /usr | /usr/)
335   # 64-bit libraries on bi-arch platforms go in /lib64 instead of /lib.
336   # Allow earlier configure scripts to handle libc_cv_slibdir, libdir,
337   # and libc_cv_localedir.
338   test -n "$libc_cv_slibdir" || \
339   case $machine in
340   sparc/sparc64 | x86_64 | powerpc/powerpc64 | s390/s390-64)
341     libc_cv_slibdir="/lib64"
342     if test "$libdir" = '${exec_prefix}/lib'; then
343       libdir='${exec_prefix}/lib64';
344       # Locale data can be shared between 32bit and 64bit libraries
345       libc_cv_localedir='${exec_prefix}/lib/locale'
346     fi
347     ;;
348   *)
349     libc_cv_slibdir="/lib"
350     ;;
351   esac
352   # Allow the user to override the path with --sysconfdir
353   if test $sysconfdir = '${prefix}/etc'; then
354     libc_cv_sysconfdir=/etc
355   else
356     libc_cv_sysconfdir=$sysconfdir
357    fi
358   libc_cv_rootsbindir="/sbin"
359   ;;
360 esac
362 # Under Linux the NPTL add-on should be available.
363 case $add_ons in
364   # It is available.  Good.
365   *nptl*)
366     nptl_missing=
367     ;;
368   *)
369     nptl_missing=yes
370     ;;
371 esac
373 if test "$nptl_missing"; then
374   if test $enable_sanity = yes; then
375     echo "\
376 *** On GNU/Linux systems it is normal to compile GNU libc with the
377 *** \`nptl' add-on.  Without that, the library will be
378 *** incompatible with normal GNU/Linux systems.
379 *** If you really mean to not use this add-on, run configure again
380 *** using the extra parameter \`--disable-sanity-checks'."
381     exit 1
382   else
383     echo "\
384 *** WARNING: Are you sure you do not want to use the \`nptl'
385 *** add-on?"
386   fi
389 if test "$prefix" = "/usr/local" -o "$prefix" = "/usr/local/" -o "$prefix" = "NONE"; then
390   if test $enable_sanity = yes; then
391     echo "\
392 *** On GNU/Linux systems the GNU C Library should not be installed into
393 *** /usr/local since this might make your system totally unusable.
394 *** We strongly advise to use a different prefix.  For details read the FAQ.
395 *** If you really mean to do this, run configure again using the extra
396 *** parameter \`--disable-sanity-checks'."
397     exit 1
398   else
399     echo "\
400 *** WARNING: Do you really want to install the GNU C Library into /usr/local?
401 *** This might make your system totally unusable, for details read the FAQ."
402   fi
406 # One Linux we use ldconfig.
407 use_ldconfig=yes
409 # We need some extensions to the `ldd' script.
411 case "$machine" in
412   i[3456]86* | m68*)
413     ldd_rewrite_script=../sysdeps/unix/sysv/linux/ldd-rewrite.sed
414     ;;
415   ia64*)
416     ldd_rewrite_script=../sysdeps/unix/sysv/linux/ia64/ldd-rewrite.sed
417     ;;
418   s390*)
419     ldd_rewrite_script=../sysdeps/unix/sysv/linux/s390/ldd-rewrite.sed
420     ;;
421   sparc*)
422     ldd_rewrite_script=../sysdeps/unix/sysv/linux/sparc/ldd-rewrite.sed
423     ;;
424   x86_64*)
425     ldd_rewrite_script=../sysdeps/unix/sysv/linux/x86_64/ldd-rewrite.sed
426     ;;
427   powerpc*)
428     ldd_rewrite_script=../sysdeps/unix/sysv/linux/powerpc/ldd-rewrite.sed
429     ;;
430   *)
431     ;;
432 esac
435 if test $host = $build; then
436   # If $prefix/include/{net,scsi} are symlinks, make install will
437   # clobber what they're linked to (probably a kernel tree).
438   # test -L ought to work on all Linux boxes.
439   if test "x$prefix" != xNONE; then
440     ac_prefix=$prefix
441   else
442     ac_prefix=$ac_default_prefix
443   fi
444   { $as_echo "$as_me:$LINENO: checking for symlinks in ${ac_prefix}/include" >&5
445 $as_echo_n "checking for symlinks in ${ac_prefix}/include... " >&6; }
446   ac_message=
447   if test -L ${ac_prefix}/include/net; then
448     ac_message="$ac_message
449    ${ac_prefix}/include/net is a symlink"
450   fi
451   if test -L ${ac_prefix}/include/scsi; then
452     ac_message="$ac_message
453    ${ac_prefix}/include/scsi is a symlink"
454   fi
455   if test -n "$ac_message"; then
456     { { $as_echo "$as_me:$LINENO: error: $ac_message
457 \`make install' will destroy the target of the link(s).
458 Delete the links and re-run configure, or better still, move the entire
459 ${ac_prefix}/include directory out of the way." >&5
460 $as_echo "$as_me: error: $ac_message
461 \`make install' will destroy the target of the link(s).
462 Delete the links and re-run configure, or better still, move the entire
463 ${ac_prefix}/include directory out of the way." >&2;}
464    { (exit 1); exit 1; }; }
465   else
466     { $as_echo "$as_me:$LINENO: result: ok" >&5
467 $as_echo "ok" >&6; }
468   fi
471 # We have inlined syscalls.
472 cat >>confdefs.h <<\_ACEOF
473 #define HAVE_INLINED_SYSCALLS 1
474 _ACEOF