1 GLIBC_PROVIDES dnl See aclocal.m4 in the top level source directory.
2 # Local configure fragment for sysdeps/unix/bsd/bsd4.4/kfreebsd.
4 # The kFreeBSD headers can be found in
6 # Check whether this directory is available.
7 if test -z "$sysheaders" &&
8 test "x$cross_compiling" = xno &&
9 test -d /usr/src/sys/ ; then
10 sysheaders="/usr/src/sys/"
11 ccheaders=`$CC -print-file-name=include`
12 dnl We don't have to use -nostdinc. We just want one more directory
14 SYSINCLUDES="-I $sysheaders"
17 # Don't bother trying to generate any glue code to be compatible with the
18 # existing system library, because we are the only system library.
21 define([LIBC_KFREEBSD_VERSION],[8.3.0])dnl
22 if test -n "$sysheaders"; then
23 OLD_CPPFLAGS=$CPPFLAGS
24 CPPFLAGS="$CPPFLAGS $SYSINCLUDES"
26 define([libc_cv_kfreebsdVER], [libc_cv_kfreebsd]patsubst(LIBC_KFREEBSD_VERSION,[\.]))dnl
27 AC_CACHE_CHECK(installed kFreeBSD kernel header files, libc_cv_kfreebsdVER, [dnl
28 AC_EGREP_CPP([eat flaming death], [#include <osreldate.h>
29 #if !defined(__FreeBSD_kernel_version) && defined(__FreeBSD_version)
30 #define __FreeBSD_kernel_version __FreeBSD_version
32 #if !defined __FreeBSD_kernel_version || __FreeBSD_kernel_version < ]dnl
33 patsubst(LIBC_KFREEBSD_VERSION,[^\([^.]*\)\.\([^.]*\)\.\([^.]*\)$],dnl
34 [ (\1 *100000+ \2 *1000+ \3) /* \1.\2.\3 */])[
37 libc_cv_kfreebsdVER='TOO OLD!',
38 libc_cv_kfreebsdVER='LIBC_KFREEBSD_VERSION or later')])
39 if test "$libc_cv_kfreebsdVER" != 'LIBC_KFREEBSD_VERSION or later'; then
40 AC_MSG_ERROR([GNU libc requires kernel header files from
41 kFreeBSD LIBC_KFREEBSD_VERSION or later to be installed before configuring.
42 The kernel header files are found usually in /usr/src/sys/; make sure
43 these directories use files from kFreeBSD LIBC_KFREEBSD_VERSION or later.
44 This check uses <osreldate.h>, so
45 make sure that file was built correctly when installing the kernel header
46 files. To use kernel headers not from /usr/src/sys/, use the
47 configure option --with-headers.])
50 AC_ARG_ENABLE([compatible-utmp],
51 AC_HELP_STRING([--disable-compatible-utmp],
52 [use a struct utmp which is the same as struct utmpx, as on kFreeBSD, but incompatible with FreeBSD]),
53 [enable_utmp_compat=$enableval],
54 [enable_utmp_compat=no])
55 if test "$enable_utmp_compat" = no; then
56 utmp_subdir=utmp-utmpx
58 utmp_subdir=utmp-compat
60 sysnames="$sysnames sysdeps/unix/bsd/bsd4.4/kfreebsd/$utmp_subdir"
62 # If the user gave a minimal version number test whether the available
63 # kernel headers are young enough. Additionally we have minimal
64 # kernel versions for some architectures. If a previous configure fragment
65 # set arch_minimum_kernel already, let that override our defaults here.
66 # Note that we presume such a fragment has set libc_cv_gcc_unwind_find_fde
68 test -n "$arch_minimum_kernel" ||
71 libc_cv_gcc_unwind_find_fde=yes
72 arch_minimum_kernel=8.3.0
75 arch_minimum_kernel=8.3.0
78 arch_minimum_kernel=8.3.0
81 if test -n "$minimum_kernel"; then
83 user_version=$((`echo "$minimum_kernel.0.0.0" | sed 's/\([0-9]*\)\.\([0-9]*\)\.\([0-9]*\).*/\1 \* 65536 + \2 \* 256 + \3/'`))
84 arch_version=$((`echo "$arch_minimum_kernel.0.0.0" | sed 's/\([0-9]*\)\.\([0-9]*\)\.\([0-9]*\).*/\1 \* 65536 + \2 \* 256 + \3/'`))
86 if test $user_version -lt $arch_version; then
87 AC_MSG_WARN([minimum kernel version reset to $arch_minimum_kernel])
88 minimum_kernel=$arch_minimum_kernel
91 if test $arch_minimum_kernel != '8.3.0'; then
92 minimum_kernel=$arch_minimum_kernel
96 if test -n "$minimum_kernel"; then
97 AC_MSG_CHECKING(for kernel header at least $minimum_kernel)
99 hdrnum=`echo "$minimum_kernel.0.0.0" | sed 's/\([0-9]*\)\.\([0-9]*\)\.\([0-9]*\).*/(\1 * 100000 + \2 * 1000 + \3)/'`;
100 decnum=`echo "$minimum_kernel.0.0.0" | sed 's/\([0-9]*\)\.\([0-9]*\)\.\([0-9]*\).*/(\1 * 65536 + \2 * 256 + \3)/'`;
101 abinum=`echo "$minimum_kernel.0.0.0" | sed 's/\([0-9]*\)\.\([0-9]*\)\.\([0-9]*\).*/\1,\2,\3/'`;
103 AC_EGREP_CPP([eat flaming death], [#include <osreldate.h>
104 #if !defined(__FreeBSD_kernel_version) && defined(__FreeBSD_version)
105 #define __FreeBSD_kernel_version __FreeBSD_version
107 #if __FreeBSD_kernel_version < $hdrnum
109 #endif], libc_minimum_kernel='too old!', libc_minimum_kernel=ok)
110 AC_MSG_RESULT($libc_minimum_kernel)
111 if test "$libc_minimum_kernel" = ok; then
112 AC_DEFINE_UNQUOTED(__KFREEBSD_KERNEL_VERSION, $decnum)
113 AC_DEFINE_UNQUOTED(__ABI_TAG_VERSION, $abinum)
115 AC_MSG_ERROR([*** The available kernel headers are older than the requested
116 *** compatible kernel version])
120 if test -n "$sysheaders"; then
121 CPPFLAGS=$OLD_CPPFLAGS
123 # The Linux filesystem standard prescribes where to place "essential"
124 # files. I.e., when the installation prefix is "/usr" we have to place
125 # shared library objects and the configuration files on the root partition
129 # 64-bit libraries on bi-arch platforms go in /lib64 instead of /lib
131 sparc/sparc64 | x86_64 | powerpc/powerpc64 | s390/s390-64 | \
133 libc_cv_slibdir="/lib64"
134 if test "$libdir" = '${exec_prefix}/lib'; then
135 libdir='${exec_prefix}/lib64';
136 # Locale data can be shared between 32bit and 64bit libraries
137 libc_cv_localedir='${exec_prefix}/lib/locale'
141 libc_cv_slibdir="/lib32"
142 if test "$libdir" = '${exec_prefix}/lib'; then
143 libdir='${exec_prefix}/lib32';
144 # Locale data can be shared between 32bit and 64bit libraries
145 libc_cv_localedir='${exec_prefix}/lib/locale'
149 libc_cv_slibdir="/lib"
152 # Allow the user to override the path with --sysconfdir
153 if test $sysconfdir = '${prefix}/etc'; then
154 libc_cv_sysconfdir=/etc
156 libc_cv_sysconfdir=$sysconfdir
158 libc_cv_rootsbindir="/sbin"
163 # Put exception handling support into libc, so that not every shared
164 # library needs to include it.
165 # FIXME: Does not work yet.
166 libc_cv_gcc_unwind_find_fde=no
169 # Under kFreeBSD the FBTL add-on should be available.
171 # It is available. Good.
180 if test "$fbtl_missing"; then
181 if test $enable_sanity = yes; then
183 *** On GNU/kFreeBSD systems it is normal to compile GNU libc with the
184 *** \`fbtl' add-on. Without that, the library will be
185 *** incompatible with normal GNU/kFreeBSD systems.
186 *** If you really mean to not use this add-on, run configure again
187 *** using the extra parameter \`--disable-sanity-checks'."
191 *** WARNING: Are you sure you do not want to use the \`fbtl'
196 if test "$prefix" = "/usr/local" -o "$prefix" = "/usr/local/" -o "$prefix" = "NONE"; then
197 if test $enable_sanity = yes; then
199 *** On GNU/kFreeBSD systems the GNU C Library should not be installed into
200 *** /usr/local since this might make your system totally unusable.
201 *** We strongly advise to use a different prefix. For details read the FAQ.
202 *** If you really mean to do this, run configure again using the extra
203 *** parameter \`--disable-sanity-checks'."
207 *** WARNING: Do you really want to install the GNU C Library into /usr/local?
208 *** This might make your system totally unusable, for details read the FAQ."
213 # One kFreeBSD we use ldconfig.
216 # We need some extensions to the `ldd' script.
220 ldd_rewrite_script=$dir/x86_64/ldd-rewrite.sed
227 if test $host = $build; then
228 # If $prefix/include/{net,scsi} are symlinks, make install will
229 # clobber what they're linked to (probably a kernel tree).
230 # test -L ought to work on all Linux boxes.
231 if test "x$prefix" != xNONE; then
234 ac_prefix=$ac_default_prefix
236 AC_MSG_CHECKING([for symlinks in ${ac_prefix}/include])
238 if test -L ${ac_prefix}/include/net; then
239 ac_message="$ac_message
240 ${ac_prefix}/include/net is a symlink"
242 if test -L ${ac_prefix}/include/scsi; then
243 ac_message="$ac_message
244 ${ac_prefix}/include/scsi is a symlink"
246 if test -n "$ac_message"; then
247 AC_MSG_ERROR([$ac_message
248 \`make install' will destroy the target of the link(s).
249 Delete the links and re-run configure, or better still, move the entire
250 ${ac_prefix}/include directory out of the way.])
256 # We support internal syscalls.
257 # It is advertised as inlined syscalls availability ...
258 AC_DEFINE(HAVE_INLINED_SYSCALLS)