update 114 for new getparents interface and xfs_io parent command.
[xfstests-dev.git] / aclocal.m4
1 # generated automatically by aclocal 1.7.5 -*- Autoconf -*-
2
3 # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002
4 # 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.
8
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
12 # PARTICULAR PURPOSE.
13
14
15 # Generic macro, sets up all of the global packaging variables.
16 # The following environment variables may be set to override defaults:
17 #   DEBUG OPTIMIZER MALLOCLIB PLATFORM DISTRIBUTION INSTALL_USER INSTALL_GROUP
18 #   BUILD_VERSION
19 #
20 AC_DEFUN([AC_PACKAGE_GLOBALS],
21   [ pkg_name="$1"
22     AC_SUBST(pkg_name)
23
24     . ./VERSION
25     pkg_version=${PKG_MAJOR}.${PKG_MINOR}.${PKG_REVISION}
26     AC_SUBST(pkg_version)
27     pkg_release=$PKG_BUILD
28     test -z "$BUILD_VERSION" || pkg_release="$BUILD_VERSION"
29     AC_SUBST(pkg_release)
30
31     DEBUG=${DEBUG:-'-DDEBUG'}           dnl  -DNDEBUG
32     debug_build="$DEBUG"
33     AC_SUBST(debug_build)
34
35     OPTIMIZER=${OPTIMIZER:-'-g'}        dnl  -O2
36     opt_build="$OPTIMIZER"
37     AC_SUBST(opt_build)
38
39     MALLOCLIB=${MALLOCLIB:-''}          dnl  /usr/lib/libefence.a
40     malloc_lib="$MALLOCLIB"
41     AC_SUBST(malloc_lib)
42
43     PKG_USER=${INSTALL_USER:-'root'}
44     pkg_user="$PKG_USER"
45     AC_SUBST(pkg_user)
46
47     PKG_GROUP=${INSTALL_GROUP:-'root'}
48     pkg_group="$PKG_GROUP"
49     AC_SUBST(pkg_group)
50
51     pkg_distribution=`uname -s`
52     test -z "$DISTRIBUTION" || pkg_distribution="$DISTRIBUTION"
53     AC_SUBST(pkg_distribution)
54
55     pkg_platform=`uname -s | tr 'A-Z' 'a-z' | sed -e 's/irix64/irix/'`
56     test -z "$PLATFORM" || pkg_platform="$PLATFORM"
57     AC_SUBST(pkg_platform)
58   ])
59
60 #
61 # Check for specified utility (env var) - if unset, fail.
62
63 AC_DEFUN([AC_PACKAGE_NEED_UTILITY],
64   [ if test -z "$2"; then
65         echo
66         echo FATAL ERROR: $3 does not seem to be installed.
67         echo $1 cannot be built without a working $4 installation.
68         exit 1
69     fi
70   ])
71
72 #
73 # Generic macro, sets up all of the global build variables.
74 # The following environment variables may be set to override defaults:
75 #  CC MAKE LIBTOOL TAR ZIP MAKEDEPEND AWK SED ECHO SORT
76 #  MSGFMT MSGMERGE RPM
77 #
78 AC_DEFUN([AC_PACKAGE_UTILITIES],
79   [ AC_PROG_CC
80     cc="$CC"
81     AC_SUBST(cc)
82     AC_PACKAGE_NEED_UTILITY($1, "$cc", cc, [C compiler])
83
84     if test -z "$MAKE"; then
85         AC_PATH_PROG(MAKE, gmake,, /usr/bin:/usr/local/bin:/usr/freeware/bin)
86     fi
87     if test -z "$MAKE"; then
88         AC_PATH_PROG(MAKE, make,, /usr/bin)
89     fi
90     make=$MAKE
91     AC_SUBST(make)
92     AC_PACKAGE_NEED_UTILITY($1, "$make", make, [GNU make])
93
94     if test -z "$LIBTOOL"; then
95         AC_PATH_PROG(LIBTOOL, glibtool,, /usr/bin)
96     fi
97     if test -z "$LIBTOOL"; then
98         AC_PATH_PROG(LIBTOOL, libtool,, /usr/bin:/usr/local/bin:/usr/freeware/bin)
99     fi
100     libtool=$LIBTOOL
101     AC_SUBST(libtool)
102     AC_PACKAGE_NEED_UTILITY($1, "$libtool", libtool, [GNU libtool])
103
104     if test -z "$TAR"; then
105         AC_PATH_PROG(TAR, tar,, /usr/freeware/bin:/bin:/usr/local/bin:/usr/bin)
106     fi
107     tar=$TAR
108     AC_SUBST(tar)
109     if test -z "$ZIP"; then
110         AC_PATH_PROG(ZIP, gzip,, /bin:/usr/bin:/usr/local/bin:/usr/freeware/bin)
111     fi
112
113     zip=$ZIP
114     AC_SUBST(zip)
115
116     if test -z "$MAKEDEPEND"; then
117         AC_PATH_PROG(MAKEDEPEND, makedepend, /bin/true)
118     fi
119     makedepend=$MAKEDEPEND
120     AC_SUBST(makedepend)
121
122     if test -z "$AWK"; then
123         AC_PATH_PROG(AWK, awk,, /bin:/usr/bin)
124     fi
125     awk=$AWK
126     AC_SUBST(awk)
127
128     if test -z "$SED"; then
129         AC_PATH_PROG(SED, sed,, /bin:/usr/bin)
130     fi
131     sed=$SED
132     AC_SUBST(sed)
133
134     if test -z "$ECHO"; then
135         AC_PATH_PROG(ECHO, echo,, /bin:/usr/bin)
136     fi
137     echo=$ECHO
138     AC_SUBST(echo)
139
140     if test -z "$SORT"; then
141         AC_PATH_PROG(SORT, sort,, /bin:/usr/bin)
142     fi
143     sort=$SORT
144     AC_SUBST(sort)
145
146     dnl check if symbolic links are supported
147     AC_PROG_LN_S
148
149     if test "$enable_gettext" = yes; then
150         if test -z "$MSGFMT"; then
151                 AC_PATH_PROG(MSGFMT, msgfmt,, /usr/bin:/usr/local/bin:/usr/freeware/bin)
152         fi
153         msgfmt=$MSGFMT
154         AC_SUBST(msgfmt)
155         AC_PACKAGE_NEED_UTILITY($1, "$msgfmt", msgfmt, gettext)
156
157         if test -z "$MSGMERGE"; then
158                 AC_PATH_PROG(MSGMERGE, msgmerge,, /usr/bin:/usr/local/bin:/usr/freeware/bin)
159         fi
160         msgmerge=$MSGMERGE
161         AC_SUBST(msgmerge)
162         AC_PACKAGE_NEED_UTILITY($1, "$msgmerge", msgmerge, gettext)
163     fi
164
165     if test -z "$RPM"; then
166         AC_PATH_PROG(RPM, rpm,, /bin:/usr/bin:/usr/freeware/bin)
167     fi
168     rpm=$RPM
169     AC_SUBST(rpm)
170
171     dnl .. and what version is rpm
172     rpm_version=0
173     test -x "$RPM" && rpm_version=`$RPM --version \
174                         | awk '{print $NF}' | awk -F. '{V=1; print $V}'`
175     AC_SUBST(rpm_version)
176     dnl At some point in rpm 4.0, rpm can no longer build rpms, and
177     dnl rpmbuild is needed (rpmbuild may go way back; not sure)
178     dnl So, if rpm version >= 4.0, look for rpmbuild.  Otherwise build w/ rpm
179     if test $rpm_version -ge 4; then
180         AC_PATH_PROG(RPMBUILD, rpmbuild)
181         rpmbuild=$RPMBUILD
182     else
183         rpmbuild=$RPM
184     fi
185     AC_SUBST(rpmbuild)
186   ])
187
188 AC_DEFUN([AC_PACKAGE_NEED_UUID_H],
189   [ AC_CHECK_HEADERS([uuid.h sys/uuid.h uuid/uuid.h])
190     if test $ac_cv_header_uuid_h = no -a \
191             $ac_cv_header_sys_uuid_h = no -a \
192             $ac_cv_header_uuid_uuid_h = no; then
193         echo
194         echo 'FATAL ERROR: could not find a valid UUID header.'
195         echo 'Install the Universally Unique Identifiers development package.'
196         exit 1
197     fi
198   ])
199
200 AC_DEFUN([AC_PACKAGE_NEED_UUIDCOMPARE],
201   [ AC_CHECK_FUNCS(uuid_compare)
202     if test $ac_cv_func_uuid_compare = yes; then
203         libuuid=""
204     else
205         AC_CHECK_LIB(uuid, uuid_compare,, [
206             echo
207             echo 'FATAL ERROR: could not find a valid UUID library.'
208             echo 'Install the Universally Unique Identifiers library package.'
209             exit 1])
210         libuuid="-luuid"
211     fi
212     AC_SUBST(libuuid)
213   ])
214
215 AC_DEFUN([AC_PACKAGE_NEED_SYS_ACL_H],
216   [ AC_CHECK_HEADERS([sys/acl.h])
217     if test "$ac_cv_header_sys_acl_h" != "yes"; then
218         echo
219         echo 'FATAL ERROR: sys/acl.h does not exist.'
220         echo 'Install the access control lists (acl) development package.'
221         echo 'Alternatively, run "make install-lib" from the acl source.'
222         exit 1
223     fi
224   ])
225
226 AC_DEFUN([AC_PACKAGE_NEED_ACL_LIBACL_H],
227   [ AC_CHECK_HEADERS([acl/libacl.h])
228     if test "$ac_cv_header_acl_libacl_h" != "yes"; then
229         echo
230         echo 'FATAL ERROR: acl/libacl.h does not exist.'
231         echo 'Install the access control lists (acl) development package.'
232         echo 'Alternatively, run "make install-lib" from the acl source.'
233         exit 1
234     fi
235   ])
236
237
238 AC_DEFUN([AC_PACKAGE_NEED_ACLINIT_LIBACL],
239   [ AC_CHECK_LIB(acl, acl_init,, [
240         echo
241         echo 'FATAL ERROR: could not find a valid Access Control List library.'
242         echo 'Install either the libacl (rpm) or the libacl1 (deb) package.'
243         echo 'Alternatively, run "make install-lib" from the acl source.'
244         exit 1
245     ])
246     libacl="-lacl"
247     test -f `pwd`/../acl/libacl/libacl.la && \
248         libacl="`pwd`/../acl/libacl/libacl.la"
249     test -f /usr/lib/libacl.la && libacl="/usr/lib/libacl.la"
250     AC_SUBST(libacl)
251   ])
252
253 AC_DEFUN([AC_PACKAGE_NEED_ATTR_XATTR_H],
254   [ AC_CHECK_HEADERS([attr/xattr.h])
255     if test "$ac_cv_header_attr_xattr_h" != "yes"; then
256         echo
257         echo 'FATAL ERROR: attr/xattr.h does not exist.'
258         echo 'Install the extended attributes (attr) development package.'
259         echo 'Alternatively, run "make install-lib" from the attr source.'
260         exit 1
261     fi
262   ])
263
264 AC_DEFUN([AC_PACKAGE_NEED_ATTR_ERROR_H],
265   [ AC_CHECK_HEADERS([attr/error_context.h])
266     if test "$ac_cv_header_attr_error_context_h" != "yes"; then
267         echo
268         echo 'FATAL ERROR: attr/error_context.h does not exist.'
269         echo 'Install the extended attributes (attr) development package.'
270         echo 'Alternatively, run "make install-lib" from the attr source.'
271         exit 1
272     fi
273   ])
274
275 AC_DEFUN([AC_PACKAGE_NEED_ATTRIBUTES_H],
276   [ have_attributes_h=false
277     AC_CHECK_HEADERS([attr/attributes.h sys/attributes.h], [have_attributes_h=true], )
278     if test "$have_attributes_h" = "false"; then
279         echo
280         echo 'FATAL ERROR: attributes.h does not exist.'
281         echo 'Install the extended attributes (attr) development package.'
282         echo 'Alternatively, run "make install-lib" from the attr source.'
283         exit 1
284     fi
285   ])
286
287 AC_DEFUN([AC_PACKAGE_NEED_GETXATTR_LIBATTR],
288   [ AC_CHECK_LIB(attr, getxattr,, [
289         echo
290         echo 'FATAL ERROR: could not find a valid Extended Attributes library.'
291         echo 'Install the extended attributes (attr) development package.'
292         echo 'Alternatively, run "make install-lib" from the attr source.'
293         exit 1
294     ])
295     libattr="-lattr"
296     test -f `pwd`/../attr/libattr/libattr.la && \
297         libattr="`pwd`/../attr/libattr/libattr.la"
298     test -f /usr/lib/libattr.la && libattr="/usr/lib/libattr.la"
299     AC_SUBST(libattr)
300   ])
301
302 AC_DEFUN([AC_PACKAGE_NEED_ATTRGET_LIBATTR],
303   [ AC_CHECK_LIB(attr, attr_get,, [
304         echo
305         echo 'FATAL ERROR: could not find a valid Extended Attributes library.'
306         echo 'Install the extended attributes (attr) development package.'
307         echo 'Alternatively, run "make install-lib" from the attr source.'
308         exit 1
309     ])
310     libattr="-lattr"
311     test -f `pwd`/../attr/libattr/libattr.la && \
312         libattr="`pwd`/../attr/libattr/libattr.la"
313     test -f /usr/lib/libattr.la && libattr="/usr/lib/libattr.la"
314     AC_SUBST(libattr)
315   ])
316
317 AC_DEFUN([AC_PACKAGE_NEED_ATTRIBUTES_MACROS],
318   [ AC_MSG_CHECKING([macros in attr/attributes.h])
319     AC_TRY_LINK([
320 #include <sys/types.h>
321 #include <attr/attributes.h>],
322     [ int x = ATTR_SECURE; ], [ echo ok ], [
323         echo
324         echo 'FATAL ERROR: could not find a current attributes header.'
325         echo 'Upgrade the extended attributes (attr) development package.'
326         echo 'Alternatively, run "make install-dev" from the attr source.'
327         exit 1 ])
328   ])
329
330 AC_DEFUN([AC_PACKAGE_WANT_NDBM],
331   [ AC_CHECK_HEADERS(ndbm.h, [ have_db=true ], [ have_db=false ])
332     libgdbm=""
333     AC_SUBST(libgdbm)
334     AC_SUBST(have_db)
335   ])
336
337 AC_DEFUN([AC_PACKAGE_WANT_GDBM],
338   [ AC_CHECK_HEADERS([gdbm/ndbm.h], [ have_db=true ], [ have_db=false ])
339     if test $have_db = true -a -f /usr/lib/libgdbm.a; then
340         libgdbm="/usr/lib/libgdbm.a"
341     fi
342     AC_SUBST(libgdbm)
343     AC_SUBST(have_db)
344   ])
345
346 AC_DEFUN([AC_PACKAGE_NEED_XFS_LIBXFS_H],
347   [ AC_CHECK_HEADERS([xfs/libxfs.h])
348     if test "$ac_cv_header_xfs_libxfs_h" != "yes"; then
349         echo
350         echo 'FATAL ERROR: cannot find a valid <xfs/libxfs.h> header file.'
351         echo 'Install or upgrade the XFS development package.'
352         echo 'Alternatively, run "make install-dev" from the xfsprogs source.'
353         exit 1
354     fi
355   ])
356
357 AC_DEFUN([AC_PACKAGE_NEED_XFS_XQM_H],
358   [ AC_CHECK_HEADERS([xfs/xqm.h])
359     if test "$ac_cv_header_xfs_xqm_h" != "yes"; then
360         echo
361         echo 'FATAL ERROR: cannot find a valid <xfs/xqm.h> header file.'
362         echo 'Install or upgrade the XFS development package.'
363         echo 'Alternatively, run "make install-dev" from the xfsprogs source.'
364         exit 1
365     fi
366   ])
367
368 AC_DEFUN([AC_PACKAGE_NEED_XFS_HANDLE_H],
369   [ AC_CHECK_HEADERS([xfs/handle.h])
370     if test "$ac_cv_header_xfs_handle_h" != "yes"; then
371         echo
372         echo 'FATAL ERROR: cannot find a valid <xfs/handle.h> header file.'
373         echo 'Install or upgrade the XFS development package.'
374         echo 'Alternatively, run "make install-dev" from the xfsprogs source.'
375         exit 1
376     fi
377   ])
378
379 AC_DEFUN([AC_PACKAGE_NEED_LIBXFSINIT_LIBXFS],
380   [ AC_CHECK_LIB(xfs, libxfs_init,, [
381         echo
382         echo 'FATAL ERROR: could not find a valid XFS base library.'
383         echo 'Install or upgrade the XFS library package.'
384         echo 'Alternatively, run "make install-dev" from the xfsprogs source.'
385         exit 1
386     ])
387     libxfs="-lxfs"
388     test -f `pwd`/../xfsprogs/libxfs/libxfs.la && \
389         libxfs="`pwd`/../xfsprogs/libxfs/libxfs.la"
390     test -f /usr/lib/libxfs.la && libxfs="/usr/lib/libxfs.la"
391     AC_SUBST(libxfs)
392   ])
393
394 AC_DEFUN([AC_PACKAGE_NEED_OPEN_BY_FSHANDLE],
395   [ AC_CHECK_LIB(handle, open_by_fshandle,, [
396         echo
397         echo 'FATAL ERROR: could not find a current XFS handle library.'
398         echo 'Install or upgrade the XFS library package.'
399         echo 'Alternatively, run "make install-dev" from the xfsprogs source.'
400         exit 1
401     ])
402     libhdl="-lhandle"
403     test -f `pwd`/../xfsprogs/libhandle/libhandle.la && \
404         libhdl="`pwd`/../xfsprogs/libhandle/libhandle.la"
405     test -f /usr/lib/libhandle.la && libhdl="/usr/lib/libhandle.la"
406     AC_SUBST(libhdl)
407   ])
408
409 AC_DEFUN([AC_PACKAGE_NEED_ATTRLIST_LIBHANDLE],
410   [ AC_CHECK_LIB(handle, attr_list_by_handle,, [
411         echo
412         echo 'FATAL ERROR: could not find a current XFS handle library.'
413         echo 'Install or upgrade the XFS library package.'
414         echo 'Alternatively, run "make install-lib" from the xfsprogs source.'
415         exit 1
416     ])
417     libhdl="-lhandle"
418     test -f `pwd`/../xfsprogs/libhandle/libhandle.la && \
419         libhdl="`pwd`/../xfsprogs/libhandle/libhandle.la"
420     test -f /usr/lib/libhandle.la && libhdl="/usr/lib/libhandle.la"
421     AC_SUBST(libhdl)
422   ])
423
424 AC_DEFUN([AC_PACKAGE_NEED_IRIX_LIBHANDLE],
425   [ 
426     AC_MSG_CHECKING([libhandle.a for IRIX])
427     libhdl="`pwd`/../irix/libhandle/libhandle.a"
428     if ! test -f $libhdl; then
429         echo 'no'
430         echo 'FATAL ERROR: could not find IRIX XFS handle library.'
431         exit 1
432     fi
433     echo 'yes'
434     AC_SUBST(libhdl)
435   ])
436
437 AC_DEFUN([AC_PACKAGE_NEED_XFSCTL_MACRO],
438   [ AC_MSG_CHECKING([xfsctl from xfs/libxfs.h])
439     AC_TRY_LINK([#include <xfs/libxfs.h>], [ int x = xfsctl(0, 0, 0, 0); ],
440       [ echo ok ],
441       [ echo
442         echo 'FATAL ERROR: cannot find required macros in the XFS headers.'
443         echo 'Upgrade your XFS programs (xfsprogs) development package.'
444         echo 'Alternatively, run "make install-dev" from the xfsprogs source.'
445         exit 1
446       ])
447   ])
448
449 AC_DEFUN([AC_PACKAGE_WANT_AIO],
450   [ AC_CHECK_HEADERS(libaio.h, [ have_aio=true ], [ have_aio=false ])
451     AC_SUBST(have_aio)
452   ])
453