]> git.ipfire.org Git - thirdparty/xfsprogs-dev.git/blob - aclocal.m4
Make fsck.xfs provide more assistance to the unwary user.
[thirdparty/xfsprogs-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=`id -u`
43 test -z "$INSTALL_USER" || pkg_user="$INSTALL_USER"
44 AC_SUBST(pkg_user)
45
46 pkg_group=`id -g`
47 test -z "$INSTALL_GROUP" || pkg_group="$INSTALL_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 [ AC_PROG_CC
79 cc="$CC"
80 AC_SUBST(cc)
81 AC_PACKAGE_NEED_UTILITY($1, "$cc", cc, [C compiler])
82
83 if test -z "$MAKE"; then
84 AC_PATH_PROG(MAKE, gmake,, /usr/bin:/usr/local/bin:/usr/freeware/bin)
85 fi
86 if test -z "$MAKE"; then
87 AC_PATH_PROG(MAKE, make,, /usr/bin)
88 fi
89 make=$MAKE
90 AC_SUBST(make)
91 AC_PACKAGE_NEED_UTILITY($1, "$make", make, [GNU make])
92
93 if test -z "$LIBTOOL"; then
94 AC_PATH_PROG(LIBTOOL, glibtool,, /usr/bin)
95 fi
96 if test -z "$LIBTOOL"; then
97 AC_PATH_PROG(LIBTOOL, libtool,, /usr/bin:/usr/local/bin:/usr/freeware/bin)
98 fi
99 libtool=$LIBTOOL
100 AC_SUBST(libtool)
101 AC_PACKAGE_NEED_UTILITY($1, "$libtool", libtool, [GNU libtool])
102
103 if test -z "$TAR"; then
104 AC_PATH_PROG(TAR, tar,, /usr/freeware/bin:/bin:/usr/local/bin:/usr/bin)
105 fi
106 tar=$TAR
107 AC_SUBST(tar)
108 if test -z "$ZIP"; then
109 AC_PATH_PROG(ZIP, gzip,, /bin:/usr/bin:/usr/local/bin:/usr/freeware/bin)
110 fi
111
112 zip=$ZIP
113 AC_SUBST(zip)
114
115 if test -z "$MAKEDEPEND"; then
116 AC_PATH_PROG(MAKEDEPEND, makedepend, /bin/true)
117 fi
118 makedepend=$MAKEDEPEND
119 AC_SUBST(makedepend)
120
121 if test -z "$AWK"; then
122 AC_PATH_PROG(AWK, awk,, /bin:/usr/bin)
123 fi
124 awk=$AWK
125 AC_SUBST(awk)
126
127 if test -z "$SED"; then
128 AC_PATH_PROG(SED, sed,, /bin:/usr/bin)
129 fi
130 sed=$SED
131 AC_SUBST(sed)
132
133 if test -z "$ECHO"; then
134 AC_PATH_PROG(ECHO, echo,, /bin:/usr/bin)
135 fi
136 echo=$ECHO
137 AC_SUBST(echo)
138
139 if test -z "$SORT"; then
140 AC_PATH_PROG(SORT, sort,, /bin:/usr/bin)
141 fi
142 sort=$SORT
143 AC_SUBST(sort)
144
145 dnl check if symbolic links are supported
146 AC_PROG_LN_S
147
148 if test "$enable_gettext" = yes; then
149 if test -z "$MSGFMT"; then
150 AC_PATH_PROG(MSGFMT, msgfmt,, /usr/bin:/usr/local/bin:/usr/freeware/bin)
151 fi
152 msgfmt=$MSGFMT
153 AC_SUBST(msgfmt)
154 AC_PACKAGE_NEED_UTILITY($1, "$msgfmt", msgfmt, gettext)
155
156 if test -z "$MSGMERGE"; then
157 AC_PATH_PROG(MSGMERGE, msgmerge,, /usr/bin:/usr/local/bin:/usr/freeware/bin)
158 fi
159 msgmerge=$MSGMERGE
160 AC_SUBST(msgmerge)
161 AC_PACKAGE_NEED_UTILITY($1, "$msgmerge", msgmerge, gettext)
162 fi
163
164 if test -z "$RPM"; then
165 AC_PATH_PROG(RPM, rpm,, /bin:/usr/bin:/usr/freeware/bin)
166 fi
167 rpm=$RPM
168 AC_SUBST(rpm)
169
170 dnl .. and what version is rpm
171 rpm_version=0
172 test -n "$RPM" && test -x "$RPM" && rpm_version=`$RPM --version \
173 | awk '{print $NF}' | awk -F. '{V=1; print $V}'`
174 AC_SUBST(rpm_version)
175 dnl At some point in rpm 4.0, rpm can no longer build rpms, and
176 dnl rpmbuild is needed (rpmbuild may go way back; not sure)
177 dnl So, if rpm version >= 4.0, look for rpmbuild. Otherwise build w/ rpm
178 if test $rpm_version -ge 4; then
179 AC_PATH_PROG(RPMBUILD, rpmbuild)
180 rpmbuild=$RPMBUILD
181 else
182 rpmbuild=$RPM
183 fi
184 AC_SUBST(rpmbuild)
185 ])
186
187 AC_DEFUN([AC_PACKAGE_NEED_UUID_H],
188 [ AC_CHECK_HEADERS([uuid.h sys/uuid.h uuid/uuid.h])
189 if test $ac_cv_header_uuid_h = no -a \
190 $ac_cv_header_sys_uuid_h = no -a \
191 $ac_cv_header_uuid_uuid_h = no; then
192 echo
193 echo 'FATAL ERROR: could not find a valid UUID header.'
194 echo 'Install the Universally Unique Identifiers development package.'
195 exit 1
196 fi
197 ])
198
199 AC_DEFUN([AC_PACKAGE_NEED_UUIDCOMPARE],
200 [ AC_CHECK_FUNCS(uuid_compare)
201 if test $ac_cv_func_uuid_compare = yes; then
202 libuuid=""
203 else
204 AC_CHECK_LIB(uuid, uuid_compare,, [
205 echo
206 echo 'FATAL ERROR: could not find a valid UUID library.'
207 echo 'Install the Universally Unique Identifiers library package.'
208 exit 1])
209 libuuid="-luuid"
210 fi
211 AC_SUBST(libuuid)
212 ])
213
214 AC_DEFUN([AC_PACKAGE_NEED_PTHREAD_H],
215 [ AC_CHECK_HEADERS(pthread.h)
216 if test $ac_cv_header_pthread_h = no; then
217 AC_CHECK_HEADERS(pthread.h,, [
218 echo
219 echo 'FATAL ERROR: could not find a valid pthread header.'
220 exit 1])
221 fi
222 ])
223
224 AC_DEFUN([AC_PACKAGE_NEED_PTHREADMUTEXINIT],
225 [ AC_CHECK_LIB(pthread, pthread_mutex_init,, [
226 echo
227 echo 'FATAL ERROR: could not find a valid pthread library.'
228 exit 1
229 ])
230 libpthread=-lpthread
231 AC_SUBST(libpthread)
232 ])
233
234 #
235 # Check if we have a working fadvise system call
236 #
237 AC_DEFUN([AC_HAVE_FADVISE],
238 [ AC_MSG_CHECKING([for fadvise ])
239 AC_TRY_COMPILE([
240 #define _GNU_SOURCE
241 #define _FILE_OFFSET_BITS 64
242 #include <fcntl.h>
243 ], [
244 posix_fadvise(0, 1, 0, POSIX_FADV_NORMAL);
245 ], have_fadvise=yes
246 AC_MSG_RESULT(yes),
247 AC_MSG_RESULT(no))
248 AC_SUBST(have_fadvise)
249 ])
250
251 #
252 # Check if we have a working madvise system call
253 #
254 AC_DEFUN([AC_HAVE_MADVISE],
255 [ AC_MSG_CHECKING([for madvise ])
256 AC_TRY_COMPILE([
257 #define _GNU_SOURCE
258 #define _FILE_OFFSET_BITS 64
259 #include <sys/mman.h>
260 ], [
261 posix_madvise(0, 0, MADV_NORMAL);
262 ], have_madvise=yes
263 AC_MSG_RESULT(yes),
264 AC_MSG_RESULT(no))
265 AC_SUBST(have_madvise)
266 ])
267
268 #
269 # Check if we have a working mincore system call
270 #
271 AC_DEFUN([AC_HAVE_MINCORE],
272 [ AC_MSG_CHECKING([for mincore ])
273 AC_TRY_COMPILE([
274 #define _GNU_SOURCE
275 #define _FILE_OFFSET_BITS 64
276 #include <sys/mman.h>
277 ], [
278 mincore(0, 0, 0);
279 ], have_mincore=yes
280 AC_MSG_RESULT(yes),
281 AC_MSG_RESULT(no))
282 AC_SUBST(have_mincore)
283 ])
284
285 #
286 # Check if we have a working sendfile system call
287 #
288 AC_DEFUN([AC_HAVE_SENDFILE],
289 [ AC_MSG_CHECKING([for sendfile ])
290 AC_TRY_COMPILE([
291 #define _GNU_SOURCE
292 #define _FILE_OFFSET_BITS 64
293 #include <sys/sendfile.h>
294 ], [
295 sendfile(0, 0, 0, 0);
296 ], have_sendfile=yes
297 AC_MSG_RESULT(yes),
298 AC_MSG_RESULT(no))
299 AC_SUBST(have_sendfile)
300 ])
301
302 #
303 # Check if we have a getmntent libc call (IRIX, Linux)
304 #
305 AC_DEFUN([AC_HAVE_GETMNTENT],
306 [ AC_MSG_CHECKING([for getmntent ])
307 AC_TRY_COMPILE([
308 #include <stdio.h>
309 #include <mntent.h>
310 ], [
311 getmntent(0);
312 ], have_getmntent=yes
313 AC_MSG_RESULT(yes),
314 AC_MSG_RESULT(no))
315 AC_SUBST(have_getmntent)
316 ])
317
318 #
319 # Check if we have a getmntinfo libc call (FreeBSD, Mac OS X)
320 #
321 AC_DEFUN([AC_HAVE_GETMNTINFO],
322 [ AC_MSG_CHECKING([for getmntinfo ])
323 AC_TRY_COMPILE([
324 #include <sys/param.h>
325 #include <sys/ucred.h>
326 #include <sys/mount.h>
327 ], [
328 getmntinfo(0, 0);
329 ], have_getmntinfo=yes
330 AC_MSG_RESULT(yes),
331 AC_MSG_RESULT(no))
332 AC_SUBST(have_getmntinfo)
333 ])
334
335 #
336 # Check if we have a type for the pointer's size integer (__psint_t)
337 #
338 AC_DEFUN([AC_TYPE_PSINT],
339 [ AC_MSG_CHECKING([for __psint_t ])
340 AC_TRY_COMPILE([
341 #include <sys/types.h>
342 #include <stdlib.h>
343 #include <stddef.h>
344 ], [
345 __psint_t psint;
346 ], AC_DEFINE(HAVE___PSINT_T) AC_MSG_RESULT(yes) , AC_MSG_RESULT(no))
347 ])
348
349 #
350 # Check if we have a type for the pointer's size unsigned (__psunsigned_t)
351 #
352 AC_DEFUN([AC_TYPE_PSUNSIGNED],
353 [ AC_MSG_CHECKING([for __psunsigned_t ])
354 AC_TRY_COMPILE([
355 #include <sys/types.h>
356 #include <stdlib.h>
357 #include <stddef.h>
358 ], [
359 __psunsigned_t psuint;
360 ], AC_DEFINE(HAVE___PSUNSIGNED_T) AC_MSG_RESULT(yes) , AC_MSG_RESULT(no))
361 ])
362
363 #
364 # Check type sizes
365 #
366 AC_DEFUN([AC_SIZEOF_POINTERS_AND_LONG],
367 [ if test "$cross_compiling" = yes -a -z "$ac_cv_sizeof_long"; then
368 AC_MSG_WARN([Cross compiling; assuming 32bit long and 32bit pointers])
369 fi
370 AC_CHECK_SIZEOF(long, 4)
371 AC_CHECK_SIZEOF(char *, 4)
372 if test $ac_cv_sizeof_long -eq 4 -o $ac_cv_sizeof_long -eq 0; then
373 AC_DEFINE(HAVE_32BIT_LONG)
374 fi
375 if test $ac_cv_sizeof_long -eq 8; then
376 AC_DEFINE(HAVE_64BIT_LONG)
377 fi
378 if test $ac_cv_sizeof_char_p -eq 4 -o $ac_cv_sizeof_char_p -eq 0; then
379 AC_DEFINE(HAVE_32BIT_PTR)
380 fi
381 if test $ac_cv_sizeof_char_p -eq 8; then
382 AC_DEFINE(HAVE_64BIT_PTR)
383 fi
384 ])
385
386 #
387 # Find format of installed man pages.
388 # Always gzipped on Debian, but not Redhat pre-7.0.
389 # We don't deal with bzip2'd man pages, which Mandrake uses,
390 # someone will send us a patch sometime hopefully. :-)
391 #
392 AC_DEFUN([AC_MANUAL_FORMAT],
393 [ have_zipped_manpages=false
394 for d in ${prefix}/share/man ${prefix}/man ; do
395 if test -f $d/man1/man.1.gz
396 then
397 have_zipped_manpages=true
398 break
399 fi
400 done
401 AC_SUBST(have_zipped_manpages)
402 ])
403