initial commit
[glibc.git] / sysdeps / unix / bsd / bsd4.4 / kfreebsd / configure.in
1 GLIBC_PROVIDES dnl See aclocal.m4 in the top level source directory.
2 # Local configure fragment for sysdeps/unix/bsd/bsd4.4/kfreebsd.
3
4 # The kFreeBSD headers can be found in
5 # /usr/src/sys/
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
13 dnl to be used.
14 SYSINCLUDES="-I $sysheaders"
15 fi
16
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.
19 inhibit_glue=yes
20
21 define([LIBC_KFREEBSD_VERSION],[8.3.0])dnl
22 if test -n "$sysheaders"; then
23 OLD_CPPFLAGS=$CPPFLAGS
24 CPPFLAGS="$CPPFLAGS $SYSINCLUDES"
25 fi
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
31 #endif
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 */])[
35 eat flaming death
36 #endif],
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.])
48 fi
49
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
57 else
58 utmp_subdir=utmp-compat
59 fi
60 sysnames="$sysnames sysdeps/unix/bsd/bsd4.4/kfreebsd/$utmp_subdir"
61
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
67 # if appropriate too.
68 test -n "$arch_minimum_kernel" ||
69 case "$machine" in
70 i386*)
71 libc_cv_gcc_unwind_find_fde=yes
72 arch_minimum_kernel=8.3.0
73 ;;
74 x86_64*)
75 arch_minimum_kernel=8.3.0
76 ;;
77 *)
78 arch_minimum_kernel=8.3.0
79 ;;
80 esac
81 if test -n "$minimum_kernel"; then
82 changequote(,)
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/'`))
85 changequote([,])
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
89 fi
90 else
91 if test $arch_minimum_kernel != '8.3.0'; then
92 minimum_kernel=$arch_minimum_kernel
93 fi
94 fi
95
96 if test -n "$minimum_kernel"; then
97 AC_MSG_CHECKING(for kernel header at least $minimum_kernel)
98 changequote(,)dnl
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/'`;
102 changequote([,])dnl
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
106 #endif
107 #if __FreeBSD_kernel_version < $hdrnum
108 eat flaming death
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)
114 else
115 AC_MSG_ERROR([*** The available kernel headers are older than the requested
116 *** compatible kernel version])
117 fi
118 fi
119
120 if test -n "$sysheaders"; then
121 CPPFLAGS=$OLD_CPPFLAGS
122 fi
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
126 # in /lib and /etc.
127 case "$prefix" in
128 /usr | /usr/)
129 # 64-bit libraries on bi-arch platforms go in /lib64 instead of /lib
130 case $machine in
131 sparc/sparc64 | x86_64 | powerpc/powerpc64 | s390/s390-64 | \
132 mips/mips64/n64/* )
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'
138 fi
139 ;;
140 mips/mips64/n32/* )
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'
146 fi
147 ;;
148 *)
149 libc_cv_slibdir="/lib"
150 ;;
151 esac
152 # Allow the user to override the path with --sysconfdir
153 if test $sysconfdir = '${prefix}/etc'; then
154 libc_cv_sysconfdir=/etc
155 else
156 libc_cv_sysconfdir=$sysconfdir
157 fi
158 libc_cv_rootsbindir="/sbin"
159 ;;
160 esac
161
162
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
167
168
169 # Under kFreeBSD the FBTL add-on should be available.
170 case $add_ons in
171 # It is available. Good.
172 *fbtl*)
173 fbtl_missing=
174 ;;
175 *)
176 fbtl_missing=yes
177 ;;
178 esac
179
180 if test "$fbtl_missing"; then
181 if test $enable_sanity = yes; then
182 echo "\
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'."
188 exit 1
189 else
190 echo "\
191 *** WARNING: Are you sure you do not want to use the \`fbtl'
192 *** add-on?"
193 fi
194 fi
195
196 if test "$prefix" = "/usr/local" -o "$prefix" = "/usr/local/" -o "$prefix" = "NONE"; then
197 if test $enable_sanity = yes; then
198 echo "\
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'."
204 exit 1
205 else
206 echo "\
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."
209 fi
210 fi
211
212
213 # One kFreeBSD we use ldconfig.
214 use_ldconfig=yes
215
216 # We need some extensions to the `ldd' script.
217 changequote(,)
218 case "$machine" in
219 x86_64*)
220 ldd_rewrite_script=$dir/x86_64/ldd-rewrite.sed
221 ;;
222 *)
223 ;;
224 esac
225 changequote([,])
226
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
232 ac_prefix=$prefix
233 else
234 ac_prefix=$ac_default_prefix
235 fi
236 AC_MSG_CHECKING([for symlinks in ${ac_prefix}/include])
237 ac_message=
238 if test -L ${ac_prefix}/include/net; then
239 ac_message="$ac_message
240 ${ac_prefix}/include/net is a symlink"
241 fi
242 if test -L ${ac_prefix}/include/scsi; then
243 ac_message="$ac_message
244 ${ac_prefix}/include/scsi is a symlink"
245 fi
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.])
251 else
252 AC_MSG_RESULT(ok)
253 fi
254 fi
255
256 # We support internal syscalls.
257 # It is advertised as inlined syscalls availability ...
258 AC_DEFINE(HAVE_INLINED_SYSCALLS)