]> git.ipfire.org Git - thirdparty/xfsprogs-dev.git/blame - configure.in
add a reference to xfs_info(8) in the SEE ALSO section (suggestion from
[thirdparty/xfsprogs-dev.git] / configure.in
CommitLineData
fc49813f
NS
1dnl unpacking check - this file must exist
2AC_INIT(include/libxfs.h)
3pkg_name="xfsprogs"
4AC_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
6c6508ec 11# MALLOCLIB DISTRIBUTION PACKAGE_BUILDER
fc49813f
NS
12#
13
14DEBUG=${DEBUG:-'-DDEBUG'} # -DNDEBUG
f91dde66 15OPTIMIZER=${OPTIMIZER:-'-g'} # (-O1 enforced default)
fc49813f
NS
16MALLOCLIB=${MALLOCLIB:-''} # /usr/lib/libefence.a
17
18dnl Debug build?
19debug_build="$DEBUG"
20AC_SUBST(debug_build)
21
22dnl Optimization options?
23opt_build="$OPTIMIZER"
24AC_SUBST(opt_build)
25
26dnl Alternate malloc library?
27malloc_lib="$MALLOCLIB"
28AC_SUBST(malloc_lib)
29
30dnl Set version
132c4946 31. ./VERSION
fc49813f
NS
32
33pkg_version=${PKG_MAJOR}.${PKG_MINOR}.${PKG_REVISION}
34pkg_release=$PKG_BUILD
35AC_SUBST(pkg_version)
36AC_SUBST(pkg_release)
37
f937adac 38pkg_distribution="SGI XFS"
fc49813f
NS
39test -z "$DISTRIBUTION" || pkg_distribution="$DISTRIBUTION"
40AC_SUBST(pkg_distribution)
41
caca5fe8 42pkg_builder=`id -u -n`@`hostname`
fc49813f
NS
43test -z "$PACKAGE_BUILDER" || pkg_builder="$PACKAGE_BUILDER"
44AC_SUBST(pkg_builder)
45
fc49813f
NS
46dnl output header with cpp defs HAVE_*, etc
47AC_CONFIG_HEADER(include/platform_defs.h)
48
49dnl check if user wants their own C compiler
50test -z "$CC" && AC_PROG_CC
51cc=$CC
52AC_SUBST(cc)
53
54dnl check if users wants their own make
55test -z "$MAKE" && AC_PATH_PROG(MAKE, make, /usr/bin/make)
56make=$MAKE
57AC_SUBST(make)
58
59dnl check if users wants their own linker
60test -z "$LD" && AC_PATH_PROG(LD, ld, /usr/bin/ld)
61ld=$LD
62AC_SUBST(ld)
63
64dnl check if the tar program is available
65test -z "$TAR" && AC_PATH_PROG(TAR, tar)
66tar=$TAR
67AC_SUBST(tar)
68
69dnl check if the gzip program is available
70test -z "$ZIP" && AC_PATH_PROG(ZIP, gzip, /bin/gzip)
71zip=$ZIP
72AC_SUBST(zip)
73
74dnl check if the rpm program is available
75test -z "$RPM" && AC_PATH_PROG(RPM, rpm, /bin/rpm)
76rpm=$RPM
77AC_SUBST(rpm)
78
79dnl .. and what version is rpm
80rpm_version=0
81test -x $RPM && \
82 rpm_version=`$RPM --version | awk '{print $NF}' | awk -F. '{print $1}'`
83AC_SUBST(rpm_version)
84
41a1923d
ES
85dnl At some point in rpm 4.0, rpm can no longer build rpms, and
86dnl rpmbuild is needed (rpmbuild may go way back; not sure)
87dnl So, if rpm version >= 4.0, look for rpmbuild. Otherwise build w/ rpm
88
89if test $rpm_version -ge 4; then
90 AC_PATH_PROG(RPMBUILD, rpmbuild)
91 rpmbuild=$RPMBUILD
92else
93 rpmbuild=$RPM
94fi
95
96AC_SUBST(rpmbuild)
97
98dnl check if the msgfmt program is available
99test -z "$MSGFMT" && AC_CHECK_PROG(MSGFMT, msgfmt, /usr/bin/msgfmt)
100msgfmt=$MSGFMT
101AC_SUBST(msgfmt)
102
fc49813f
NS
103dnl check if the makedepend program is available
104test -z "$MAKEDEPEND" && AC_PATH_PROG(MAKEDEPEND, makedepend, /bin/true)
105makedepend=$MAKEDEPEND
106AC_SUBST(makedepend)
107
108dnl check if symbolic links are supported
109AC_PROG_LN_S
110
111dnl check if user wants their own awk, sed and echo
112test -z "$AWK" && AC_PATH_PROG(AWK, awk, /bin/awk)
113awk=$AWK
114AC_SUBST(awk)
115test -z "$SED" && AC_PATH_PROG(SED, sed, /bin/sed)
116sed=$SED
117AC_SUBST(sed)
118test -z "$ECHO" && AC_PATH_PROG(ECHO, echo, /bin/echo)
119echo=$ECHO
120AC_SUBST(echo)
121
d5dca43b
NS
122dnl ensure libtool is installed
123AC_PATH_PROG(LIBTOOL, libtool,,/usr/bin)
124if test "$LIBTOOL" = ""; then
125 echo
126 echo 'FATAL ERROR: libtool does not seem to be installed.'
127 echo $pkg_name cannot be built without a working libtool installation.
128 exit 1
129fi
130libtool=$LIBTOOL
131AC_SUBST(libtool)
132
133dnl libtool to build libraries static only?
534b0bfd 134AC_ARG_ENABLE(shared,
6c6508ec 135 [ --enable-shared=[yes/no] Enable use of shared libraries [default=yes]],,
d5dca43b
NS
136 enable_shared=yes)
137AC_SUBST(enable_shared)
138
639231be
NS
139dnl Checks for UUID header and library.
140AC_CHECK_HEADER(uuid/uuid.h,, [
fc49813f 141 echo
639231be
NS
142 echo 'FATAL ERROR: could not find a valid UUID header.'
143 echo 'Install either the e2fsprogs-devel (rpm) or the uuid-dev (deb) package.'
fc49813f
NS
144 exit 1
145])
639231be
NS
146AC_CHECK_LIB(uuid, uuid_generate,, [
147 echo
148 echo 'FATAL ERROR: could not find a valid UUID library.'
149 echo 'Install either the e2fsprogs-devel (rpm) or the uuid-dev (deb) package.'
150 exit 1
151])
655782c8
NS
152dnl
153dnl Caution - using libuuid shared adds an additional runtime dependency,
154dnl but the rpm spec file and debian control file do _not_ enforce this.
155dnl We want to keep our runtime dependencies to an absolute minimum for
156dnl this particular package, but the option is there.
157dnl
158AC_ARG_ENABLE(shared-uuid,
159 [ --enable-shared-uuid=[yes/no] Link shared libuuid [default=no].],
160 libuuid="/usr/lib/libuuid.a"
161 if test "$enable_shared_uuid" = yes; then
162 libuuid="-luuid"
163 fi,
164 libuuid="/usr/lib/libuuid.a")
639231be 165AC_SUBST(libuuid)
fc49813f 166
fc49813f
NS
167dnl Check if we have a type for the pointer's size integer (__psint_t)
168AC_MSG_CHECKING([for __psint_t ])
169AC_TRY_COMPILE(
170[
171 #include <sys/types.h>
172 #include <stdlib.h>
173 #include <stddef.h>
174],
175[
176 __psint_t psint;
177], AC_DEFINE(HAVE___PSINT_T) AC_MSG_RESULT(yes) , AC_MSG_RESULT(no))
178
179dnl Check if we have a type for the pointer's size unsigned (__psunsigned_t)
180AC_MSG_CHECKING([for __psunsigned_t ])
181AC_TRY_COMPILE(
182[
183 #include <sys/types.h>
184 #include <stdlib.h>
185 #include <stddef.h>
186],
187[
188 __psunsigned_t psuint;
189], AC_DEFINE(HAVE___PSUNSIGNED_T) AC_MSG_RESULT(yes) , AC_MSG_RESULT(no))
190
caca5fe8
NS
191dnl Check type sizes
192if test "$cross_compiling" = yes -a "$ac_cv_sizeof_long" = ""; then
193 AC_MSG_WARN([Cross compiling; assuming 32bit long and 32bit pointers])
194fi
195AC_CHECK_SIZEOF(long, 4)
196AC_CHECK_SIZEOF(char *, 4)
197test $ac_cv_sizeof_long -eq 4 && AC_DEFINE(HAVE_32BIT_LONG)
198test $ac_cv_sizeof_long -eq 8 && AC_DEFINE(HAVE_64BIT_LONG)
199test $ac_cv_sizeof_char_p -eq 4 && AC_DEFINE(HAVE_32BIT_PTR)
200test $ac_cv_sizeof_char_p -eq 8 && AC_DEFINE(HAVE_64BIT_PTR)
fc49813f 201
fc49813f
NS
202dnl man pages (source)
203dnl also check if man page source is gzipped
204dnl (usually on Debian, but not Redhat pre-7.0)
205have_zipped_manpages=false
206for d in ${prefix}/share/man ${prefix}/man ; do
207 if test -f $d/man1/man.1.gz
208 then
fc49813f
NS
209 have_zipped_manpages=true
210 break
211 fi
212done
fc49813f
NS
213AC_SUBST(have_zipped_manpages)
214
6c6508ec
NS
215dnl build definitions for use in Makefiles
216AC_OUTPUT(include/builddefs)