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'} # (-O1 enforced default)
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`
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.'
125 echo 'Alternatively, run "make install-dev" from the xfsprogs source.'
128 AC_CHECK_LIB(xfs, libxfs_init,, [
130 echo 'FATAL ERROR: could not find a valid XFS base library.'
131 echo 'Install either the xfsprogs-devel (rpm) or the xfslibs-dev (deb) package.'
132 echo 'Alternatively, run "make install-dev" from the xfsprogs source.'
135 AC_CHECK_HEADER(xfs/handle.h,, [
137 echo 'FATAL ERROR: could not find a valid XFS handle header.'
138 echo 'Install either the xfsprogs-devel (rpm) or the xfslibs-dev (deb) package.'
139 echo 'Alternatively, run "make install-dev" from the xfsprogs source.'
142 AC_CHECK_LIB(handle, path_to_handle,, [
144 echo 'FATAL ERROR: could not find a valid XFS handle library.'
145 echo 'Install either the xfsprogs-devel (rpm) or the xfslibs-dev (deb) package.'
146 echo 'Alternatively, run "make install-dev" from the xfsprogs source.'
154 dnl Checks for Extended Attributes header and library.
155 AC_CHECK_HEADER(attr/xattr.h,, [
157 echo 'FATAL ERROR: could not find a valid Extended Attributes header.'
158 echo 'Install either the attr-devel (rpm) or the attr-dev (deb) package.'
159 echo 'Alternatively, run "make install-dev" from the attr source.'
162 AC_CHECK_LIB(attr, getxattr,, [
164 echo 'FATAL ERROR: could not find a valid Extended Attributes library.'
165 echo 'Install either the libattr (rpm) or the libattr1 (deb) package.'
166 echo 'Alternatively, run "make install-lib" from the attr source.'
172 dnl Checks for Access Control List headers and library.
173 AC_CHECK_HEADER(sys/acl.h,, [
175 echo 'FATAL ERROR: could not find a valid Access Control List headers.'
176 echo 'Install either the acl-devel (rpm) or the acl (deb) package.'
177 echo 'Alternatively, run "make install-dev" from the acl source.'
180 AC_CHECK_HEADER(acl/libacl.h,, [
182 echo 'FATAL ERROR: could not find a valid Access Control List headers.'
183 echo 'Install either the acl-devel (rpm) or the acl (deb) package.'
184 echo 'Alternatively, run "make install-dev" from the acl source.'
187 AC_CHECK_LIB(acl, acl_init,, [
189 echo 'FATAL ERROR: could not find a valid Access Control List library.'
190 echo 'Install either the libacl (rpm) or the libacl1 (deb) package.'
191 echo 'Alternatively, run "make install-lib" from the acl source.'
197 dnl Checks for GNU database manager header and library.
200 AC_CHECK_HEADER(gdbm/ndbm.h,, [ have_db=false ])
201 if test $have_db = "true" -a -f /usr/lib/libgdbm.a; then
202 libgdbm="/usr/lib/libgdbm.a"
207 dnl alternate root and usr prefixes
208 test -z "$ROOT_PREFIX" && ROOT_PREFIX=""
209 root_prefix="$ROOT_PREFIX"
210 test -z "$PREFIX" && PREFIX="/usr"
213 dnl man pages (source)
214 dnl also check if man page source is gzipped
215 dnl (usually on Debian, but not Redhat pre-7.0)
216 pkg_man_dir=${prefix}/share/man
217 have_zipped_manpages=false
218 for d in ${prefix}/share/man ${prefix}/man ; do
219 if test -f $d/man1/man.1.gz
222 have_zipped_manpages=true
226 AC_SUBST(pkg_man_dir)
227 AC_SUBST(have_zipped_manpages)
230 pkg_bin_dir=${prefix}/sbin
231 AC_SUBST(pkg_bin_dir)
234 pkg_lib_dir=${prefix}/lib
235 AC_SUBST(pkg_lib_dir)
237 dnl runtime shared system libraries
238 pkg_slib_dir=${root_prefix}/lib
239 AC_SUBST(pkg_slib_dir)
242 pkg_sbin_dir=${root_prefix}/sbin
243 AC_SUBST(pkg_sbin_dir)
246 pkg_inc_dir=${prefix}/include
247 AC_SUBST(pkg_inc_dir)
250 pkg_doc_dir=${prefix}/share/doc/${pkg_name}
251 AC_SUBST(pkg_doc_dir)
259 dnl Build definitions for use in Makefiles