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_NEED_ATTR_XATTR_H],
103 [ AC_CHECK_HEADERS([attr/xattr.h])
104 if test "$ac_cv_header_attr_xattr_h" != "yes"; then
106 echo 'FATAL ERROR: attr/xattr.h does not exist.'
107 echo 'Install the extended attributes (attr) development package.'
108 echo 'Alternatively, run "make install-dev" from the attr source.'
113 AC_DEFUN([AC_PACKAGE_NEED_ATTR_ERROR_H],
114 [ AC_CHECK_HEADERS([attr/error_context.h])
115 if test "$ac_cv_header_attr_error_context_h" != "yes"; then
117 echo 'FATAL ERROR: attr/error_context.h does not exist.'
118 echo 'Install the extended attributes (attr) development package.'
119 echo 'Alternatively, run "make install-dev" from the attr source.'
124 AC_DEFUN([AC_PACKAGE_NEED_ATTRIBUTES_H],
125 [ have_attributes_h=false
126 AC_CHECK_HEADERS([attr/attributes.h sys/attributes.h], [have_attributes_h=true], )
127 if test "$have_attributes_h" = "false"; then
129 echo 'FATAL ERROR: attributes.h does not exist.'
130 echo 'Install the extended attributes (attr) development package.'
131 echo 'Alternatively, run "make install-dev" from the attr source.'
136 AC_DEFUN([AC_PACKAGE_WANT_ATTRLIST_LIBATTR],
137 [ AC_CHECK_LIB(attr, attr_list, [have_attr_list=true], [have_attr_list=false])
138 AC_SUBST(have_attr_list)
141 AC_DEFUN([AC_PACKAGE_NEED_GETXATTR_LIBATTR],
142 [ AC_CHECK_LIB(attr, getxattr,, [
144 echo 'FATAL ERROR: could not find a valid Extended Attributes library.'
145 echo 'Install the extended attributes (attr) development package.'
146 echo 'Alternatively, run "make install-lib" from the attr source.'
150 test -f `pwd`/../attr/libattr/libattr.la && \
151 libattr="`pwd`/../attr/libattr/libattr.la"
152 test -f ${libexecdir}${libdirsuffix}/libattr.la && \
153 libattr="${libexecdir}${libdirsuffix}/libattr.la"
157 AC_DEFUN([AC_PACKAGE_NEED_ATTRGET_LIBATTR],
158 [ AC_CHECK_LIB(attr, attr_get,, [
160 echo 'FATAL ERROR: could not find a valid Extended Attributes library.'
161 echo 'Install the extended attributes (attr) development package.'
162 echo 'Alternatively, run "make install-lib" from the attr source.'
166 test -f `pwd`/../attr/libattr/libattr.la && \
167 libattr="`pwd`/../attr/libattr/libattr.la"
168 test -f ${libexecdir}${libdirsuffix}/libattr.la && \
169 libattr="${libexecdir}${libdirsuffix}/libattr.la"
173 AC_DEFUN([AC_PACKAGE_NEED_ATTRIBUTES_MACROS],
174 [ AC_MSG_CHECKING([macros in attr/attributes.h])
176 #include <sys/types.h>
177 #include <attr/attributes.h>],
178 [ int x = ATTR_SECURE; ], [ echo ok ], [
180 echo 'FATAL ERROR: could not find a current attributes header.'
181 echo 'Upgrade the extended attributes (attr) development package.'
182 echo 'Alternatively, run "make install-dev" from the attr source.'
186 AC_DEFUN([AC_PACKAGE_WANT_NDBM],
187 [ AC_CHECK_HEADERS(ndbm.h, [ have_db=true ], [ have_db=false ])
193 AC_DEFUN([AC_PACKAGE_WANT_GDBM],
194 [ AC_CHECK_HEADERS([gdbm/ndbm.h], [ have_db=true ], [ have_db=false ])
195 if test $have_db = true -a -f ${libexecdir}${libdirsuffix}/libgdbm.a; then
196 libgdbm="${libexecdir}${libdirsuffix}/libgdbm.a"
203 # Generic macro, sets up all of the global packaging variables.
204 # The following environment variables may be set to override defaults:
205 # DEBUG OPTIMIZER MALLOCLIB PLATFORM DISTRIBUTION INSTALL_USER INSTALL_GROUP
208 AC_DEFUN([AC_PACKAGE_GLOBALS],
213 pkg_version=${PKG_MAJOR}.${PKG_MINOR}.${PKG_REVISION}
214 AC_SUBST(pkg_version)
215 pkg_release=$PKG_BUILD
216 test -z "$BUILD_VERSION" || pkg_release="$BUILD_VERSION"
217 AC_SUBST(pkg_release)
219 DEBUG=${DEBUG:-'-DDEBUG'} dnl -DNDEBUG
221 AC_SUBST(debug_build)
223 OPTIMIZER=${OPTIMIZER:-'-g -O2'}
224 opt_build="$OPTIMIZER"
227 MALLOCLIB=${MALLOCLIB:-''} dnl /usr/lib/libefence.a
228 malloc_lib="$MALLOCLIB"
232 test -z "$INSTALL_USER" || pkg_user="$INSTALL_USER"
236 test -z "$INSTALL_GROUP" || pkg_group="$INSTALL_GROUP"
239 pkg_distribution=`uname -s`
240 test -z "$DISTRIBUTION" || pkg_distribution="$DISTRIBUTION"
241 AC_SUBST(pkg_distribution)
243 pkg_platform=`uname -s | tr 'A-Z' 'a-z' | sed -e 's/irix64/irix/'`
244 test -z "$PLATFORM" || pkg_platform="$PLATFORM"
245 AC_SUBST(pkg_platform)
249 # Check for specified utility (env var) - if unset, fail.
251 AC_DEFUN([AC_PACKAGE_NEED_UTILITY],
252 [ if test -z "$2"; then
254 echo FATAL ERROR: $3 does not seem to be installed.
255 echo $1 cannot be built without a working $4 installation.
261 # Generic macro, sets up all of the global build variables.
262 # The following environment variables may be set to override defaults:
263 # CC MAKE LIBTOOL TAR ZIP MAKEDEPEND AWK SED ECHO SORT
264 # MSGFMT MSGMERGE RPM
266 AC_DEFUN([AC_PACKAGE_UTILITIES],
270 AC_PACKAGE_NEED_UTILITY($1, "$cc", cc, [C compiler])
272 if test -z "$MAKE"; then
273 AC_PATH_PROG(MAKE, gmake,, /usr/bin:/usr/local/bin:/usr/freeware/bin)
275 if test -z "$MAKE"; then
276 AC_PATH_PROG(MAKE, make,, /usr/bin)
280 AC_PACKAGE_NEED_UTILITY($1, "$make", make, [GNU make])
282 if test -z "$LIBTOOL"; then
283 AC_PATH_PROG(LIBTOOL, glibtool,, /usr/bin)
285 if test -z "$LIBTOOL"; then
286 AC_PATH_PROG(LIBTOOL, libtool,, /usr/bin:/usr/local/bin:/usr/freeware/bin)
290 AC_PACKAGE_NEED_UTILITY($1, "$libtool", libtool, [GNU libtool])
292 if test -z "$TAR"; then
293 AC_PATH_PROG(TAR, tar,, /usr/freeware/bin:/bin:/usr/local/bin:/usr/bin)
297 if test -z "$ZIP"; then
298 AC_PATH_PROG(ZIP, gzip,, /bin:/usr/bin:/usr/local/bin:/usr/freeware/bin)
304 if test -z "$MAKEDEPEND"; then
305 AC_PATH_PROG(MAKEDEPEND, makedepend, /bin/true)
307 makedepend=$MAKEDEPEND
310 if test -z "$AWK"; then
311 AC_PATH_PROG(AWK, awk,, /bin:/usr/bin)
316 if test -z "$SED"; then
317 AC_PATH_PROG(SED, sed,, /bin:/usr/bin)
322 if test -z "$ECHO"; then
323 AC_PATH_PROG(ECHO, echo,, /bin:/usr/bin)
328 if test -z "$SORT"; then
329 AC_PATH_PROG(SORT, sort,, /bin:/usr/bin)
334 dnl check if symbolic links are supported
337 if test "$enable_gettext" = yes; then
338 if test -z "$MSGFMT"; then
339 AC_PATH_PROG(MSGFMT, msgfmt,, /usr/bin:/usr/local/bin:/usr/freeware/bin)
343 AC_PACKAGE_NEED_UTILITY($1, "$msgfmt", msgfmt, gettext)
345 if test -z "$MSGMERGE"; then
346 AC_PATH_PROG(MSGMERGE, msgmerge,, /usr/bin:/usr/local/bin:/usr/freeware/bin)
350 AC_PACKAGE_NEED_UTILITY($1, "$msgmerge", msgmerge, gettext)
353 if test -z "$RPM"; then
354 AC_PATH_PROG(RPM, rpm,, /bin:/usr/bin:/usr/freeware/bin)
359 dnl .. and what version is rpm
361 test -n "$RPM" && test -x "$RPM" && rpm_version=`$RPM --version \
362 | awk '{print $NF}' | awk -F. '{V=1; print $V}'`
363 AC_SUBST(rpm_version)
364 dnl At some point in rpm 4.0, rpm can no longer build rpms, and
365 dnl rpmbuild is needed (rpmbuild may go way back; not sure)
366 dnl So, if rpm version >= 4.0, look for rpmbuild. Otherwise build w/ rpm
367 if test $rpm_version -ge 4; then
368 AC_PATH_PROG(RPMBUILD, rpmbuild)
376 AC_DEFUN([AC_PACKAGE_NEED_UUID_H],
377 [ AC_CHECK_HEADERS([uuid.h sys/uuid.h uuid/uuid.h])
378 if test $ac_cv_header_uuid_h = no -a \
379 $ac_cv_header_sys_uuid_h = no -a \
380 $ac_cv_header_uuid_uuid_h = no; then
382 echo 'FATAL ERROR: could not find a valid UUID header.'
383 echo 'Install the Universally Unique Identifiers development package.'
388 AC_DEFUN([AC_PACKAGE_NEED_UUIDCOMPARE],
389 [ AC_CHECK_FUNCS(uuid_compare)
390 if test $ac_cv_func_uuid_compare = yes; then
393 AC_CHECK_LIB(uuid, uuid_compare,, [
395 echo 'FATAL ERROR: could not find a valid UUID library.'
396 echo 'Install the Universally Unique Identifiers library package.'
403 AC_DEFUN([AC_PACKAGE_NEED_XFS_LIBXFS_H],
404 [ AC_CHECK_HEADERS([xfs/libxfs.h])
405 if test "$ac_cv_header_xfs_libxfs_h" != "yes"; then
407 echo 'FATAL ERROR: cannot find a valid <xfs/libxfs.h> header file.'
408 echo 'Install or upgrade the XFS development package.'
409 echo 'Alternatively, run "make install-dev" from the xfsprogs source.'
414 AC_DEFUN([AC_PACKAGE_NEED_XFS_XQM_H],
415 [ AC_CHECK_HEADERS([xfs/xqm.h])
416 if test "$ac_cv_header_xfs_xqm_h" != "yes"; then
418 echo 'FATAL ERROR: cannot find a valid <xfs/xqm.h> header file.'
419 echo 'Install or upgrade the XFS development package.'
420 echo 'Alternatively, run "make install-dev" from the xfsprogs source.'
425 AC_DEFUN([AC_PACKAGE_NEED_XFS_HANDLE_H],
426 [ AC_CHECK_HEADERS([xfs/handle.h])
427 if test "$ac_cv_header_xfs_handle_h" != "yes"; then
429 echo 'FATAL ERROR: cannot find a valid <xfs/handle.h> header file.'
430 echo 'Install or upgrade the XFS development package.'
431 echo 'Alternatively, run "make install-dev" from the xfsprogs source.'
436 AC_DEFUN([AC_PACKAGE_NEED_LIBXFSINIT_LIBXFS],
437 [ AC_CHECK_LIB(xfs, libxfs_init,, [
439 echo 'FATAL ERROR: could not find a valid XFS base library.'
440 echo 'Install or upgrade the XFS library package.'
441 echo 'Alternatively, run "make install-dev" from the xfsprogs source.'
445 test -f `pwd`/../xfsprogs/libxfs/libxfs.la && \
446 libxfs="`pwd`/../xfsprogs/libxfs/libxfs.la"
447 test -f ${libexecdir}${libdirsuffix}/libxfs.la && \
448 libxfs="${libexecdir}${libdirsuffix}/libxfs.la"
452 AC_DEFUN([AC_PACKAGE_NEED_OPEN_BY_FSHANDLE],
453 [ AC_CHECK_LIB(handle, open_by_fshandle,, [
455 echo 'FATAL ERROR: could not find a current XFS handle library.'
456 echo 'Install or upgrade the XFS library package.'
457 echo 'Alternatively, run "make install-dev" from the xfsprogs source.'
461 test -f `pwd`/../xfsprogs/libhandle/libhandle.la && \
462 libhdl="`pwd`/../xfsprogs/libhandle/libhandle.la"
463 test -f ${libexecdir}${libdirsuffix}/libhandle.la && \
464 libhdl="${libexecdir}${libdirsuffix}/libhandle.la"
468 AC_DEFUN([AC_PACKAGE_NEED_ATTRLIST_LIBHANDLE],
469 [ AC_CHECK_LIB(handle, attr_list_by_handle,, [
471 echo 'FATAL ERROR: could not find a current XFS handle library.'
472 echo 'Install or upgrade the XFS library package.'
473 echo 'Alternatively, run "make install-lib" from the xfsprogs source.'
477 test -f `pwd`/../xfsprogs/libhandle/libhandle.la && \
478 libhdl="`pwd`/../xfsprogs/libhandle/libhandle.la"
479 test -f ${libexecdir}${libdirsuffix}/libhandle.la && \
480 libhdl="${libexecdir}${libdirsuffix}/libhandle.la"
484 AC_DEFUN([AC_PACKAGE_NEED_IRIX_LIBHANDLE],
486 AC_MSG_CHECKING([libhandle.a for IRIX])
487 libhdl="`pwd`/../irix/libhandle/libhandle.a"
488 if ! test -f $libhdl; then
490 echo 'FATAL ERROR: could not find IRIX XFS handle library.'
497 AC_DEFUN([AC_PACKAGE_NEED_XFSCTL_MACRO],
498 [ AC_MSG_CHECKING([xfsctl from xfs/libxfs.h])
499 AC_TRY_LINK([#include <xfs/libxfs.h>], [ int x = xfsctl(0, 0, 0, 0); ],
502 echo 'FATAL ERROR: cannot find required macros in the XFS headers.'
503 echo 'Upgrade your XFS programs (xfsprogs) development package.'
504 echo 'Alternatively, run "make install-dev" from the xfsprogs source.'