2 # ac_fn_c_check_header_compile LINENO HEADER VAR INCLUDES
3 # -------------------------------------------------------
4 # Tests whether HEADER exists and can be compiled using the include files in
5 # INCLUDES, setting the cache variable VAR accordingly.
6 ac_fn_c_check_header_compile ()
8 as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
9 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5
10 $as_echo_n "checking for $2... " >&6; }
11 if eval \${$3+:} false; then :
12 $as_echo_n "(cached) " >&6
14 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
19 if ac_fn_c_try_compile "$LINENO"; then :
24 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
27 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
28 $as_echo "$ac_res" >&6; }
29 eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
31 } # ac_fn_c_check_header_compile
32 # This file is generated from configure.ac by Autoconf. DO NOT EDIT!
33 # Local configure fragment for sysdeps/unix/sysv/linux.
35 if test -n "$sysheaders"; then
36 OLD_CPPFLAGS=$CPPFLAGS
37 CPPFLAGS="$CPPFLAGS $SYSINCLUDES"
41 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for grep that handles long lines and -e" >&5
42 $as_echo_n "checking for grep that handles long lines and -e... " >&6; }
43 if ${ac_cv_path_GREP+:} false; then :
44 $as_echo_n "(cached) " >&6
46 if test -z "$GREP"; then
47 ac_path_GREP_found=false
48 # Loop through the user's path and test for each of PROGNAME-LIST
49 as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
50 for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin
53 test -z "$as_dir" && as_dir=.
54 for ac_prog in grep ggrep; do
55 for ac_exec_ext in '' $ac_executable_extensions; do
56 ac_path_GREP="$as_dir/$ac_prog$ac_exec_ext"
57 { test -f "$ac_path_GREP" && $as_test_x "$ac_path_GREP"; } || continue
58 # Check for GNU ac_path_GREP and select it if it is found.
59 # Check for GNU $ac_path_GREP
60 case `"$ac_path_GREP" --version 2>&1` in
62 ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_found=:;;
65 $as_echo_n 0123456789 >"conftest.in"
68 cat "conftest.in" "conftest.in" >"conftest.tmp"
69 mv "conftest.tmp" "conftest.in"
70 cp "conftest.in" "conftest.nl"
71 $as_echo 'GREP' >> "conftest.nl"
72 "$ac_path_GREP" -e 'GREP$' -e '-(cannot match)-' < "conftest.nl" >"conftest.out" 2>/dev/null || break
73 diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break
74 as_fn_arith $ac_count + 1 && ac_count=$as_val
75 if test $ac_count -gt ${ac_path_GREP_max-0}; then
76 # Best one so far, save it but keep looking for a better one
77 ac_cv_path_GREP="$ac_path_GREP"
78 ac_path_GREP_max=$ac_count
80 # 10*(2^10) chars as input seems more than enough
81 test $ac_count -gt 10 && break
83 rm -f conftest.in conftest.tmp conftest.nl conftest.out;;
86 $ac_path_GREP_found && break 3
91 if test -z "$ac_cv_path_GREP"; then
92 as_fn_error $? "no acceptable grep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5
99 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_GREP" >&5
100 $as_echo "$ac_cv_path_GREP" >&6; }
101 GREP="$ac_cv_path_GREP"
104 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for egrep" >&5
105 $as_echo_n "checking for egrep... " >&6; }
106 if ${ac_cv_path_EGREP+:} false; then :
107 $as_echo_n "(cached) " >&6
109 if echo a | $GREP -E '(a|b)' >/dev/null 2>&1
110 then ac_cv_path_EGREP="$GREP -E"
112 if test -z "$EGREP"; then
113 ac_path_EGREP_found=false
114 # Loop through the user's path and test for each of PROGNAME-LIST
115 as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
116 for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin
119 test -z "$as_dir" && as_dir=.
120 for ac_prog in egrep; do
121 for ac_exec_ext in '' $ac_executable_extensions; do
122 ac_path_EGREP="$as_dir/$ac_prog$ac_exec_ext"
123 { test -f "$ac_path_EGREP" && $as_test_x "$ac_path_EGREP"; } || continue
124 # Check for GNU ac_path_EGREP and select it if it is found.
125 # Check for GNU $ac_path_EGREP
126 case `"$ac_path_EGREP" --version 2>&1` in
128 ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_found=:;;
131 $as_echo_n 0123456789 >"conftest.in"
134 cat "conftest.in" "conftest.in" >"conftest.tmp"
135 mv "conftest.tmp" "conftest.in"
136 cp "conftest.in" "conftest.nl"
137 $as_echo 'EGREP' >> "conftest.nl"
138 "$ac_path_EGREP" 'EGREP$' < "conftest.nl" >"conftest.out" 2>/dev/null || break
139 diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break
140 as_fn_arith $ac_count + 1 && ac_count=$as_val
141 if test $ac_count -gt ${ac_path_EGREP_max-0}; then
142 # Best one so far, save it but keep looking for a better one
143 ac_cv_path_EGREP="$ac_path_EGREP"
144 ac_path_EGREP_max=$ac_count
146 # 10*(2^10) chars as input seems more than enough
147 test $ac_count -gt 10 && break
149 rm -f conftest.in conftest.tmp conftest.nl conftest.out;;
152 $ac_path_EGREP_found && break 3
157 if test -z "$ac_cv_path_EGREP"; then
158 as_fn_error $? "no acceptable egrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5
161 ac_cv_path_EGREP=$EGREP
166 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_EGREP" >&5
167 $as_echo "$ac_cv_path_EGREP" >&6; }
168 EGREP="$ac_cv_path_EGREP"
171 { $as_echo "$as_me:${as_lineno-$LINENO}: checking installed Linux kernel header files" >&5
172 $as_echo_n "checking installed Linux kernel header files... " >&6; }
173 if ${libc_cv_linux2632+:} false; then :
174 $as_echo_n "(cached) " >&6
176 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
177 /* end confdefs.h. */
178 #include <linux/version.h>
179 #if !defined LINUX_VERSION_CODE || LINUX_VERSION_CODE < (2 *65536+ 6 *256+ 32) /* 2.6.32 */
183 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
184 $EGREP "eat flaming death" >/dev/null 2>&1; then :
185 libc_cv_linux2632='TOO OLD!'
187 libc_cv_linux2632='2.6.32 or later'
192 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $libc_cv_linux2632" >&5
193 $as_echo "$libc_cv_linux2632" >&6; }
194 if test "$libc_cv_linux2632" != '2.6.32 or later'; then
195 as_fn_error $? "GNU libc requires kernel header files from
196 Linux 2.6.32 or later to be installed before configuring.
197 The kernel header files are found usually in /usr/include/asm and
198 /usr/include/linux; make sure these directories use files from
199 Linux 2.6.32 or later. This check uses <linux/version.h>, so
200 make sure that file was built correctly when installing the kernel header
201 files. To use kernel headers not from /usr/include/linux, use the
202 configure option --with-headers." "$LINENO" 5
205 # If the user gave a minimal version number test whether the available
206 # kernel headers are young enough. Additionally we have minimal
207 # kernel versions for some architectures. If a previous configure fragment
208 # set arch_minimum_kernel already, let that override our defaults here.
209 # Note that we presume such a fragment has set libc_cv_gcc_unwind_find_fde
210 # if appropriate too.
211 test -n "$arch_minimum_kernel" ||
214 libc_cv_gcc_unwind_find_fde=yes
215 arch_minimum_kernel=2.6.32
218 arch_minimum_kernel=3.4.0
221 libc_cv_gcc_unwind_find_fde=yes
222 arch_minimum_kernel=2.6.32
225 libc_cv_gcc_unwind_find_fde=yes
226 arch_minimum_kernel=2.6.32
229 libc_cv_gcc_unwind_find_fde=yes
230 arch_minimum_kernel=2.6.32
233 arch_minimum_kernel=2.6.32
234 libc_cv_gcc_unwind_find_fde=yes
237 libc_cv_gcc_unwind_find_fde=yes
238 arch_minimum_kernel=2.6.32
241 libc_cv_gcc_unwind_find_fde=yes
242 arch_minimum_kernel=2.6.32
245 arch_minimum_kernel=2.6.32
248 if test -n "$minimum_kernel"; then
250 user_version=$((`echo "$minimum_kernel.0.0.0" | sed 's/\([0-9]*\)\.\([0-9]*\)\.\([0-9]*\).*/\1 \* 65536 + \2 \* 256 + \3/'`))
251 arch_version=$((`echo "$arch_minimum_kernel.0.0.0" | sed 's/\([0-9]*\)\.\([0-9]*\)\.\([0-9]*\).*/\1 \* 65536 + \2 \* 256 + \3/'`))
253 if test $user_version -lt $arch_version; then
254 { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: minimum kernel version reset to $arch_minimum_kernel" >&5
255 $as_echo "$as_me: WARNING: minimum kernel version reset to $arch_minimum_kernel" >&2;}
256 minimum_kernel=$arch_minimum_kernel
259 minimum_kernel=$arch_minimum_kernel
262 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for kernel header at least $minimum_kernel" >&5
263 $as_echo_n "checking for kernel header at least $minimum_kernel... " >&6; }
264 decnum=`echo "$minimum_kernel.0.0.0" | sed 's/\([0-9]*\)\.\([0-9]*\)\.\([0-9]*\).*/(\1 * 65536 + \2 * 256 + \3)/'`;
265 abinum=`echo "$minimum_kernel.0.0.0" | sed 's/\([0-9]*\)\.\([0-9]*\)\.\([0-9]*\).*/\1,\2,\3/'`;
266 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
267 /* end confdefs.h. */
268 #include <linux/version.h>
269 #if LINUX_VERSION_CODE < $decnum
273 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
274 $EGREP "eat flaming death" >/dev/null 2>&1; then :
275 libc_minimum_kernel='too old!'
277 libc_minimum_kernel=ok
281 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $libc_minimum_kernel" >&5
282 $as_echo "$libc_minimum_kernel" >&6; }
283 if test "$libc_minimum_kernel" = ok; then
284 cat >>confdefs.h <<_ACEOF
285 #define __LINUX_KERNEL_VERSION $decnum
288 cat >>confdefs.h <<_ACEOF
289 #define __ABI_TAG_VERSION $abinum
293 as_fn_error $? "*** The available kernel headers are older than the requested
294 *** compatible kernel version" "$LINENO" 5
297 # Until we start requiring 2.6.37+ headers, we need to check for the
298 # availability of linux/fanotify.h for testing purposes.
299 ac_fn_c_check_header_compile "$LINENO" "linux/fanotify.h" "ac_cv_header_linux_fanotify_h" "/* No default includes. */
301 if test "x$ac_cv_header_linux_fanotify_h" = xyes; then :
302 $as_echo "#define HAVE_LINUX_FANOTIFY_H 1" >>confdefs.h
308 # The result of the above test for the use of the FDE code is invalid if
309 # the user overrides the decision about the minimum ABI.
310 if test "$oldest_abi" != default && test "2.2.4" \< "$oldest_abi"; then
311 libc_cv_gcc_unwind_find_fde=no
314 if test -n "$sysheaders"; then
315 CPPFLAGS=$OLD_CPPFLAGS
318 # Under Linux the NPTL add-on should be available.
320 # It is available. Good.
329 if test "$nptl_missing"; then
330 if test $enable_sanity = yes; then
332 *** On GNU/Linux systems it is normal to compile GNU libc with the
333 *** \`nptl' add-on. Without that, the library will be
334 *** incompatible with normal GNU/Linux systems.
335 *** If you really mean to not use this add-on, run configure again
336 *** using the extra parameter \`--disable-sanity-checks'."
340 *** WARNING: Are you sure you do not want to use the \`nptl'
345 if test "$prefix" = "/usr/local" -o "$prefix" = "/usr/local/" -o "$prefix" = "NONE"; then
346 if test $enable_sanity = yes; then
348 *** On GNU/Linux systems the GNU C Library should not be installed into
349 *** /usr/local since this might make your system totally unusable.
350 *** We strongly advise to use a different prefix. For details read the FAQ.
351 *** If you really mean to do this, run configure again using the extra
352 *** parameter \`--disable-sanity-checks'."
356 *** WARNING: Do you really want to install the GNU C Library into /usr/local?
357 *** This might make your system totally unusable, for details read the FAQ."
362 # One Linux we use ldconfig.
365 # We need some extensions to the `ldd' script.
369 ldd_rewrite_script=sysdeps/unix/sysv/linux/ldd-rewrite.sed
372 ldd_rewrite_script=sysdeps/unix/sysv/linux/s390/ldd-rewrite.sed
375 ldd_rewrite_script=sysdeps/unix/sysv/linux/sparc/ldd-rewrite.sed
378 ldd_rewrite_script=sysdeps/unix/sysv/linux/x86_64/ldd-rewrite.sed
381 ldd_rewrite_script=sysdeps/unix/sysv/linux/powerpc/ldd-rewrite.sed
388 if test $host = $build; then
389 # If $prefix/include/{net,scsi} are symlinks, make install will
390 # clobber what they're linked to (probably a kernel tree).
391 # test -L ought to work on all Linux boxes.
392 if test "x$prefix" != xNONE; then
395 ac_prefix=$ac_default_prefix
397 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for symlinks in ${ac_prefix}/include" >&5
398 $as_echo_n "checking for symlinks in ${ac_prefix}/include... " >&6; }
400 if test -L ${ac_prefix}/include/net; then
401 ac_message="$ac_message
402 ${ac_prefix}/include/net is a symlink"
404 if test -L ${ac_prefix}/include/scsi; then
405 ac_message="$ac_message
406 ${ac_prefix}/include/scsi is a symlink"
408 if test -n "$ac_message"; then
409 as_fn_error $? "$ac_message
410 \`make install' will destroy the target of the link(s).
411 Delete the links and re-run configure, or better still, move the entire
412 ${ac_prefix}/include directory out of the way." "$LINENO" 5
414 { $as_echo "$as_me:${as_lineno-$LINENO}: result: ok" >&5
419 # We have inlined syscalls.
420 $as_echo "#define HAVE_INLINED_SYSCALLS 1" >>confdefs.h