blob: eeeccec7174e0046a1f94cded6b4a8404b9b4033 [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'o50e1e101997-04-26 13:58:21 +00004MCONFIG=./MCONFIG
5AC_SUBST_FILE(MCONFIG)
Theodore Ts'o74becf31997-04-26 14:37:06 +00006BINARY_TYPE=bin
7dnl
8dnl This is to figure out the version number and the date....
9dnl
10E2FSPROGS_VERSION=`grep E2FSPROGS_VERSION ${srcdir}/version.h \
11 | awk '{print $3}' | tr \" " " | awk '{print $1}'`
12DATE=`grep E2FSPROGS_DATE ${srcdir}/version.h | awk '{print $3}' \
13 | tr \" " "`
Theodore Ts'obff0cc92003-03-23 01:37:53 -050014E2FSPROGS_DAY=`echo $DATE | awk -F- '{print $1}'`
Theodore Ts'o74becf31997-04-26 14:37:06 +000015MONTH=`echo $DATE | awk -F- '{print $2}'`
16YEAR=`echo $DATE | awk -F- '{print $3}'`
17
Theodore Ts'o40fa8cc1999-01-09 05:06:02 +000018if expr $YEAR ">" 1900 > /dev/null ; then
19 E2FSPROGS_YEAR=$YEAR
20elif expr $YEAR ">" 90 >/dev/null ; then
Theodore Ts'o74becf31997-04-26 14:37:06 +000021 E2FSPROGS_YEAR=19$YEAR
22else
23 E2FSPROGS_YEAR=20$YEAR
24fi
25
26case $MONTH in
Andreas Dilger927566a2006-11-12 19:41:25 -050027Jan) MONTH_NUM=01; E2FSPROGS_MONTH="January" ;;
28Feb) MONTH_NUM=02; E2FSPROGS_MONTH="February" ;;
29Mar) MONTH_NUM=03; E2FSPROGS_MONTH="March" ;;
30Apr) MONTH_NUM=04; E2FSPROGS_MONTH="April" ;;
31May) MONTH_NUM=05; E2FSPROGS_MONTH="May" ;;
32Jun) MONTH_NUM=06; E2FSPROGS_MONTH="June" ;;
33Jul) MONTH_NUM=07; E2FSPROGS_MONTH="July" ;;
34Aug) MONTH_NUM=08; E2FSPROGS_MONTH="August" ;;
35Sep) MONTH_NUM=09; E2FSPROGS_MONTH="September" ;;
36Oct) MONTH_NUM=10; E2FSPROGS_MONTH="October" ;;
37Nov) MONTH_NUM=11; E2FSPROGS_MONTH="November" ;;
38Dec) MONTH_NUM=12; E2FSPROGS_MONTH="December" ;;
Theodore Ts'o02d04db2008-08-22 10:52:42 -040039*) AC_MSG_WARN([Unknown month $MONTH??]) ;;
Theodore Ts'o74becf31997-04-26 14:37:06 +000040esac
41
Andreas Dilger927566a2006-11-12 19:41:25 -050042base_ver=`echo $E2FSPROGS_VERSION | \
43 sed -e 's/-WIP//' -e 's/pre-//' -e 's/-PLUS//'`
Andreas Dilger927566a2006-11-12 19:41:25 -050044
45date_spec=${E2FSPROGS_YEAR}.${MONTH_NUM}.${E2FSPROGS_DAY}
46
47case $E2FSPROGS_VERSION in
48*-WIP|pre-*)
Theodore Ts'oab063962008-07-07 16:07:43 -040049 E2FSPROGS_PKGVER="$base_ver~WIP-$E2FSPROGS_YEAR-$MONTH_NUM-$E2FSPROGS_DAY"
Andreas Dilger927566a2006-11-12 19:41:25 -050050 ;;
51*)
52 E2FSPROGS_PKGVER="$base_ver"
53 ;;
54esac
55
56unset DATE MONTH YEAR base_ver pre_vers date_spec
Theodore Ts'o02d04db2008-08-22 10:52:42 -040057AC_MSG_RESULT([Generating configuration file for e2fsprogs version $E2FSPROGS_VERSION])
58AC_MSG_RESULT([Release date is ${E2FSPROGS_MONTH}, ${E2FSPROGS_YEAR}])
Theodore Ts'o74becf31997-04-26 14:37:06 +000059AC_SUBST(E2FSPROGS_YEAR)
60AC_SUBST(E2FSPROGS_MONTH)
Theodore Ts'obff0cc92003-03-23 01:37:53 -050061AC_SUBST(E2FSPROGS_DAY)
Theodore Ts'o74becf31997-04-26 14:37:06 +000062AC_SUBST(E2FSPROGS_VERSION)
Andreas Dilger927566a2006-11-12 19:41:25 -050063AC_SUBST(E2FSPROGS_PKGVER)
Theodore Ts'oea97be52001-09-19 15:20:12 -040064AC_CANONICAL_HOST
Theodore Ts'o74becf31997-04-26 14:37:06 +000065dnl
Theodore Ts'od21ae6c2003-05-05 09:00:24 -040066dnl Use diet libc
67dnl
Theodore Ts'oeafba6c2008-07-10 10:21:42 -040068WITH_DIET_LIBC=
Theodore Ts'od21ae6c2003-05-05 09:00:24 -040069AC_ARG_WITH([diet-libc],
Theodore Ts'o32493942007-12-31 10:45:01 -050070[ --with-diet-libc use diet libc],
Theodore Ts'od21ae6c2003-05-05 09:00:24 -040071CC="diet cc -nostdinc"
Theodore Ts'oeafba6c2008-07-10 10:21:42 -040072WITH_DIET_LIBC=yes
Theodore Ts'od21ae6c2003-05-05 09:00:24 -040073AC_MSG_RESULT(CC=$CC))dnl
74dnl
Theodore Ts'o74becf31997-04-26 14:37:06 +000075AC_ARG_WITH([cc],
Theodore Ts'o0b5b9f92009-09-06 21:28:47 -040076AC_HELP_STRING([--with-cc],[no longer supported, use CC= instead]),
77AC_MSG_ERROR([--with-cc no longer supported; use CC= instead]))
Theodore Ts'o74becf31997-04-26 14:37:06 +000078dnl
79AC_ARG_WITH([ccopts],
Theodore Ts'o0b5b9f92009-09-06 21:28:47 -040080AC_HELP_STRING([--with-ccopts],[no longer supported, use CFLAGS= instead]),
81AC_MSG_ERROR([--with-ccopts no longer supported; use CFLAGS= instead]))
82dnl
83AC_ARG_WITH([ldopts],
84AC_HELP_STRING([--with-ldopts],[no longer supported, use LDFLAGS= instead]),
85AC_MSG_ERROR([--with-ldopts no longer supported; use LDFLAGS= instead]))
86dnl
87AC_PROG_CC
88AC_PROG_CPP
Theodore Ts'o74becf31997-04-26 14:37:06 +000089dnl
Theodore Ts'of8bd9801999-10-26 04:19:45 +000090dnl On systems without linux header files, we add an extra include directory
91dnl that holds enough to fake it (hopefully). Note that the $(top_srcdir) here
92dnl is quoted so that it gets expanded by make, not by configure.
93dnl
94AC_CHECK_HEADER(linux/fs.h, [linux_headers=yes], [linux_headers=no])
Theodore Ts'o73ae2d42000-02-02 16:13:14 +000095if test "$linux_headers" != yes; then
96 LINUX_INCLUDE='-I$(top_builddir)/include'
Theodore Ts'of8bd9801999-10-26 04:19:45 +000097fi
98AC_SUBST(LINUX_INCLUDE)
99dnl
Matthias Andreeb1c92f92004-02-23 21:30:11 +0100100dnl Alpha computers use fast and imprecise floating point code that may
101dnl miss exceptions by default. Force sane options if we're using GCC.
102AC_MSG_CHECKING(for additional special compiler flags)
103if test "$GCC" = yes
104then
105 case "$host_cpu" in
106 alpha) addcflags="-mieee" ;;
107 esac
108fi
109if test "x$addcflags" != x
110then
111 AC_MSG_RESULT($addcflags)
112 CFLAGS="$addcflags $CFLAGS"
113else
114 AC_MSG_RESULT([[(none)]])
115fi
116dnl
Theodore Ts'oa4d09611997-04-29 14:28:00 +0000117dnl Set default values for library extentions. Will be dealt with after
118dnl parsing configuration opions, which may modify these
119dnl
120LIB_EXT=.a
121STATIC_LIB_EXT=.a
Theodore Ts'o14b596d2009-04-22 09:18:30 -0400122PROFILED_LIB_EXT=.a
Theodore Ts'oa4d09611997-04-29 14:28:00 +0000123dnl
Theodore Ts'oa4b2d3c1998-04-03 16:12:25 +0000124dnl Allow separate `root_prefix' to be specified
Theodore Ts'ofc6d9d51997-04-29 14:51:31 +0000125dnl
Theodore Ts'oa4b2d3c1998-04-03 16:12:25 +0000126AC_ARG_WITH([root-prefix],
127[ --with-root-prefix=PREFIX override prefix variable for files to be placed in the root],
128root_prefix=$withval,
129root_prefix=NONE)dnl
Theodore Ts'ofc6d9d51997-04-29 14:51:31 +0000130dnl
Theodore Ts'o98919bd2005-02-04 10:43:58 -0500131dnl handle --enable-maintainer-mode
132dnl
133AC_ARG_ENABLE([maintainer-mode],
134[ --enable-maintainer-mode enable makefile rules useful for maintainers],
135if test "$enableval" = "no"
136then
137 MAINTAINER_CMT=#
Theodore Ts'o02d04db2008-08-22 10:52:42 -0400138 AC_MSG_RESULT([Disabling maintainer mode])
Theodore Ts'o98919bd2005-02-04 10:43:58 -0500139else
140 MAINTAINER_CMT=
Theodore Ts'o02d04db2008-08-22 10:52:42 -0400141 AC_MSG_RESULT([Enabling maintainer mode])
Theodore Ts'o98919bd2005-02-04 10:43:58 -0500142fi
143,
144MAINTAINER_CMT=#
Theodore Ts'o02d04db2008-08-22 10:52:42 -0400145AC_MSG_RESULT([Disabling maintainer mode by default])
Theodore Ts'o98919bd2005-02-04 10:43:58 -0500146)
147AC_SUBST(MAINTAINER_CMT)
148dnl
Theodore Ts'oc13351f2009-07-02 00:11:17 -0400149dnl handle --enable-verbose-makecmds
150dnl
151AC_ARG_ENABLE([verbose-makecmds],
152[ --enable-verbose-makecmds enable verbose make command output],
153if test "$enableval" = "no"
154then
155 AC_MSG_RESULT([Disabling verbose make commands])
156 E=@echo
157 Q=@
158else
159 AC_MSG_RESULT([Enabling verbose make commands])
160 E=@\\#
161 Q=
162fi
163,
164AC_MSG_RESULT([Disabling verbose make commands])
165E=@echo
166Q=@
167)
168AC_SUBST(E)
169AC_SUBST(Q)
170dnl
Theodore Ts'o19178752000-02-11 15:55:07 +0000171dnl handle --enable-compression
172dnl
173AC_ARG_ENABLE([compression],
174[ --enable-compression enable EXPERIMENTAL compression support],
175if test "$enableval" = "no"
176then
Theodore Ts'o02d04db2008-08-22 10:52:42 -0400177 AC_MSG_RESULT([Disabling compression support])
Theodore Ts'o19178752000-02-11 15:55:07 +0000178else
179 AC_DEFINE(ENABLE_COMPRESSION)
Theodore Ts'o02d04db2008-08-22 10:52:42 -0400180 AC_MSG_RESULT([Enabling compression support])
181 AC_MSG_WARN([Compression support is experimental])
Theodore Ts'o19178752000-02-11 15:55:07 +0000182fi
183,
Theodore Ts'o02d04db2008-08-22 10:52:42 -0400184AC_MSG_RESULT([Disabling compression support by default])
Theodore Ts'o19178752000-02-11 15:55:07 +0000185)
186dnl
Theodore Ts'o8fdc9982002-06-25 23:26:34 -0400187dnl handle --enable-htree
188dnl
189AC_ARG_ENABLE([htree],
190[ --enable-htree enable EXPERIMENTAL htree directory support],
191if test "$enableval" = "no"
192then
193 HTREE_CMT=#
Theodore Ts'o02d04db2008-08-22 10:52:42 -0400194 AC_MSG_RESULT([Disabling htree directory support])
Theodore Ts'o8fdc9982002-06-25 23:26:34 -0400195else
196 HTREE_CMT=
197 AC_DEFINE(ENABLE_HTREE)
Theodore Ts'o02d04db2008-08-22 10:52:42 -0400198 AC_MSG_RESULT([Enabling htree directory support])
Theodore Ts'o8fdc9982002-06-25 23:26:34 -0400199fi
200,
Theodore Ts'o559ca6c2002-08-18 03:48:55 -0400201HTREE_CMT=
202AC_DEFINE(ENABLE_HTREE)
Theodore Ts'o02d04db2008-08-22 10:52:42 -0400203AC_MSG_RESULT([Enabling htree directory support by default])
Theodore Ts'o8fdc9982002-06-25 23:26:34 -0400204)
205AC_SUBST(HTREE_CMT)
206dnl
Theodore Ts'oa4ece352008-01-01 20:05:04 -0500207dnl This needs to be before all of the --enable-*-shlibs options
208dnl
209E2_PKG_CONFIG_STATIC=--static
Theodore Ts'o55da9872008-09-02 23:12:38 -0400210LDFLAG_DYNAMIC=
211PRIVATE_LIBS_CMT=
Theodore Ts'oa4ece352008-01-01 20:05:04 -0500212dnl
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000213dnl handle --enable-elf-shlibs
214dnl
215AC_ARG_ENABLE([elf-shlibs],
Theodore Ts'oa4d09611997-04-29 14:28:00 +0000216[ --enable-elf-shlibs select ELF shared libraries],
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000217if test "$enableval" = "no"
218then
219 ELF_CMT=#
220 MAKEFILE_ELF=/dev/null
Theodore Ts'o02d04db2008-08-22 10:52:42 -0400221 AC_MSG_RESULT([Disabling ELF shared libraries])
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000222else
Theodore Ts'oa4ece352008-01-01 20:05:04 -0500223 E2_PKG_CONFIG_STATIC=
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000224 ELF_CMT=
225 MAKEFILE_ELF=$srcdir/lib/Makefile.elf-lib
Theodore Ts'of5955dd2000-10-25 02:38:39 +0000226 [case "$host_os" in
227 solaris2.*)
228 MAKEFILE_ELF=$srcdir/lib/Makefile.solaris-lib
229 ;;
230 esac]
Theodore Ts'o74becf31997-04-26 14:37:06 +0000231 BINARY_TYPE=elfbin
Theodore Ts'oa4d09611997-04-29 14:28:00 +0000232 LIB_EXT=.so
Theodore Ts'o55da9872008-09-02 23:12:38 -0400233 PRIVATE_LIBS_CMT=#
234 LDFLAG_DYNAMIC=['-Wl,-rpath-link,$(top_builddir)/lib']
Theodore Ts'o02d04db2008-08-22 10:52:42 -0400235 AC_MSG_RESULT([Enabling ELF shared libraries])
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000236fi
237,
238MAKEFILE_ELF=/dev/null
239ELF_CMT=#
Theodore Ts'o02d04db2008-08-22 10:52:42 -0400240AC_MSG_RESULT([Disabling ELF shared libraries by default])
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000241)
242AC_SUBST(ELF_CMT)
243AC_SUBST_FILE(MAKEFILE_ELF)
244dnl
245dnl handle --enable-bsd-shlibs
246dnl
247AC_ARG_ENABLE([bsd-shlibs],
Theodore Ts'oa4d09611997-04-29 14:28:00 +0000248[ --enable-bsd-shlibs select BSD shared libraries],
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000249if test "$enableval" = "no"
250then
251 BSDLIB_CMT=#
252 MAKEFILE_BSDLIB=/dev/null
Theodore Ts'o02d04db2008-08-22 10:52:42 -0400253 AC_MSG_RESULT([Disabling BSD shared libraries])
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000254else
Theodore Ts'oa4ece352008-01-01 20:05:04 -0500255 E2_PKG_CONFIG_STATIC=
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000256 BSDLIB_CMT=
257 MAKEFILE_BSDLIB=$srcdir/lib/Makefile.bsd-lib
Theodore Ts'oa4d09611997-04-29 14:28:00 +0000258 LIB_EXT=.so
Theodore Ts'oe71d8732003-03-14 02:13:48 -0500259 [case "$host_os" in
Theodore Ts'oaa75ecc2003-03-17 10:01:22 -0500260 darwin*)
Theodore Ts'oe71d8732003-03-14 02:13:48 -0500261 MAKEFILE_BSDLIB=$srcdir/lib/Makefile.darwin-lib
262 LIB_EXT=.dylib
263 ;;
264 esac]
Theodore Ts'o02d04db2008-08-22 10:52:42 -0400265 AC_MSG_RESULT([Enabling BSD shared libraries])
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000266fi
267,
268MAKEFILE_BSDLIB=/dev/null
269BSDLIB_CMT=#
Theodore Ts'o02d04db2008-08-22 10:52:42 -0400270AC_MSG_RESULT([Disabling BSD shared libraries by default])
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000271)
272AC_SUBST(BSDLIB_CMT)
273AC_SUBST_FILE(MAKEFILE_BSDLIB)
274dnl
275dnl handle --enable-profile
276dnl
277AC_ARG_ENABLE([profile],
Theodore Ts'oa4d09611997-04-29 14:28:00 +0000278[ --enable-profile build profiling libraries],
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000279if test "$enableval" = "no"
280then
281 PROFILE_CMT=#
282 MAKEFILE_PROFILE=/dev/null
Theodore Ts'o02d04db2008-08-22 10:52:42 -0400283 AC_MSG_RESULT([Disabling profiling libraries])
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000284else
285 PROFILE_CMT=
286 MAKEFILE_PROFILE=$srcdir/lib/Makefile.profile
Theodore Ts'oa4d09611997-04-29 14:28:00 +0000287 PROFILED_LIB_EXT=_p.a
Theodore Ts'o02d04db2008-08-22 10:52:42 -0400288 AC_MSG_RESULT([Building profiling libraries])
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000289fi
290,
291PROFILE_CMT=#
292MAKEFILE_PROFILE=/dev/null
Theodore Ts'o02d04db2008-08-22 10:52:42 -0400293AC_MSG_RESULT([Disabling profiling libraries by default])
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000294)
295AC_SUBST(PROFILE_CMT)
296AC_SUBST_FILE(MAKEFILE_PROFILE)
297dnl
298dnl handle --enable-checker
299dnl
300AC_ARG_ENABLE([checker],
Theodore Ts'oa4d09611997-04-29 14:28:00 +0000301[ --enable-checker build checker libraries],
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000302if test "$enableval" = "no"
303then
304 CHECKER_CMT=#
305 MAKEFILE_CHECKER=/dev/null
Theodore Ts'o02d04db2008-08-22 10:52:42 -0400306 AC_MSG_RESULT([Disabling checker libraries])
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000307else
308 CHECKER_CMT=
309 MAKEFILE_CHECKER=$srcdir/lib/Makefile.checker
Theodore Ts'o02d04db2008-08-22 10:52:42 -0400310 AC_MSG_RESULT([Building checker libraries])
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000311fi
312,
313CHECKER_CMT=#
314MAKEFILE_CHECKER=/dev/null
Theodore Ts'o02d04db2008-08-22 10:52:42 -0400315AC_MSG_RESULT([Disabling checker libraries by default])
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000316)
317AC_SUBST(CHECKER_CMT)
318AC_SUBST_FILE(MAKEFILE_CHECKER)
319dnl
Theodore Ts'oa4d09611997-04-29 14:28:00 +0000320dnl Substitute library extensions
321dnl
322AC_SUBST(LIB_EXT)
323AC_SUBST(STATIC_LIB_EXT)
324AC_SUBST(PROFILED_LIB_EXT)
Theodore Ts'o55da9872008-09-02 23:12:38 -0400325AC_SUBST(LDFLAG_DYNAMIC)
326AC_SUBST(PRIVATE_LIBS_CMT)
Theodore Ts'oa4d09611997-04-29 14:28:00 +0000327dnl
Theodore Ts'o782bebf2002-11-08 18:46:45 -0500328dnl handle --enable-jbd-debug
Theodore Ts'ocdf186e2001-06-13 22:16:47 +0000329dnl
Theodore Ts'o782bebf2002-11-08 18:46:45 -0500330AC_ARG_ENABLE([jbd-debug],
331[ --enable-jbd-debug enable journal debugging],
Theodore Ts'ocdf186e2001-06-13 22:16:47 +0000332if test "$enableval" = "no"
333then
Theodore Ts'o02d04db2008-08-22 10:52:42 -0400334 AC_MSG_RESULT([Disabling journal debugging])
Theodore Ts'ocdf186e2001-06-13 22:16:47 +0000335else
Theodore Ts'o8cf93332001-12-16 02:23:36 -0500336 AC_DEFINE(CONFIG_JBD_DEBUG)
Theodore Ts'o02d04db2008-08-22 10:52:42 -0400337 AC_MSG_RESULT([Enabling journal debugging])
Theodore Ts'ocdf186e2001-06-13 22:16:47 +0000338fi
339,
Theodore Ts'o02d04db2008-08-22 10:52:42 -0400340AC_MSG_RESULT([Disabling journal debugging by default])
Theodore Ts'ocdf186e2001-06-13 22:16:47 +0000341)
342dnl
Theodore Ts'of0a22d02003-02-22 13:19:53 -0500343dnl handle --enable-blkid-debug
344dnl
345AC_ARG_ENABLE([blkid-debug],
Theodore Ts'od21ae6c2003-05-05 09:00:24 -0400346[ --enable-blkid-debug enable blkid debugging],
Theodore Ts'of0a22d02003-02-22 13:19:53 -0500347if test "$enableval" = "no"
348then
Theodore Ts'o02d04db2008-08-22 10:52:42 -0400349 AC_MSG_RESULT([Disabling blkid debugging])
Theodore Ts'of0a22d02003-02-22 13:19:53 -0500350else
351 AC_DEFINE(CONFIG_BLKID_DEBUG)
Theodore Ts'o02d04db2008-08-22 10:52:42 -0400352 AC_MSG_RESULT([Enabling blkid debugging])
Theodore Ts'of0a22d02003-02-22 13:19:53 -0500353fi
354,
Theodore Ts'o02d04db2008-08-22 10:52:42 -0400355AC_MSG_RESULT([Disabling blkid debugging by default])
Theodore Ts'of0a22d02003-02-22 13:19:53 -0500356)
357dnl
Theodore Ts'o2a29f132003-05-05 12:08:47 -0400358dnl handle --enable-testio-debug
359dnl
360AC_ARG_ENABLE([testio-debug],
Theodore Ts'oaf773652008-09-01 11:27:27 -0400361[ --disable-testio-debug disable the use of the test I/O manager for debugging],
Theodore Ts'o2a29f132003-05-05 12:08:47 -0400362if test "$enableval" = "no"
363then
Theodore Ts'o02d04db2008-08-22 10:52:42 -0400364 AC_MSG_RESULT([Disabling testio debugging])
Theodore Ts'oaf773652008-09-01 11:27:27 -0400365 TEST_IO_CMT="#"
Theodore Ts'o2a29f132003-05-05 12:08:47 -0400366else
Theodore Ts'oaf773652008-09-01 11:27:27 -0400367 TEST_IO_CMT=
Theodore Ts'o2a29f132003-05-05 12:08:47 -0400368 AC_DEFINE(CONFIG_TESTIO_DEBUG)
Theodore Ts'o02d04db2008-08-22 10:52:42 -0400369 AC_MSG_RESULT([Enabling testio debugging])
Theodore Ts'o2a29f132003-05-05 12:08:47 -0400370fi
371,
Theodore Ts'oaf773652008-09-01 11:27:27 -0400372AC_MSG_RESULT([Enabling testio debugging by default])
373AC_DEFINE(CONFIG_TESTIO_DEBUG)
374TEST_IO_CMT=
Theodore Ts'o2a29f132003-05-05 12:08:47 -0400375)
Theodore Ts'oaf773652008-09-01 11:27:27 -0400376AC_SUBST(TEST_IO_CMT)
Theodore Ts'o2a29f132003-05-05 12:08:47 -0400377dnl
Scott James Remnant39fd3d42009-05-14 13:03:25 +0100378dnl handle --disable-libuuid
379dnl
380PKG_PROG_PKG_CONFIG
381LIBUUID=
382DEPLIBUUID=
383STATIC_LIBUUID=
384DEPSTATIC_LIBUUID=
385PROFILED_LIBUUID=
386DEPPROFILED_LIBUUID=
387UUID_CMT=
388AC_ARG_ENABLE([libuuid],
389[ --disable-libuuid do not build private uuid library],
390if test "$enableval" = "no"
391then
392 if test -z "$PKG_CONFIG"; then
393 AC_MSG_ERROR([pkg-config not installed; please install it.])
394 fi
395
396 AC_CHECK_LIB(uuid, uuid_generate,
397 [LIBUUID=`$PKG_CONFIG --libs uuid`;
398 STATIC_LIBUUID=`$PKG_CONFIG --static --libs uuid`],
399 [AC_MSG_ERROR([external uuid library not found])],
400 [$LIBUUID])
401 UUID_CMT=#
402 AC_MSG_RESULT([Disabling private uuid library])
403else
404 LIBUUID='$(LIB)/libuuid'$LIB_EXT
405 DEPLIBUUID=$LIBUUID
406 STATIC_LIBUUID='$(LIB)/libuuid'$STATIC_LIB_EXT
407 DEPSTATIC_LIBUUID=$STATIC_LIBUUID
408 PROFILED_LIBUUID='$(LIB)/libuuid'$PROFILED_LIB_EXT
409 DEPPROFILED_LIBUUID=$PROFILED_LIBUUID
410 AC_MSG_RESULT([Enabling private uuid library])
411fi
412,
413LIBUUID='$(LIB)/libuuid'$LIB_EXT
414DEPLIBUUID=$LIBUUID
415STATIC_LIBUUID='$(LIB)/libuuid'$STATIC_LIB_EXT
416DEPSTATIC_LIBUUID=$STATIC_LIBUUID
417PROFILED_LIBUUID='$(LIB)/libuuid'$PROFILED_LIB_EXT
418DEPPROFILED_LIBUUID=$PROFILED_LIBUUID
419AC_MSG_RESULT([Enabling private uuid library by default])
420)
421AC_SUBST(LIBUUID)
422AC_SUBST(DEPLIBUUID)
423AC_SUBST(STATIC_LIBUUID)
424AC_SUBST(DEPSTATIC_LIBUUID)
425AC_SUBST(PROFILED_LIBUUID)
426AC_SUBST(DEPPROFILED_LIBUUID)
427AC_SUBST(UUID_CMT)
428dnl
Theodore Ts'o14b596d2009-04-22 09:18:30 -0400429dnl handle --disable-libblkid
430dnl
431PKG_PROG_PKG_CONFIG
432LIBBLKID=
433DEPLIBBLKID=
434STATIC_LIBBLKID=
435DEPSTATIC_LIBBLKID=
436PROFILED_LIBBLKID=
437DEPPROFILED_LIBBLKID=
438BLKID_CMT=
439AC_ARG_ENABLE([libblkid],
440[ --disable-libblkid do not build private blkid library],
441if test "$enableval" = "no"
442then
443 if test -z "$PKG_CONFIG"; then
444 AC_MSG_ERROR([pkg-config not installed; please install it.])
445 fi
446
447 AC_CHECK_LIB(blkid, blkid_get_cache,
448 [LIBBLKID=`$PKG_CONFIG --libs blkid`;
449 STATIC_LIBBLKID=`$PKG_CONFIG --static --libs blkid`],
450 [AC_MSG_ERROR([external blkid library not found])],
451 [$LIBBLKID])
452 BLKID_CMT=#
453 AC_MSG_RESULT([Disabling private blkid library])
454else
455 LIBBLKID='$(LIB)/libblkid'$LIB_EXT
456 DEPLIBBLKID=$LIBBLKID
457 STATIC_LIBBLKID='$(LIB)/libblkid'$STATIC_LIB_EXT
458 DEPSTATIC_LIBBLKID=$STATIC_LIBBLKID
459 PROFILED_LIBBLKID='$(LIB)/libblkid'$PROFILED_LIB_EXT
460 DEPPROFILED_LIBBLKID=$PROFILED_LIBBLKID
461 AC_DEFINE(CONFIG_BUILD_FINDFS)
462 AC_MSG_RESULT([Enabling private blkid library])
463fi
464,
465LIBBLKID='$(LIB)/libblkid'$LIB_EXT
466DEPLIBBLKID=$LIBBLKID
467STATIC_LIBBLKID='$(LIB)/libblkid'$STATIC_LIB_EXT
468DEPSTATIC_LIBBLKID=$STATIC_LIBBLKID
469PROFILED_LIBBLKID='$(LIB)/libblkid'$PROFILED_LIB_EXT
470DEPPROFILED_LIBBLKID=$PROFILED_LIBBLKID
471AC_DEFINE(CONFIG_BUILD_FINDFS)
472AC_MSG_RESULT([Enabling private blkid library by default])
473)
474AC_SUBST(LIBBLKID)
475AC_SUBST(DEPLIBBLKID)
476AC_SUBST(STATIC_LIBBLKID)
477AC_SUBST(DEPSTATIC_LIBBLKID)
478AC_SUBST(PROFILED_LIBBLKID)
479AC_SUBST(DEPPROFILED_LIBBLKID)
480AC_SUBST(BLKID_CMT)
481dnl
Theodore Ts'ocdf186e2001-06-13 22:16:47 +0000482dnl handle --enable-debugfs
483dnl
484AC_ARG_ENABLE([debugfs],
485[ --disable-debugfs disable support of debugfs program],
486if test "$enableval" = "no"
487then
Theodore Ts'o02d04db2008-08-22 10:52:42 -0400488 AC_MSG_RESULT([Disabling debugfs support])
Theodore Ts'ocdf186e2001-06-13 22:16:47 +0000489 DEBUGFS_CMT="#"
490else
491 DEBUGFS_CMT=
Theodore Ts'o02d04db2008-08-22 10:52:42 -0400492 AC_MSG_RESULT([Enabling debugfs support])
Theodore Ts'ocdf186e2001-06-13 22:16:47 +0000493fi
494,
Theodore Ts'o02d04db2008-08-22 10:52:42 -0400495AC_MSG_RESULT([Enabling debugfs support by default])
Theodore Ts'ocdf186e2001-06-13 22:16:47 +0000496DEBUGFS_CMT=
497)
498AC_SUBST(DEBUGFS_CMT)
499dnl
500dnl handle --enable-imager
501dnl
502AC_ARG_ENABLE([imager],
503[ --disable-imager disable support of e2image program],
504if test "$enableval" = "no"
505then
Theodore Ts'o02d04db2008-08-22 10:52:42 -0400506 AC_MSG_RESULT([Disabling e2image support])
Theodore Ts'ocdf186e2001-06-13 22:16:47 +0000507 IMAGER_CMT="#"
508else
509 IMAGER_CMT=
Theodore Ts'o02d04db2008-08-22 10:52:42 -0400510 AC_MSG_RESULT([Enabling e2image support])
Theodore Ts'ocdf186e2001-06-13 22:16:47 +0000511fi
512,
Theodore Ts'o02d04db2008-08-22 10:52:42 -0400513AC_MSG_RESULT([Enabling e2image support by default])
Theodore Ts'ocdf186e2001-06-13 22:16:47 +0000514IMAGER_CMT=
515)
516AC_SUBST(IMAGER_CMT)
517dnl
518dnl handle --enable-resizer
519dnl
520AC_ARG_ENABLE([resizer],
521[ --disable-resizer disable support of e2resize program],
522if test "$enableval" = "no"
523then
Theodore Ts'o02d04db2008-08-22 10:52:42 -0400524 AC_MSG_RESULT([Disabling e2resize support])
Theodore Ts'ocdf186e2001-06-13 22:16:47 +0000525 RESIZER_CMT="#"
526else
527 RESIZER_CMT=
Theodore Ts'o02d04db2008-08-22 10:52:42 -0400528 AC_MSG_RESULT([Enabling e2resize support])
Theodore Ts'ocdf186e2001-06-13 22:16:47 +0000529fi
530,
Theodore Ts'o02d04db2008-08-22 10:52:42 -0400531AC_MSG_RESULT([Enabling e2resize support by default])
Theodore Ts'ocdf186e2001-06-13 22:16:47 +0000532RESIZER_CMT=
533)
534AC_SUBST(RESIZER_CMT)
535dnl
Theodore Ts'ofc6d9d51997-04-29 14:51:31 +0000536dnl See whether to install the `fsck' wrapper program (that calls e2fsck)
537dnl
538AC_ARG_ENABLE([fsck],
539[ --enable-fsck build fsck wrapper program],
540[if test "$enableval" = "no"
541then
542 FSCK_PROG='' FSCK_MAN=''
Theodore Ts'o02d04db2008-08-22 10:52:42 -0400543 AC_MSG_RESULT([Not building fsck wrapper])
Theodore Ts'ofc6d9d51997-04-29 14:51:31 +0000544else
545 FSCK_PROG=fsck FSCK_MAN=fsck.8
Theodore Ts'o02d04db2008-08-22 10:52:42 -0400546 AC_MSG_RESULT([Building fsck wrapper])
Theodore Ts'ofc6d9d51997-04-29 14:51:31 +0000547fi]
548,
549[case "$host_os" in
Theodore Ts'oe3632402004-05-04 19:39:54 -0400550 gnu*)
Theodore Ts'ofc6d9d51997-04-29 14:51:31 +0000551 FSCK_PROG='' FSCK_MAN=''
Theodore Ts'o02d04db2008-08-22 10:52:42 -0400552 AC_MSG_RESULT([Not building fsck wrapper by default])
Theodore Ts'ofc6d9d51997-04-29 14:51:31 +0000553 ;;
554 *)
555 FSCK_PROG=fsck FSCK_MAN=fsck.8
Theodore Ts'o02d04db2008-08-22 10:52:42 -0400556 AC_MSG_RESULT([Building fsck wrapper by default])
Theodore Ts'ofc6d9d51997-04-29 14:51:31 +0000557esac]
558)
559AC_SUBST(FSCK_PROG)
560AC_SUBST(FSCK_MAN)
561dnl
Theodore Ts'o5d407732004-09-18 14:53:14 -0400562dnl See whether to install the `e2initrd-helper' program
563dnl
564AC_ARG_ENABLE([e2initrd-helper],
565[ --enable-e2initrd-helper build e2initrd-helper program],
566[if test "$enableval" = "no"
567then
568 E2INITRD_PROG='' E2INITRD_MAN=''
Theodore Ts'o02d04db2008-08-22 10:52:42 -0400569 AC_MSG_RESULT([Not building e2initrd helper])
Theodore Ts'o5d407732004-09-18 14:53:14 -0400570else
571 E2INITRD_PROG=e2initrd_helper E2INITRD_MAN=e2initrd_helper.8
Theodore Ts'o02d04db2008-08-22 10:52:42 -0400572 AC_MSG_RESULT([Building e2initrd helper])
Theodore Ts'o5d407732004-09-18 14:53:14 -0400573fi]
574,
575E2INITRD_PROG=e2initrd_helper E2INITRD_MAN=e2initrd_helper.8
Theodore Ts'o02d04db2008-08-22 10:52:42 -0400576AC_MSG_RESULT([Building e2initrd helper by default])
Theodore Ts'o5d407732004-09-18 14:53:14 -0400577)
578AC_SUBST(E2INITRD_PROG)
579AC_SUBST(E2INITRD_MAN)
Karel Zak4db2f592006-03-08 14:17:28 -0500580dnl
Theodore Ts'o5d407732004-09-18 14:53:14 -0400581dnl
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000582dnl
Theodore Ts'o32493942007-12-31 10:45:01 -0500583AC_ARG_ENABLE([tls],
584[ --disable-tls disable use of thread local support],
585[if test "$enableval" = "no"
586then
587 try_tls=""
Theodore Ts'o02d04db2008-08-22 10:52:42 -0400588 AC_MSG_RESULT([Disabling thread local support])
Theodore Ts'o32493942007-12-31 10:45:01 -0500589else
590 try_tls="yes"
Theodore Ts'o02d04db2008-08-22 10:52:42 -0400591 AC_MSG_RESULT([Enabling thread local support])
Theodore Ts'o32493942007-12-31 10:45:01 -0500592fi]
593,
Theodore Ts'oeafba6c2008-07-10 10:21:42 -0400594if test -n "$WITH_DIET_LIBC"
595then
596 try_tls=""
Theodore Ts'o02d04db2008-08-22 10:52:42 -0400597 AC_MSG_RESULT([Diet libc does not support thread local support])
Theodore Ts'oeafba6c2008-07-10 10:21:42 -0400598else
599 try_tls="yes"
Theodore Ts'o02d04db2008-08-22 10:52:42 -0400600 AC_MSG_RESULT([Try using thread local support by default])
Theodore Ts'oeafba6c2008-07-10 10:21:42 -0400601fi
Theodore Ts'o32493942007-12-31 10:45:01 -0500602)
603if test "$try_tls" = "yes"
604then
605AX_TLS
606fi
607dnl
608dnl
609dnl
Theodore Ts'o5610f992007-12-31 11:16:56 -0500610AC_ARG_ENABLE([uuidd],
611[ --disable-uuidd disable building the uuid daemon],
612[if test "$enableval" = "no"
613then
Theodore Ts'o02d04db2008-08-22 10:52:42 -0400614 AC_MSG_RESULT([Not building uuidd])
Theodore Ts'o5610f992007-12-31 11:16:56 -0500615 UUIDD_CMT="#"
616else
617 AC_DEFINE(USE_UUIDD)
618 UUIDD_CMT=""
Theodore Ts'o02d04db2008-08-22 10:52:42 -0400619 AC_MSG_RESULT([Building uuidd])
Theodore Ts'o5610f992007-12-31 11:16:56 -0500620fi]
621,
622AC_DEFINE(USE_UUIDD)
623UUIDD_CMT=""
Theodore Ts'o02d04db2008-08-22 10:52:42 -0400624AC_MSG_RESULT([Building uuidd by default])
Theodore Ts'o5610f992007-12-31 11:16:56 -0500625)
626AC_SUBST(UUIDD_CMT)
627dnl
628dnl
629dnl
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000630MAKEFILE_LIBRARY=$srcdir/lib/Makefile.library
631AC_SUBST_FILE(MAKEFILE_LIBRARY)
632dnl
Theodore Ts'ocdf186e2001-06-13 22:16:47 +0000633dnl Add internationalization support, using gettext.
634dnl
Theodore Ts'ob0cacab2004-11-30 19:00:19 -0500635GETTEXT_PACKAGE=e2fsprogs
Theodore Ts'ocdf186e2001-06-13 22:16:47 +0000636PACKAGE=e2fsprogs
637VERSION="$E2FSPROGS_VERSION"
Theodore Ts'ob0cacab2004-11-30 19:00:19 -0500638VERSION=0.14.1
Theodore Ts'ocdf186e2001-06-13 22:16:47 +0000639AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE")
640AC_DEFINE_UNQUOTED(VERSION, "$VERSION")
Theodore Ts'ob0cacab2004-11-30 19:00:19 -0500641AC_SUBST(GETTEXT_PACKAGE)
Theodore Ts'ocdf186e2001-06-13 22:16:47 +0000642AC_SUBST(PACKAGE)
643AC_SUBST(VERSION)
644
Theodore Ts'ocdf186e2001-06-13 22:16:47 +0000645AM_GNU_GETTEXT
646dnl
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000647dnl End of configuration options
648dnl
Theodore Ts'o74becf31997-04-26 14:37:06 +0000649AC_SUBST(BINARY_TYPE)
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000650AC_PROG_MAKE_SET
Theodore Ts'obcb915b2009-07-02 18:19:10 -0400651CHECK_GNU_MAKE
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000652AC_PATH_PROG(LN, ln, ln)
Theodore Ts'ofc6d9d51997-04-29 14:51:31 +0000653AC_PROG_LN_S
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000654AC_PATH_PROG(MV, mv, mv)
655AC_PATH_PROG(CP, cp, cp)
656AC_PATH_PROG(RM, rm, rm)
657AC_PATH_PROG(CHMOD, chmod, :)
Theodore Ts'o32237012005-01-17 19:13:39 -0500658AC_PROG_AWK
659AC_PROG_EGREP
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000660AC_PATH_PROG(SED, sed, sed)
Theodore Ts'o9d564f71999-07-03 20:25:58 +0000661AC_PATH_PROG(PERL, perl, perl)
Theodore Ts'o250f79f2001-05-19 22:02:22 +0000662AC_PATH_PROG(LDCONFIG, ldconfig, :)
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000663AC_CHECK_TOOL(AR, ar, ar)
664AC_CHECK_TOOL(RANLIB, ranlib, :)
665AC_CHECK_TOOL(STRIP, strip, :)
Manish Katiyar7321d942008-04-14 17:20:03 +0530666AC_CHECK_PROG(MAKEINFO, makeinfo, makeinfo, )
667if test "_$MAKEINFO" = "_"; then
668 MAKEINFO="@echo Makeinfo is missing. Info documentation will not be built.;true"
669else
670 case "$MAKEINFO" in
671 */missing.*)
672 AC_MSG_WARN([
673*** Makeinfo is missing. Info documentation will not be built.])
674 ;;
675 *)
676 ;;
677 esac
678fi
679AC_SUBST(MAKEINFO)
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000680AC_PROG_INSTALL
Theodore Ts'o6c133521999-07-03 20:37:03 +0000681# See if we need a separate native compiler.
682if test $cross_compiling = no; then
683 BUILD_CC="$CC"
684 AC_SUBST(BUILD_CC)
685else
686 AC_CHECK_PROGS(BUILD_CC, gcc cc)
687fi
Theodore Ts'od7f45af2008-09-12 10:15:26 -0400688AC_CHECK_HEADERS(dirent.h errno.h getopt.h malloc.h mntent.h paths.h semaphore.h setjmp.h signal.h stdarg.h stdint.h stdlib.h termios.h termio.h unistd.h utime.h linux/fd.h linux/major.h net/if_dl.h netinet/in.h sys/disklabel.h sys/file.h sys/ioctl.h sys/mkdev.h sys/mman.h sys/prctl.h sys/queue.h sys/resource.h sys/select.h sys/socket.h sys/sockio.h sys/stat.h sys/syscall.h sys/sysmacros.h sys/time.h sys/types.h sys/un.h sys/wait.h)
Theodore Ts'oda76d6b2005-01-18 23:29:01 -0500689AC_CHECK_HEADERS(sys/disk.h sys/mount.h,,,
690[[
691#if HAVE_SYS_QUEUE_H
692#include <sys/queue.h>
693#endif
694]])
695AC_CHECK_HEADERS(net/if.h,,,
696[[
697#if HAVE_SYS_TYPES_H
698#include <sys/types.h>
699#endif
700#if HAVE_SYS_SOCKET
701#include <sys/socket.h>
702#endif
703]])
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000704AC_FUNC_VPRINTF
Theodore Ts'offf45482003-04-13 00:44:19 -0400705dnl Check to see if dirent has member d_reclen. On cygwin those d_reclen
706dnl is not decleared.
Theodore Ts'o6c65d252005-01-19 12:59:48 -0500707AC_CHECK_MEMBER(struct dirent.d_reclen,[AC_DEFINE(HAVE_RECLEN_DIRENT)],,
708 [#include <dirent.h>])
Theodore Ts'offf45482003-04-13 00:44:19 -0400709dnl Check to see if ssize_t was decleared
Theodore Ts'o6c65d252005-01-19 12:59:48 -0500710AC_CHECK_TYPE(ssize_t,[AC_DEFINE(HAVE_TYPE_SSIZE_T)],,
711 [#include <sys/types.h>])
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000712dnl
Theodore Ts'ob0b9c4d1997-10-20 23:36:30 +0000713dnl Check to see if llseek() is declared in unistd.h. On some libc's
714dnl it is, and on others it isn't..... Thank you glibc developers....
715dnl
Theodore Ts'o6c65d252005-01-19 12:59:48 -0500716AC_CHECK_DECL(llseek,[AC_DEFINE(HAVE_LLSEEK_PROTOTYPE)],,
717 [#include <unistd.h>])
Theodore Ts'ob0b9c4d1997-10-20 23:36:30 +0000718dnl
Theodore Ts'o6928adc2000-05-25 23:28:50 +0000719dnl Check to see if lseek64() is declared in unistd.h. Glibc's header files
720dnl are so convoluted that I can't tell whether it will always be defined,
721dnl and if it isn't defined while lseek64 is defined in the library,
722dnl disaster will strike.
723dnl
724dnl Warning! Use of --enable-gcc-wall may throw off this test.
725dnl
726dnl
Theodore Ts'o6c65d252005-01-19 12:59:48 -0500727AC_CHECK_DECL(lseek64,[AC_DEFINE(HAVE_LSEEK64_PROTOTYPE)],,
728 [#define _LARGEFILE_SOURCE
729 #define _LARGEFILE64_SOURCE
730 #include <unistd.h>])
Theodore Ts'o6928adc2000-05-25 23:28:50 +0000731dnl
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000732dnl Word sizes...
733dnl
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000734AC_CHECK_SIZEOF(short)
735AC_CHECK_SIZEOF(int)
736AC_CHECK_SIZEOF(long)
Theodore Ts'ofc6d9d51997-04-29 14:51:31 +0000737AC_CHECK_SIZEOF(long long)
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000738SIZEOF_SHORT=$ac_cv_sizeof_short
739SIZEOF_INT=$ac_cv_sizeof_int
740SIZEOF_LONG=$ac_cv_sizeof_long
Theodore Ts'ofc6d9d51997-04-29 14:51:31 +0000741SIZEOF_LONG_LONG=$ac_cv_sizeof_long_long
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000742AC_SUBST(SIZEOF_SHORT)
743AC_SUBST(SIZEOF_INT)
744AC_SUBST(SIZEOF_LONG)
Theodore Ts'ofc6d9d51997-04-29 14:51:31 +0000745AC_SUBST(SIZEOF_LONG_LONG)
Theodore Ts'o877eb6d2001-06-11 06:54:13 +0000746AC_C_BIGENDIAN
Theodore Ts'o29a5dee2007-07-04 16:28:47 -0400747BUILD_CC="$BUILD_CC" CPP="$CPP" /bin/sh $ac_aux_dir/parse-types.sh
Theodore Ts'o4ea7ea02006-04-09 08:41:55 -0400748ASM_TYPES_HEADER=./asm_types.h
749AC_SUBST_FILE(ASM_TYPES_HEADER)
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000750dnl
Theodore Ts'o488c75a2008-06-07 08:55:21 -0400751dnl Save the configuration #defines needed for the public ext2fs.h
752dnl header file
753dnl
754echo "/* These defines are needed for the public ext2fs.h header file */" \
755 > public_config.h
756if grep HAVE_SYS_TYPES_H confdefs.h > tmp_config.$$; then
757 uniq tmp_config.$$ >> public_config.h
758else
759 echo "#undef HAVE_SYS_TYPES_H" >> public_config.h
760fi
761if grep WORDS_BIGENDIAN confdefs.h > tmp_config.$$; then
762 uniq tmp_config.$$ >> public_config.h
763else
764 echo "#undef WORDS_BIGENDIAN" >> public_config.h
765fi
766rm -f tmp_config.$$
767PUBLIC_CONFIG_HEADER=./public_config.h
768AC_SUBST_FILE(PUBLIC_CONFIG_HEADER)
769dnl
Theodore Ts'o0c193f82003-08-01 14:26:23 -0400770dnl See if we have inttypes.h and if intptr_t is defined
771dnl
772AC_CHECK_HEADERS([inttypes.h])
Theodore Ts'od2ee56d2005-01-09 00:57:45 -0500773AC_CHECK_TYPES(intptr_t)
Theodore Ts'o0c193f82003-08-01 14:26:23 -0400774dnl
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000775dnl See if struct stat has a st_flags field, in which case we can get file
776dnl flags somewhat portably. Also check for the analogous setter, chflags().
777dnl
778AC_MSG_CHECKING(whether struct stat has a st_flags field)
779AC_CACHE_VAL(e2fsprogs_cv_struct_st_flags,
780 AC_TRY_COMPILE([#include <sys/stat.h>],
781 [struct stat stat; stat.st_flags = 0;],
782 [e2fsprogs_cv_struct_st_flags=yes],
783 [e2fsprogs_cv_struct_st_flags=no]))
784AC_MSG_RESULT($e2fsprogs_cv_struct_st_flags)
785if test "$e2fsprogs_cv_struct_st_flags" = yes; then
Theodore Ts'oc03bc4e1999-10-20 18:20:36 +0000786 AC_MSG_CHECKING(whether st_flags field is useful)
787 AC_CACHE_VAL(e2fsprogs_cv_struct_st_flags_immut,
788 AC_TRY_COMPILE([#include <sys/stat.h>],
789 [struct stat stat; stat.st_flags |= UF_IMMUTABLE;],
790 [e2fsprogs_cv_struct_st_flags_immut=yes],
791 [e2fsprogs_cv_struct_st_flags_immut=no]))
792 AC_MSG_RESULT($e2fsprogs_cv_struct_st_flags_immut)
793 if test "$e2fsprogs_cv_struct_st_flags_immut" = yes; then
794 AC_DEFINE(HAVE_STAT_FLAGS)
795 fi
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000796fi
Theodore Ts'o84ea6e72004-03-19 19:29:17 -0500797dnl
798dnl Check for the presence of SA_LEN
799dnl
Theodore Ts'o6c65d252005-01-19 12:59:48 -0500800AC_CHECK_MEMBER(struct sockaddr.sa_len,
801 AC_DEFINE_UNQUOTED(HAVE_SA_LEN,1,[Define if struct sockaddr contains sa_len]),,
802 [#include <sys/types.h>
803 #include <sys/socket.h>])
Theodore Ts'o84ea6e72004-03-19 19:29:17 -0500804dnl
Eric Sandeen9ed8e5f2009-10-02 11:32:42 -0500805dnl This will add -lblkid to the AC_CHECK_FUNCS search if we are using
806dnl the system-provided blkid library
807dnl
808if test -n "$BLKID_CMT"; then
809 AC_SEARCH_LIBS([blkid_probe_all], [blkid])
810fi
811dnl
812AC_CHECK_FUNCS(chflags getrusage llseek lseek64 open64 fstat64 ftruncate64 getmntinfo strtoull strcasecmp srandom jrand48 fchown mallinfo fdatasync strnlen strptime strdup sysconf pathconf posix_memalign memalign valloc __secure_getenv prctl mmap utime setresuid setresgid usleep nanosleep getdtablesize getrlimit blkid_probe_get_topology2)
Theodore Ts'ofc6d9d51997-04-29 14:51:31 +0000813dnl
Theodore Ts'ofc6d9d51997-04-29 14:51:31 +0000814dnl Check to see if -lsocket is required (solaris) to make something
815dnl that uses socket() to compile; this is needed for the UUID library
816dnl
817SOCKET_LIB=''
818AC_CHECK_LIB(socket, socket, [SOCKET_LIB=-lsocket])
819AC_SUBST(SOCKET_LIB)
820dnl
Theodore Ts'o3ae497e2003-03-16 06:26:25 -0500821dnl Check to see if libdl exists for the sake of dlopen
822dnl
823DLOPEN_LIB=''
824AC_CHECK_LIB(dl, dlopen,
825[DLOPEN_LIB=-ldl
826AC_DEFINE(HAVE_DLOPEN)])
827AC_SUBST(DLOPEN_LIB)
828dnl
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000829dnl See if optreset exists
830dnl
831AC_MSG_CHECKING(for optreset)
832AC_CACHE_VAL(ac_cv_have_optreset,
833[AC_EGREP_HEADER(optreset, unistd.h,
834 ac_cv_have_optreset=yes, ac_cv_have_optreset=no)])dnl
835AC_MSG_RESULT($ac_cv_have_optreset)
836if test $ac_cv_have_optreset = yes; then
837 AC_DEFINE(HAVE_OPTRESET)
838fi
839dnl
Theodore Ts'od7f45af2008-09-12 10:15:26 -0400840dnl Test for sem_init, and which library it might require:
841dnl
842SEM_INIT_LIB=''
843AC_CHECK_FUNC(sem_init, ,
844 AC_CHECK_LIB(pthread, sem_init,
845 AC_DEFINE(HAVE_SEM_INIT)
846 SEM_INIT_LIB=-lpthread,
847 AC_CHECK_LIB(rt, sem_init,
848 AC_DEFINE(HAVE_SEM_INIT)
849 SEM_INIT_LIB=-lrt,
850 AC_CHECK_LIB(posix4, sem_init,
851 AC_DEFINE(HAVE_SEM_INIT)
852 SEM_INIT_LIB=-lposix4))))dnl
853AC_SUBST(SEM_INIT_LIB)
854dnl
Theodore Ts'oe54635d2006-08-06 14:33:13 -0400855dnl Check for unified diff
856dnl
857AC_MSG_CHECKING(for unified diff option)
Theodore Ts'o27f991b2008-04-01 20:32:55 -0400858if diff -u $0 $0 > /dev/null 2>&1 ; then
Theodore Ts'oe54635d2006-08-06 14:33:13 -0400859 UNI_DIFF_OPTS=-u
860else
861 UNI_DIFF_OPTS=-c
862fi
863AC_MSG_RESULT($UNI_DIFF_OPTS)
864AC_SUBST(UNI_DIFF_OPTS)
865dnl
Theodore Ts'o8f3f29d2000-02-11 05:04:44 +0000866dnl We use the EXT2 ioctls only under Linux
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000867dnl
Theodore Ts'o8f3f29d2000-02-11 05:04:44 +0000868case "$host_os" in
869linux*)
870 AC_DEFINE(HAVE_EXT2_IOCTLS)
871 ;;
872esac
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000873dnl
Theodore Ts'offf45482003-04-13 00:44:19 -0400874dnl OS-specific uncomment control
Theodore Ts'oe6f2bda2002-08-18 03:37:10 -0400875dnl
876LINUX_CMT="#"
Theodore Ts'offf45482003-04-13 00:44:19 -0400877CYGWIN_CMT="#"
878UNIX_CMT=
Theodore Ts'oe6f2bda2002-08-18 03:37:10 -0400879case "$host_os" in
880linux*)
881 LINUX_CMT=
882 ;;
Theodore Ts'offf45482003-04-13 00:44:19 -0400883cygwin)
884 CYGWIN_CMT=
885 UNIX_CMT="#"
Theodore Ts'offf45482003-04-13 00:44:19 -0400886 ;;
Theodore Ts'oe6f2bda2002-08-18 03:37:10 -0400887esac
888AC_SUBST(LINUX_CMT)
Theodore Ts'offf45482003-04-13 00:44:19 -0400889AC_SUBST(CYGWIN_CMT)
890AC_SUBST(UNIX_CMT)
Theodore Ts'oe6f2bda2002-08-18 03:37:10 -0400891dnl
Theodore Ts'o6c133521999-07-03 20:37:03 +0000892dnl Linux and Hurd places root files in the / by default
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000893dnl
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000894case "$host_os" in
Theodore Ts'o93636bd2003-07-12 02:45:05 -0400895linux* | gnu* | k*bsd*-gnu)
Theodore Ts'oa4b2d3c1998-04-03 16:12:25 +0000896 if test "$prefix" = NONE -a "$root_prefix" = NONE ; then
897 root_prefix="";
Theodore Ts'o02d04db2008-08-22 10:52:42 -0400898 AC_MSG_RESULT([On $host_os systems, root_prefix defaults to ''])
Theodore Ts'ofc6d9d51997-04-29 14:51:31 +0000899 fi
900 ;;
901esac
Theodore Ts'ofc6d9d51997-04-29 14:51:31 +0000902dnl
Theodore Ts'oa4b2d3c1998-04-03 16:12:25 +0000903dnl On Linux/hurd, force the prefix to be /usr
Theodore Ts'ofc6d9d51997-04-29 14:51:31 +0000904dnl
905case "$host_os" in
Theodore Ts'o93636bd2003-07-12 02:45:05 -0400906linux* | gnu* | k*bsd*-gnu)
Theodore Ts'ofc6d9d51997-04-29 14:51:31 +0000907 if test "$prefix" = NONE ; then
Theodore Ts'oa4b2d3c1998-04-03 16:12:25 +0000908 prefix="/usr";
Theodore Ts'o02d04db2008-08-22 10:52:42 -0400909 AC_MSG_RESULT([On $host_os systems, prefix defaults to /usr])
Theodore Ts'obff61a72002-05-21 22:21:38 -0400910 if test "$mandir" = '${prefix}/man' ; then
Theodore Ts'o02d04db2008-08-22 10:52:42 -0400911 AC_MSG_RESULT([...and mandir defaults to /usr/share/man])
Theodore Ts'obff61a72002-05-21 22:21:38 -0400912 mandir=/usr/share/man
913 fi
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000914 fi
915;;
916esac
Theodore Ts'oa4b2d3c1998-04-03 16:12:25 +0000917if test "$root_prefix" = NONE ; then
Theodore Ts'offe19911998-04-08 06:05:49 +0000918 if test "$prefix" = NONE ; then
Theodore Ts'oa4b2d3c1998-04-03 16:12:25 +0000919 root_prefix="$ac_default_prefix"
920 else
921 root_prefix="$prefix"
922 fi
Theodore Ts'ob5ffead2002-05-11 19:17:00 -0400923 root_bindir=$bindir
924 root_sbindir=$sbindir
925 root_libdir=$libdir
926 root_sysconfdir=$sysconfdir
927else
928 root_bindir='${root_prefix}/bin'
929 root_sbindir='${root_prefix}/sbin'
930 root_libdir='${root_prefix}/lib'
931 root_sysconfdir='${root_prefix}/etc'
Theodore Ts'oa4b2d3c1998-04-03 16:12:25 +0000932fi
Theodore Ts'oc4ef11c2008-01-04 16:55:37 -0500933if test "$bindir" != '${exec_prefix}/bin'; then
934 root_bindir=$bindir
Theodore Ts'o02d04db2008-08-22 10:52:42 -0400935 AC_MSG_RESULT([Setting root_bindir to $root_bindir])
Theodore Ts'oc4ef11c2008-01-04 16:55:37 -0500936fi
937if test "$sbindir" != '${exec_prefix}/sbin'; then
938 root_sbindir=$sbindir
Theodore Ts'o02d04db2008-08-22 10:52:42 -0400939 AC_MSG_RESULT([Setting root_sbindir to $root_sbindir])
Theodore Ts'oc4ef11c2008-01-04 16:55:37 -0500940fi
941if test "$libdir" != '${exec_prefix}/lib'; then
942 root_libdir=$libdir
Theodore Ts'o02d04db2008-08-22 10:52:42 -0400943 AC_MSG_RESULT([Setting root_libdir to $root_libdir])
Theodore Ts'oc4ef11c2008-01-04 16:55:37 -0500944fi
945if test "$sysconfdir" != '${prefix}/etc'; then
946 root_sysconfdir=$sysconfdir
Theodore Ts'o02d04db2008-08-22 10:52:42 -0400947 AC_MSG_RESULT([Setting root_sysconfdir to $root_sysconfdir])
Theodore Ts'oc4ef11c2008-01-04 16:55:37 -0500948fi
Theodore Ts'oa4b2d3c1998-04-03 16:12:25 +0000949AC_SUBST(root_prefix)
Theodore Ts'ob5ffead2002-05-11 19:17:00 -0400950AC_SUBST(root_bindir)
951AC_SUBST(root_sbindir)
952AC_SUBST(root_libdir)
953AC_SUBST(root_sysconfdir)
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000954dnl
955dnl See if -static works.
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000956dnl
Theodore Ts'oae851481997-04-29 18:13:24 +0000957AC_MSG_CHECKING([whether linker accepts -static])
958AC_CACHE_VAL(ac_cv_e2fsprogs_use_static,
959[SAVE_LDFLAGS=$LDFLAGS; LDFLAGS="$LDFLAGS -static"
960AC_TRY_LINK([#include <stdio.h>],[fflush(stdout);],
961 ac_cv_e2fsprogs_use_static=yes, ac_cv_e2fsprogs_use_static=no)
962LDFLAGS=$SAVE_LDFLAGS])
Theodore Ts'odefde781999-01-04 07:39:19 +0000963dnl
964dnl Regardless of how the test turns out, Solaris doesn't handle -static
965dnl This is caused by the socket library requiring the nsl library, which
966dnl requires the -dl library, which only works for dynamically linked
967dnl programs. It basically means you can't have statically linked programs
968dnl which use the network under Solaris.
969dnl
970case "$host_os" in
971solaris2.*)
972 ac_cv_e2fsprogs_use_static=no
973;;
974esac
Theodore Ts'oae851481997-04-29 18:13:24 +0000975AC_MSG_RESULT($ac_cv_e2fsprogs_use_static)
Theodore Ts'o74becf31997-04-26 14:37:06 +0000976LDFLAG_STATIC=
Theodore Ts'oae851481997-04-29 18:13:24 +0000977if test $ac_cv_e2fsprogs_use_static = yes; then
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000978 LDFLAG_STATIC=-static
Theodore Ts'oae851481997-04-29 18:13:24 +0000979fi
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000980AC_SUBST(LDFLAG_STATIC)
981dnl
Theodore Ts'o07a0db12003-07-05 14:50:24 -0400982dnl Work around mysterious Darwin / GNU libintl problem
983dnl (__asm__ redirection doesn't work for some mysterious reason. Looks like
984dnl Apple hacked gcc somehow?)
985dnl
986case "$host_os" in
987darwin*)
Theodore Ts'o02d04db2008-08-22 10:52:42 -0400988 AC_MSG_RESULT([Using Apple Darwin / GNU libintl workaround])
Theodore Ts'o07a0db12003-07-05 14:50:24 -0400989 AC_DEFINE(_INTL_REDIRECT_MACROS)
990 ;;
991esac
992dnl
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000993dnl Make the ss and et directories work correctly.
994dnl
995SS_DIR=`cd ${srcdir}/lib/ss; pwd`
996ET_DIR=`cd ${srcdir}/lib/et; pwd`
997AC_SUBST(SS_DIR)
998AC_SUBST(ET_DIR)
999dnl
1000dnl Only try to run the test suite if we're not cross compiling.
1001dnl
1002if test "$cross_compiling" = yes ; then
1003 DO_TEST_SUITE=
1004else
1005 DO_TEST_SUITE=check
1006fi
1007AC_SUBST(DO_TEST_SUITE)
1008dnl
Theodore Ts'oc6f35b82003-05-17 16:29:27 -04001009dnl Only include the intl include files if we're building with them
1010dnl
1011INTL_FLAGS=
1012if test "$USE_INCLUDED_LIBINTL" = "yes" ; then
1013 INTL_FLAGS='-I$(top_builddir)/intl -I$(top_srcdir)/intl'
1014fi
1015AC_SUBST(INTL_FLAGS)
1016dnl
Theodore Ts'odd947da2005-11-09 18:37:07 -04001017dnl Build CFLAGS
1018dnl
1019if test $cross_compiling = no; then
1020 BUILD_CFLAGS="$CFLAGS"
1021 BUILD_LDFLAGS="$LDFLAGS"
1022else
1023 BUILD_CFLAGS=
1024 BUILD_LDFLAGS=
1025fi
1026AC_SUBST(BUILD_CFLAGS)
1027AC_SUBST(BUILD_LDFLAGS)
1028dnl
Theodore Ts'o50e1e101997-04-26 13:58:21 +00001029dnl Make our output files, being sure that we create the some miscellaneous
1030dnl directories
1031dnl
1032test -d lib || mkdir lib
1033test -d include || mkdir include
1034test -d include/linux || mkdir include/linux
Theodore Ts'odefde781999-01-04 07:39:19 +00001035test -d include/asm || mkdir include/asm
Theodore Ts'obff0cc92003-03-23 01:37:53 -05001036for i in MCONFIG Makefile e2fsprogs.spec \
1037 util/Makefile util/subst.conf util/gen-tarball \
Theodore Ts'o4ea7ea02006-04-09 08:41:55 -04001038 lib/et/Makefile lib/ss/Makefile lib/e2p/Makefile \
1039 lib/ext2fs/Makefile lib/ext2fs/ext2_types.h \
Theodore Ts'o94ba8c72003-03-02 02:07:14 -05001040 lib/uuid/Makefile lib/uuid/uuid_types.h \
1041 lib/blkid/Makefile lib/blkid/blkid_types.h \
Theodore Ts'oe6441862005-01-26 12:59:25 -05001042 lib/ss/ss.pc lib/uuid/uuid.pc lib/et/com_err.pc \
1043 lib/e2p/e2p.pc lib/blkid/blkid.pc lib/ext2fs/ext2fs.pc \
Theodore Ts'o921f4ad2004-11-19 17:25:27 -05001044 misc/Makefile ext2ed/Makefile e2fsck/Makefile \
Theodore Ts'o94ba8c72003-03-02 02:07:14 -05001045 debugfs/Makefile tests/Makefile tests/progs/Makefile \
Matthias Andree98a5ad62009-07-15 17:37:52 +02001046 resize/Makefile doc/Makefile intl/Makefile \
1047 intl/libgnuintl.h po/Makefile.in ; do
Theodore Ts'o94ba8c72003-03-02 02:07:14 -05001048 if test -d `dirname ${srcdir}/$i` ; then
1049 outlist="$outlist $i"
1050 fi
1051done
1052AC_OUTPUT($outlist)
Theodore Ts'oee683a12005-02-05 15:53:56 -05001053if test -f util/gen-tarball; then chmod +x util/gen-tarball; fi