1 dnl unpacking check - this file must exist
2 AC_INIT(include/libxfs.h)
3 AC_CONFIG_HEADER(include/platform_defs.h)
9 # Note: the following environment variables may be set to override the
10 # defaults (to change paths and/or executables, build parameters, etc):
12 # DEBUG OPTIMIZER MALLOCLIB
13 # PLATFORM DISTRIBUTION INSTALL_USER INSTALL_GROUP
14 # MAKE CC LD TAR ZIP AWK SED ECHO RPM LIBTOOL
15 # MSGFMT MSGMERGE XGETTEXT
18 DEBUG=${DEBUG:-'-DDEBUG'} # -DNDEBUG
19 OPTIMIZER=${OPTIMIZER:-'-O1 -g'} # some gcc's miscompile at -O2
20 MALLOCLIB=${MALLOCLIB:-''} # /usr/lib/libefence.a
26 dnl Optimization options?
27 opt_build="$OPTIMIZER"
30 dnl Alternate malloc library?
31 malloc_lib="$MALLOCLIB"
37 pkg_version=${PKG_MAJOR}.${PKG_MINOR}.${PKG_REVISION}
38 pkg_release=$PKG_BUILD
42 pkg_platform=`uname -s`
43 pkg_distribution="Generic $pkg_platform"
44 pkg_platform=`echo $pkg_platform | tr 'A-Z' 'a-z' | sed -e 's/irix64/irix/'`
45 test -z "$PLATFORM" || pkg_platform="$PLATFORM"
46 test -z "$DISTRIBUTION" || pkg_distribution="$DISTRIBUTION"
47 AC_SUBST(pkg_distribution)
48 AC_SUBST(pkg_platform)
51 test -z "$INSTALL_USER" || pkg_user="$INSTALL_USER"
55 test -z "$INSTALL_GROUP" || pkg_group="$INSTALL_GROUP"
58 dnl check if user wants their own C compiler
59 if test -z "$CC"; then
65 dnl check if users wants their own make
66 if test -z "$MAKE"; then
67 AC_PATH_PROG(MAKE, make, /usr/bin/make)
72 dnl check if users wants their own linker
73 if test -z "$LD"; then
74 AC_PATH_PROG(LD, ld, /usr/bin/ld)
79 dnl check if the tar program is available
80 if test -z "$TAR"; then
81 AC_PATH_PROG(TAR, tar, /bin/tar)
86 dnl check if the gzip program is available
87 if test -z "$ZIP"; then
88 AC_PATH_PROG(ZIP, gzip, /bin/gzip)
93 dnl check if the makedepend program is available
94 if test -z "$MAKEDEPEND"; then
95 AC_PATH_PROG(MAKEDEPEND, makedepend, /bin/true)
97 makedepend=$MAKEDEPEND
100 dnl check if the rpm program is available
101 if test -z "$RPM"; then
102 AC_PATH_PROG(RPM, rpm, /bin/rpm)
107 dnl .. and what version is rpm
110 rpm_version=`$RPM --version | awk '{print $NF}' | awk -F. '{print $1}'`
111 AC_SUBST(rpm_version)
113 dnl At some point in rpm 4.0, rpm can no longer build rpms, and
114 dnl rpmbuild is needed (rpmbuild may go way back; not sure)
115 dnl So, if rpm version >= 4.0, look for rpmbuild. Otherwise build w/ rpm
117 if test $rpm_version -ge 4; then
118 AC_PATH_PROG(RPMBUILD, rpmbuild)
125 dnl check if symbolic links are supported
128 dnl check if user wants their own awk, sed and echo
129 if test -z "$AWK"; then
130 AC_PATH_PROG(AWK, awk, /bin/awk)
134 if test -z "$SED"; then
135 AC_PATH_PROG(SED, sed, /bin/sed)
139 if test -z "$ECHO"; then
140 AC_PATH_PROG(ECHO, echo, /bin/echo)
145 dnl ensure libtool is installed
146 if test -z "$LIBTOOL"; then
147 AC_PATH_PROG(LIBTOOL, libtool,,/usr/bin)
149 if test -z "$LIBTOOL"; then
151 echo 'FATAL ERROR: libtool does not seem to be installed.'
152 echo $pkg_name cannot be built without a working libtool installation.
158 dnl libtool to build libraries static only?
159 AC_ARG_ENABLE(shared,
160 [ --enable-shared=[yes/no] Enable use of shared libraries [default=yes]],,
162 AC_SUBST(enable_shared)
164 dnl will we be making use of readline?
165 AC_ARG_ENABLE(readline,
166 [ --enable-readline=[yes/no] Enable readline command editing [default=no]],,
168 if test $enable_readline = yes; then
169 libreadline="-lreadline -lncurses"
173 AC_SUBST(libreadline)
174 AC_SUBST(enable_readline)
176 dnl will we be making use of gettext?
177 AC_ARG_ENABLE(gettext,
178 [ --enable-gettext=[yes/no] Enable alternate language support [default=yes]],,
180 AC_SUBST(enable_gettext)
182 dnl check if the msgfmt, msgmerge, xgettext programs are available
183 if test "$enable_gettext" = yes; then
184 if test -z "$MSGFMT"; then
185 AC_CHECK_PROG(MSGFMT, msgfmt, /usr/bin/msgfmt)
189 if test -z "$MSGMERGE"; then
190 AC_CHECK_PROG(MSGMERGE, msgmerge, /usr/bin/msgmerge)
194 if test -z "$XGETTEXT"; then
195 AC_CHECK_PROG(XGETTEXT, xgettext, /usr/bin/xgettext)
200 if test -z "$XGETTEXT"; then
202 echo 'FATAL ERROR: xgettext does not seem to be installed.'
203 echo $pkg_name cannot be built without a working gettext installation.
208 dnl Checks for UUID header and library.
209 AC_CHECK_HEADER(uuid/uuid.h,, [
211 echo 'FATAL ERROR: could not find a valid UUID header.'
212 echo 'Install either the e2fsprogs-devel (rpm) or the uuid-dev (deb) package.'
215 AC_CHECK_LIB(uuid, uuid_generate,, [
217 echo 'FATAL ERROR: could not find a valid UUID library.'
218 echo 'Install either the e2fsprogs-devel (rpm) or the uuid-dev (deb) package.'
223 dnl Caution: using libuuid shared adds an additional runtime dependency,
224 dnl but the rpm spec file and debian control file do _not_ enforce this.
225 dnl We want to keep our runtime dependencies to an absolute minimum for
226 dnl this particular package, but the option is there.
228 AC_ARG_ENABLE(shared-uuid,
229 [ --enable-shared-uuid=[yes/no] Link shared libuuid [default=no].],
230 libuuid="/usr/lib/libuuid.a"
231 if test "$enable_shared_uuid" = yes; then
234 libuuid="/usr/lib/libuuid.a")
237 dnl Check if we have a type for the pointer's size integer (__psint_t)
238 AC_MSG_CHECKING([for __psint_t ])
241 #include <sys/types.h>
247 ], AC_DEFINE(HAVE___PSINT_T) AC_MSG_RESULT(yes) , AC_MSG_RESULT(no))
249 dnl Check if we have a type for the pointer's size unsigned (__psunsigned_t)
250 AC_MSG_CHECKING([for __psunsigned_t ])
253 #include <sys/types.h>
258 __psunsigned_t psuint;
259 ], AC_DEFINE(HAVE___PSUNSIGNED_T) AC_MSG_RESULT(yes) , AC_MSG_RESULT(no))
262 if test "$cross_compiling" = yes -a -z "$ac_cv_sizeof_long"; then
263 AC_MSG_WARN([Cross compiling; assuming 32bit long and 32bit pointers])
265 AC_CHECK_SIZEOF(long, 4)
266 AC_CHECK_SIZEOF(char *, 4)
267 if test $ac_cv_sizeof_long -eq 4; then
268 AC_DEFINE(HAVE_32BIT_LONG)
270 if test $ac_cv_sizeof_long -eq 8; then
271 AC_DEFINE(HAVE_64BIT_LONG)
273 if test $ac_cv_sizeof_char_p -eq 4; then
274 AC_DEFINE(HAVE_32BIT_PTR)
276 if test $ac_cv_sizeof_char_p -eq 8; then
277 AC_DEFINE(HAVE_64BIT_PTR)
280 dnl man pages (source)
281 dnl also check if man page source is gzipped
282 dnl (usually on Debian, but not Redhat pre-7.0)
283 have_zipped_manpages=false
284 for d in ${prefix}/share/man ${prefix}/man ; do
285 if test -f $d/man1/man.1.gz; then
286 have_zipped_manpages=true
290 AC_SUBST(have_zipped_manpages)
292 dnl build definitions for use in Makefiles
293 AC_OUTPUT(include/builddefs)