1 dnl aclocal.m4 generated automatically by aclocal 1.4-p6
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.
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.
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
19 AC_DEFUN([AC_PACKAGE_GLOBALS],
24 pkg_version=${PKG_MAJOR}.${PKG_MINOR}.${PKG_REVISION}
26 pkg_release=$PKG_BUILD
27 test -z "$BUILD_VERSION" || pkg_release="$BUILD_VERSION"
30 DEBUG=${DEBUG:-'-DDEBUG'} dnl -DNDEBUG
34 OPTIMIZER=${OPTIMIZER:-'-g'} dnl -O2
35 opt_build="$OPTIMIZER"
38 MALLOCLIB=${MALLOCLIB:-''} dnl /usr/lib/libefence.a
39 malloc_lib="$MALLOCLIB"
43 test -z "$INSTALL_USER" || pkg_user="$INSTALL_USER"
47 test -z "$INSTALL_GROUP" || pkg_group="$INSTALL_GROUP"
50 pkg_distribution=`uname -s`
51 test -z "$DISTRIBUTION" || pkg_distribution="$DISTRIBUTION"
52 AC_SUBST(pkg_distribution)
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)
60 # Check for specified utility (env var) - if unset, fail.
62 AC_DEFUN([AC_PACKAGE_NEED_UTILITY],
63 [ if test -z "$2"; then
65 echo FATAL ERROR: $3 does not seem to be installed.
66 echo $1 cannot be built without a working $4 installation.
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
77 AC_DEFUN([AC_PACKAGE_UTILITIES],
81 AC_PACKAGE_NEED_UTILITY($1, "$cc", cc, [C compiler])
83 if test -z "$MAKE"; then
84 AC_PATH_PROG(MAKE, gmake,, /usr/bin:/usr/local/bin:/usr/freeware/bin)
86 if test -z "$MAKE"; then
87 AC_PATH_PROG(MAKE, make,, /usr/bin)
91 AC_PACKAGE_NEED_UTILITY($1, "$make", make, [GNU make])
93 if test -z "$LIBTOOL"; then
94 AC_PATH_PROG(LIBTOOL, glibtool,, /usr/bin)
96 if test -z "$LIBTOOL"; then
97 AC_PATH_PROG(LIBTOOL, libtool,, /usr/bin:/usr/local/bin:/usr/freeware/bin)
101 AC_PACKAGE_NEED_UTILITY($1, "$libtool", libtool, [GNU libtool])
103 if test -z "$TAR"; then
104 AC_PATH_PROG(TAR, tar,, /usr/freeware/bin:/bin:/usr/local/bin:/usr/bin)
108 if test -z "$ZIP"; then
109 AC_PATH_PROG(ZIP, gzip,, /bin:/usr/bin:/usr/local/bin:/usr/freeware/bin)
115 if test -z "$MAKEDEPEND"; then
116 AC_PATH_PROG(MAKEDEPEND, makedepend, /bin/true)
118 makedepend=$MAKEDEPEND
121 if test -z "$AWK"; then
122 AC_PATH_PROG(AWK, awk,, /bin:/usr/bin)
127 if test -z "$SED"; then
128 AC_PATH_PROG(SED, sed,, /bin:/usr/bin)
133 if test -z "$ECHO"; then
134 AC_PATH_PROG(ECHO, echo,, /bin:/usr/bin)
139 if test -z "$SORT"; then
140 AC_PATH_PROG(SORT, sort,, /bin:/usr/bin)
145 dnl check if symbolic links are supported
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)
154 AC_PACKAGE_NEED_UTILITY($1, "$msgfmt", msgfmt, gettext)
156 if test -z "$MSGMERGE"; then
157 AC_PATH_PROG(MSGMERGE, msgmerge,, /usr/bin:/usr/local/bin:/usr/freeware/bin)
161 AC_PACKAGE_NEED_UTILITY($1, "$msgmerge", msgmerge, gettext)
164 if test -z "$RPM"; then
165 AC_PATH_PROG(RPM, rpm,, /bin:/usr/bin:/usr/freeware/bin)
170 dnl .. and what version is rpm
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)
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
193 echo 'FATAL ERROR: could not find a valid UUID header.'
194 echo 'Install the Universally Unique Identifiers development package.'
199 AC_DEFUN([AC_PACKAGE_NEED_UUIDCOMPARE],
200 [ AC_CHECK_FUNCS(uuid_compare)
201 if test $ac_cv_func_uuid_compare = yes; then
204 AC_CHECK_LIB(uuid, uuid_compare,, [
206 echo 'FATAL ERROR: could not find a valid UUID library.'
207 echo 'Install the Universally Unique Identifiers library package.'
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,, [
219 echo 'FATAL ERROR: could not find a valid pthread header.'
224 AC_DEFUN([AC_PACKAGE_NEED_PTHREADMUTEXINIT],
225 [ AC_CHECK_LIB(pthread, pthread_mutex_init,, [
227 echo 'FATAL ERROR: could not find a valid pthread library.'
235 # Check if we have a working fadvise system call
237 AC_DEFUN([AC_HAVE_FADVISE],
238 [ AC_MSG_CHECKING([for fadvise ])
241 #define _FILE_OFFSET_BITS 64
244 posix_fadvise(0, 1, 0, POSIX_FADV_NORMAL);
248 AC_SUBST(have_fadvise)
252 # Check if we have a working madvise system call
254 AC_DEFUN([AC_HAVE_MADVISE],
255 [ AC_MSG_CHECKING([for madvise ])
258 #define _FILE_OFFSET_BITS 64
259 #include <sys/mman.h>
261 posix_madvise(0, 0, MADV_NORMAL);
265 AC_SUBST(have_madvise)
269 # Check if we have a working mincore system call
271 AC_DEFUN([AC_HAVE_MINCORE],
272 [ AC_MSG_CHECKING([for mincore ])
275 #define _FILE_OFFSET_BITS 64
276 #include <sys/mman.h>
282 AC_SUBST(have_mincore)
286 # Check if we have a working sendfile system call
288 AC_DEFUN([AC_HAVE_SENDFILE],
289 [ AC_MSG_CHECKING([for sendfile ])
292 #define _FILE_OFFSET_BITS 64
293 #include <sys/sendfile.h>
295 sendfile(0, 0, 0, 0);
299 AC_SUBST(have_sendfile)
303 # Check if we have a getmntent libc call (IRIX, Linux)
305 AC_DEFUN([AC_HAVE_GETMNTENT],
306 [ AC_MSG_CHECKING([for getmntent ])
312 ], have_getmntent=yes
315 AC_SUBST(have_getmntent)
319 # Check if we have a getmntinfo libc call (FreeBSD, Mac OS X)
321 AC_DEFUN([AC_HAVE_GETMNTINFO],
322 [ AC_MSG_CHECKING([for getmntinfo ])
324 #include <sys/param.h>
325 #include <sys/ucred.h>
326 #include <sys/mount.h>
329 ], have_getmntinfo=yes
332 AC_SUBST(have_getmntinfo)
336 # Check if we have a type for the pointer's size integer (__psint_t)
338 AC_DEFUN([AC_TYPE_PSINT],
339 [ AC_MSG_CHECKING([for __psint_t ])
341 #include <sys/types.h>
346 ], AC_DEFINE(HAVE___PSINT_T) AC_MSG_RESULT(yes) , AC_MSG_RESULT(no))
350 # Check if we have a type for the pointer's size unsigned (__psunsigned_t)
352 AC_DEFUN([AC_TYPE_PSUNSIGNED],
353 [ AC_MSG_CHECKING([for __psunsigned_t ])
355 #include <sys/types.h>
359 __psunsigned_t psuint;
360 ], AC_DEFINE(HAVE___PSUNSIGNED_T) AC_MSG_RESULT(yes) , AC_MSG_RESULT(no))
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])
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)
375 if test $ac_cv_sizeof_long -eq 8; then
376 AC_DEFINE(HAVE_64BIT_LONG)
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)
381 if test $ac_cv_sizeof_char_p -eq 8; then
382 AC_DEFINE(HAVE_64BIT_PTR)
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. :-)
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
397 have_zipped_manpages=true
401 AC_SUBST(have_zipped_manpages)