]> git.ipfire.org Git - thirdparty/xfsprogs-dev.git/blame - aclocal.m4
Fix build - bsd changes from awhile ago introduced a m4 macro bug, only
[thirdparty/xfsprogs-dev.git] / aclocal.m4
CommitLineData
3b73128c 1# aclocal.m4 generated automatically by aclocal 1.6.3 -*- Autoconf -*-
16c44ed2 2
3b73128c
NS
3# Copyright 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.
16c44ed2 8
3b73128c
NS
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.
16c44ed2
NS
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
3b73128c 18# BUILD_VERSION
16c44ed2
NS
19#
20AC_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
3b73128c 28 test -z "$BUILD_VERSION" || pkg_release="$BUILD_VERSION"
16c44ed2
NS
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#
63AC_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#
78AC_DEFUN([AC_PACKAGE_UTILITIES],
79 [ if test -z "$CC"; then
80 AC_PROG_CC
81 fi
82 cc="$CC"
83 AC_SUBST(cc)
84 AC_PACKAGE_NEED_UTILITY($1, "$cc", cc, [C compiler])
85
86 if test -z "$MAKE"; then
87 AC_PATH_PROG(MAKE, make, /usr/bin/make)
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
3b73128c 94 AC_PATH_PROG(LIBTOOL, libtool,,/usr/bin:/usr/local/bin)
16c44ed2
NS
95 fi
96 libtool=$LIBTOOL
97 AC_SUBST(libtool)
98 AC_PACKAGE_NEED_UTILITY($1, "$libtool", libtool, [GNU libtool])
99
100 if test -z "$TAR"; then
101 AC_PATH_PROG(TAR, tar)
102 fi
103 tar=$TAR
104 AC_SUBST(tar)
105 if test -z "$ZIP"; then
106 AC_PATH_PROG(ZIP, gzip, /bin/gzip)
107 fi
108 zip=$ZIP
109 AC_SUBST(zip)
110 if test -z "$MAKEDEPEND"; then
111 AC_PATH_PROG(MAKEDEPEND, makedepend, /bin/true)
112 fi
113 makedepend=$MAKEDEPEND
114 AC_SUBST(makedepend)
115 if test -z "$AWK"; then
116 AC_PATH_PROG(AWK, awk, /bin/awk)
117 fi
118 awk=$AWK
119 AC_SUBST(awk)
120 if test -z "$SED"; then
121 AC_PATH_PROG(SED, sed, /bin/sed)
122 fi
123 sed=$SED
124 AC_SUBST(sed)
125 if test -z "$ECHO"; then
126 AC_PATH_PROG(ECHO, echo, /bin/echo)
127 fi
128 echo=$ECHO
129 AC_SUBST(echo)
130 if test -z "$SORT"; then
131 AC_PATH_PROG(SORT, sort, /bin/sort)
132 fi
133 sort=$SORT
134 AC_SUBST(sort)
135
136 dnl check if symbolic links are supported
137 AC_PROG_LN_S
138
139 if test "$enable_gettext" = yes; then
140 if test -z "$MSGFMT"; then
141 AC_CHECK_PROG(MSGFMT, msgfmt, /usr/bin/msgfmt)
142 fi
143 msgfmt=$MSGFMT
144 AC_SUBST(msgfmt)
145 AC_PACKAGE_NEED_UTILITY($1, "$msgfmt", msgfmt, gettext)
146 if test -z "$MSGMERGE"; then
147 AC_CHECK_PROG(MSGMERGE, msgmerge, /usr/bin/msgmerge)
148 fi
149 msgmerge=$MSGMERGE
150 AC_SUBST(msgmerge)
151 AC_PACKAGE_NEED_UTILITY($1, "$msgmerge", msgmerge, gettext)
152 fi
153
154 if test -z "$RPM"; then
155 AC_PATH_PROG(RPM, rpm, /bin/rpm)
156 fi
157 rpm=$RPM
158 AC_SUBST(rpm)
159 dnl .. and what version is rpm
160 rpm_version=0
161 test -x $RPM && rpm_version=`$RPM --version \
162 | awk '{print $NF}' | awk -F. '{V=1; print $V}'`
163 AC_SUBST(rpm_version)
164 dnl At some point in rpm 4.0, rpm can no longer build rpms, and
165 dnl rpmbuild is needed (rpmbuild may go way back; not sure)
166 dnl So, if rpm version >= 4.0, look for rpmbuild. Otherwise build w/ rpm
167 if test $rpm_version -ge 4; then
168 AC_PATH_PROG(RPMBUILD, rpmbuild)
169 rpmbuild=$RPMBUILD
170 else
171 rpmbuild=$RPM
172 fi
173 AC_SUBST(rpmbuild)
174 ])
175
176AC_DEFUN([AC_PACKAGE_NEED_UUID_UUID_H],
3b73128c
NS
177 [ AC_CHECK_HEADERS(uuid/uuid.h,, [
178 AC_CHECK_HEADER(uuid.h,, [
16c44ed2
NS
179 echo
180 echo 'FATAL ERROR: could not find a valid UUID header.'
181 echo 'Install the Universally Unique Identifiers development package.'
3b73128c 182 exit 1])
28ba8fcc 183 ])
16c44ed2
NS
184 ])
185
3b73128c
NS
186AC_DEFUN([AC_PACKAGE_NEED_UUIDCOMPARE_LIBUUID],
187 [ AC_CHECK_LIB(uuid, uuid_compare,, [
188 AC_CHECK_FUNCS(uuid_compare,, [
16c44ed2
NS
189 echo
190 echo 'FATAL ERROR: could not find a valid UUID library.'
191 echo 'Install the Universally Unique Identifiers library package.'
3b73128c 192 exit 1])
16c44ed2
NS
193 ])
194 libuuid="/usr/lib/libuuid.a"
195 AC_SUBST(libuuid)
196 ])
197
198#
199# Check if we have a type for the pointer's size integer (__psint_t)
200#
201AC_DEFUN([AC_TYPE_PSINT],
202 [ AC_MSG_CHECKING([for __psint_t ])
203 AC_TRY_COMPILE([
204#include <sys/types.h>
205#include <stdlib.h>
206#include <stddef.h>
207 ], [
208 __psint_t psint;
209 ], AC_DEFINE(HAVE___PSINT_T) AC_MSG_RESULT(yes) , AC_MSG_RESULT(no))
210 ])
211
212#
213# Check if we have a type for the pointer's size unsigned (__psunsigned_t)
214#
215AC_DEFUN([AC_TYPE_PSUNSIGNED],
216 [ AC_MSG_CHECKING([for __psunsigned_t ])
217 AC_TRY_COMPILE([
218#include <sys/types.h>
219#include <stdlib.h>
220#include <stddef.h>
221 ], [
222 __psunsigned_t psuint;
223 ], AC_DEFINE(HAVE___PSUNSIGNED_T) AC_MSG_RESULT(yes) , AC_MSG_RESULT(no))
224 ])
225
226#
227# Check type sizes
228#
229AC_DEFUN([AC_SIZEOF_POINTERS_AND_LONG],
230 [ if test "$cross_compiling" = yes -a -z "$ac_cv_sizeof_long"; then
231 AC_MSG_WARN([Cross compiling; assuming 32bit long and 32bit pointers])
232 fi
233 AC_CHECK_SIZEOF(long, 4)
234 AC_CHECK_SIZEOF(char *, 4)
235 if test $ac_cv_sizeof_long -eq 4; then
236 AC_DEFINE(HAVE_32BIT_LONG)
237 fi
238 if test $ac_cv_sizeof_long -eq 8; then
239 AC_DEFINE(HAVE_64BIT_LONG)
240 fi
241 if test $ac_cv_sizeof_char_p -eq 4; then
242 AC_DEFINE(HAVE_32BIT_PTR)
243 fi
244 if test $ac_cv_sizeof_char_p -eq 8; then
245 AC_DEFINE(HAVE_64BIT_PTR)
246 fi
247 ])
248
249#
250# Find format of installed man pages.
251# Always gzipped on Debian, but not Redhat pre-7.0.
252# We don't deal with bzip2'd man pages, which Mandrake uses,
253# someone will send us a patch sometime hopefully. :-)
254#
255AC_DEFUN([AC_MANUAL_FORMAT],
256 [ have_zipped_manpages=false
257 for d in ${prefix}/share/man ${prefix}/man ; do
258 if test -f $d/man1/man.1.gz
259 then
260 have_zipped_manpages=true
261 break
262 fi
263 done
264 AC_SUBST(have_zipped_manpages)
265 ])
266