1 dnl unpacking check - this file must exist
2 AC_INIT(src/fsstress.c)
7 # Note: the following environment variables may be set to override the
8 # defaults (to change paths and/or executables, build parameters, etc):
10 # DEBUG OPTIMIZER MAKE CC LD TAR ZIP RPM AWK SED ECHO
11 # MALLOCLIB DISTRIBUTION PACKAGE_BUILDER PREFIX ROOT_PREFIX
14 DEBUG=${DEBUG:-'-DDEBUG'} # -DNDEBUG
15 OPTIMIZER=${OPTIMIZER:-'-g'} # -O2
16 MALLOCLIB=${MALLOCLIB:-''} # /usr/lib/libefence.a
22 dnl Optimization options?
23 opt_build="$OPTIMIZER"
26 dnl Alternate malloc library?
27 malloc_lib="$MALLOCLIB"
33 pkg_version=${PKG_MAJOR}.${PKG_MINOR}.${PKG_REVISION}
34 pkg_release=$PKG_BUILD
38 pkg_distribution="SGI ProPack"
39 test -z "$DISTRIBUTION" || pkg_distribution="$DISTRIBUTION"
40 AC_SUBST(pkg_distribution)
42 pkg_builder=`id -u -n`@`hostname -f`
43 test -z "$PACKAGE_BUILDER" || pkg_builder="$PACKAGE_BUILDER"
46 dnl check if user wants their own C compiler
47 test -z "$CC" && AC_PROG_CC
51 dnl check if users wants their own make
52 test -z "$MAKE" && AC_PATH_PROG(MAKE, make, /usr/bin/make)
56 dnl check if users wants their own linker
57 test -z "$LD" && AC_PATH_PROG(LD, ld, /usr/bin/ld)
61 dnl check if the tar program is available
62 test -z "$TAR" && AC_PATH_PROG(TAR, tar)
66 dnl check if the gzip program is available
67 test -z "$ZIP" && AC_PATH_PROG(ZIP, gzip, /bin/gzip)
71 dnl check if the rpm program is available
72 test -z "$RPM" && AC_PATH_PROG(RPM, rpm, /bin/rpm)
76 dnl .. and what version is rpm
79 rpm_version=`$RPM --version | awk '{print $NF}' | awk -F. '{print $1}'`
82 dnl check if the makedepend program is available
83 test -z "$MAKEDEPEND" && AC_PATH_PROG(MAKEDEPEND, makedepend, /bin/true)
84 makedepend=$MAKEDEPEND
87 dnl check if symbolic links are supported
90 dnl check if user wants their own awk, sed and echo
91 test -z "$AWK" && AC_PATH_PROG(AWK, awk, /bin/awk)
94 test -z "$SED" && AC_PATH_PROG(SED, sed, /bin/sed)
97 test -z "$ECHO" && AC_PATH_PROG(ECHO, echo, /bin/echo)
101 CPPFLAGS="-I/usr/include/xfs"
104 dnl Checks for UUID header and library.
105 AC_CHECK_HEADER(uuid/uuid.h,, [
107 echo 'FATAL ERROR: could not find a valid UUID header.'
108 echo 'Install either the e2fsprogs-devel (rpm) or the uuid-dev (deb) package.'
111 AC_CHECK_LIB(uuid, uuid_generate,, [
113 echo 'FATAL ERROR: could not find a valid UUID library.'
114 echo 'Install either the e2fsprogs-devel (rpm) or the uuid-dev (deb) package.'
117 libuuid="/usr/lib/libuuid.a"
120 dnl Checks for base XFS headers and libraries.
121 AC_CHECK_HEADER(xfs/libxfs.h,, [
123 echo 'FATAL ERROR: could not find a valid XFS library header.'
124 echo 'Install either the xfsprogs-devel (rpm) or the xfslibs-dev (deb) package.'
127 AC_CHECK_LIB(xfs, libxfs_init,, [
129 echo 'FATAL ERROR: could not find a valid XFS base library.'
130 echo 'Install either the xfsprogs-devel (rpm) or the xfslibs-dev (deb) package.'
133 AC_CHECK_HEADER(xfs/handle.h,, [
135 echo 'FATAL ERROR: could not find a valid XFS handle header.'
136 echo 'Install either the xfsprogs-devel (rpm) or the xfslibs-dev (deb) package.'
139 AC_CHECK_LIB(handle, path_to_handle,, [
141 echo 'FATAL ERROR: could not find a valid XFS handle library.'
142 echo 'Install either the xfsprogs-devel (rpm) or the xfslibs-dev (deb) package.'
150 dnl Checks for Extended Attributes header and library.
151 AC_CHECK_HEADER(attr/attributes.h,, [
153 echo 'FATAL ERROR: could not find a valid Extended Attributes header.'
154 echo 'Install either the attr-devel (rpm) or the attr-dev (deb) package.'
157 AC_CHECK_LIB(attr, attr_get,, [
159 echo 'FATAL ERROR: could not find a valid Extended Attributes library.'
160 echo 'Install either the attr-devel (rpm) or the attr-dev (deb) package.'
163 libattr="/usr/lib/libattr.a"
166 dnl Checks for Access Control List header and library.
167 AC_CHECK_HEADER(acl/acl.h,, [
169 echo 'FATAL ERROR: could not find a valid Access Control List header.'
170 echo 'Install either the acl-devel (rpm) or the acl-dev (deb) package.'
173 AC_CHECK_LIB(acl, acl_get,, [
175 echo 'FATAL ERROR: could not find a valid Access Control List library.'
176 echo 'Install either the acl-devel (rpm) or the acl-dev (deb) package.'
179 libacl="/usr/lib/libacl.a"
182 dnl Checks for GNU database manager header and library.
185 AC_CHECK_HEADER(gdbm/ndbm.h,, [ have_db=false ])
186 if test $have_db = "true" -a -f /usr/lib/libgdbm.a; then
187 libgdbm="/usr/lib/libgdbm.a"
192 dnl alternate root and usr prefixes
193 test -z "$ROOT_PREFIX" && ROOT_PREFIX=""
194 root_prefix="$ROOT_PREFIX"
195 test -z "$PREFIX" && PREFIX="/usr"
198 dnl man pages (source)
199 dnl also check if man page source is gzipped
200 dnl (usually on Debian, but not Redhat pre-7.0)
201 pkg_man_dir=${prefix}/man
202 have_zipped_manpages=false
203 for d in ${prefix}/share/man ${prefix}/man ; do
204 if test -f $d/man1/man.1.gz
207 have_zipped_manpages=true
211 AC_SUBST(pkg_man_dir)
212 AC_SUBST(have_zipped_manpages)
215 pkg_bin_dir=${prefix}/sbin
216 AC_SUBST(pkg_bin_dir)
219 pkg_lib_dir=${prefix}/lib
220 AC_SUBST(pkg_lib_dir)
222 dnl runtime shared system libraries
223 pkg_slib_dir=${root_prefix}/lib
224 AC_SUBST(pkg_slib_dir)
227 pkg_sbin_dir=${root_prefix}/sbin
228 AC_SUBST(pkg_sbin_dir)
231 pkg_inc_dir=${prefix}/include
232 AC_SUBST(pkg_inc_dir)
235 pkg_doc_dir=${prefix}/share/doc/${pkg_name}
236 AC_SUBST(pkg_doc_dir)
244 dnl Build definitions for use in Makefiles