fix a typo in pkg test.
[xfstests-dev.git] / configure.in
1 dnl unpacking check - this file must exist
2 AC_INIT(src/fsstress.c)
3 pkg_name="xfstests"
4 AC_SUBST(pkg_name)
5
6 #
7 # Note: the following environment variables may be set to override the
8 # defaults (to change paths and/or executables, build parameters, etc):
9 #
10 #   DEBUG  OPTIMIZER  MAKE  CC  LD  TAR  ZIP  RPM  AWK  SED  ECHO
11 #   MALLOCLIB  DISTRIBUTION  PACKAGE_BUILDER  PREFIX  ROOT_PREFIX
12 #
13
14 DEBUG=${DEBUG:-'-DDEBUG'}               # -DNDEBUG
15 OPTIMIZER=${OPTIMIZER:-'-g'}            # (-O1 enforced default)
16 MALLOCLIB=${MALLOCLIB:-''}              # /usr/lib/libefence.a
17
18 dnl Debug build?
19 debug_build="$DEBUG"
20 AC_SUBST(debug_build)
21
22 dnl Optimization options?
23 opt_build="$OPTIMIZER"
24 AC_SUBST(opt_build)
25
26 dnl Alternate malloc library?
27 malloc_lib="$MALLOCLIB"
28 AC_SUBST(malloc_lib)
29
30 dnl Set version
31 . ./VERSION
32
33 pkg_version=${PKG_MAJOR}.${PKG_MINOR}.${PKG_REVISION}
34 pkg_release=$PKG_BUILD
35 AC_SUBST(pkg_version)
36 AC_SUBST(pkg_release)
37
38 pkg_distribution="SGI ProPack"
39 test -z "$DISTRIBUTION" || pkg_distribution="$DISTRIBUTION"
40 AC_SUBST(pkg_distribution)
41
42 pkg_builder=`id -u -n`@`hostname`
43 test -z "$PACKAGE_BUILDER" || pkg_builder="$PACKAGE_BUILDER"
44 AC_SUBST(pkg_builder)
45
46 dnl check if user wants their own C compiler
47 test -z "$CC" && AC_PROG_CC
48 cc=$CC
49 AC_SUBST(cc)
50
51 dnl check if users wants their own make
52 test -z "$MAKE" && AC_PATH_PROG(MAKE, make, /usr/bin/make)
53 make=$MAKE
54 AC_SUBST(make)
55
56 dnl check if users wants their own linker
57 test -z "$LD" && AC_PATH_PROG(LD, ld, /usr/bin/ld)
58 ld=$LD
59 AC_SUBST(ld)
60
61 dnl check if the tar program is available
62 test -z "$TAR" && AC_PATH_PROG(TAR, tar)
63 tar=$TAR
64 AC_SUBST(tar)
65
66 dnl check if the gzip program is available
67 test -z "$ZIP" && AC_PATH_PROG(ZIP, gzip, /bin/gzip)
68 zip=$ZIP
69 AC_SUBST(zip)
70
71 dnl check if the rpm program is available
72 test -z "$RPM" && AC_PATH_PROG(RPM, rpm, /bin/rpm)
73 rpm=$RPM
74 AC_SUBST(rpm)
75
76 dnl .. and what version is rpm
77 rpm_version=0
78 test -x $RPM && \
79         rpm_version=`$RPM --version | awk '{print $NF}' | awk -F. '{print $1}'`
80 AC_SUBST(rpm_version)
81
82 dnl check if the makedepend program is available
83 test -z "$MAKEDEPEND" && AC_PATH_PROG(MAKEDEPEND, makedepend, /bin/true)
84 makedepend=$MAKEDEPEND
85 AC_SUBST(makedepend)
86
87 dnl check if symbolic links are supported
88 AC_PROG_LN_S
89
90 dnl check if user wants their own awk, sed and echo
91 test -z "$AWK" && AC_PATH_PROG(AWK, awk, /bin/awk)
92 awk=$AWK
93 AC_SUBST(awk)
94 test -z "$SED" && AC_PATH_PROG(SED, sed, /bin/sed)
95 sed=$SED
96 AC_SUBST(sed)
97 test -z "$ECHO" && AC_PATH_PROG(ECHO, echo, /bin/echo)
98 echo=$ECHO
99 AC_SUBST(echo)
100
101 CPPFLAGS="-I/usr/include/xfs"
102 AC_SUBST(CPPFLAGS)
103
104 dnl Checks for UUID header and library.
105 AC_CHECK_HEADER(uuid/uuid.h,, [
106         echo
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.'
109         exit 1
110 ])
111 AC_CHECK_LIB(uuid, uuid_generate,, [
112         echo
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.'
115         exit 1
116 ])
117 libuuid="/usr/lib/libuuid.a"
118 AC_SUBST(libuuid)
119
120 dnl Checks for base XFS headers and libraries.
121 AC_CHECK_HEADER(xfs/libxfs.h,, [
122         echo
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.'
126         exit 1
127 ])
128 AC_CHECK_LIB(xfs, libxfs_init,, [
129         echo
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.'
133         exit 1
134 ])
135 AC_CHECK_HEADER(xfs/handle.h,, [
136         echo
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.'
140         exit 1
141 ])
142 AC_CHECK_LIB(handle, path_to_handle,, [
143         echo
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.'
147         exit 1
148 ])
149 libxfs="-lxfs"
150 libhdl="-lhandle"
151 AC_SUBST(libxfs)
152 AC_SUBST(libhdl)
153
154 dnl Checks for Extended Attributes header and library.
155 AC_CHECK_HEADER(attr/xattr.h,, [
156         echo
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.'
160         exit 1
161 ])
162 AC_CHECK_LIB(attr, getxattr,, [
163         echo
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.'
167         exit 1
168 ])
169 libattr="-lattr"
170 AC_SUBST(libattr)
171
172 dnl Checks for Access Control List headers and library.
173 AC_CHECK_HEADER(sys/acl.h,, [
174         echo
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.'
178         exit 1
179 ])
180 AC_CHECK_HEADER(acl/libacl.h,, [
181         echo
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.'
185         exit 1
186 ])
187 AC_CHECK_LIB(acl, acl_init,, [
188         echo
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.'
192         exit 1
193 ])
194 libacl="-lacl"
195 AC_SUBST(libacl)
196
197 dnl Checks for GNU database manager header and library.
198 libgdbm=""
199 have_db=true
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"
203 fi
204 AC_SUBST(libgdbm)
205 AC_SUBST(have_db)
206
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"
211 prefix="$PREFIX"
212
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
220     then
221         pkg_man_dir=$d
222         have_zipped_manpages=true
223         break
224     fi
225 done
226 AC_SUBST(pkg_man_dir)
227 AC_SUBST(have_zipped_manpages)
228
229 dnl binaries
230 pkg_bin_dir=${prefix}/sbin
231 AC_SUBST(pkg_bin_dir)
232
233 dnl static libraries
234 pkg_lib_dir=${prefix}/lib
235 AC_SUBST(pkg_lib_dir)
236
237 dnl runtime shared system libraries
238 pkg_slib_dir=${root_prefix}/lib
239 AC_SUBST(pkg_slib_dir)
240
241 dnl system binaries
242 pkg_sbin_dir=${root_prefix}/sbin
243 AC_SUBST(pkg_sbin_dir)
244
245 dnl include files
246 pkg_inc_dir=${prefix}/include
247 AC_SUBST(pkg_inc_dir)
248
249 dnl doc directory
250 pkg_doc_dir=${prefix}/share/doc/${pkg_name}
251 AC_SUBST(pkg_doc_dir)
252
253
254 dnl
255 dnl output files
256 dnl
257
258 AC_OUTPUT( \
259 dnl  Build definitions for use in Makefiles
260     include/builddefs \
261 )