blob: e521ddc5b3d6bdf44dfa258cdb4bb68e8f428c4a [file] [log] [blame]
Theodore Ts'o50e1e101997-04-26 13:58:21 +00001AC_INIT(version.h)
Theodore Ts'ob0cacab2004-11-30 19:00:19 -05002AC_PREREQ(2.50)
3AC_CONFIG_AUX_DIR(config)
Theodore Ts'od1154eb2011-09-18 17:34:37 -04004AC_CONFIG_HEADERS([lib/config.h])
5AH_BOTTOM([#include "dirpaths.h"])
Theodore Ts'o50e1e101997-04-26 13:58:21 +00006MCONFIG=./MCONFIG
7AC_SUBST_FILE(MCONFIG)
Theodore Ts'o74becf31997-04-26 14:37:06 +00008BINARY_TYPE=bin
9dnl
10dnl This is to figure out the version number and the date....
11dnl
12E2FSPROGS_VERSION=`grep E2FSPROGS_VERSION ${srcdir}/version.h \
13 | awk '{print $3}' | tr \" " " | awk '{print $1}'`
14DATE=`grep E2FSPROGS_DATE ${srcdir}/version.h | awk '{print $3}' \
15 | tr \" " "`
Theodore Ts'obff0cc92003-03-23 01:37:53 -050016E2FSPROGS_DAY=`echo $DATE | awk -F- '{print $1}'`
Theodore Ts'o74becf31997-04-26 14:37:06 +000017MONTH=`echo $DATE | awk -F- '{print $2}'`
18YEAR=`echo $DATE | awk -F- '{print $3}'`
19
Theodore Ts'o40fa8cc1999-01-09 05:06:02 +000020if expr $YEAR ">" 1900 > /dev/null ; then
21 E2FSPROGS_YEAR=$YEAR
22elif expr $YEAR ">" 90 >/dev/null ; then
Theodore Ts'o74becf31997-04-26 14:37:06 +000023 E2FSPROGS_YEAR=19$YEAR
24else
25 E2FSPROGS_YEAR=20$YEAR
26fi
27
28case $MONTH in
Andreas Dilger927566a2006-11-12 19:41:25 -050029Jan) MONTH_NUM=01; E2FSPROGS_MONTH="January" ;;
30Feb) MONTH_NUM=02; E2FSPROGS_MONTH="February" ;;
31Mar) MONTH_NUM=03; E2FSPROGS_MONTH="March" ;;
32Apr) MONTH_NUM=04; E2FSPROGS_MONTH="April" ;;
33May) MONTH_NUM=05; E2FSPROGS_MONTH="May" ;;
34Jun) MONTH_NUM=06; E2FSPROGS_MONTH="June" ;;
35Jul) MONTH_NUM=07; E2FSPROGS_MONTH="July" ;;
36Aug) MONTH_NUM=08; E2FSPROGS_MONTH="August" ;;
37Sep) MONTH_NUM=09; E2FSPROGS_MONTH="September" ;;
38Oct) MONTH_NUM=10; E2FSPROGS_MONTH="October" ;;
39Nov) MONTH_NUM=11; E2FSPROGS_MONTH="November" ;;
40Dec) MONTH_NUM=12; E2FSPROGS_MONTH="December" ;;
Theodore Ts'o02d04db2008-08-22 10:52:42 -040041*) AC_MSG_WARN([Unknown month $MONTH??]) ;;
Theodore Ts'o74becf31997-04-26 14:37:06 +000042esac
43
Andreas Dilger927566a2006-11-12 19:41:25 -050044base_ver=`echo $E2FSPROGS_VERSION | \
45 sed -e 's/-WIP//' -e 's/pre-//' -e 's/-PLUS//'`
Andreas Dilger927566a2006-11-12 19:41:25 -050046
47date_spec=${E2FSPROGS_YEAR}.${MONTH_NUM}.${E2FSPROGS_DAY}
48
49case $E2FSPROGS_VERSION in
50*-WIP|pre-*)
Theodore Ts'oab063962008-07-07 16:07:43 -040051 E2FSPROGS_PKGVER="$base_ver~WIP-$E2FSPROGS_YEAR-$MONTH_NUM-$E2FSPROGS_DAY"
Andreas Dilger927566a2006-11-12 19:41:25 -050052 ;;
53*)
54 E2FSPROGS_PKGVER="$base_ver"
55 ;;
56esac
57
58unset DATE MONTH YEAR base_ver pre_vers date_spec
Theodore Ts'o02d04db2008-08-22 10:52:42 -040059AC_MSG_RESULT([Generating configuration file for e2fsprogs version $E2FSPROGS_VERSION])
60AC_MSG_RESULT([Release date is ${E2FSPROGS_MONTH}, ${E2FSPROGS_YEAR}])
Theodore Ts'o74becf31997-04-26 14:37:06 +000061AC_SUBST(E2FSPROGS_YEAR)
62AC_SUBST(E2FSPROGS_MONTH)
Theodore Ts'obff0cc92003-03-23 01:37:53 -050063AC_SUBST(E2FSPROGS_DAY)
Theodore Ts'o74becf31997-04-26 14:37:06 +000064AC_SUBST(E2FSPROGS_VERSION)
Andreas Dilger927566a2006-11-12 19:41:25 -050065AC_SUBST(E2FSPROGS_PKGVER)
Theodore Ts'oea97be52001-09-19 15:20:12 -040066AC_CANONICAL_HOST
Theodore Ts'o74becf31997-04-26 14:37:06 +000067dnl
Theodore Ts'o57aa50d2009-11-26 10:38:04 -050068dnl Check to see if libdl exists for the sake of dlopen
69dnl
70DLOPEN_LIB=''
71AC_CHECK_LIB(dl, dlopen,
72[DLOPEN_LIB=-ldl
Theodore Ts'od1154eb2011-09-18 17:34:37 -040073AC_DEFINE(HAVE_DLOPEN, 1, [Define to 1 if dlopen/libdl exists])])
Theodore Ts'o57aa50d2009-11-26 10:38:04 -050074AC_SUBST(DLOPEN_LIB)
75dnl
Theodore Ts'od21ae6c2003-05-05 09:00:24 -040076dnl Use diet libc
77dnl
Theodore Ts'oeafba6c2008-07-10 10:21:42 -040078WITH_DIET_LIBC=
Theodore Ts'od21ae6c2003-05-05 09:00:24 -040079AC_ARG_WITH([diet-libc],
Theodore Ts'o32493942007-12-31 10:45:01 -050080[ --with-diet-libc use diet libc],
Theodore Ts'od21ae6c2003-05-05 09:00:24 -040081CC="diet cc -nostdinc"
Theodore Ts'oeafba6c2008-07-10 10:21:42 -040082WITH_DIET_LIBC=yes
Theodore Ts'od21ae6c2003-05-05 09:00:24 -040083AC_MSG_RESULT(CC=$CC))dnl
84dnl
Theodore Ts'o74becf31997-04-26 14:37:06 +000085AC_ARG_WITH([cc],
Theodore Ts'o0b5b9f92009-09-06 21:28:47 -040086AC_HELP_STRING([--with-cc],[no longer supported, use CC= instead]),
87AC_MSG_ERROR([--with-cc no longer supported; use CC= instead]))
Theodore Ts'o74becf31997-04-26 14:37:06 +000088dnl
89AC_ARG_WITH([ccopts],
Theodore Ts'o0b5b9f92009-09-06 21:28:47 -040090AC_HELP_STRING([--with-ccopts],[no longer supported, use CFLAGS= instead]),
91AC_MSG_ERROR([--with-ccopts no longer supported; use CFLAGS= instead]))
92dnl
93AC_ARG_WITH([ldopts],
94AC_HELP_STRING([--with-ldopts],[no longer supported, use LDFLAGS= instead]),
95AC_MSG_ERROR([--with-ldopts no longer supported; use LDFLAGS= instead]))
96dnl
97AC_PROG_CC
Theodore Ts'o9b3018a2011-08-11 14:56:49 -040098if test "$GCC" = yes; then
99 RDYNAMIC="-rdynamic"
100 AC_SUBST(RDYNAMIC)
101fi
Theodore Ts'o0b5b9f92009-09-06 21:28:47 -0400102AC_PROG_CPP
Theodore Ts'o74becf31997-04-26 14:37:06 +0000103dnl
Matthias Andreeb1c92f92004-02-23 21:30:11 +0100104dnl Alpha computers use fast and imprecise floating point code that may
105dnl miss exceptions by default. Force sane options if we're using GCC.
106AC_MSG_CHECKING(for additional special compiler flags)
107if test "$GCC" = yes
108then
109 case "$host_cpu" in
110 alpha) addcflags="-mieee" ;;
111 esac
112fi
113if test "x$addcflags" != x
114then
115 AC_MSG_RESULT($addcflags)
116 CFLAGS="$addcflags $CFLAGS"
117else
118 AC_MSG_RESULT([[(none)]])
119fi
120dnl
Theodore Ts'oa4d09611997-04-29 14:28:00 +0000121dnl Set default values for library extentions. Will be dealt with after
122dnl parsing configuration opions, which may modify these
123dnl
124LIB_EXT=.a
125STATIC_LIB_EXT=.a
Theodore Ts'o14b596d2009-04-22 09:18:30 -0400126PROFILED_LIB_EXT=.a
Theodore Ts'oa4d09611997-04-29 14:28:00 +0000127dnl
Theodore Ts'oa4b2d3c1998-04-03 16:12:25 +0000128dnl Allow separate `root_prefix' to be specified
Theodore Ts'ofc6d9d51997-04-29 14:51:31 +0000129dnl
Theodore Ts'oa4b2d3c1998-04-03 16:12:25 +0000130AC_ARG_WITH([root-prefix],
131[ --with-root-prefix=PREFIX override prefix variable for files to be placed in the root],
132root_prefix=$withval,
133root_prefix=NONE)dnl
Theodore Ts'ofc6d9d51997-04-29 14:51:31 +0000134dnl
Theodore Ts'o98919bd2005-02-04 10:43:58 -0500135dnl handle --enable-maintainer-mode
136dnl
137AC_ARG_ENABLE([maintainer-mode],
138[ --enable-maintainer-mode enable makefile rules useful for maintainers],
139if test "$enableval" = "no"
140then
141 MAINTAINER_CMT=#
Theodore Ts'o02d04db2008-08-22 10:52:42 -0400142 AC_MSG_RESULT([Disabling maintainer mode])
Theodore Ts'o98919bd2005-02-04 10:43:58 -0500143else
144 MAINTAINER_CMT=
Theodore Ts'o02d04db2008-08-22 10:52:42 -0400145 AC_MSG_RESULT([Enabling maintainer mode])
Theodore Ts'o98919bd2005-02-04 10:43:58 -0500146fi
147,
148MAINTAINER_CMT=#
Theodore Ts'o02d04db2008-08-22 10:52:42 -0400149AC_MSG_RESULT([Disabling maintainer mode by default])
Theodore Ts'o98919bd2005-02-04 10:43:58 -0500150)
151AC_SUBST(MAINTAINER_CMT)
152dnl
Theodore Ts'o5aa6c3f2010-05-17 19:21:42 -0400153dnl handle --enable-symlink-install
154dnl
155AC_ARG_ENABLE([symlink-install],
156[ --enable-symlink-install use symlinks when installing instead of hard links],
157if test "$enableval" = "no"
158then
159 LINK_INSTALL_FLAGS=-f
160 AC_MSG_RESULT([Disabling symlinks for install])
161else
162 LINK_INSTALL_FLAGS=-sf
163 AC_MSG_RESULT([Enabling symlinks for install])
164fi
165,
166LINK_INSTALL_FLAGS=-f
Theodore Ts'o183c73b2012-05-12 23:13:24 -0400167AC_MSG_RESULT([Disabling symlinks for install by default])
Theodore Ts'o5aa6c3f2010-05-17 19:21:42 -0400168)
169AC_SUBST(LINK_INSTALL_FLAGS)
170dnl
Theodore Ts'o183c73b2012-05-12 23:13:24 -0400171dnl handle --enable-relative-symlinks
172dnl
173AC_ARG_ENABLE([symlink-relative-symlinks],
174[ --enable-relative-symlinks use relative symlinks when installing],
175if test "$enableval" = "no"
176then
177 SYMLINK_RELATIVE=
178 AC_MSG_RESULT([Disabling relative symlinks for install])
179else
180 SYMLINK_RELATIVE=--relative
181 AC_MSG_RESULT([Enabling symlinks for install])
182fi
183,
184 SYMLINK_RELATIVE=
185AC_MSG_RESULT([Disabling relative symlinks for install by default])
186)
187AC_SUBST(SYMLINK_RELATIVE)
188dnl
Theodore Ts'o5aa6c3f2010-05-17 19:21:42 -0400189dnl handle --enable-symlink-build
190dnl
191AC_ARG_ENABLE([symlink-build],
192[ --enable-symlink-build use symlinks while building instead of hard links],
193if test "$enableval" = "no"
194then
195 LINK_BUILD_FLAGS=
196 AC_MSG_RESULT([Disabling symlinks for build])
197else
198 LINK_BUILD_FLAGS=-s
199 AC_MSG_RESULT([Enabling symlinks for build])
200fi
201,
202LINK_BUILD_FLAGS=
Theodore Ts'o183c73b2012-05-12 23:13:24 -0400203AC_MSG_RESULT([Disabling symlinks for build by default])
Theodore Ts'o5aa6c3f2010-05-17 19:21:42 -0400204)
205AC_SUBST(LINK_BUILD_FLAGS)
206dnl
Theodore Ts'oc13351f2009-07-02 00:11:17 -0400207dnl handle --enable-verbose-makecmds
208dnl
209AC_ARG_ENABLE([verbose-makecmds],
Theodore Ts'o5aa6c3f2010-05-17 19:21:42 -0400210[ --enable-verbose-makecmds enable verbose make command output],
Theodore Ts'oc13351f2009-07-02 00:11:17 -0400211if test "$enableval" = "no"
212then
213 AC_MSG_RESULT([Disabling verbose make commands])
214 E=@echo
Theodore Ts'oc1986ec2012-06-13 15:29:13 -0400215 ES=echo
Theodore Ts'oc13351f2009-07-02 00:11:17 -0400216 Q=@
217else
218 AC_MSG_RESULT([Enabling verbose make commands])
219 E=@\\#
Theodore Ts'oc1986ec2012-06-13 15:29:13 -0400220 ES=\\#
Theodore Ts'oc13351f2009-07-02 00:11:17 -0400221 Q=
222fi
223,
224AC_MSG_RESULT([Disabling verbose make commands])
225E=@echo
Theodore Ts'oc1986ec2012-06-13 15:29:13 -0400226ES=echo
Theodore Ts'oc13351f2009-07-02 00:11:17 -0400227Q=@
228)
229AC_SUBST(E)
Theodore Ts'oc1986ec2012-06-13 15:29:13 -0400230AC_SUBST(ES)
Theodore Ts'oc13351f2009-07-02 00:11:17 -0400231AC_SUBST(Q)
232dnl
Theodore Ts'o19178752000-02-11 15:55:07 +0000233dnl handle --enable-compression
234dnl
235AC_ARG_ENABLE([compression],
236[ --enable-compression enable EXPERIMENTAL compression support],
237if test "$enableval" = "no"
238then
Theodore Ts'o02d04db2008-08-22 10:52:42 -0400239 AC_MSG_RESULT([Disabling compression support])
Theodore Ts'o19178752000-02-11 15:55:07 +0000240else
Theodore Ts'od1154eb2011-09-18 17:34:37 -0400241 AC_DEFINE(ENABLE_COMPRESSION, 1,
242 [Define to 1 if ext2 compression enabled])
Theodore Ts'o02d04db2008-08-22 10:52:42 -0400243 AC_MSG_RESULT([Enabling compression support])
244 AC_MSG_WARN([Compression support is experimental])
Theodore Ts'o19178752000-02-11 15:55:07 +0000245fi
246,
Theodore Ts'o02d04db2008-08-22 10:52:42 -0400247AC_MSG_RESULT([Disabling compression support by default])
Theodore Ts'o19178752000-02-11 15:55:07 +0000248)
249dnl
Theodore Ts'o8fdc9982002-06-25 23:26:34 -0400250dnl handle --enable-htree
251dnl
Theodore Ts'od1154eb2011-09-18 17:34:37 -0400252AH_TEMPLATE([ENABLE_HTREE], [Define to 1 if ext3/4 htree support enabled])
Theodore Ts'o8fdc9982002-06-25 23:26:34 -0400253AC_ARG_ENABLE([htree],
254[ --enable-htree enable EXPERIMENTAL htree directory support],
255if test "$enableval" = "no"
256then
257 HTREE_CMT=#
Theodore Ts'o02d04db2008-08-22 10:52:42 -0400258 AC_MSG_RESULT([Disabling htree directory support])
Theodore Ts'o8fdc9982002-06-25 23:26:34 -0400259else
260 HTREE_CMT=
Theodore Ts'od1154eb2011-09-18 17:34:37 -0400261 AC_DEFINE(ENABLE_HTREE, 1)
Theodore Ts'o02d04db2008-08-22 10:52:42 -0400262 AC_MSG_RESULT([Enabling htree directory support])
Theodore Ts'o8fdc9982002-06-25 23:26:34 -0400263fi
264,
Theodore Ts'o559ca6c2002-08-18 03:48:55 -0400265HTREE_CMT=
Theodore Ts'od1154eb2011-09-18 17:34:37 -0400266AC_DEFINE(ENABLE_HTREE, 1)
Theodore Ts'o02d04db2008-08-22 10:52:42 -0400267AC_MSG_RESULT([Enabling htree directory support by default])
Theodore Ts'o8fdc9982002-06-25 23:26:34 -0400268)
269AC_SUBST(HTREE_CMT)
270dnl
Theodore Ts'oa4ece352008-01-01 20:05:04 -0500271dnl This needs to be before all of the --enable-*-shlibs options
272dnl
273E2_PKG_CONFIG_STATIC=--static
Theodore Ts'o55da9872008-09-02 23:12:38 -0400274LDFLAG_DYNAMIC=
275PRIVATE_LIBS_CMT=
Theodore Ts'oa4ece352008-01-01 20:05:04 -0500276dnl
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000277dnl handle --enable-elf-shlibs
278dnl
279AC_ARG_ENABLE([elf-shlibs],
Theodore Ts'oa4d09611997-04-29 14:28:00 +0000280[ --enable-elf-shlibs select ELF shared libraries],
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000281if test "$enableval" = "no"
282then
283 ELF_CMT=#
284 MAKEFILE_ELF=/dev/null
Theodore Ts'o02d04db2008-08-22 10:52:42 -0400285 AC_MSG_RESULT([Disabling ELF shared libraries])
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000286else
Theodore Ts'oa4ece352008-01-01 20:05:04 -0500287 E2_PKG_CONFIG_STATIC=
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000288 ELF_CMT=
289 MAKEFILE_ELF=$srcdir/lib/Makefile.elf-lib
Theodore Ts'of5955dd2000-10-25 02:38:39 +0000290 [case "$host_os" in
291 solaris2.*)
292 MAKEFILE_ELF=$srcdir/lib/Makefile.solaris-lib
293 ;;
294 esac]
Theodore Ts'o74becf31997-04-26 14:37:06 +0000295 BINARY_TYPE=elfbin
Theodore Ts'oa4d09611997-04-29 14:28:00 +0000296 LIB_EXT=.so
Theodore Ts'o55da9872008-09-02 23:12:38 -0400297 PRIVATE_LIBS_CMT=#
298 LDFLAG_DYNAMIC=['-Wl,-rpath-link,$(top_builddir)/lib']
Theodore Ts'o02d04db2008-08-22 10:52:42 -0400299 AC_MSG_RESULT([Enabling ELF shared libraries])
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000300fi
301,
302MAKEFILE_ELF=/dev/null
303ELF_CMT=#
Theodore Ts'o02d04db2008-08-22 10:52:42 -0400304AC_MSG_RESULT([Disabling ELF shared libraries by default])
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000305)
306AC_SUBST(ELF_CMT)
307AC_SUBST_FILE(MAKEFILE_ELF)
308dnl
309dnl handle --enable-bsd-shlibs
310dnl
311AC_ARG_ENABLE([bsd-shlibs],
Theodore Ts'oa4d09611997-04-29 14:28:00 +0000312[ --enable-bsd-shlibs select BSD shared libraries],
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000313if test "$enableval" = "no"
314then
315 BSDLIB_CMT=#
316 MAKEFILE_BSDLIB=/dev/null
Theodore Ts'o02d04db2008-08-22 10:52:42 -0400317 AC_MSG_RESULT([Disabling BSD shared libraries])
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000318else
Theodore Ts'oa4ece352008-01-01 20:05:04 -0500319 E2_PKG_CONFIG_STATIC=
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000320 BSDLIB_CMT=
321 MAKEFILE_BSDLIB=$srcdir/lib/Makefile.bsd-lib
Theodore Ts'oa4d09611997-04-29 14:28:00 +0000322 LIB_EXT=.so
Theodore Ts'oe71d8732003-03-14 02:13:48 -0500323 [case "$host_os" in
Theodore Ts'oaa75ecc2003-03-17 10:01:22 -0500324 darwin*)
Theodore Ts'oe71d8732003-03-14 02:13:48 -0500325 MAKEFILE_BSDLIB=$srcdir/lib/Makefile.darwin-lib
326 LIB_EXT=.dylib
327 ;;
328 esac]
Theodore Ts'o02d04db2008-08-22 10:52:42 -0400329 AC_MSG_RESULT([Enabling BSD shared libraries])
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000330fi
331,
332MAKEFILE_BSDLIB=/dev/null
333BSDLIB_CMT=#
Theodore Ts'o02d04db2008-08-22 10:52:42 -0400334AC_MSG_RESULT([Disabling BSD shared libraries by default])
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000335)
336AC_SUBST(BSDLIB_CMT)
337AC_SUBST_FILE(MAKEFILE_BSDLIB)
338dnl
339dnl handle --enable-profile
340dnl
341AC_ARG_ENABLE([profile],
Theodore Ts'oa4d09611997-04-29 14:28:00 +0000342[ --enable-profile build profiling libraries],
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000343if test "$enableval" = "no"
344then
345 PROFILE_CMT=#
346 MAKEFILE_PROFILE=/dev/null
Theodore Ts'o02d04db2008-08-22 10:52:42 -0400347 AC_MSG_RESULT([Disabling profiling libraries])
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000348else
349 PROFILE_CMT=
350 MAKEFILE_PROFILE=$srcdir/lib/Makefile.profile
Theodore Ts'oa4d09611997-04-29 14:28:00 +0000351 PROFILED_LIB_EXT=_p.a
Theodore Ts'o02d04db2008-08-22 10:52:42 -0400352 AC_MSG_RESULT([Building profiling libraries])
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000353fi
354,
355PROFILE_CMT=#
356MAKEFILE_PROFILE=/dev/null
Theodore Ts'o02d04db2008-08-22 10:52:42 -0400357AC_MSG_RESULT([Disabling profiling libraries by default])
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000358)
359AC_SUBST(PROFILE_CMT)
360AC_SUBST_FILE(MAKEFILE_PROFILE)
361dnl
362dnl handle --enable-checker
363dnl
364AC_ARG_ENABLE([checker],
Theodore Ts'oa4d09611997-04-29 14:28:00 +0000365[ --enable-checker build checker libraries],
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000366if test "$enableval" = "no"
367then
368 CHECKER_CMT=#
369 MAKEFILE_CHECKER=/dev/null
Theodore Ts'o02d04db2008-08-22 10:52:42 -0400370 AC_MSG_RESULT([Disabling checker libraries])
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000371else
372 CHECKER_CMT=
373 MAKEFILE_CHECKER=$srcdir/lib/Makefile.checker
Theodore Ts'o02d04db2008-08-22 10:52:42 -0400374 AC_MSG_RESULT([Building checker libraries])
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000375fi
376,
377CHECKER_CMT=#
378MAKEFILE_CHECKER=/dev/null
Theodore Ts'o02d04db2008-08-22 10:52:42 -0400379AC_MSG_RESULT([Disabling checker libraries by default])
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000380)
381AC_SUBST(CHECKER_CMT)
382AC_SUBST_FILE(MAKEFILE_CHECKER)
383dnl
Theodore Ts'oa4d09611997-04-29 14:28:00 +0000384dnl Substitute library extensions
385dnl
386AC_SUBST(LIB_EXT)
387AC_SUBST(STATIC_LIB_EXT)
388AC_SUBST(PROFILED_LIB_EXT)
Theodore Ts'o55da9872008-09-02 23:12:38 -0400389AC_SUBST(LDFLAG_DYNAMIC)
390AC_SUBST(PRIVATE_LIBS_CMT)
Theodore Ts'oa4d09611997-04-29 14:28:00 +0000391dnl
Theodore Ts'o782bebf2002-11-08 18:46:45 -0500392dnl handle --enable-jbd-debug
Theodore Ts'ocdf186e2001-06-13 22:16:47 +0000393dnl
Theodore Ts'o782bebf2002-11-08 18:46:45 -0500394AC_ARG_ENABLE([jbd-debug],
395[ --enable-jbd-debug enable journal debugging],
Theodore Ts'ocdf186e2001-06-13 22:16:47 +0000396if test "$enableval" = "no"
397then
Theodore Ts'o02d04db2008-08-22 10:52:42 -0400398 AC_MSG_RESULT([Disabling journal debugging])
Theodore Ts'ocdf186e2001-06-13 22:16:47 +0000399else
Theodore Ts'od1154eb2011-09-18 17:34:37 -0400400 AC_DEFINE(CONFIG_JBD_DEBUG, 1,
401 [Define to 1 if debugging ext3/4 journal code])
Theodore Ts'o02d04db2008-08-22 10:52:42 -0400402 AC_MSG_RESULT([Enabling journal debugging])
Theodore Ts'ocdf186e2001-06-13 22:16:47 +0000403fi
404,
Theodore Ts'o02d04db2008-08-22 10:52:42 -0400405AC_MSG_RESULT([Disabling journal debugging by default])
Theodore Ts'ocdf186e2001-06-13 22:16:47 +0000406)
407dnl
Theodore Ts'of0a22d02003-02-22 13:19:53 -0500408dnl handle --enable-blkid-debug
409dnl
410AC_ARG_ENABLE([blkid-debug],
Theodore Ts'od21ae6c2003-05-05 09:00:24 -0400411[ --enable-blkid-debug enable blkid debugging],
Theodore Ts'of0a22d02003-02-22 13:19:53 -0500412if test "$enableval" = "no"
413then
Theodore Ts'o02d04db2008-08-22 10:52:42 -0400414 AC_MSG_RESULT([Disabling blkid debugging])
Theodore Ts'of0a22d02003-02-22 13:19:53 -0500415else
Theodore Ts'od1154eb2011-09-18 17:34:37 -0400416 AC_DEFINE(CONFIG_BLKID_DEBUG, 1,
417 [Define to 1 if debugging the blkid library])
Theodore Ts'o02d04db2008-08-22 10:52:42 -0400418 AC_MSG_RESULT([Enabling blkid debugging])
Theodore Ts'of0a22d02003-02-22 13:19:53 -0500419fi
420,
Theodore Ts'o02d04db2008-08-22 10:52:42 -0400421AC_MSG_RESULT([Disabling blkid debugging by default])
Theodore Ts'of0a22d02003-02-22 13:19:53 -0500422)
423dnl
Theodore Ts'o2a29f132003-05-05 12:08:47 -0400424dnl handle --enable-testio-debug
425dnl
426AC_ARG_ENABLE([testio-debug],
Theodore Ts'oaf773652008-09-01 11:27:27 -0400427[ --disable-testio-debug disable the use of the test I/O manager for debugging],
Theodore Ts'od1154eb2011-09-18 17:34:37 -0400428AH_TEMPLATE([CONFIG_TESTIO_DEBUG],
429 [Define to 1 if the testio I/O manager should be enabled])
Theodore Ts'o2a29f132003-05-05 12:08:47 -0400430if test "$enableval" = "no"
431then
Theodore Ts'o02d04db2008-08-22 10:52:42 -0400432 AC_MSG_RESULT([Disabling testio debugging])
Theodore Ts'oaf773652008-09-01 11:27:27 -0400433 TEST_IO_CMT="#"
Theodore Ts'o2a29f132003-05-05 12:08:47 -0400434else
Theodore Ts'oaf773652008-09-01 11:27:27 -0400435 TEST_IO_CMT=
Theodore Ts'od1154eb2011-09-18 17:34:37 -0400436 AC_DEFINE(CONFIG_TESTIO_DEBUG, 1)
Theodore Ts'o02d04db2008-08-22 10:52:42 -0400437 AC_MSG_RESULT([Enabling testio debugging])
Theodore Ts'o2a29f132003-05-05 12:08:47 -0400438fi
439,
Theodore Ts'oaf773652008-09-01 11:27:27 -0400440AC_MSG_RESULT([Enabling testio debugging by default])
Theodore Ts'od1154eb2011-09-18 17:34:37 -0400441AC_DEFINE(CONFIG_TESTIO_DEBUG, 1)
Theodore Ts'oaf773652008-09-01 11:27:27 -0400442TEST_IO_CMT=
Theodore Ts'o2a29f132003-05-05 12:08:47 -0400443)
Theodore Ts'oaf773652008-09-01 11:27:27 -0400444AC_SUBST(TEST_IO_CMT)
Theodore Ts'o2a29f132003-05-05 12:08:47 -0400445dnl
Scott James Remnant39fd3d42009-05-14 13:03:25 +0100446dnl handle --disable-libuuid
447dnl
448PKG_PROG_PKG_CONFIG
449LIBUUID=
450DEPLIBUUID=
451STATIC_LIBUUID=
452DEPSTATIC_LIBUUID=
453PROFILED_LIBUUID=
454DEPPROFILED_LIBUUID=
455UUID_CMT=
456AC_ARG_ENABLE([libuuid],
457[ --disable-libuuid do not build private uuid library],
458if test "$enableval" = "no"
459then
460 if test -z "$PKG_CONFIG"; then
461 AC_MSG_ERROR([pkg-config not installed; please install it.])
462 fi
463
464 AC_CHECK_LIB(uuid, uuid_generate,
465 [LIBUUID=`$PKG_CONFIG --libs uuid`;
466 STATIC_LIBUUID=`$PKG_CONFIG --static --libs uuid`],
467 [AC_MSG_ERROR([external uuid library not found])],
468 [$LIBUUID])
469 UUID_CMT=#
470 AC_MSG_RESULT([Disabling private uuid library])
471else
472 LIBUUID='$(LIB)/libuuid'$LIB_EXT
473 DEPLIBUUID=$LIBUUID
474 STATIC_LIBUUID='$(LIB)/libuuid'$STATIC_LIB_EXT
475 DEPSTATIC_LIBUUID=$STATIC_LIBUUID
476 PROFILED_LIBUUID='$(LIB)/libuuid'$PROFILED_LIB_EXT
477 DEPPROFILED_LIBUUID=$PROFILED_LIBUUID
478 AC_MSG_RESULT([Enabling private uuid library])
479fi
480,
481LIBUUID='$(LIB)/libuuid'$LIB_EXT
482DEPLIBUUID=$LIBUUID
483STATIC_LIBUUID='$(LIB)/libuuid'$STATIC_LIB_EXT
484DEPSTATIC_LIBUUID=$STATIC_LIBUUID
485PROFILED_LIBUUID='$(LIB)/libuuid'$PROFILED_LIB_EXT
486DEPPROFILED_LIBUUID=$PROFILED_LIBUUID
487AC_MSG_RESULT([Enabling private uuid library by default])
488)
489AC_SUBST(LIBUUID)
490AC_SUBST(DEPLIBUUID)
491AC_SUBST(STATIC_LIBUUID)
492AC_SUBST(DEPSTATIC_LIBUUID)
493AC_SUBST(PROFILED_LIBUUID)
494AC_SUBST(DEPPROFILED_LIBUUID)
495AC_SUBST(UUID_CMT)
496dnl
Theodore Ts'o14b596d2009-04-22 09:18:30 -0400497dnl handle --disable-libblkid
498dnl
499PKG_PROG_PKG_CONFIG
500LIBBLKID=
501DEPLIBBLKID=
502STATIC_LIBBLKID=
503DEPSTATIC_LIBBLKID=
504PROFILED_LIBBLKID=
505DEPPROFILED_LIBBLKID=
506BLKID_CMT=
Theodore Ts'od1154eb2011-09-18 17:34:37 -0400507AH_TEMPLATE([CONFIG_BUILD_FINDFS], [Define to 1 to compile findfs])
Theodore Ts'o14b596d2009-04-22 09:18:30 -0400508AC_ARG_ENABLE([libblkid],
509[ --disable-libblkid do not build private blkid library],
510if test "$enableval" = "no"
511then
512 if test -z "$PKG_CONFIG"; then
513 AC_MSG_ERROR([pkg-config not installed; please install it.])
514 fi
515
516 AC_CHECK_LIB(blkid, blkid_get_cache,
517 [LIBBLKID=`$PKG_CONFIG --libs blkid`;
518 STATIC_LIBBLKID=`$PKG_CONFIG --static --libs blkid`],
519 [AC_MSG_ERROR([external blkid library not found])],
520 [$LIBBLKID])
521 BLKID_CMT=#
522 AC_MSG_RESULT([Disabling private blkid library])
523else
524 LIBBLKID='$(LIB)/libblkid'$LIB_EXT
525 DEPLIBBLKID=$LIBBLKID
526 STATIC_LIBBLKID='$(LIB)/libblkid'$STATIC_LIB_EXT
527 DEPSTATIC_LIBBLKID=$STATIC_LIBBLKID
528 PROFILED_LIBBLKID='$(LIB)/libblkid'$PROFILED_LIB_EXT
529 DEPPROFILED_LIBBLKID=$PROFILED_LIBBLKID
Theodore Ts'od1154eb2011-09-18 17:34:37 -0400530 AC_DEFINE(CONFIG_BUILD_FINDFS, 1)
Theodore Ts'o14b596d2009-04-22 09:18:30 -0400531 AC_MSG_RESULT([Enabling private blkid library])
532fi
533,
534LIBBLKID='$(LIB)/libblkid'$LIB_EXT
535DEPLIBBLKID=$LIBBLKID
536STATIC_LIBBLKID='$(LIB)/libblkid'$STATIC_LIB_EXT
537DEPSTATIC_LIBBLKID=$STATIC_LIBBLKID
538PROFILED_LIBBLKID='$(LIB)/libblkid'$PROFILED_LIB_EXT
539DEPPROFILED_LIBBLKID=$PROFILED_LIBBLKID
Theodore Ts'od1154eb2011-09-18 17:34:37 -0400540AC_DEFINE(CONFIG_BUILD_FINDFS, 1)
Theodore Ts'o14b596d2009-04-22 09:18:30 -0400541AC_MSG_RESULT([Enabling private blkid library by default])
542)
543AC_SUBST(LIBBLKID)
544AC_SUBST(DEPLIBBLKID)
545AC_SUBST(STATIC_LIBBLKID)
546AC_SUBST(DEPSTATIC_LIBBLKID)
547AC_SUBST(PROFILED_LIBBLKID)
548AC_SUBST(DEPPROFILED_LIBBLKID)
549AC_SUBST(BLKID_CMT)
550dnl
Theodore Ts'o7becb202011-11-14 10:40:43 -0500551dnl handle --enable-quota
Aditya Kalif239fef2011-07-20 11:40:02 -0700552dnl
553PKG_PROG_PKG_CONFIG
Theodore Ts'o7becb202011-11-14 10:40:43 -0500554AH_TEMPLATE([CONFIG_QUOTA], [Define to 1 to enable quota support])
555AC_ARG_ENABLE([quota],
556[ --enable-libquota enable quota support],
Aditya Kalif239fef2011-07-20 11:40:02 -0700557if test "$enableval" = "no"
558then
Theodore Ts'o7becb202011-11-14 10:40:43 -0500559 AC_MSG_RESULT([Disabling quota support])
Aditya Kalif239fef2011-07-20 11:40:02 -0700560else
Theodore Ts'o7becb202011-11-14 10:40:43 -0500561 AC_DEFINE(CONFIG_QUOTA, 1)
562 AC_MSG_RESULT([Enabling quota support])
Aditya Kalif239fef2011-07-20 11:40:02 -0700563fi
564,
Theodore Ts'o7becb202011-11-14 10:40:43 -0500565AC_MSG_RESULT([Disabling quota support by default])
566)
567dnl
568dnl Define stuff expected for quota library
569dnl
Aditya Kalif239fef2011-07-20 11:40:02 -0700570LIBQUOTA='$(LIB)/libquota'$LIB_EXT
571DEPLIBQUOTA=$LIBQUOTA
572STATIC_LIBQUOTA='$(LIB)/libquota'$STATIC_LIB_EXT
573DEPSTATIC_LIBQUOTA=$STATIC_LIBQUOTA
574PROFILED_LIBQUOTA='$(LIB)/libquota'$PROFILED_LIB_EXT
575DEPPROFILED_LIBQUOTA=$PROFILED_LIBQUOTA
Aditya Kalif239fef2011-07-20 11:40:02 -0700576AC_SUBST(LIBQUOTA)
577AC_SUBST(DEPLIBQUOTA)
578AC_SUBST(STATIC_LIBQUOTA)
579AC_SUBST(DEPSTATIC_LIBQUOTA)
580AC_SUBST(PROFILED_LIBQUOTA)
581AC_SUBST(DEPPROFILED_LIBQUOTA)
582AC_SUBST(QUOTA_CMT)
583dnl
Theodore Ts'ocdf186e2001-06-13 22:16:47 +0000584dnl handle --enable-debugfs
585dnl
586AC_ARG_ENABLE([debugfs],
587[ --disable-debugfs disable support of debugfs program],
588if test "$enableval" = "no"
589then
Theodore Ts'o02d04db2008-08-22 10:52:42 -0400590 AC_MSG_RESULT([Disabling debugfs support])
Theodore Ts'ocdf186e2001-06-13 22:16:47 +0000591 DEBUGFS_CMT="#"
592else
593 DEBUGFS_CMT=
Theodore Ts'o02d04db2008-08-22 10:52:42 -0400594 AC_MSG_RESULT([Enabling debugfs support])
Theodore Ts'ocdf186e2001-06-13 22:16:47 +0000595fi
596,
Theodore Ts'o02d04db2008-08-22 10:52:42 -0400597AC_MSG_RESULT([Enabling debugfs support by default])
Theodore Ts'ocdf186e2001-06-13 22:16:47 +0000598DEBUGFS_CMT=
599)
600AC_SUBST(DEBUGFS_CMT)
601dnl
602dnl handle --enable-imager
603dnl
604AC_ARG_ENABLE([imager],
605[ --disable-imager disable support of e2image program],
606if test "$enableval" = "no"
607then
Theodore Ts'o02d04db2008-08-22 10:52:42 -0400608 AC_MSG_RESULT([Disabling e2image support])
Theodore Ts'ocdf186e2001-06-13 22:16:47 +0000609 IMAGER_CMT="#"
610else
611 IMAGER_CMT=
Theodore Ts'o02d04db2008-08-22 10:52:42 -0400612 AC_MSG_RESULT([Enabling e2image support])
Theodore Ts'ocdf186e2001-06-13 22:16:47 +0000613fi
614,
Theodore Ts'o02d04db2008-08-22 10:52:42 -0400615AC_MSG_RESULT([Enabling e2image support by default])
Theodore Ts'ocdf186e2001-06-13 22:16:47 +0000616IMAGER_CMT=
617)
618AC_SUBST(IMAGER_CMT)
619dnl
620dnl handle --enable-resizer
621dnl
622AC_ARG_ENABLE([resizer],
623[ --disable-resizer disable support of e2resize program],
624if test "$enableval" = "no"
625then
Theodore Ts'o02d04db2008-08-22 10:52:42 -0400626 AC_MSG_RESULT([Disabling e2resize support])
Theodore Ts'ocdf186e2001-06-13 22:16:47 +0000627 RESIZER_CMT="#"
628else
629 RESIZER_CMT=
Theodore Ts'o02d04db2008-08-22 10:52:42 -0400630 AC_MSG_RESULT([Enabling e2resize support])
Theodore Ts'ocdf186e2001-06-13 22:16:47 +0000631fi
632,
Theodore Ts'o02d04db2008-08-22 10:52:42 -0400633AC_MSG_RESULT([Enabling e2resize support by default])
Theodore Ts'ocdf186e2001-06-13 22:16:47 +0000634RESIZER_CMT=
635)
636AC_SUBST(RESIZER_CMT)
637dnl
Theodore Ts'o8d9c50c2010-12-24 15:19:44 -0500638dnl handle --enable-defrag
639dnl
640AC_ARG_ENABLE([defrag],
641[ --disable-defrag disable support of e4defrag program],
642if test "$enableval" = "no"
643then
644 AC_MSG_RESULT([Disabling e4defrag support])
645 DEFRAG_CMT="#"
646else
647 DEFRAG_CMT=
648 AC_MSG_RESULT([Enabling e4defrag support])
649fi
650,
651AC_MSG_RESULT([Enabling e4defrag support by default])
652DEFRAG_CMT=
653)
654AC_SUBST(DEFRAG_CMT)
655dnl
Theodore Ts'ofc6d9d51997-04-29 14:51:31 +0000656dnl See whether to install the `fsck' wrapper program (that calls e2fsck)
657dnl
658AC_ARG_ENABLE([fsck],
659[ --enable-fsck build fsck wrapper program],
660[if test "$enableval" = "no"
661then
662 FSCK_PROG='' FSCK_MAN=''
Theodore Ts'o02d04db2008-08-22 10:52:42 -0400663 AC_MSG_RESULT([Not building fsck wrapper])
Theodore Ts'ofc6d9d51997-04-29 14:51:31 +0000664else
665 FSCK_PROG=fsck FSCK_MAN=fsck.8
Theodore Ts'o02d04db2008-08-22 10:52:42 -0400666 AC_MSG_RESULT([Building fsck wrapper])
Theodore Ts'ofc6d9d51997-04-29 14:51:31 +0000667fi]
668,
669[case "$host_os" in
Theodore Ts'oe3632402004-05-04 19:39:54 -0400670 gnu*)
Theodore Ts'ofc6d9d51997-04-29 14:51:31 +0000671 FSCK_PROG='' FSCK_MAN=''
Theodore Ts'o02d04db2008-08-22 10:52:42 -0400672 AC_MSG_RESULT([Not building fsck wrapper by default])
Theodore Ts'ofc6d9d51997-04-29 14:51:31 +0000673 ;;
674 *)
675 FSCK_PROG=fsck FSCK_MAN=fsck.8
Theodore Ts'o02d04db2008-08-22 10:52:42 -0400676 AC_MSG_RESULT([Building fsck wrapper by default])
Theodore Ts'ofc6d9d51997-04-29 14:51:31 +0000677esac]
678)
679AC_SUBST(FSCK_PROG)
680AC_SUBST(FSCK_MAN)
681dnl
Theodore Ts'o5d407732004-09-18 14:53:14 -0400682dnl See whether to install the `e2initrd-helper' program
683dnl
684AC_ARG_ENABLE([e2initrd-helper],
685[ --enable-e2initrd-helper build e2initrd-helper program],
686[if test "$enableval" = "no"
687then
688 E2INITRD_PROG='' E2INITRD_MAN=''
Theodore Ts'o02d04db2008-08-22 10:52:42 -0400689 AC_MSG_RESULT([Not building e2initrd helper])
Theodore Ts'o5d407732004-09-18 14:53:14 -0400690else
691 E2INITRD_PROG=e2initrd_helper E2INITRD_MAN=e2initrd_helper.8
Theodore Ts'o02d04db2008-08-22 10:52:42 -0400692 AC_MSG_RESULT([Building e2initrd helper])
Theodore Ts'o5d407732004-09-18 14:53:14 -0400693fi]
694,
695E2INITRD_PROG=e2initrd_helper E2INITRD_MAN=e2initrd_helper.8
Theodore Ts'o02d04db2008-08-22 10:52:42 -0400696AC_MSG_RESULT([Building e2initrd helper by default])
Theodore Ts'o5d407732004-09-18 14:53:14 -0400697)
698AC_SUBST(E2INITRD_PROG)
699AC_SUBST(E2INITRD_MAN)
Karel Zak4db2f592006-03-08 14:17:28 -0500700dnl
Theodore Ts'o5d407732004-09-18 14:53:14 -0400701dnl
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000702dnl
Theodore Ts'o32493942007-12-31 10:45:01 -0500703AC_ARG_ENABLE([tls],
704[ --disable-tls disable use of thread local support],
705[if test "$enableval" = "no"
706then
707 try_tls=""
Theodore Ts'o02d04db2008-08-22 10:52:42 -0400708 AC_MSG_RESULT([Disabling thread local support])
Theodore Ts'o32493942007-12-31 10:45:01 -0500709else
710 try_tls="yes"
Theodore Ts'o02d04db2008-08-22 10:52:42 -0400711 AC_MSG_RESULT([Enabling thread local support])
Theodore Ts'o32493942007-12-31 10:45:01 -0500712fi]
713,
Theodore Ts'oeafba6c2008-07-10 10:21:42 -0400714if test -n "$WITH_DIET_LIBC"
715then
716 try_tls=""
Theodore Ts'o02d04db2008-08-22 10:52:42 -0400717 AC_MSG_RESULT([Diet libc does not support thread local support])
Theodore Ts'oeafba6c2008-07-10 10:21:42 -0400718else
719 try_tls="yes"
Theodore Ts'o02d04db2008-08-22 10:52:42 -0400720 AC_MSG_RESULT([Try using thread local support by default])
Theodore Ts'oeafba6c2008-07-10 10:21:42 -0400721fi
Theodore Ts'o32493942007-12-31 10:45:01 -0500722)
723if test "$try_tls" = "yes"
724then
725AX_TLS
726fi
727dnl
728dnl
729dnl
Theodore Ts'od1154eb2011-09-18 17:34:37 -0400730AH_TEMPLATE([USE_UUIDD], [Define to 1 to build uuidd])
Theodore Ts'o5610f992007-12-31 11:16:56 -0500731AC_ARG_ENABLE([uuidd],
732[ --disable-uuidd disable building the uuid daemon],
733[if test "$enableval" = "no"
734then
Theodore Ts'o02d04db2008-08-22 10:52:42 -0400735 AC_MSG_RESULT([Not building uuidd])
Theodore Ts'o5610f992007-12-31 11:16:56 -0500736 UUIDD_CMT="#"
737else
Theodore Ts'od1154eb2011-09-18 17:34:37 -0400738 AC_DEFINE(USE_UUIDD, 1)
Theodore Ts'o5610f992007-12-31 11:16:56 -0500739 UUIDD_CMT=""
Theodore Ts'o02d04db2008-08-22 10:52:42 -0400740 AC_MSG_RESULT([Building uuidd])
Theodore Ts'o5610f992007-12-31 11:16:56 -0500741fi]
742,
Theodore Ts'od1154eb2011-09-18 17:34:37 -0400743AC_DEFINE(USE_UUIDD, 1)
Theodore Ts'o5610f992007-12-31 11:16:56 -0500744UUIDD_CMT=""
Theodore Ts'o02d04db2008-08-22 10:52:42 -0400745AC_MSG_RESULT([Building uuidd by default])
Theodore Ts'o5610f992007-12-31 11:16:56 -0500746)
747AC_SUBST(UUIDD_CMT)
748dnl
Tony Breedsd6a4bcb2012-06-26 11:42:15 +1000749dnl handle --disable-mmp
750dnl
751AH_TEMPLATE([CONFIG_MMP], [Define to 1 to enable mmp support])
752AC_ARG_ENABLE([mmp],
753[ --disable-mmp disable support mmp, Multi Mount Protection],
754if test "$enableval" = "no"
755then
756 AC_MSG_RESULT([Disabling mmp support])
757else
758 AC_MSG_RESULT([Enabling mmp support])
759 AC_DEFINE(CONFIG_MMP, 1)
760fi
761,
762AC_MSG_RESULT([Enabling mmp support by default])
763AC_DEFINE(CONFIG_MMP, 1)
764)
765dnl
Tony Breeds1625bf42012-07-30 14:44:12 -0400766dnl handle --disable-bmap-stats
767dnl
768AH_TEMPLATE([ENABLE_BMAP_STATS], [Define to 1 to enable bitmap stats.])
769AC_ARG_ENABLE([bmap-stats],
770[ --disable-bmap-stats disable collection of bitmap stats.],
771if test "$enableval" = "no"
772then
773 AC_MSG_RESULT([Disabling bitmap statistics support])
774else
775 AC_MSG_RESULT([Enabling bitmap statistics support])
776 AC_DEFINE(ENABLE_BMAP_STATS, 1)
777fi
778,
779AC_MSG_RESULT([Enabling bitmap statistics support by default])
780AC_DEFINE(ENABLE_BMAP_STATS, 1)
781)
782dnl
783dnl handle --enable-bmap-stats-ops
784dnl
785AH_TEMPLATE([ENABLE_BMAP_STATS_OPS], [Define to 1 to enable bitmap stats.])
786AC_ARG_ENABLE([bmap-stats-ops],
787[ --enable-bmap-stats-ops enable collection of additional bitmap stats],
788if test "$enableval" = "no"
789then
790 AC_MSG_RESULT([Disabling additional bitmap statistics])
791else
792 dnl There has to be a better way!
793 AS_IF([test "x${enable_bmap_stats}" = "xno"],
794 AC_MSG_FAILURE([Error --enable-bmap-stats-ops requires bmap-stats]))
795
796 AC_MSG_RESULT([Enabling additional bitmap statistics])
797 AC_DEFINE(ENABLE_BMAP_STATS_OPS, 1)
798fi
799,
800AC_MSG_RESULT([Disabling additional bitmap statistics by default])
801)
802dnl
Theodore Ts'o5610f992007-12-31 11:16:56 -0500803dnl
804dnl
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000805MAKEFILE_LIBRARY=$srcdir/lib/Makefile.library
806AC_SUBST_FILE(MAKEFILE_LIBRARY)
807dnl
Theodore Ts'ocdf186e2001-06-13 22:16:47 +0000808dnl Add internationalization support, using gettext.
809dnl
Theodore Ts'ob0cacab2004-11-30 19:00:19 -0500810GETTEXT_PACKAGE=e2fsprogs
Theodore Ts'ocdf186e2001-06-13 22:16:47 +0000811PACKAGE=e2fsprogs
812VERSION="$E2FSPROGS_VERSION"
Theodore Ts'ob0cacab2004-11-30 19:00:19 -0500813VERSION=0.14.1
Theodore Ts'od1154eb2011-09-18 17:34:37 -0400814AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [package name for gettext])
815AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [version for gettext])
Theodore Ts'ob0cacab2004-11-30 19:00:19 -0500816AC_SUBST(GETTEXT_PACKAGE)
Theodore Ts'ocdf186e2001-06-13 22:16:47 +0000817AC_SUBST(PACKAGE)
818AC_SUBST(VERSION)
819
Theodore Ts'ocdf186e2001-06-13 22:16:47 +0000820AM_GNU_GETTEXT
821dnl
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000822dnl End of configuration options
823dnl
Theodore Ts'o74becf31997-04-26 14:37:06 +0000824AC_SUBST(BINARY_TYPE)
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000825AC_PROG_MAKE_SET
Theodore Ts'obcb915b2009-07-02 18:19:10 -0400826CHECK_GNU_MAKE
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000827AC_PATH_PROG(LN, ln, ln)
Theodore Ts'ofc6d9d51997-04-29 14:51:31 +0000828AC_PROG_LN_S
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000829AC_PATH_PROG(MV, mv, mv)
830AC_PATH_PROG(CP, cp, cp)
831AC_PATH_PROG(RM, rm, rm)
832AC_PATH_PROG(CHMOD, chmod, :)
Theodore Ts'o32237012005-01-17 19:13:39 -0500833AC_PROG_AWK
834AC_PROG_EGREP
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000835AC_PATH_PROG(SED, sed, sed)
Theodore Ts'o9d564f71999-07-03 20:25:58 +0000836AC_PATH_PROG(PERL, perl, perl)
Theodore Ts'o250f79f2001-05-19 22:02:22 +0000837AC_PATH_PROG(LDCONFIG, ldconfig, :)
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000838AC_CHECK_TOOL(AR, ar, ar)
839AC_CHECK_TOOL(RANLIB, ranlib, :)
840AC_CHECK_TOOL(STRIP, strip, :)
Manish Katiyar7321d942008-04-14 17:20:03 +0530841AC_CHECK_PROG(MAKEINFO, makeinfo, makeinfo, )
842if test "_$MAKEINFO" = "_"; then
843 MAKEINFO="@echo Makeinfo is missing. Info documentation will not be built.;true"
844else
845 case "$MAKEINFO" in
846 */missing.*)
847 AC_MSG_WARN([
848*** Makeinfo is missing. Info documentation will not be built.])
849 ;;
850 *)
851 ;;
852 esac
853fi
854AC_SUBST(MAKEINFO)
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000855AC_PROG_INSTALL
Theodore Ts'o6c133521999-07-03 20:37:03 +0000856# See if we need a separate native compiler.
857if test $cross_compiling = no; then
858 BUILD_CC="$CC"
859 AC_SUBST(BUILD_CC)
860else
861 AC_CHECK_PROGS(BUILD_CC, gcc cc)
862fi
Mike Frysinger677fc912012-03-06 20:13:54 -0500863AC_CHECK_HEADERS(m4_flatten([
864 dirent.h
865 errno.h
866 execinfo.h
867 getopt.h
868 malloc.h
869 mntent.h
870 paths.h
871 semaphore.h
872 setjmp.h
873 signal.h
874 stdarg.h
875 stdint.h
876 stdlib.h
877 termios.h
878 termio.h
879 unistd.h
880 utime.h
881 linux/falloc.h
882 linux/fd.h
883 linux/major.h
884 net/if_dl.h
885 netinet/in.h
886 sys/disklabel.h
887 sys/file.h
888 sys/ioctl.h
889 sys/mkdev.h
890 sys/mman.h
891 sys/prctl.h
892 sys/queue.h
893 sys/resource.h
894 sys/select.h
895 sys/socket.h
896 sys/sockio.h
897 sys/stat.h
898 sys/syscall.h
899 sys/sysmacros.h
900 sys/time.h
901 sys/types.h
902 sys/un.h
903 sys/wait.h
904]))
Theodore Ts'oda76d6b2005-01-18 23:29:01 -0500905AC_CHECK_HEADERS(sys/disk.h sys/mount.h,,,
906[[
907#if HAVE_SYS_QUEUE_H
908#include <sys/queue.h>
909#endif
910]])
911AC_CHECK_HEADERS(net/if.h,,,
912[[
913#if HAVE_SYS_TYPES_H
914#include <sys/types.h>
915#endif
916#if HAVE_SYS_SOCKET
917#include <sys/socket.h>
918#endif
919]])
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000920AC_FUNC_VPRINTF
Theodore Ts'offf45482003-04-13 00:44:19 -0400921dnl Check to see if dirent has member d_reclen. On cygwin those d_reclen
922dnl is not decleared.
Theodore Ts'od1154eb2011-09-18 17:34:37 -0400923AC_CHECK_MEMBER(struct dirent.d_reclen,[AC_DEFINE(HAVE_RECLEN_DIRENT, 1,
924 [Define to 1 if dirent has d_reclen])],,
Theodore Ts'o6c65d252005-01-19 12:59:48 -0500925 [#include <dirent.h>])
Theodore Ts'od1154eb2011-09-18 17:34:37 -0400926dnl Check to see if ssize_t was declared
927AC_CHECK_TYPE(ssize_t,[AC_DEFINE(HAVE_TYPE_SSIZE_T, 1,
928 [Define to 1 if ssize_t declared])],,
Theodore Ts'o6c65d252005-01-19 12:59:48 -0500929 [#include <sys/types.h>])
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000930dnl
Theodore Ts'ob0b9c4d1997-10-20 23:36:30 +0000931dnl Check to see if llseek() is declared in unistd.h. On some libc's
932dnl it is, and on others it isn't..... Thank you glibc developers....
933dnl
Theodore Ts'od1154eb2011-09-18 17:34:37 -0400934AC_CHECK_DECL(llseek,[AC_DEFINE(HAVE_LLSEEK_PROTOTYPE, 1,
935 [Define to 1 if llseek declared in unistd.h])],,
Theodore Ts'o6c65d252005-01-19 12:59:48 -0500936 [#include <unistd.h>])
Theodore Ts'ob0b9c4d1997-10-20 23:36:30 +0000937dnl
Theodore Ts'o6928adc2000-05-25 23:28:50 +0000938dnl Check to see if lseek64() is declared in unistd.h. Glibc's header files
939dnl are so convoluted that I can't tell whether it will always be defined,
940dnl and if it isn't defined while lseek64 is defined in the library,
941dnl disaster will strike.
942dnl
943dnl Warning! Use of --enable-gcc-wall may throw off this test.
944dnl
945dnl
Theodore Ts'od1154eb2011-09-18 17:34:37 -0400946AC_CHECK_DECL(lseek64,[AC_DEFINE(HAVE_LSEEK64_PROTOTYPE, 1,
947 [Define to 1 if lseek64 declared in unistd.h])],,
Theodore Ts'o6c65d252005-01-19 12:59:48 -0500948 [#define _LARGEFILE_SOURCE
949 #define _LARGEFILE64_SOURCE
950 #include <unistd.h>])
Theodore Ts'o6928adc2000-05-25 23:28:50 +0000951dnl
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000952dnl Word sizes...
953dnl
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000954AC_CHECK_SIZEOF(short)
955AC_CHECK_SIZEOF(int)
956AC_CHECK_SIZEOF(long)
Theodore Ts'ofc6d9d51997-04-29 14:51:31 +0000957AC_CHECK_SIZEOF(long long)
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000958SIZEOF_SHORT=$ac_cv_sizeof_short
959SIZEOF_INT=$ac_cv_sizeof_int
960SIZEOF_LONG=$ac_cv_sizeof_long
Theodore Ts'ofc6d9d51997-04-29 14:51:31 +0000961SIZEOF_LONG_LONG=$ac_cv_sizeof_long_long
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000962AC_SUBST(SIZEOF_SHORT)
963AC_SUBST(SIZEOF_INT)
964AC_SUBST(SIZEOF_LONG)
Theodore Ts'ofc6d9d51997-04-29 14:51:31 +0000965AC_SUBST(SIZEOF_LONG_LONG)
Theodore Ts'o877eb6d2001-06-11 06:54:13 +0000966AC_C_BIGENDIAN
Theodore Ts'o29a5dee2007-07-04 16:28:47 -0400967BUILD_CC="$BUILD_CC" CPP="$CPP" /bin/sh $ac_aux_dir/parse-types.sh
Theodore Ts'o4ea7ea02006-04-09 08:41:55 -0400968ASM_TYPES_HEADER=./asm_types.h
969AC_SUBST_FILE(ASM_TYPES_HEADER)
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000970dnl
Theodore Ts'o488c75a2008-06-07 08:55:21 -0400971dnl Save the configuration #defines needed for the public ext2fs.h
972dnl header file
973dnl
974echo "/* These defines are needed for the public ext2fs.h header file */" \
975 > public_config.h
976if grep HAVE_SYS_TYPES_H confdefs.h > tmp_config.$$; then
977 uniq tmp_config.$$ >> public_config.h
978else
979 echo "#undef HAVE_SYS_TYPES_H" >> public_config.h
980fi
981if grep WORDS_BIGENDIAN confdefs.h > tmp_config.$$; then
982 uniq tmp_config.$$ >> public_config.h
983else
984 echo "#undef WORDS_BIGENDIAN" >> public_config.h
985fi
986rm -f tmp_config.$$
987PUBLIC_CONFIG_HEADER=./public_config.h
988AC_SUBST_FILE(PUBLIC_CONFIG_HEADER)
989dnl
Theodore Ts'o0c193f82003-08-01 14:26:23 -0400990dnl See if we have inttypes.h and if intptr_t is defined
991dnl
992AC_CHECK_HEADERS([inttypes.h])
Theodore Ts'od2ee56d2005-01-09 00:57:45 -0500993AC_CHECK_TYPES(intptr_t)
Theodore Ts'o0c193f82003-08-01 14:26:23 -0400994dnl
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000995dnl See if struct stat has a st_flags field, in which case we can get file
996dnl flags somewhat portably. Also check for the analogous setter, chflags().
997dnl
998AC_MSG_CHECKING(whether struct stat has a st_flags field)
999AC_CACHE_VAL(e2fsprogs_cv_struct_st_flags,
1000 AC_TRY_COMPILE([#include <sys/stat.h>],
1001 [struct stat stat; stat.st_flags = 0;],
1002 [e2fsprogs_cv_struct_st_flags=yes],
1003 [e2fsprogs_cv_struct_st_flags=no]))
1004AC_MSG_RESULT($e2fsprogs_cv_struct_st_flags)
1005if test "$e2fsprogs_cv_struct_st_flags" = yes; then
Theodore Ts'oc03bc4e1999-10-20 18:20:36 +00001006 AC_MSG_CHECKING(whether st_flags field is useful)
1007 AC_CACHE_VAL(e2fsprogs_cv_struct_st_flags_immut,
1008 AC_TRY_COMPILE([#include <sys/stat.h>],
1009 [struct stat stat; stat.st_flags |= UF_IMMUTABLE;],
1010 [e2fsprogs_cv_struct_st_flags_immut=yes],
1011 [e2fsprogs_cv_struct_st_flags_immut=no]))
1012 AC_MSG_RESULT($e2fsprogs_cv_struct_st_flags_immut)
1013 if test "$e2fsprogs_cv_struct_st_flags_immut" = yes; then
Theodore Ts'od1154eb2011-09-18 17:34:37 -04001014 AC_DEFINE(HAVE_STAT_FLAGS, 1,
1015 [Define to 1 if struct stat has st_flags])
Theodore Ts'oc03bc4e1999-10-20 18:20:36 +00001016 fi
Theodore Ts'o50e1e101997-04-26 13:58:21 +00001017fi
Theodore Ts'o84ea6e72004-03-19 19:29:17 -05001018dnl
1019dnl Check for the presence of SA_LEN
1020dnl
Theodore Ts'o6c65d252005-01-19 12:59:48 -05001021AC_CHECK_MEMBER(struct sockaddr.sa_len,
Theodore Ts'od1154eb2011-09-18 17:34:37 -04001022 AC_DEFINE_UNQUOTED(HAVE_SA_LEN,1,
1023 [Define to 1 if if struct sockaddr contains sa_len]),,
Theodore Ts'o6c65d252005-01-19 12:59:48 -05001024 [#include <sys/types.h>
1025 #include <sys/socket.h>])
Theodore Ts'o84ea6e72004-03-19 19:29:17 -05001026dnl
Eric Sandeen9ed8e5f2009-10-02 11:32:42 -05001027dnl This will add -lblkid to the AC_CHECK_FUNCS search if we are using
1028dnl the system-provided blkid library
1029dnl
1030if test -n "$BLKID_CMT"; then
1031 AC_SEARCH_LIBS([blkid_probe_all], [blkid])
1032fi
1033dnl
Mike Frysinger677fc912012-03-06 20:13:54 -05001034AC_CHECK_FUNCS(m4_flatten([
1035 __secure_getenv
1036 backtrace
1037 blkid_probe_get_topology
1038 chflags
1039 fallocate
1040 fallocate64
1041 fchown
1042 fdatasync
1043 fstat64
1044 ftruncate64
1045 getdtablesize
1046 getmntinfo
Theodore Ts'o25ff7722012-04-05 15:16:50 -07001047 getpwuid_r
Mike Frysinger677fc912012-03-06 20:13:54 -05001048 getrlimit
1049 getrusage
1050 jrand48
1051 llseek
1052 lseek64
1053 mallinfo
1054 mbstowcs
1055 memalign
1056 mmap
1057 msync
1058 nanosleep
1059 open64
1060 pathconf
1061 posix_fadvise
1062 posix_memalign
1063 prctl
Theodore Ts'ob24efa22012-04-05 15:31:09 -07001064 setmntent
Mike Frysinger677fc912012-03-06 20:13:54 -05001065 setresgid
1066 setresuid
1067 srandom
1068 strcasecmp
1069 strdup
1070 strnlen
1071 strptime
1072 strtoull
1073 sync_file_range
1074 sysconf
1075 usleep
1076 utime
1077 valloc
1078]))
Theodore Ts'ofc6d9d51997-04-29 14:51:31 +00001079dnl
Theodore Ts'ofc6d9d51997-04-29 14:51:31 +00001080dnl Check to see if -lsocket is required (solaris) to make something
1081dnl that uses socket() to compile; this is needed for the UUID library
1082dnl
1083SOCKET_LIB=''
1084AC_CHECK_LIB(socket, socket, [SOCKET_LIB=-lsocket])
1085AC_SUBST(SOCKET_LIB)
1086dnl
Theodore Ts'o50e1e101997-04-26 13:58:21 +00001087dnl See if optreset exists
1088dnl
1089AC_MSG_CHECKING(for optreset)
1090AC_CACHE_VAL(ac_cv_have_optreset,
1091[AC_EGREP_HEADER(optreset, unistd.h,
1092 ac_cv_have_optreset=yes, ac_cv_have_optreset=no)])dnl
1093AC_MSG_RESULT($ac_cv_have_optreset)
1094if test $ac_cv_have_optreset = yes; then
Theodore Ts'od1154eb2011-09-18 17:34:37 -04001095 AC_DEFINE(HAVE_OPTRESET, 1, [Define to 1 if optreset for getopt is present])
Theodore Ts'o50e1e101997-04-26 13:58:21 +00001096fi
1097dnl
Theodore Ts'od7f45af2008-09-12 10:15:26 -04001098dnl Test for sem_init, and which library it might require:
1099dnl
Theodore Ts'od1154eb2011-09-18 17:34:37 -04001100AH_TEMPLATE([HAVE_SEM_INIT], [Define to 1 if sem_init() exists])
Theodore Ts'od7f45af2008-09-12 10:15:26 -04001101SEM_INIT_LIB=''
1102AC_CHECK_FUNC(sem_init, ,
1103 AC_CHECK_LIB(pthread, sem_init,
Theodore Ts'od1154eb2011-09-18 17:34:37 -04001104 AC_DEFINE(HAVE_SEM_INIT, 1)
Theodore Ts'od7f45af2008-09-12 10:15:26 -04001105 SEM_INIT_LIB=-lpthread,
1106 AC_CHECK_LIB(rt, sem_init,
Theodore Ts'od1154eb2011-09-18 17:34:37 -04001107 AC_DEFINE(HAVE_SEM_INIT, 1)
Theodore Ts'od7f45af2008-09-12 10:15:26 -04001108 SEM_INIT_LIB=-lrt,
1109 AC_CHECK_LIB(posix4, sem_init,
Theodore Ts'od1154eb2011-09-18 17:34:37 -04001110 AC_DEFINE(HAVE_SEM_INIT, 1)
Theodore Ts'od7f45af2008-09-12 10:15:26 -04001111 SEM_INIT_LIB=-lposix4))))dnl
1112AC_SUBST(SEM_INIT_LIB)
1113dnl
Theodore Ts'oe54635d2006-08-06 14:33:13 -04001114dnl Check for unified diff
1115dnl
1116AC_MSG_CHECKING(for unified diff option)
Theodore Ts'o27f991b2008-04-01 20:32:55 -04001117if diff -u $0 $0 > /dev/null 2>&1 ; then
Theodore Ts'oe54635d2006-08-06 14:33:13 -04001118 UNI_DIFF_OPTS=-u
1119else
1120 UNI_DIFF_OPTS=-c
1121fi
1122AC_MSG_RESULT($UNI_DIFF_OPTS)
1123AC_SUBST(UNI_DIFF_OPTS)
1124dnl
Theodore Ts'o8f3f29d2000-02-11 05:04:44 +00001125dnl We use the EXT2 ioctls only under Linux
Theodore Ts'o50e1e101997-04-26 13:58:21 +00001126dnl
Theodore Ts'o8f3f29d2000-02-11 05:04:44 +00001127case "$host_os" in
1128linux*)
Theodore Ts'od1154eb2011-09-18 17:34:37 -04001129 AC_DEFINE(HAVE_EXT2_IOCTLS, 1, [Define to 1 if Ext2 ioctls present])
Theodore Ts'o8f3f29d2000-02-11 05:04:44 +00001130 ;;
1131esac
Theodore Ts'o50e1e101997-04-26 13:58:21 +00001132dnl
Theodore Ts'offf45482003-04-13 00:44:19 -04001133dnl OS-specific uncomment control
Theodore Ts'oe6f2bda2002-08-18 03:37:10 -04001134dnl
1135LINUX_CMT="#"
Theodore Ts'offf45482003-04-13 00:44:19 -04001136CYGWIN_CMT="#"
1137UNIX_CMT=
Theodore Ts'oe6f2bda2002-08-18 03:37:10 -04001138case "$host_os" in
1139linux*)
1140 LINUX_CMT=
1141 ;;
Theodore Ts'offf45482003-04-13 00:44:19 -04001142cygwin)
1143 CYGWIN_CMT=
1144 UNIX_CMT="#"
Theodore Ts'offf45482003-04-13 00:44:19 -04001145 ;;
Theodore Ts'oe6f2bda2002-08-18 03:37:10 -04001146esac
1147AC_SUBST(LINUX_CMT)
Theodore Ts'offf45482003-04-13 00:44:19 -04001148AC_SUBST(CYGWIN_CMT)
1149AC_SUBST(UNIX_CMT)
Theodore Ts'oe6f2bda2002-08-18 03:37:10 -04001150dnl
Theodore Ts'o6c133521999-07-03 20:37:03 +00001151dnl Linux and Hurd places root files in the / by default
Theodore Ts'o50e1e101997-04-26 13:58:21 +00001152dnl
Theodore Ts'o50e1e101997-04-26 13:58:21 +00001153case "$host_os" in
Theodore Ts'o93636bd2003-07-12 02:45:05 -04001154linux* | gnu* | k*bsd*-gnu)
Theodore Ts'oa4b2d3c1998-04-03 16:12:25 +00001155 if test "$prefix" = NONE -a "$root_prefix" = NONE ; then
1156 root_prefix="";
Theodore Ts'o02d04db2008-08-22 10:52:42 -04001157 AC_MSG_RESULT([On $host_os systems, root_prefix defaults to ''])
Theodore Ts'ofc6d9d51997-04-29 14:51:31 +00001158 fi
1159 ;;
1160esac
Theodore Ts'ofc6d9d51997-04-29 14:51:31 +00001161dnl
Theodore Ts'oa4b2d3c1998-04-03 16:12:25 +00001162dnl On Linux/hurd, force the prefix to be /usr
Theodore Ts'ofc6d9d51997-04-29 14:51:31 +00001163dnl
1164case "$host_os" in
Theodore Ts'o93636bd2003-07-12 02:45:05 -04001165linux* | gnu* | k*bsd*-gnu)
Theodore Ts'ofc6d9d51997-04-29 14:51:31 +00001166 if test "$prefix" = NONE ; then
Theodore Ts'oa4b2d3c1998-04-03 16:12:25 +00001167 prefix="/usr";
Theodore Ts'o02d04db2008-08-22 10:52:42 -04001168 AC_MSG_RESULT([On $host_os systems, prefix defaults to /usr])
Theodore Ts'obff61a72002-05-21 22:21:38 -04001169 if test "$mandir" = '${prefix}/man' ; then
Theodore Ts'o02d04db2008-08-22 10:52:42 -04001170 AC_MSG_RESULT([...and mandir defaults to /usr/share/man])
Theodore Ts'obff61a72002-05-21 22:21:38 -04001171 mandir=/usr/share/man
1172 fi
Theodore Ts'o50e1e101997-04-26 13:58:21 +00001173 fi
1174;;
1175esac
Theodore Ts'oa4b2d3c1998-04-03 16:12:25 +00001176if test "$root_prefix" = NONE ; then
Theodore Ts'offe19911998-04-08 06:05:49 +00001177 if test "$prefix" = NONE ; then
Theodore Ts'oa4b2d3c1998-04-03 16:12:25 +00001178 root_prefix="$ac_default_prefix"
1179 else
1180 root_prefix="$prefix"
1181 fi
Theodore Ts'ob5ffead2002-05-11 19:17:00 -04001182 root_bindir=$bindir
1183 root_sbindir=$sbindir
1184 root_libdir=$libdir
1185 root_sysconfdir=$sysconfdir
1186else
1187 root_bindir='${root_prefix}/bin'
1188 root_sbindir='${root_prefix}/sbin'
1189 root_libdir='${root_prefix}/lib'
1190 root_sysconfdir='${root_prefix}/etc'
Theodore Ts'oa4b2d3c1998-04-03 16:12:25 +00001191fi
Theodore Ts'oc4ef11c2008-01-04 16:55:37 -05001192if test "$bindir" != '${exec_prefix}/bin'; then
1193 root_bindir=$bindir
Theodore Ts'o02d04db2008-08-22 10:52:42 -04001194 AC_MSG_RESULT([Setting root_bindir to $root_bindir])
Theodore Ts'oc4ef11c2008-01-04 16:55:37 -05001195fi
1196if test "$sbindir" != '${exec_prefix}/sbin'; then
1197 root_sbindir=$sbindir
Theodore Ts'o02d04db2008-08-22 10:52:42 -04001198 AC_MSG_RESULT([Setting root_sbindir to $root_sbindir])
Theodore Ts'oc4ef11c2008-01-04 16:55:37 -05001199fi
1200if test "$libdir" != '${exec_prefix}/lib'; then
1201 root_libdir=$libdir
Theodore Ts'o02d04db2008-08-22 10:52:42 -04001202 AC_MSG_RESULT([Setting root_libdir to $root_libdir])
Theodore Ts'oc4ef11c2008-01-04 16:55:37 -05001203fi
1204if test "$sysconfdir" != '${prefix}/etc'; then
1205 root_sysconfdir=$sysconfdir
Theodore Ts'o02d04db2008-08-22 10:52:42 -04001206 AC_MSG_RESULT([Setting root_sysconfdir to $root_sysconfdir])
Theodore Ts'oc4ef11c2008-01-04 16:55:37 -05001207fi
Theodore Ts'oa4b2d3c1998-04-03 16:12:25 +00001208AC_SUBST(root_prefix)
Theodore Ts'ob5ffead2002-05-11 19:17:00 -04001209AC_SUBST(root_bindir)
1210AC_SUBST(root_sbindir)
1211AC_SUBST(root_libdir)
1212AC_SUBST(root_sysconfdir)
Theodore Ts'o50e1e101997-04-26 13:58:21 +00001213dnl
Theodore Ts'o55e00a22011-09-18 23:53:23 -04001214dnl Allow specification of the multiarch arch
1215dnl
1216AC_ARG_WITH([multiarch],
1217[ --with-multiarch=ARCH specify the multiarch triplet],
1218libdir=$libdir/$withval
1219root_libdir=$root_libdir/$withval
1220)dnl
1221dnl
Theodore Ts'o50e1e101997-04-26 13:58:21 +00001222dnl See if -static works.
Theodore Ts'o50e1e101997-04-26 13:58:21 +00001223dnl
Theodore Ts'oae851481997-04-29 18:13:24 +00001224AC_MSG_CHECKING([whether linker accepts -static])
1225AC_CACHE_VAL(ac_cv_e2fsprogs_use_static,
1226[SAVE_LDFLAGS=$LDFLAGS; LDFLAGS="$LDFLAGS -static"
1227AC_TRY_LINK([#include <stdio.h>],[fflush(stdout);],
1228 ac_cv_e2fsprogs_use_static=yes, ac_cv_e2fsprogs_use_static=no)
1229LDFLAGS=$SAVE_LDFLAGS])
Theodore Ts'odefde781999-01-04 07:39:19 +00001230dnl
1231dnl Regardless of how the test turns out, Solaris doesn't handle -static
1232dnl This is caused by the socket library requiring the nsl library, which
1233dnl requires the -dl library, which only works for dynamically linked
1234dnl programs. It basically means you can't have statically linked programs
1235dnl which use the network under Solaris.
1236dnl
1237case "$host_os" in
1238solaris2.*)
1239 ac_cv_e2fsprogs_use_static=no
1240;;
1241esac
Theodore Ts'oae851481997-04-29 18:13:24 +00001242AC_MSG_RESULT($ac_cv_e2fsprogs_use_static)
Theodore Ts'o74becf31997-04-26 14:37:06 +00001243LDFLAG_STATIC=
Theodore Ts'oae851481997-04-29 18:13:24 +00001244if test $ac_cv_e2fsprogs_use_static = yes; then
Theodore Ts'o50e1e101997-04-26 13:58:21 +00001245 LDFLAG_STATIC=-static
Theodore Ts'oae851481997-04-29 18:13:24 +00001246fi
Theodore Ts'o50e1e101997-04-26 13:58:21 +00001247AC_SUBST(LDFLAG_STATIC)
1248dnl
Theodore Ts'o07a0db12003-07-05 14:50:24 -04001249dnl Work around mysterious Darwin / GNU libintl problem
1250dnl (__asm__ redirection doesn't work for some mysterious reason. Looks like
1251dnl Apple hacked gcc somehow?)
1252dnl
1253case "$host_os" in
1254darwin*)
Theodore Ts'o02d04db2008-08-22 10:52:42 -04001255 AC_MSG_RESULT([Using Apple Darwin / GNU libintl workaround])
Theodore Ts'od1154eb2011-09-18 17:34:37 -04001256 AC_DEFINE(_INTL_REDIRECT_MACROS, 1,
1257 [Define to 1 if Apple Darwin libintl workaround is needed])
Theodore Ts'o07a0db12003-07-05 14:50:24 -04001258 ;;
1259esac
1260dnl
Theodore Ts'o50e1e101997-04-26 13:58:21 +00001261dnl Make the ss and et directories work correctly.
1262dnl
1263SS_DIR=`cd ${srcdir}/lib/ss; pwd`
1264ET_DIR=`cd ${srcdir}/lib/et; pwd`
1265AC_SUBST(SS_DIR)
1266AC_SUBST(ET_DIR)
1267dnl
1268dnl Only try to run the test suite if we're not cross compiling.
1269dnl
1270if test "$cross_compiling" = yes ; then
1271 DO_TEST_SUITE=
1272else
1273 DO_TEST_SUITE=check
1274fi
1275AC_SUBST(DO_TEST_SUITE)
1276dnl
Theodore Ts'oc6f35b82003-05-17 16:29:27 -04001277dnl Only include the intl include files if we're building with them
Theodore Ts'od1154eb2011-09-18 17:34:37 -04001278dnl
1279INCLUDES='-I. -I$(top_builddir)/lib -I$(top_srcdir)/lib'
1280if test -n "$CPPFLAGS" ; then
1281 INCLUDES="$INCLUDES $CPPFLAGS"
Theodore Ts'oc6f35b82003-05-17 16:29:27 -04001282fi
Theodore Ts'od1154eb2011-09-18 17:34:37 -04001283if test "$USE_INCLUDED_LIBINTL" = "yes" ; then
1284 INCLUDES=$INCLUDES' -I$(top_builddir)/intl -I$(top_srcdir)/intl'
1285fi
1286AC_SUBST(INCLUDES)
Theodore Ts'oc6f35b82003-05-17 16:29:27 -04001287dnl
Theodore Ts'odd947da2005-11-09 18:37:07 -04001288dnl Build CFLAGS
1289dnl
1290if test $cross_compiling = no; then
Theodore Ts'oc1986ec2012-06-13 15:29:13 -04001291 BUILD_CFLAGS="$CFLAGS $CPPFLAGS"
Theodore Ts'odd947da2005-11-09 18:37:07 -04001292 BUILD_LDFLAGS="$LDFLAGS"
1293else
1294 BUILD_CFLAGS=
1295 BUILD_LDFLAGS=
1296fi
1297AC_SUBST(BUILD_CFLAGS)
1298AC_SUBST(BUILD_LDFLAGS)
1299dnl
Theodore Ts'o50e1e101997-04-26 13:58:21 +00001300dnl Make our output files, being sure that we create the some miscellaneous
1301dnl directories
1302dnl
1303test -d lib || mkdir lib
1304test -d include || mkdir include
1305test -d include/linux || mkdir include/linux
Theodore Ts'odefde781999-01-04 07:39:19 +00001306test -d include/asm || mkdir include/asm
Theodore Ts'obff0cc92003-03-23 01:37:53 -05001307for i in MCONFIG Makefile e2fsprogs.spec \
Theodore Ts'o183c73b2012-05-12 23:13:24 -04001308 util/Makefile util/subst.conf util/gen-tarball util/install-symlink \
Theodore Ts'o4ea7ea02006-04-09 08:41:55 -04001309 lib/et/Makefile lib/ss/Makefile lib/e2p/Makefile \
1310 lib/ext2fs/Makefile lib/ext2fs/ext2_types.h \
Theodore Ts'o94ba8c72003-03-02 02:07:14 -05001311 lib/uuid/Makefile lib/uuid/uuid_types.h \
Aditya Kalif239fef2011-07-20 11:40:02 -07001312 lib/blkid/Makefile lib/blkid/blkid_types.h lib/quota/Makefile \
Theodore Ts'oe6441862005-01-26 12:59:25 -05001313 lib/ss/ss.pc lib/uuid/uuid.pc lib/et/com_err.pc \
1314 lib/e2p/e2p.pc lib/blkid/blkid.pc lib/ext2fs/ext2fs.pc \
Theodore Ts'o921f4ad2004-11-19 17:25:27 -05001315 misc/Makefile ext2ed/Makefile e2fsck/Makefile \
Theodore Ts'o94ba8c72003-03-02 02:07:14 -05001316 debugfs/Makefile tests/Makefile tests/progs/Makefile \
Matthias Andree98a5ad62009-07-15 17:37:52 +02001317 resize/Makefile doc/Makefile intl/Makefile \
1318 intl/libgnuintl.h po/Makefile.in ; do
Theodore Ts'o94ba8c72003-03-02 02:07:14 -05001319 if test -d `dirname ${srcdir}/$i` ; then
1320 outlist="$outlist $i"
1321 fi
1322done
1323AC_OUTPUT($outlist)
Theodore Ts'oee683a12005-02-05 15:53:56 -05001324if test -f util/gen-tarball; then chmod +x util/gen-tarball; fi