1 # generated automatically by aclocal 1.9.6 -*- Autoconf -*-
3 # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
4 # 2005 Free Software Foundation, Inc.
5 # This file is free software; the Free Software Foundation
6 # gives unlimited permission to copy and/or distribute it,
7 # with or without modifications, as long as this notice is preserved.
9 # This program is distributed in the hope that it will be useful,
10 # but WITHOUT ANY WARRANTY, to the extent permitted by law; without
11 # even the implied warranty of MERCHANTABILITY or FITNESS FOR A
15 # Find format of installed man pages.
16 # Always gzipped on Debian, but not Redhat pre-7.0.
17 # We don't deal with bzip2'd man pages, which Mandrake uses,
18 # someone will send us a patch sometime hopefully. :-)
20 AC_DEFUN([AC_MANUAL_FORMAT],
21 [ have_zipped_manpages=false
22 for d in ${prefix}/share/man ${prefix}/man ; do
23 if test -f $d/man1/man.1.gz
25 have_zipped_manpages=true
29 AC_SUBST(have_zipped_manpages)
32 # The AC_MULTILIB macro was extracted and modified from
33 # gettext-0.15's AC_LIB_PREPARE_MULTILIB macro in the lib-prefix.m4 file
34 # so that the correct paths can be used for 64-bit libraries.
36 dnl Copyright (C) 2001-2005 Free Software Foundation, Inc.
37 dnl This file is free software; the Free Software Foundation
38 dnl gives unlimited permission to copy and/or distribute it,
39 dnl with or without modifications, as long as this notice is preserved.
40 dnl From Bruno Haible.
42 dnl AC_MULTILIB creates a variable libdirsuffix, containing
43 dnl the suffix of the libdir, either "" or "64".
44 dnl Only do this if the given enable parameter is "yes".
45 AC_DEFUN([AC_MULTILIB],
47 dnl There is no formal standard regarding lib and lib64. The current
48 dnl practice is that on a system supporting 32-bit and 64-bit instruction
49 dnl sets or ABIs, 64-bit libraries go under $prefix/lib64 and 32-bit
50 dnl libraries go under $prefix/lib. We determine the compiler's default
51 dnl mode by looking at the compiler's library search path. If at least
52 dnl of its elements ends in /lib64 or points to a directory whose absolute
53 dnl pathname ends in /lib64, we assume a 64-bit ABI. Otherwise we use the
54 dnl default, namely "lib".
57 searchpath=`(LC_ALL=C $CC -print-search-dirs) 2>/dev/null | sed -n -e 's,^libraries: ,,p' | sed -e 's,^=,,'`
58 if test "$enable_lib64" = "yes" -a -n "$searchpath"; then
59 save_IFS="${IFS= }"; IFS=":"
60 for searchdir in $searchpath; do
61 if test -d "$searchdir"; then
63 */lib64/ | */lib64 ) libdirsuffix=64 ;;
64 *) searchdir=`cd "$searchdir" && pwd`
66 */lib64 ) libdirsuffix=64 ;;
73 AC_SUBST(libdirsuffix)
77 # Check if we have a libaio.h installed
79 AC_DEFUN([AC_PACKAGE_WANT_AIO],
80 [ AC_CHECK_HEADERS(libaio.h, [ have_aio=true ], [ have_aio=false ])
85 # Check if we have an aio.h installed
87 AC_DEFUN([AC_PACKAGE_NEED_AIO_H],
88 [ AC_CHECK_HEADERS(aio.h)
89 if test $ac_cv_header_aio_h = no; then
91 echo 'FATAL ERROR: could not find a valid <aio.h> header.'
97 # Check if we have the lio_listio routine in either libc/librt
99 AC_DEFUN([AC_PACKAGE_NEED_LIO_LISTIO],
100 [ AC_CHECK_FUNCS(lio_listio)
101 if test $ac_cv_func_lio_listio = yes; then
104 AC_CHECK_LIB(rt, lio_listio,, [
106 echo 'FATAL ERROR: could not find a library with lio_listio.'
115 # Generic macro, sets up all of the global packaging variables.
116 # The following environment variables may be set to override defaults:
117 # DEBUG OPTIMIZER MALLOCLIB PLATFORM DISTRIBUTION INSTALL_USER INSTALL_GROUP
120 AC_DEFUN([AC_PACKAGE_GLOBALS],
125 pkg_version=${PKG_MAJOR}.${PKG_MINOR}.${PKG_REVISION}
126 AC_SUBST(pkg_version)
127 pkg_release=$PKG_BUILD
128 test -z "$BUILD_VERSION" || pkg_release="$BUILD_VERSION"
129 AC_SUBST(pkg_release)
131 DEBUG=${DEBUG:-'-DDEBUG'} dnl -DNDEBUG
133 AC_SUBST(debug_build)
135 OPTIMIZER=${OPTIMIZER:-'-g -O2'}
136 opt_build="$OPTIMIZER"
139 MALLOCLIB=${MALLOCLIB:-''} dnl /usr/lib/libefence.a
140 malloc_lib="$MALLOCLIB"
144 test -z "$INSTALL_USER" || pkg_user="$INSTALL_USER"
148 test -z "$INSTALL_GROUP" || pkg_group="$INSTALL_GROUP"
151 pkg_distribution=`uname -s`
152 test -z "$DISTRIBUTION" || pkg_distribution="$DISTRIBUTION"
153 AC_SUBST(pkg_distribution)
155 pkg_platform=`uname -s | tr 'A-Z' 'a-z' | sed -e 's/irix64/irix/'`
156 test -z "$PLATFORM" || pkg_platform="$PLATFORM"
157 AC_SUBST(pkg_platform)
161 # Check if we have a working fadvise system call
163 AC_DEFUN([AC_HAVE_FADVISE],
164 [ AC_MSG_CHECKING([for fadvise ])
167 #define _FILE_OFFSET_BITS 64
170 posix_fadvise(0, 1, 0, POSIX_FADV_NORMAL);
174 AC_SUBST(have_fadvise)
178 # Check if we have a working madvise system call
180 AC_DEFUN([AC_HAVE_MADVISE],
181 [ AC_MSG_CHECKING([for madvise ])
184 #define _FILE_OFFSET_BITS 64
185 #include <sys/mman.h>
187 posix_madvise(0, 0, MADV_NORMAL);
191 AC_SUBST(have_madvise)
195 # Check if we have a working mincore system call
197 AC_DEFUN([AC_HAVE_MINCORE],
198 [ AC_MSG_CHECKING([for mincore ])
201 #define _FILE_OFFSET_BITS 64
202 #include <sys/mman.h>
208 AC_SUBST(have_mincore)
212 # Check if we have a working sendfile system call
214 AC_DEFUN([AC_HAVE_SENDFILE],
215 [ AC_MSG_CHECKING([for sendfile ])
218 #define _FILE_OFFSET_BITS 64
219 #include <sys/sendfile.h>
221 sendfile(0, 0, 0, 0);
225 AC_SUBST(have_sendfile)
229 # Check if we have a getmntent libc call (IRIX, Linux)
231 AC_DEFUN([AC_HAVE_GETMNTENT],
232 [ AC_MSG_CHECKING([for getmntent ])
238 ], have_getmntent=yes
241 AC_SUBST(have_getmntent)
245 # Check if we have a getmntinfo libc call (FreeBSD, Mac OS X)
247 AC_DEFUN([AC_HAVE_GETMNTINFO],
248 [ AC_MSG_CHECKING([for getmntinfo ])
250 #include <sys/param.h>
251 #include <sys/ucred.h>
252 #include <sys/mount.h>
255 ], have_getmntinfo=yes
258 AC_SUBST(have_getmntinfo)
261 AC_DEFUN([AC_PACKAGE_NEED_PTHREAD_H],
262 [ AC_CHECK_HEADERS(pthread.h)
263 if test $ac_cv_header_pthread_h = no; then
264 AC_CHECK_HEADERS(pthread.h,, [
266 echo 'FATAL ERROR: could not find a valid pthread header.'
271 AC_DEFUN([AC_PACKAGE_NEED_PTHREADMUTEXINIT],
272 [ AC_CHECK_LIB(pthread, pthread_mutex_init,, [
274 echo 'FATAL ERROR: could not find a valid pthread library.'
282 # Check if we have a type for the pointer's size integer (__psint_t)
284 AC_DEFUN([AC_TYPE_PSINT],
285 [ AC_MSG_CHECKING([for __psint_t ])
287 #include <sys/types.h>
292 ], AC_DEFINE(HAVE___PSINT_T) AC_MSG_RESULT(yes) , AC_MSG_RESULT(no))
296 # Check if we have a type for the pointer's size unsigned (__psunsigned_t)
298 AC_DEFUN([AC_TYPE_PSUNSIGNED],
299 [ AC_MSG_CHECKING([for __psunsigned_t ])
301 #include <sys/types.h>
305 __psunsigned_t psuint;
306 ], AC_DEFINE(HAVE___PSUNSIGNED_T) AC_MSG_RESULT(yes) , AC_MSG_RESULT(no))
310 # Check if we have a type for __u32
312 AC_DEFUN([AC_TYPE_U32],
313 [ AC_MSG_CHECKING([for __u32 ])
315 #include <asm/types.h>
320 ], AC_DEFINE(HAVE___U32) AC_MSG_RESULT(yes) , AC_MSG_RESULT(no))
326 AC_DEFUN([AC_SIZEOF_POINTERS_AND_LONG],
327 [ if test "$cross_compiling" = yes -a -z "$ac_cv_sizeof_long"; then
328 AC_MSG_WARN([Cross compiling; assuming 32bit long and 32bit pointers])
330 AC_CHECK_SIZEOF(long, 4)
331 AC_CHECK_SIZEOF(char *, 4)
332 if test $ac_cv_sizeof_long -eq 4 -o $ac_cv_sizeof_long -eq 0; then
333 AC_DEFINE(HAVE_32BIT_LONG)
335 if test $ac_cv_sizeof_long -eq 8; then
336 AC_DEFINE(HAVE_64BIT_LONG)
338 if test $ac_cv_sizeof_char_p -eq 4 -o $ac_cv_sizeof_char_p -eq 0; then
339 AC_DEFINE(HAVE_32BIT_PTR)
341 if test $ac_cv_sizeof_char_p -eq 8; then
342 AC_DEFINE(HAVE_64BIT_PTR)
347 # Check for specified utility (env var) - if unset, fail.
349 AC_DEFUN([AC_PACKAGE_NEED_UTILITY],
350 [ if test -z "$2"; then
352 echo FATAL ERROR: $3 does not seem to be installed.
353 echo $1 cannot be built without a working $4 installation.
359 # Generic macro, sets up all of the global build variables.
360 # The following environment variables may be set to override defaults:
361 # CC MAKE LIBTOOL TAR ZIP MAKEDEPEND AWK SED ECHO SORT
362 # MSGFMT MSGMERGE XGETTEXT RPM
364 AC_DEFUN([AC_PACKAGE_UTILITIES],
368 AC_PACKAGE_NEED_UTILITY($1, "$cc", cc, [C compiler])
370 if test -z "$MAKE"; then
371 AC_PATH_PROG(MAKE, gmake,, /usr/bin:/usr/local/bin:/usr/freeware/bin)
373 if test -z "$MAKE"; then
374 AC_PATH_PROG(MAKE, make,, /usr/bin)
378 AC_PACKAGE_NEED_UTILITY($1, "$make", make, [GNU make])
380 if test -z "$LIBTOOL"; then
381 AC_PATH_PROG(LIBTOOL, glibtool,, /usr/bin)
383 if test -z "$LIBTOOL"; then
384 AC_PATH_PROG(LIBTOOL, libtool,, /usr/bin:/usr/local/bin:/usr/freeware/bin)
388 AC_PACKAGE_NEED_UTILITY($1, "$libtool", libtool, [GNU libtool])
390 if test -z "$TAR"; then
391 AC_PATH_PROG(TAR, tar,, /usr/freeware/bin:/bin:/usr/local/bin:/usr/bin)
395 if test -z "$ZIP"; then
396 AC_PATH_PROG(ZIP, gzip,, /bin:/usr/bin:/usr/local/bin:/usr/freeware/bin)
402 if test -z "$MAKEDEPEND"; then
403 AC_PATH_PROG(MAKEDEPEND, makedepend, /bin/true)
405 makedepend=$MAKEDEPEND
408 if test -z "$AWK"; then
409 AC_PATH_PROG(AWK, awk,, /bin:/usr/bin)
414 if test -z "$SED"; then
415 AC_PATH_PROG(SED, sed,, /bin:/usr/bin)
420 if test -z "$ECHO"; then
421 AC_PATH_PROG(ECHO, echo,, /bin:/usr/bin)
426 if test -z "$SORT"; then
427 AC_PATH_PROG(SORT, sort,, /bin:/usr/bin)
432 dnl check if symbolic links are supported
435 if test "$enable_gettext" = yes; then
436 if test -z "$MSGFMT"; then
437 AC_PATH_PROG(MSGFMT, msgfmt,, /usr/bin:/usr/local/bin:/usr/freeware/bin)
441 AC_PACKAGE_NEED_UTILITY($1, "$msgfmt", msgfmt, gettext)
443 if test -z "$MSGMERGE"; then
444 AC_PATH_PROG(MSGMERGE, msgmerge,, /usr/bin:/usr/local/bin:/usr/freeware/bin)
448 AC_PACKAGE_NEED_UTILITY($1, "$msgmerge", msgmerge, gettext)
450 if test -z "$XGETTEXT"; then
451 AC_PATH_PROG(XGETTEXT, xgettext,, /usr/bin:/usr/local/bin:/usr/freeware/bin)
455 AC_PACKAGE_NEED_UTILITY($1, "$xgettext", xgettext, gettext)
458 if test -z "$RPM"; then
459 AC_PATH_PROG(RPM, rpm,, /bin:/usr/bin:/usr/freeware/bin)
464 dnl .. and what version is rpm
466 test -n "$RPM" && test -x "$RPM" && rpm_version=`$RPM --version \
467 | awk '{print $NF}' | awk -F. '{V=1; print $V}'`
468 AC_SUBST(rpm_version)
469 dnl At some point in rpm 4.0, rpm can no longer build rpms, and
470 dnl rpmbuild is needed (rpmbuild may go way back; not sure)
471 dnl So, if rpm version >= 4.0, look for rpmbuild. Otherwise build w/ rpm
472 if test $rpm_version -ge 4; then
473 AC_PATH_PROG(RPMBUILD, rpmbuild)
481 AC_DEFUN([AC_PACKAGE_NEED_UUID_H],
482 [ AC_CHECK_HEADERS([uuid.h sys/uuid.h uuid/uuid.h])
483 if test $ac_cv_header_uuid_h = no -a \
484 $ac_cv_header_sys_uuid_h = no -a \
485 $ac_cv_header_uuid_uuid_h = no; then
487 echo 'FATAL ERROR: could not find a valid UUID header.'
488 echo 'Install the Universally Unique Identifiers development package.'
493 AC_DEFUN([AC_PACKAGE_NEED_UUIDCOMPARE],
494 [ AC_CHECK_FUNCS(uuid_compare)
495 if test $ac_cv_func_uuid_compare = yes; then
498 AC_CHECK_LIB(uuid, uuid_compare,, [
500 echo 'FATAL ERROR: could not find a valid UUID library.'
501 echo 'Install the Universally Unique Identifiers library package.'