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
14 # The AC_MULTILIB macro was extracted and modified from
15 # gettext-0.15's AC_LIB_PREPARE_MULTILIB macro in the lib-prefix.m4 file
16 # so that the correct paths can be used for 64-bit libraries.
18 dnl Copyright (C) 2001-2005 Free Software Foundation, Inc.
19 dnl This file is free software; the Free Software Foundation
20 dnl gives unlimited permission to copy and/or distribute it,
21 dnl with or without modifications, as long as this notice is preserved.
22 dnl From Bruno Haible.
24 dnl AC_MULTILIB creates a variable libdirsuffix, containing
25 dnl the suffix of the libdir, either "" or "64".
26 dnl Only do this if the given enable parameter is "yes".
27 AC_DEFUN([AC_MULTILIB],
29 dnl There is no formal standard regarding lib and lib64. The current
30 dnl practice is that on a system supporting 32-bit and 64-bit instruction
31 dnl sets or ABIs, 64-bit libraries go under $prefix/lib64 and 32-bit
32 dnl libraries go under $prefix/lib. We determine the compiler's default
33 dnl mode by looking at the compiler's library search path. If at least
34 dnl of its elements ends in /lib64 or points to a directory whose absolute
35 dnl pathname ends in /lib64, we assume a 64-bit ABI. Otherwise we use the
36 dnl default, namely "lib".
39 searchpath=`(LC_ALL=C $CC -print-search-dirs) 2>/dev/null | sed -n -e 's,^libraries: ,,p' | sed -e 's,^=,,'`
40 if test "$enable_lib64" = "yes" -a -n "$searchpath"; then
41 save_IFS="${IFS= }"; IFS=":"
42 for searchdir in $searchpath; do
43 if test -d "$searchdir"; then
45 */lib64/ | */lib64 ) libdirsuffix=64 ;;
46 *) searchdir=`cd "$searchdir" && pwd`
48 */lib64 ) libdirsuffix=64 ;;
55 AC_SUBST(libdirsuffix)
58 AC_DEFUN([AC_PACKAGE_NEED_SYS_ACL_H],
59 [ AC_CHECK_HEADERS([sys/acl.h])
60 if test "$ac_cv_header_sys_acl_h" != "yes"; then
62 echo 'FATAL ERROR: sys/acl.h does not exist.'
63 echo 'Install the access control lists (acl) development package.'
64 echo 'Alternatively, run "make install-dev" from the acl source.'
69 AC_DEFUN([AC_PACKAGE_NEED_ACL_LIBACL_H],
70 [ AC_CHECK_HEADERS([acl/libacl.h])
71 if test "$ac_cv_header_acl_libacl_h" != "yes"; then
73 echo 'FATAL ERROR: acl/libacl.h does not exist.'
74 echo 'Install the access control lists (acl) development package.'
75 echo 'Alternatively, run "make install-dev" from the acl source.'
81 AC_DEFUN([AC_PACKAGE_NEED_ACLINIT_LIBACL],
82 [ AC_CHECK_LIB(acl, acl_init,, [
84 echo 'FATAL ERROR: could not find a valid Access Control List library.'
85 echo 'Install either the libacl (rpm) or the libacl1 (deb) package.'
86 echo 'Alternatively, run "make install-lib" from the acl source.'
90 test -f `pwd`/../acl/libacl/libacl.la && \
91 libacl="`pwd`/../acl/libacl/libacl.la"
92 test -f ${libexecdir}${libdirsuffix}/libacl.la && \
93 libacl="${libexecdir}${libdirsuffix}/libacl.la"
97 AC_DEFUN([AC_PACKAGE_WANT_AIO],
98 [ AC_CHECK_HEADERS(libaio.h, [ have_aio=true ], [ have_aio=false ])
102 AC_DEFUN([AC_PACKAGE_WANT_DMAPI],
103 [ AC_CHECK_HEADERS(sys/dmapi/dmapi.h, [ have_dmapi=true ], [ have_dmapi=false ])
107 AC_DEFUN([AC_PACKAGE_NEED_ATTR_XATTR_H],
108 [ AC_CHECK_HEADERS([attr/xattr.h])
109 if test "$ac_cv_header_attr_xattr_h" != "yes"; then
111 echo 'FATAL ERROR: attr/xattr.h does not exist.'
112 echo 'Install the extended attributes (attr) development package.'
113 echo 'Alternatively, run "make install-dev" from the attr source.'
118 AC_DEFUN([AC_PACKAGE_NEED_ATTR_ERROR_H],
119 [ AC_CHECK_HEADERS([attr/error_context.h])
120 if test "$ac_cv_header_attr_error_context_h" != "yes"; then
122 echo 'FATAL ERROR: attr/error_context.h does not exist.'
123 echo 'Install the extended attributes (attr) development package.'
124 echo 'Alternatively, run "make install-dev" from the attr source.'
129 AC_DEFUN([AC_PACKAGE_NEED_ATTRIBUTES_H],
130 [ have_attributes_h=false
131 AC_CHECK_HEADERS([attr/attributes.h sys/attributes.h], [have_attributes_h=true], )
132 if test "$have_attributes_h" = "false"; then
134 echo 'FATAL ERROR: attributes.h does not exist.'
135 echo 'Install the extended attributes (attr) development package.'
136 echo 'Alternatively, run "make install-dev" from the attr source.'
141 AC_DEFUN([AC_PACKAGE_WANT_ATTRLIST_LIBATTR],
142 [ AC_CHECK_LIB(attr, attr_list, [have_attr_list=true], [have_attr_list=false])
143 AC_SUBST(have_attr_list)
146 AC_DEFUN([AC_PACKAGE_NEED_GETXATTR_LIBATTR],
147 [ AC_CHECK_LIB(attr, getxattr,, [
149 echo 'FATAL ERROR: could not find a valid Extended Attributes library.'
150 echo 'Install the extended attributes (attr) development package.'
151 echo 'Alternatively, run "make install-lib" from the attr source.'
155 test -f `pwd`/../attr/libattr/libattr.la && \
156 libattr="`pwd`/../attr/libattr/libattr.la"
157 test -f ${libexecdir}${libdirsuffix}/libattr.la && \
158 libattr="${libexecdir}${libdirsuffix}/libattr.la"
162 AC_DEFUN([AC_PACKAGE_NEED_ATTRGET_LIBATTR],
163 [ AC_CHECK_LIB(attr, attr_get,, [
165 echo 'FATAL ERROR: could not find a valid Extended Attributes library.'
166 echo 'Install the extended attributes (attr) development package.'
167 echo 'Alternatively, run "make install-lib" from the attr source.'
171 test -f `pwd`/../attr/libattr/libattr.la && \
172 libattr="`pwd`/../attr/libattr/libattr.la"
173 test -f ${libexecdir}${libdirsuffix}/libattr.la && \
174 libattr="${libexecdir}${libdirsuffix}/libattr.la"
178 AC_DEFUN([AC_PACKAGE_NEED_ATTRIBUTES_MACROS],
179 [ AC_MSG_CHECKING([macros in attr/attributes.h])
181 #include <sys/types.h>
182 #include <attr/attributes.h>],
183 [ int x = ATTR_SECURE; ], [ echo ok ], [
185 echo 'FATAL ERROR: could not find a current attributes header.'
186 echo 'Upgrade the extended attributes (attr) development package.'
187 echo 'Alternatively, run "make install-dev" from the attr source.'
191 AC_DEFUN([AC_PACKAGE_WANT_NDBM],
192 [ AC_CHECK_HEADERS(ndbm.h, [ have_db=true ], [ have_db=false ])
198 AC_DEFUN([AC_PACKAGE_WANT_GDBM],
199 [ AC_CHECK_HEADERS([gdbm/ndbm.h], [ have_db=true ], [ have_db=false ])
200 if test $have_db = true; then
208 # Generic macro, sets up all of the global packaging variables.
209 # The following environment variables may be set to override defaults:
210 # DEBUG OPTIMIZER MALLOCLIB PLATFORM DISTRIBUTION INSTALL_USER INSTALL_GROUP
213 AC_DEFUN([AC_PACKAGE_GLOBALS],
218 pkg_version=${PKG_MAJOR}.${PKG_MINOR}.${PKG_REVISION}
219 AC_SUBST(pkg_version)
220 pkg_release=$PKG_BUILD
221 test -z "$BUILD_VERSION" || pkg_release="$BUILD_VERSION"
222 AC_SUBST(pkg_release)
224 DEBUG=${DEBUG:-'-DDEBUG'} dnl -DNDEBUG
226 AC_SUBST(debug_build)
228 OPTIMIZER=${OPTIMIZER:-'-g -O2'}
229 opt_build="$OPTIMIZER"
232 MALLOCLIB=${MALLOCLIB:-''} dnl /usr/lib/libefence.a
233 malloc_lib="$MALLOCLIB"
237 test -z "$INSTALL_USER" || pkg_user="$INSTALL_USER"
241 test -z "$INSTALL_GROUP" || pkg_group="$INSTALL_GROUP"
244 pkg_distribution=`uname -s`
245 test -z "$DISTRIBUTION" || pkg_distribution="$DISTRIBUTION"
246 AC_SUBST(pkg_distribution)
248 pkg_platform=`uname -s | tr 'A-Z' 'a-z' | sed -e 's/irix64/irix/'`
249 test -z "$PLATFORM" || pkg_platform="$PLATFORM"
250 AC_SUBST(pkg_platform)
254 # Check for specified utility (env var) - if unset, fail.
256 AC_DEFUN([AC_PACKAGE_NEED_UTILITY],
257 [ if test -z "$2"; then
259 echo FATAL ERROR: $3 does not seem to be installed.
260 echo $1 cannot be built without a working $4 installation.
266 # Generic macro, sets up all of the global build variables.
267 # The following environment variables may be set to override defaults:
268 # CC MAKE LIBTOOL TAR ZIP MAKEDEPEND AWK SED ECHO SORT
269 # MSGFMT MSGMERGE RPM
271 AC_DEFUN([AC_PACKAGE_UTILITIES],
275 AC_PACKAGE_NEED_UTILITY($1, "$cc", cc, [C compiler])
277 if test -z "$MAKE"; then
278 AC_PATH_PROG(MAKE, gmake,, /usr/bin:/usr/local/bin:/usr/freeware/bin)
280 if test -z "$MAKE"; then
281 AC_PATH_PROG(MAKE, make,, /usr/bin)
285 AC_PACKAGE_NEED_UTILITY($1, "$make", make, [GNU make])
287 if test -z "$LIBTOOL"; then
288 AC_PATH_PROG(LIBTOOL, glibtool,, /usr/bin)
290 if test -z "$LIBTOOL"; then
291 AC_PATH_PROG(LIBTOOL, libtool,, /usr/bin:/usr/local/bin:/usr/freeware/bin)
295 AC_PACKAGE_NEED_UTILITY($1, "$libtool", libtool, [GNU libtool])
297 if test -z "$TAR"; then
298 AC_PATH_PROG(TAR, tar,, /usr/freeware/bin:/bin:/usr/local/bin:/usr/bin)
302 if test -z "$ZIP"; then
303 AC_PATH_PROG(ZIP, gzip,, /bin:/usr/bin:/usr/local/bin:/usr/freeware/bin)
309 if test -z "$MAKEDEPEND"; then
310 AC_PATH_PROG(MAKEDEPEND, makedepend, /bin/true)
312 makedepend=$MAKEDEPEND
315 if test -z "$AWK"; then
316 AC_PATH_PROG(AWK, awk,, /bin:/usr/bin)
321 if test -z "$SED"; then
322 AC_PATH_PROG(SED, sed,, /bin:/usr/bin)
327 if test -z "$ECHO"; then
328 AC_PATH_PROG(ECHO, echo,, /bin:/usr/bin)
333 if test -z "$SORT"; then
334 AC_PATH_PROG(SORT, sort,, /bin:/usr/bin)
339 dnl check if symbolic links are supported
342 if test "$enable_gettext" = yes; then
343 if test -z "$MSGFMT"; then
344 AC_PATH_PROG(MSGFMT, msgfmt,, /usr/bin:/usr/local/bin:/usr/freeware/bin)
348 AC_PACKAGE_NEED_UTILITY($1, "$msgfmt", msgfmt, gettext)
350 if test -z "$MSGMERGE"; then
351 AC_PATH_PROG(MSGMERGE, msgmerge,, /usr/bin:/usr/local/bin:/usr/freeware/bin)
355 AC_PACKAGE_NEED_UTILITY($1, "$msgmerge", msgmerge, gettext)
358 if test -z "$RPM"; then
359 AC_PATH_PROG(RPM, rpm,, /bin:/usr/bin:/usr/freeware/bin)
364 dnl .. and what version is rpm
366 test -n "$RPM" && test -x "$RPM" && rpm_version=`$RPM --version \
367 | awk '{print $NF}' | awk -F. '{V=1; print $V}'`
368 AC_SUBST(rpm_version)
369 dnl At some point in rpm 4.0, rpm can no longer build rpms, and
370 dnl rpmbuild is needed (rpmbuild may go way back; not sure)
371 dnl So, if rpm version >= 4.0, look for rpmbuild. Otherwise build w/ rpm
372 if test $rpm_version -ge 4; then
373 AC_PATH_PROG(RPMBUILD, rpmbuild)
381 AC_DEFUN([AC_PACKAGE_NEED_UUID_H],
382 [ AC_CHECK_HEADERS([uuid.h sys/uuid.h uuid/uuid.h])
383 if test $ac_cv_header_uuid_h = no -a \
384 $ac_cv_header_sys_uuid_h = no -a \
385 $ac_cv_header_uuid_uuid_h = no; then
387 echo 'FATAL ERROR: could not find a valid UUID header.'
388 echo 'Install the Universally Unique Identifiers development package.'
393 AC_DEFUN([AC_PACKAGE_NEED_UUIDCOMPARE],
394 [ AC_CHECK_FUNCS(uuid_compare)
395 if test $ac_cv_func_uuid_compare = yes; then
398 AC_CHECK_LIB(uuid, uuid_compare,, [
400 echo 'FATAL ERROR: could not find a valid UUID library.'
401 echo 'Install the Universally Unique Identifiers library package.'
408 AC_DEFUN([AC_PACKAGE_NEED_XFS_XFS_H],
409 [ AC_CHECK_HEADERS([xfs/xfs.h])
410 if test "$ac_cv_header_xfs_xfs_h" != "yes"; then
412 echo 'FATAL ERROR: cannot find a valid <xfs/xfs.h> header file.'
413 echo 'Install or upgrade the XFS development package.'
414 echo 'Alternatively, run "make install-dev" from the xfsprogs source.'
419 AC_DEFUN([AC_PACKAGE_WANT_XFS_LIBXFS_H],
420 [ AC_CHECK_HEADERS([xfs/libxfs.h], [ have_libxfs=true ], [ have_libxfs=false ])
421 AC_SUBST(have_libxfs)
424 AC_DEFUN([AC_PACKAGE_NEED_XFS_XQM_H],
425 [ AC_CHECK_HEADERS([xfs/xqm.h])
426 if test "$ac_cv_header_xfs_xqm_h" != "yes"; then
428 echo 'FATAL ERROR: cannot find a valid <xfs/xqm.h> header file.'
429 echo 'Install or upgrade the XFS development package.'
430 echo 'Alternatively, run "make install-dev" from the xfsprogs source.'
435 AC_DEFUN([AC_PACKAGE_NEED_XFS_HANDLE_H],
436 [ AC_CHECK_HEADERS([xfs/handle.h])
437 if test "$ac_cv_header_xfs_handle_h" != "yes"; then
439 echo 'FATAL ERROR: cannot find a valid <xfs/handle.h> header file.'
440 echo 'Install or upgrade the XFS development package.'
441 echo 'Alternatively, run "make install-dev" from the xfsprogs source.'
446 AC_DEFUN([AC_PACKAGE_NEED_LIBXFSINIT_LIBXFS],
447 [ AC_CHECK_LIB(xfs, libxfs_init,, [
449 echo 'FATAL ERROR: could not find a valid XFS base library.'
450 echo 'Install or upgrade the XFS library package.'
451 echo 'Alternatively, run "make install-dev" from the xfsprogs source.'
455 test -f `pwd`/../xfsprogs/libxfs/libxfs.la && \
456 libxfs="`pwd`/../xfsprogs/libxfs/libxfs.la"
457 test -f ${libexecdir}${libdirsuffix}/libxfs.la && \
458 libxfs="${libexecdir}${libdirsuffix}/libxfs.la"
462 AC_DEFUN([AC_PACKAGE_NEED_OPEN_BY_FSHANDLE],
463 [ AC_CHECK_LIB(handle, open_by_fshandle,, [
465 echo 'FATAL ERROR: could not find a current XFS handle library.'
466 echo 'Install or upgrade the XFS library package.'
467 echo 'Alternatively, run "make install-dev" from the xfsprogs source.'
471 test -f `pwd`/../xfsprogs/libhandle/libhandle.la && \
472 libhdl="`pwd`/../xfsprogs/libhandle/libhandle.la"
473 test -f ${libexecdir}${libdirsuffix}/libhandle.la && \
474 libhdl="${libexecdir}${libdirsuffix}/libhandle.la"
478 AC_DEFUN([AC_PACKAGE_NEED_ATTRLIST_LIBHANDLE],
479 [ AC_CHECK_LIB(handle, attr_list_by_handle,, [
481 echo 'FATAL ERROR: could not find a current XFS handle library.'
482 echo 'Install or upgrade the XFS library package.'
483 echo 'Alternatively, run "make install-lib" from the xfsprogs source.'
487 test -f `pwd`/../xfsprogs/libhandle/libhandle.la && \
488 libhdl="`pwd`/../xfsprogs/libhandle/libhandle.la"
489 test -f ${libexecdir}${libdirsuffix}/libhandle.la && \
490 libhdl="${libexecdir}${libdirsuffix}/libhandle.la"
494 AC_DEFUN([AC_PACKAGE_NEED_IRIX_LIBHANDLE],
496 AC_MSG_CHECKING([libhandle.a for IRIX])
497 libhdl="`pwd`/../irix/libhandle/libhandle.a"
498 if ! test -f $libhdl; then
500 echo 'FATAL ERROR: could not find IRIX XFS handle library.'
507 AC_DEFUN([AC_PACKAGE_NEED_XFSCTL_MACRO],
508 [ AC_MSG_CHECKING([xfsctl from xfs/xfs.h])
509 AC_TRY_LINK([#include <xfs/xfs.h>], [ int x = xfsctl(0, 0, 0, 0); ],
512 echo 'FATAL ERROR: cannot find required macros in the XFS headers.'
513 echo 'Upgrade your XFS programs (xfsprogs) development package.'
514 echo 'Alternatively, run "make install-dev" from the xfsprogs source.'