]> git.ipfire.org Git - thirdparty/glibc.git/blob - sysdeps/unix/sysv/linux/configure
ab0f03c35e58ed066635a341fb921c3b6ee36749
[thirdparty/glibc.git] / sysdeps / unix / sysv / linux / configure
1
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 ()
7 {
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
13 else
14 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
15 /* end confdefs.h. */
16 $4
17 #include <$2>
18 _ACEOF
19 if ac_fn_c_try_compile "$LINENO"; then :
20 eval "$3=yes"
21 else
22 eval "$3=no"
23 fi
24 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
25 fi
26 eval ac_res=\$$3
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
30
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.
34
35 # Don't bother trying to generate any glue code to be compatible with the
36 # existing system library, because we are the only system library.
37 inhibit_glue=yes
38
39 if test -n "$sysheaders"; then
40 OLD_CPPFLAGS=$CPPFLAGS
41 CPPFLAGS="$CPPFLAGS $SYSINCLUDES"
42 fi
43
44
45 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for grep that handles long lines and -e" >&5
46 $as_echo_n "checking for grep that handles long lines and -e... " >&6; }
47 if ${ac_cv_path_GREP+:} false; then :
48 $as_echo_n "(cached) " >&6
49 else
50 if test -z "$GREP"; then
51 ac_path_GREP_found=false
52 # Loop through the user's path and test for each of PROGNAME-LIST
53 as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
54 for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin
55 do
56 IFS=$as_save_IFS
57 test -z "$as_dir" && as_dir=.
58 for ac_prog in grep ggrep; do
59 for ac_exec_ext in '' $ac_executable_extensions; do
60 ac_path_GREP="$as_dir/$ac_prog$ac_exec_ext"
61 { test -f "$ac_path_GREP" && $as_test_x "$ac_path_GREP"; } || continue
62 # Check for GNU ac_path_GREP and select it if it is found.
63 # Check for GNU $ac_path_GREP
64 case `"$ac_path_GREP" --version 2>&1` in
65 *GNU*)
66 ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_found=:;;
67 *)
68 ac_count=0
69 $as_echo_n 0123456789 >"conftest.in"
70 while :
71 do
72 cat "conftest.in" "conftest.in" >"conftest.tmp"
73 mv "conftest.tmp" "conftest.in"
74 cp "conftest.in" "conftest.nl"
75 $as_echo 'GREP' >> "conftest.nl"
76 "$ac_path_GREP" -e 'GREP$' -e '-(cannot match)-' < "conftest.nl" >"conftest.out" 2>/dev/null || break
77 diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break
78 as_fn_arith $ac_count + 1 && ac_count=$as_val
79 if test $ac_count -gt ${ac_path_GREP_max-0}; then
80 # Best one so far, save it but keep looking for a better one
81 ac_cv_path_GREP="$ac_path_GREP"
82 ac_path_GREP_max=$ac_count
83 fi
84 # 10*(2^10) chars as input seems more than enough
85 test $ac_count -gt 10 && break
86 done
87 rm -f conftest.in conftest.tmp conftest.nl conftest.out;;
88 esac
89
90 $ac_path_GREP_found && break 3
91 done
92 done
93 done
94 IFS=$as_save_IFS
95 if test -z "$ac_cv_path_GREP"; then
96 as_fn_error $? "no acceptable grep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5
97 fi
98 else
99 ac_cv_path_GREP=$GREP
100 fi
101
102 fi
103 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_GREP" >&5
104 $as_echo "$ac_cv_path_GREP" >&6; }
105 GREP="$ac_cv_path_GREP"
106
107
108 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for egrep" >&5
109 $as_echo_n "checking for egrep... " >&6; }
110 if ${ac_cv_path_EGREP+:} false; then :
111 $as_echo_n "(cached) " >&6
112 else
113 if echo a | $GREP -E '(a|b)' >/dev/null 2>&1
114 then ac_cv_path_EGREP="$GREP -E"
115 else
116 if test -z "$EGREP"; then
117 ac_path_EGREP_found=false
118 # Loop through the user's path and test for each of PROGNAME-LIST
119 as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
120 for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin
121 do
122 IFS=$as_save_IFS
123 test -z "$as_dir" && as_dir=.
124 for ac_prog in egrep; do
125 for ac_exec_ext in '' $ac_executable_extensions; do
126 ac_path_EGREP="$as_dir/$ac_prog$ac_exec_ext"
127 { test -f "$ac_path_EGREP" && $as_test_x "$ac_path_EGREP"; } || continue
128 # Check for GNU ac_path_EGREP and select it if it is found.
129 # Check for GNU $ac_path_EGREP
130 case `"$ac_path_EGREP" --version 2>&1` in
131 *GNU*)
132 ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_found=:;;
133 *)
134 ac_count=0
135 $as_echo_n 0123456789 >"conftest.in"
136 while :
137 do
138 cat "conftest.in" "conftest.in" >"conftest.tmp"
139 mv "conftest.tmp" "conftest.in"
140 cp "conftest.in" "conftest.nl"
141 $as_echo 'EGREP' >> "conftest.nl"
142 "$ac_path_EGREP" 'EGREP$' < "conftest.nl" >"conftest.out" 2>/dev/null || break
143 diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break
144 as_fn_arith $ac_count + 1 && ac_count=$as_val
145 if test $ac_count -gt ${ac_path_EGREP_max-0}; then
146 # Best one so far, save it but keep looking for a better one
147 ac_cv_path_EGREP="$ac_path_EGREP"
148 ac_path_EGREP_max=$ac_count
149 fi
150 # 10*(2^10) chars as input seems more than enough
151 test $ac_count -gt 10 && break
152 done
153 rm -f conftest.in conftest.tmp conftest.nl conftest.out;;
154 esac
155
156 $ac_path_EGREP_found && break 3
157 done
158 done
159 done
160 IFS=$as_save_IFS
161 if test -z "$ac_cv_path_EGREP"; then
162 as_fn_error $? "no acceptable egrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5
163 fi
164 else
165 ac_cv_path_EGREP=$EGREP
166 fi
167
168 fi
169 fi
170 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_EGREP" >&5
171 $as_echo "$ac_cv_path_EGREP" >&6; }
172 EGREP="$ac_cv_path_EGREP"
173
174
175 { $as_echo "$as_me:${as_lineno-$LINENO}: checking installed Linux kernel header files" >&5
176 $as_echo_n "checking installed Linux kernel header files... " >&6; }
177 if ${libc_cv_linux2619+:} false; then :
178 $as_echo_n "(cached) " >&6
179 else
180 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
181 /* end confdefs.h. */
182 #include <linux/version.h>
183 #if !defined LINUX_VERSION_CODE || LINUX_VERSION_CODE < (2 *65536+ 6 *256+ 19) /* 2.6.19 */
184 eat flaming death
185 #endif
186 _ACEOF
187 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
188 $EGREP "eat flaming death" >/dev/null 2>&1; then :
189 libc_cv_linux2619='TOO OLD!'
190 else
191 libc_cv_linux2619='2.6.19 or later'
192 fi
193 rm -f conftest*
194
195 fi
196 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $libc_cv_linux2619" >&5
197 $as_echo "$libc_cv_linux2619" >&6; }
198 if test "$libc_cv_linux2619" != '2.6.19 or later'; then
199 as_fn_error $? "GNU libc requires kernel header files from
200 Linux 2.6.19 or later to be installed before configuring.
201 The kernel header files are found usually in /usr/include/asm and
202 /usr/include/linux; make sure these directories use files from
203 Linux 2.6.19 or later. This check uses <linux/version.h>, so
204 make sure that file was built correctly when installing the kernel header
205 files. To use kernel headers not from /usr/include/linux, use the
206 configure option --with-headers." "$LINENO" 5
207 fi
208
209 # If the user gave a minimal version number test whether the available
210 # kernel headers are young enough. Additionally we have minimal
211 # kernel versions for some architectures. If a previous configure fragment
212 # set arch_minimum_kernel already, let that override our defaults here.
213 # Note that we presume such a fragment has set libc_cv_gcc_unwind_find_fde
214 # if appropriate too.
215 test -n "$arch_minimum_kernel" ||
216 case "$machine" in
217 i386*)
218 libc_cv_gcc_unwind_find_fde=yes
219 arch_minimum_kernel=2.6.16
220 ;;
221 x86_64/x32)
222 arch_minimum_kernel=3.4.0
223 ;;
224 powerpc/powerpc32*)
225 libc_cv_gcc_unwind_find_fde=yes
226 arch_minimum_kernel=2.6.16
227 ;;
228 s390/s390-32)
229 libc_cv_gcc_unwind_find_fde=yes
230 arch_minimum_kernel=2.6.16
231 ;;
232 s390/s390-64)
233 libc_cv_gcc_unwind_find_fde=yes
234 arch_minimum_kernel=2.6.16
235 ;;
236 sh*)
237 arch_minimum_kernel=2.6.16
238 libc_cv_gcc_unwind_find_fde=yes
239 ;;
240 sparc/sparc64*)
241 libc_cv_gcc_unwind_find_fde=yes
242 arch_minimum_kernel=2.6.16
243 ;;
244 sparc*)
245 libc_cv_gcc_unwind_find_fde=yes
246 arch_minimum_kernel=2.6.16
247 ;;
248 *)
249 arch_minimum_kernel=2.6.16
250 ;;
251 esac
252 if test -n "$minimum_kernel"; then
253
254 user_version=$((`echo "$minimum_kernel.0.0.0" | sed 's/\([0-9]*\)\.\([0-9]*\)\.\([0-9]*\).*/\1 \* 65536 + \2 \* 256 + \3/'`))
255 arch_version=$((`echo "$arch_minimum_kernel.0.0.0" | sed 's/\([0-9]*\)\.\([0-9]*\)\.\([0-9]*\).*/\1 \* 65536 + \2 \* 256 + \3/'`))
256
257 if test $user_version -lt $arch_version; then
258 { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: minimum kernel version reset to $arch_minimum_kernel" >&5
259 $as_echo "$as_me: WARNING: minimum kernel version reset to $arch_minimum_kernel" >&2;}
260 minimum_kernel=$arch_minimum_kernel
261 fi
262 else
263 minimum_kernel=$arch_minimum_kernel
264 fi
265
266 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for kernel header at least $minimum_kernel" >&5
267 $as_echo_n "checking for kernel header at least $minimum_kernel... " >&6; }
268 decnum=`echo "$minimum_kernel.0.0.0" | sed 's/\([0-9]*\)\.\([0-9]*\)\.\([0-9]*\).*/(\1 * 65536 + \2 * 256 + \3)/'`;
269 abinum=`echo "$minimum_kernel.0.0.0" | sed 's/\([0-9]*\)\.\([0-9]*\)\.\([0-9]*\).*/\1,\2,\3/'`;
270 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
271 /* end confdefs.h. */
272 #include <linux/version.h>
273 #if LINUX_VERSION_CODE < $decnum
274 eat flaming death
275 #endif
276 _ACEOF
277 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
278 $EGREP "eat flaming death" >/dev/null 2>&1; then :
279 libc_minimum_kernel='too old!'
280 else
281 libc_minimum_kernel=ok
282 fi
283 rm -f conftest*
284
285 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $libc_minimum_kernel" >&5
286 $as_echo "$libc_minimum_kernel" >&6; }
287 if test "$libc_minimum_kernel" = ok; then
288 cat >>confdefs.h <<_ACEOF
289 #define __LINUX_KERNEL_VERSION $decnum
290 _ACEOF
291
292 cat >>confdefs.h <<_ACEOF
293 #define __ABI_TAG_VERSION $abinum
294 _ACEOF
295
296 else
297 as_fn_error $? "*** The available kernel headers are older than the requested
298 *** compatible kernel version" "$LINENO" 5
299 fi
300
301 # Until we start requiring 2.6.37+ headers, we need to check for the
302 # availability of linux/fanotify.h for testing purposes.
303 ac_fn_c_check_header_compile "$LINENO" "linux/fanotify.h" "ac_cv_header_linux_fanotify_h" "/* No default includes. */
304 "
305 if test "x$ac_cv_header_linux_fanotify_h" = xyes; then :
306 DEFINES="$DEFINES -DHAVE_LINUX_FANOTIFY_H=1"
307 fi
308
309
310
311 # The result of the above test for the use of the FDE code is invalid if
312 # the user overrides the decision about the minimum ABI.
313 if test "$oldest_abi" != default && test "2.2.4" \< "$oldest_abi"; then
314 libc_cv_gcc_unwind_find_fde=no
315 fi
316
317 if test -n "$sysheaders"; then
318 CPPFLAGS=$OLD_CPPFLAGS
319 fi
320
321 # Under Linux the NPTL add-on should be available.
322 case $add_ons in
323 # It is available. Good.
324 *nptl*)
325 nptl_missing=
326 ;;
327 *)
328 nptl_missing=yes
329 ;;
330 esac
331
332 if test "$nptl_missing"; then
333 if test $enable_sanity = yes; then
334 echo "\
335 *** On GNU/Linux systems it is normal to compile GNU libc with the
336 *** \`nptl' add-on. Without that, the library will be
337 *** incompatible with normal GNU/Linux systems.
338 *** If you really mean to not use this add-on, run configure again
339 *** using the extra parameter \`--disable-sanity-checks'."
340 exit 1
341 else
342 echo "\
343 *** WARNING: Are you sure you do not want to use the \`nptl'
344 *** add-on?"
345 fi
346 fi
347
348 if test "$prefix" = "/usr/local" -o "$prefix" = "/usr/local/" -o "$prefix" = "NONE"; then
349 if test $enable_sanity = yes; then
350 echo "\
351 *** On GNU/Linux systems the GNU C Library should not be installed into
352 *** /usr/local since this might make your system totally unusable.
353 *** We strongly advise to use a different prefix. For details read the FAQ.
354 *** If you really mean to do this, run configure again using the extra
355 *** parameter \`--disable-sanity-checks'."
356 exit 1
357 else
358 echo "\
359 *** WARNING: Do you really want to install the GNU C Library into /usr/local?
360 *** This might make your system totally unusable, for details read the FAQ."
361 fi
362 fi
363
364
365 # One Linux we use ldconfig.
366 use_ldconfig=yes
367
368 # We need some extensions to the `ldd' script.
369
370 case "$machine" in
371 i[3456]86*)
372 ldd_rewrite_script=sysdeps/unix/sysv/linux/ldd-rewrite.sed
373 ;;
374 s390*)
375 ldd_rewrite_script=sysdeps/unix/sysv/linux/s390/ldd-rewrite.sed
376 ;;
377 sparc*)
378 ldd_rewrite_script=sysdeps/unix/sysv/linux/sparc/ldd-rewrite.sed
379 ;;
380 x86_64*)
381 ldd_rewrite_script=sysdeps/unix/sysv/linux/x86_64/ldd-rewrite.sed
382 ;;
383 powerpc*)
384 ldd_rewrite_script=sysdeps/unix/sysv/linux/powerpc/ldd-rewrite.sed
385 ;;
386 *)
387 ;;
388 esac
389
390
391 if test $host = $build; then
392 # If $prefix/include/{net,scsi} are symlinks, make install will
393 # clobber what they're linked to (probably a kernel tree).
394 # test -L ought to work on all Linux boxes.
395 if test "x$prefix" != xNONE; then
396 ac_prefix=$prefix
397 else
398 ac_prefix=$ac_default_prefix
399 fi
400 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for symlinks in ${ac_prefix}/include" >&5
401 $as_echo_n "checking for symlinks in ${ac_prefix}/include... " >&6; }
402 ac_message=
403 if test -L ${ac_prefix}/include/net; then
404 ac_message="$ac_message
405 ${ac_prefix}/include/net is a symlink"
406 fi
407 if test -L ${ac_prefix}/include/scsi; then
408 ac_message="$ac_message
409 ${ac_prefix}/include/scsi is a symlink"
410 fi
411 if test -n "$ac_message"; then
412 as_fn_error $? "$ac_message
413 \`make install' will destroy the target of the link(s).
414 Delete the links and re-run configure, or better still, move the entire
415 ${ac_prefix}/include directory out of the way." "$LINENO" 5
416 else
417 { $as_echo "$as_me:${as_lineno-$LINENO}: result: ok" >&5
418 $as_echo "ok" >&6; }
419 fi
420 fi
421
422 # We have inlined syscalls.
423 $as_echo "#define HAVE_INLINED_SYSCALLS 1" >>confdefs.h
424