1 dnl unpacking check - this file must exist
2 AC_INIT(include/libxfs.h)
9 AC_SUBST(enable_shared)
13 # Note: the following environment variables may be set to override the
14 # defaults (to change paths and/or executables, build parameters, etc):
16 # DEBUG OPTIMIZER MAKE CC LD TAR ZIP RPM AWK SED ECHO
17 # MALLOCLIB DISTRIBUTION PACKAGE_BUILDER PREFIX ROOT_PREFIX
20 DEBUG=${DEBUG:-'-DDEBUG'} # -DNDEBUG
21 OPTIMIZER=${OPTIMIZER:-'-g'} # (-O1 enforced default)
22 MALLOCLIB=${MALLOCLIB:-''} # /usr/lib/libefence.a
28 dnl Optimization options?
29 opt_build="$OPTIMIZER"
32 dnl Alternate malloc library?
33 malloc_lib="$MALLOCLIB"
39 pkg_version=${PKG_MAJOR}.${PKG_MINOR}.${PKG_REVISION}
40 pkg_release=$PKG_BUILD
44 pkg_distribution="SGI XFS"
45 test -z "$DISTRIBUTION" || pkg_distribution="$DISTRIBUTION"
46 AC_SUBST(pkg_distribution)
48 pkg_builder=`id -u -n`@`hostname -f`
49 test -z "$PACKAGE_BUILDER" || pkg_builder="$PACKAGE_BUILDER"
53 dnl output header with cpp defs HAVE_*, etc
54 AC_CONFIG_HEADER(include/platform_defs.h)
56 dnl check if user wants their own C compiler
57 test -z "$CC" && AC_PROG_CC
61 dnl check if users wants their own make
62 test -z "$MAKE" && AC_PATH_PROG(MAKE, make, /usr/bin/make)
66 dnl check if users wants their own linker
67 test -z "$LD" && AC_PATH_PROG(LD, ld, /usr/bin/ld)
71 dnl check if the tar program is available
72 test -z "$TAR" && AC_PATH_PROG(TAR, tar)
76 dnl check if the gzip program is available
77 test -z "$ZIP" && AC_PATH_PROG(ZIP, gzip, /bin/gzip)
81 dnl check if the rpm program is available
82 test -z "$RPM" && AC_PATH_PROG(RPM, rpm, /bin/rpm)
86 dnl .. and what version is rpm
89 rpm_version=`$RPM --version | awk '{print $NF}' | awk -F. '{print $1}'`
92 dnl check if the makedepend program is available
93 test -z "$MAKEDEPEND" && AC_PATH_PROG(MAKEDEPEND, makedepend, /bin/true)
94 makedepend=$MAKEDEPEND
97 dnl check if symbolic links are supported
100 dnl check if user wants their own awk, sed and echo
101 test -z "$AWK" && AC_PATH_PROG(AWK, awk, /bin/awk)
104 test -z "$SED" && AC_PATH_PROG(SED, sed, /bin/sed)
107 test -z "$ECHO" && AC_PATH_PROG(ECHO, echo, /bin/echo)
111 dnl Checks for UUID header and library.
112 AC_CHECK_HEADER(uuid/uuid.h,, [
114 echo 'FATAL ERROR: could not find a valid UUID header.'
115 echo 'Install either the e2fsprogs-devel (rpm) or the uuid-dev (deb) package.'
118 AC_CHECK_LIB(uuid, uuid_generate,, [
120 echo 'FATAL ERROR: could not find a valid UUID library.'
121 echo 'Install either the e2fsprogs-devel (rpm) or the uuid-dev (deb) package.'
124 libuuid="/usr/lib/libuuid.a"
127 dnl Checks for LVM library
128 AC_MSG_CHECKING([for liblvm.a])
130 for dir in /usr/local/lib /usr/lib /lib; do
131 if test -f $dir/liblvm.a; then
135 if test -n "$liblvm"; then
143 AC_SUBST(have_liblvm)
145 dnl Check if we have a type for the pointer's size integer (__psint_t)
146 AC_MSG_CHECKING([for __psint_t ])
149 #include <sys/types.h>
155 ], AC_DEFINE(HAVE___PSINT_T) AC_MSG_RESULT(yes) , AC_MSG_RESULT(no))
157 dnl Check if we have a type for the pointer's size unsigned (__psunsigned_t)
158 AC_MSG_CHECKING([for __psunsigned_t ])
161 #include <sys/types.h>
166 __psunsigned_t psuint;
167 ], AC_DEFINE(HAVE___PSUNSIGNED_T) AC_MSG_RESULT(yes) , AC_MSG_RESULT(no))
170 dnl check sizeof long
171 AC_MSG_CHECKING([sizeof long])
172 cat <<End-of-File >conftest.c
174 main() { printf("%d\n", sizeof(long)); }
176 (eval $ac_compile) 2>&5
179 echo "./conftest -> \"$ans\"" >&5
181 test $ans -eq 4 && AC_DEFINE(HAVE_32BIT_LONG)
182 test $ans -eq 8 && AC_DEFINE(HAVE_64BIT_LONG)
183 rm -f conftest conftest.*
185 dnl check sizeof pointer
186 AC_MSG_CHECKING([sizeof pointer])
187 cat <<End-of-File >conftest.c
189 main() { printf("%d\n", sizeof(char *)); }
191 (eval $ac_compile) 2>&5
194 echo "./conftest -> \"$ans\"" >&5
196 test $ans -eq 4 && AC_DEFINE(HAVE_32BIT_PTR)
197 test $ans -eq 8 && AC_DEFINE(HAVE_64BIT_PTR)
198 rm -f conftest conftest.*
201 dnl alternate root and usr prefixes
202 test -z "$ROOT_PREFIX" && ROOT_PREFIX=""
203 root_prefix="$ROOT_PREFIX"
204 test -z "$PREFIX" && PREFIX="/usr"
207 dnl man pages (source)
208 dnl also check if man page source is gzipped
209 dnl (usually on Debian, but not Redhat pre-7.0)
210 pkg_man_dir=${prefix}/share/man
211 have_zipped_manpages=false
212 for d in ${prefix}/share/man ${prefix}/man ; do
213 if test -f $d/man1/man.1.gz
216 have_zipped_manpages=true
220 AC_SUBST(pkg_man_dir)
221 AC_SUBST(have_zipped_manpages)
224 pkg_bin_dir=${prefix}/sbin
225 AC_SUBST(pkg_bin_dir)
228 pkg_lib_dir=${prefix}/lib
229 AC_SUBST(pkg_lib_dir)
231 dnl runtime shared system libraries
232 pkg_slib_dir=${root_prefix}/lib
233 AC_SUBST(pkg_slib_dir)
236 pkg_sbin_dir=${root_prefix}/sbin
237 AC_SUBST(pkg_sbin_dir)
240 pkg_inc_dir=${prefix}/include/xfs
241 AC_SUBST(pkg_inc_dir)
242 dk_inc_dir=${prefix}/include/disk
246 pkg_doc_dir=${prefix}/share/doc/${pkg_name}
247 AC_SUBST(pkg_doc_dir)
254 #For libtool, from section 5.4.2 of the libtool manual. Just in
255 # case we ever need them.
256 LTLIBOBJS=`echo "$LIBOBJS" | sed 's/\.[^.]* /.lo /g;s/\.[^.]*$/.lo/'`
258 LTALLOCA=`echo "$ALLOCA" | sed 's/\.[^.]* /.lo /g;s/\.[^.]*$/.lo/'`
263 dnl Build definitions for use in Makefiles