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