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