blob: acbcec62d5fd54d637800f08c1beb0840dd801e4 [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 +000075dnl set $(CC) from --with-cc=value
76dnl
77AC_ARG_WITH([cc],
78[ --with-cc=COMPILER select compiler to use],
79AC_MSG_RESULT(CC=$withval)
80CC=$withval,
81if test -z "$CC" ; then CC=cc; fi
82[AC_MSG_RESULT(CC defaults to $CC)])dnl
83export CC
84AC_SUBST([CC])
Theodore Ts'o73ae2d42000-02-02 16:13:14 +000085AC_PROG_CC
Theodore Ts'o29a5dee2007-07-04 16:28:47 -040086AC_PROG_CPP
Theodore Ts'o74becf31997-04-26 14:37:06 +000087dnl
88dnl set $(LD) from --with-linker=value
89dnl
90AC_ARG_WITH([linker],
91[ --with-linker=LINKER select linker to use],
92AC_MSG_RESULT(LD=$withval)
93LD=$withval,
94if test -z "$LD" ; then LD=$CC; fi
95[AC_MSG_RESULT(LD defaults to $LD)])dnl
96export LD
97AC_SUBST([LD])
98dnl
99dnl set $(CCOPTS) from --with-ccopts=value
100dnl
101AC_ARG_WITH([ccopts],
102[ --with-ccopts=CCOPTS select compiler command line options],
103AC_MSG_RESULT(CCOPTS is $withval)
Theodore Ts'o877eb6d2001-06-11 06:54:13 +0000104CFLAGS=$withval,
105)dnl
Theodore Ts'o74becf31997-04-26 14:37:06 +0000106dnl
Theodore Ts'of8bd9801999-10-26 04:19:45 +0000107dnl On systems without linux header files, we add an extra include directory
108dnl that holds enough to fake it (hopefully). Note that the $(top_srcdir) here
109dnl is quoted so that it gets expanded by make, not by configure.
110dnl
111AC_CHECK_HEADER(linux/fs.h, [linux_headers=yes], [linux_headers=no])
Theodore Ts'o73ae2d42000-02-02 16:13:14 +0000112if test "$linux_headers" != yes; then
113 LINUX_INCLUDE='-I$(top_builddir)/include'
Theodore Ts'of8bd9801999-10-26 04:19:45 +0000114fi
115AC_SUBST(LINUX_INCLUDE)
116dnl
Matthias Andreeb1c92f92004-02-23 21:30:11 +0100117dnl Alpha computers use fast and imprecise floating point code that may
118dnl miss exceptions by default. Force sane options if we're using GCC.
119AC_MSG_CHECKING(for additional special compiler flags)
120if test "$GCC" = yes
121then
122 case "$host_cpu" in
123 alpha) addcflags="-mieee" ;;
124 esac
125fi
126if test "x$addcflags" != x
127then
128 AC_MSG_RESULT($addcflags)
129 CFLAGS="$addcflags $CFLAGS"
130else
131 AC_MSG_RESULT([[(none)]])
132fi
133dnl
Theodore Ts'oa4d09611997-04-29 14:28:00 +0000134dnl Set default values for library extentions. Will be dealt with after
135dnl parsing configuration opions, which may modify these
136dnl
137LIB_EXT=.a
138STATIC_LIB_EXT=.a
Theodore Ts'o14b596d2009-04-22 09:18:30 -0400139PROFILED_LIB_EXT=.a
Theodore Ts'oa4d09611997-04-29 14:28:00 +0000140dnl
Theodore Ts'o74becf31997-04-26 14:37:06 +0000141dnl set $(LDFLAGS) from --with-ldopts=value
142dnl
143AC_ARG_WITH([ldopts],
144[ --with-ldopts=LDOPTS select linker command line options],
145AC_MSG_RESULT(LDFLAGS is $withval)
146LDFLAGS=$withval,
Theodore Ts'o1aaaa822008-08-22 12:26:07 -0400147)dnl
Theodore Ts'o74becf31997-04-26 14:37:06 +0000148AC_SUBST(LDFLAGS)
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000149dnl
Theodore Ts'oa4b2d3c1998-04-03 16:12:25 +0000150dnl Allow separate `root_prefix' to be specified
Theodore Ts'ofc6d9d51997-04-29 14:51:31 +0000151dnl
Theodore Ts'oa4b2d3c1998-04-03 16:12:25 +0000152AC_ARG_WITH([root-prefix],
153[ --with-root-prefix=PREFIX override prefix variable for files to be placed in the root],
154root_prefix=$withval,
155root_prefix=NONE)dnl
Theodore Ts'ofc6d9d51997-04-29 14:51:31 +0000156dnl
Theodore Ts'o98919bd2005-02-04 10:43:58 -0500157dnl handle --enable-maintainer-mode
158dnl
159AC_ARG_ENABLE([maintainer-mode],
160[ --enable-maintainer-mode enable makefile rules useful for maintainers],
161if test "$enableval" = "no"
162then
163 MAINTAINER_CMT=#
Theodore Ts'o02d04db2008-08-22 10:52:42 -0400164 AC_MSG_RESULT([Disabling maintainer mode])
Theodore Ts'o98919bd2005-02-04 10:43:58 -0500165else
166 MAINTAINER_CMT=
Theodore Ts'o02d04db2008-08-22 10:52:42 -0400167 AC_MSG_RESULT([Enabling maintainer mode])
Theodore Ts'o98919bd2005-02-04 10:43:58 -0500168fi
169,
170MAINTAINER_CMT=#
Theodore Ts'o02d04db2008-08-22 10:52:42 -0400171AC_MSG_RESULT([Disabling maintainer mode by default])
Theodore Ts'o98919bd2005-02-04 10:43:58 -0500172)
173AC_SUBST(MAINTAINER_CMT)
174dnl
Theodore Ts'oc13351f2009-07-02 00:11:17 -0400175dnl handle --enable-verbose-makecmds
176dnl
177AC_ARG_ENABLE([verbose-makecmds],
178[ --enable-verbose-makecmds enable verbose make command output],
179if test "$enableval" = "no"
180then
181 AC_MSG_RESULT([Disabling verbose make commands])
182 E=@echo
183 Q=@
184else
185 AC_MSG_RESULT([Enabling verbose make commands])
186 E=@\\#
187 Q=
188fi
189,
190AC_MSG_RESULT([Disabling verbose make commands])
191E=@echo
192Q=@
193)
194AC_SUBST(E)
195AC_SUBST(Q)
196dnl
Theodore Ts'o19178752000-02-11 15:55:07 +0000197dnl handle --enable-compression
198dnl
199AC_ARG_ENABLE([compression],
200[ --enable-compression enable EXPERIMENTAL compression support],
201if test "$enableval" = "no"
202then
Theodore Ts'o02d04db2008-08-22 10:52:42 -0400203 AC_MSG_RESULT([Disabling compression support])
Theodore Ts'o19178752000-02-11 15:55:07 +0000204else
205 AC_DEFINE(ENABLE_COMPRESSION)
Theodore Ts'o02d04db2008-08-22 10:52:42 -0400206 AC_MSG_RESULT([Enabling compression support])
207 AC_MSG_WARN([Compression support is experimental])
Theodore Ts'o19178752000-02-11 15:55:07 +0000208fi
209,
Theodore Ts'o02d04db2008-08-22 10:52:42 -0400210AC_MSG_RESULT([Disabling compression support by default])
Theodore Ts'o19178752000-02-11 15:55:07 +0000211)
212dnl
Theodore Ts'o8fdc9982002-06-25 23:26:34 -0400213dnl handle --enable-htree
214dnl
215AC_ARG_ENABLE([htree],
216[ --enable-htree enable EXPERIMENTAL htree directory support],
217if test "$enableval" = "no"
218then
219 HTREE_CMT=#
Theodore Ts'o02d04db2008-08-22 10:52:42 -0400220 AC_MSG_RESULT([Disabling htree directory support])
Theodore Ts'o8fdc9982002-06-25 23:26:34 -0400221else
222 HTREE_CMT=
223 AC_DEFINE(ENABLE_HTREE)
Theodore Ts'o02d04db2008-08-22 10:52:42 -0400224 AC_MSG_RESULT([Enabling htree directory support])
Theodore Ts'o8fdc9982002-06-25 23:26:34 -0400225fi
226,
Theodore Ts'o559ca6c2002-08-18 03:48:55 -0400227HTREE_CMT=
228AC_DEFINE(ENABLE_HTREE)
Theodore Ts'o02d04db2008-08-22 10:52:42 -0400229AC_MSG_RESULT([Enabling htree directory support by default])
Theodore Ts'o8fdc9982002-06-25 23:26:34 -0400230)
231AC_SUBST(HTREE_CMT)
232dnl
Theodore Ts'oa4ece352008-01-01 20:05:04 -0500233dnl This needs to be before all of the --enable-*-shlibs options
234dnl
235E2_PKG_CONFIG_STATIC=--static
Theodore Ts'o55da9872008-09-02 23:12:38 -0400236LDFLAG_DYNAMIC=
237PRIVATE_LIBS_CMT=
Theodore Ts'oa4ece352008-01-01 20:05:04 -0500238dnl
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000239dnl handle --enable-elf-shlibs
240dnl
241AC_ARG_ENABLE([elf-shlibs],
Theodore Ts'oa4d09611997-04-29 14:28:00 +0000242[ --enable-elf-shlibs select ELF shared libraries],
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000243if test "$enableval" = "no"
244then
245 ELF_CMT=#
246 MAKEFILE_ELF=/dev/null
Theodore Ts'o02d04db2008-08-22 10:52:42 -0400247 AC_MSG_RESULT([Disabling ELF shared libraries])
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000248else
Theodore Ts'oa4ece352008-01-01 20:05:04 -0500249 E2_PKG_CONFIG_STATIC=
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000250 ELF_CMT=
251 MAKEFILE_ELF=$srcdir/lib/Makefile.elf-lib
Theodore Ts'of5955dd2000-10-25 02:38:39 +0000252 [case "$host_os" in
253 solaris2.*)
254 MAKEFILE_ELF=$srcdir/lib/Makefile.solaris-lib
255 ;;
256 esac]
Theodore Ts'o74becf31997-04-26 14:37:06 +0000257 BINARY_TYPE=elfbin
Theodore Ts'oa4d09611997-04-29 14:28:00 +0000258 LIB_EXT=.so
Theodore Ts'o55da9872008-09-02 23:12:38 -0400259 PRIVATE_LIBS_CMT=#
260 LDFLAG_DYNAMIC=['-Wl,-rpath-link,$(top_builddir)/lib']
Theodore Ts'o02d04db2008-08-22 10:52:42 -0400261 AC_MSG_RESULT([Enabling ELF shared libraries])
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000262fi
263,
264MAKEFILE_ELF=/dev/null
265ELF_CMT=#
Theodore Ts'o02d04db2008-08-22 10:52:42 -0400266AC_MSG_RESULT([Disabling ELF shared libraries by default])
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000267)
268AC_SUBST(ELF_CMT)
269AC_SUBST_FILE(MAKEFILE_ELF)
270dnl
271dnl handle --enable-bsd-shlibs
272dnl
273AC_ARG_ENABLE([bsd-shlibs],
Theodore Ts'oa4d09611997-04-29 14:28:00 +0000274[ --enable-bsd-shlibs select BSD shared libraries],
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000275if test "$enableval" = "no"
276then
277 BSDLIB_CMT=#
278 MAKEFILE_BSDLIB=/dev/null
Theodore Ts'o02d04db2008-08-22 10:52:42 -0400279 AC_MSG_RESULT([Disabling BSD shared libraries])
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000280else
Theodore Ts'oa4ece352008-01-01 20:05:04 -0500281 E2_PKG_CONFIG_STATIC=
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000282 BSDLIB_CMT=
283 MAKEFILE_BSDLIB=$srcdir/lib/Makefile.bsd-lib
Theodore Ts'oa4d09611997-04-29 14:28:00 +0000284 LIB_EXT=.so
Theodore Ts'oe71d8732003-03-14 02:13:48 -0500285 [case "$host_os" in
Theodore Ts'oaa75ecc2003-03-17 10:01:22 -0500286 darwin*)
Theodore Ts'oe71d8732003-03-14 02:13:48 -0500287 MAKEFILE_BSDLIB=$srcdir/lib/Makefile.darwin-lib
288 LIB_EXT=.dylib
289 ;;
290 esac]
Theodore Ts'o02d04db2008-08-22 10:52:42 -0400291 AC_MSG_RESULT([Enabling BSD shared libraries])
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000292fi
293,
294MAKEFILE_BSDLIB=/dev/null
295BSDLIB_CMT=#
Theodore Ts'o02d04db2008-08-22 10:52:42 -0400296AC_MSG_RESULT([Disabling BSD shared libraries by default])
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000297)
298AC_SUBST(BSDLIB_CMT)
299AC_SUBST_FILE(MAKEFILE_BSDLIB)
300dnl
301dnl handle --enable-profile
302dnl
303AC_ARG_ENABLE([profile],
Theodore Ts'oa4d09611997-04-29 14:28:00 +0000304[ --enable-profile build profiling libraries],
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000305if test "$enableval" = "no"
306then
307 PROFILE_CMT=#
308 MAKEFILE_PROFILE=/dev/null
Theodore Ts'o02d04db2008-08-22 10:52:42 -0400309 AC_MSG_RESULT([Disabling profiling libraries])
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000310else
311 PROFILE_CMT=
312 MAKEFILE_PROFILE=$srcdir/lib/Makefile.profile
Theodore Ts'oa4d09611997-04-29 14:28:00 +0000313 PROFILED_LIB_EXT=_p.a
Theodore Ts'o02d04db2008-08-22 10:52:42 -0400314 AC_MSG_RESULT([Building profiling libraries])
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000315fi
316,
317PROFILE_CMT=#
318MAKEFILE_PROFILE=/dev/null
Theodore Ts'o02d04db2008-08-22 10:52:42 -0400319AC_MSG_RESULT([Disabling profiling libraries by default])
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000320)
321AC_SUBST(PROFILE_CMT)
322AC_SUBST_FILE(MAKEFILE_PROFILE)
323dnl
324dnl handle --enable-checker
325dnl
326AC_ARG_ENABLE([checker],
Theodore Ts'oa4d09611997-04-29 14:28:00 +0000327[ --enable-checker build checker libraries],
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000328if test "$enableval" = "no"
329then
330 CHECKER_CMT=#
331 MAKEFILE_CHECKER=/dev/null
Theodore Ts'o02d04db2008-08-22 10:52:42 -0400332 AC_MSG_RESULT([Disabling checker libraries])
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000333else
334 CHECKER_CMT=
335 MAKEFILE_CHECKER=$srcdir/lib/Makefile.checker
Theodore Ts'o02d04db2008-08-22 10:52:42 -0400336 AC_MSG_RESULT([Building checker libraries])
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000337fi
338,
339CHECKER_CMT=#
340MAKEFILE_CHECKER=/dev/null
Theodore Ts'o02d04db2008-08-22 10:52:42 -0400341AC_MSG_RESULT([Disabling checker libraries by default])
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000342)
343AC_SUBST(CHECKER_CMT)
344AC_SUBST_FILE(MAKEFILE_CHECKER)
345dnl
Theodore Ts'oa4d09611997-04-29 14:28:00 +0000346dnl Substitute library extensions
347dnl
348AC_SUBST(LIB_EXT)
349AC_SUBST(STATIC_LIB_EXT)
350AC_SUBST(PROFILED_LIB_EXT)
Theodore Ts'o55da9872008-09-02 23:12:38 -0400351AC_SUBST(LDFLAG_DYNAMIC)
352AC_SUBST(PRIVATE_LIBS_CMT)
Theodore Ts'oa4d09611997-04-29 14:28:00 +0000353dnl
Theodore Ts'o782bebf2002-11-08 18:46:45 -0500354dnl handle --enable-jbd-debug
Theodore Ts'ocdf186e2001-06-13 22:16:47 +0000355dnl
Theodore Ts'o782bebf2002-11-08 18:46:45 -0500356AC_ARG_ENABLE([jbd-debug],
357[ --enable-jbd-debug enable journal debugging],
Theodore Ts'ocdf186e2001-06-13 22:16:47 +0000358if test "$enableval" = "no"
359then
Theodore Ts'o02d04db2008-08-22 10:52:42 -0400360 AC_MSG_RESULT([Disabling journal debugging])
Theodore Ts'ocdf186e2001-06-13 22:16:47 +0000361else
Theodore Ts'o8cf93332001-12-16 02:23:36 -0500362 AC_DEFINE(CONFIG_JBD_DEBUG)
Theodore Ts'o02d04db2008-08-22 10:52:42 -0400363 AC_MSG_RESULT([Enabling journal debugging])
Theodore Ts'ocdf186e2001-06-13 22:16:47 +0000364fi
365,
Theodore Ts'o02d04db2008-08-22 10:52:42 -0400366AC_MSG_RESULT([Disabling journal debugging by default])
Theodore Ts'ocdf186e2001-06-13 22:16:47 +0000367)
368dnl
Theodore Ts'of0a22d02003-02-22 13:19:53 -0500369dnl handle --enable-blkid-debug
370dnl
371AC_ARG_ENABLE([blkid-debug],
Theodore Ts'od21ae6c2003-05-05 09:00:24 -0400372[ --enable-blkid-debug enable blkid debugging],
Theodore Ts'of0a22d02003-02-22 13:19:53 -0500373if test "$enableval" = "no"
374then
Theodore Ts'o02d04db2008-08-22 10:52:42 -0400375 AC_MSG_RESULT([Disabling blkid debugging])
Theodore Ts'of0a22d02003-02-22 13:19:53 -0500376else
377 AC_DEFINE(CONFIG_BLKID_DEBUG)
Theodore Ts'o02d04db2008-08-22 10:52:42 -0400378 AC_MSG_RESULT([Enabling blkid debugging])
Theodore Ts'of0a22d02003-02-22 13:19:53 -0500379fi
380,
Theodore Ts'o02d04db2008-08-22 10:52:42 -0400381AC_MSG_RESULT([Disabling blkid debugging by default])
Theodore Ts'of0a22d02003-02-22 13:19:53 -0500382)
383dnl
Theodore Ts'o2a29f132003-05-05 12:08:47 -0400384dnl handle --enable-testio-debug
385dnl
386AC_ARG_ENABLE([testio-debug],
Theodore Ts'oaf773652008-09-01 11:27:27 -0400387[ --disable-testio-debug disable the use of the test I/O manager for debugging],
Theodore Ts'o2a29f132003-05-05 12:08:47 -0400388if test "$enableval" = "no"
389then
Theodore Ts'o02d04db2008-08-22 10:52:42 -0400390 AC_MSG_RESULT([Disabling testio debugging])
Theodore Ts'oaf773652008-09-01 11:27:27 -0400391 TEST_IO_CMT="#"
Theodore Ts'o2a29f132003-05-05 12:08:47 -0400392else
Theodore Ts'oaf773652008-09-01 11:27:27 -0400393 TEST_IO_CMT=
Theodore Ts'o2a29f132003-05-05 12:08:47 -0400394 AC_DEFINE(CONFIG_TESTIO_DEBUG)
Theodore Ts'o02d04db2008-08-22 10:52:42 -0400395 AC_MSG_RESULT([Enabling testio debugging])
Theodore Ts'o2a29f132003-05-05 12:08:47 -0400396fi
397,
Theodore Ts'oaf773652008-09-01 11:27:27 -0400398AC_MSG_RESULT([Enabling testio debugging by default])
399AC_DEFINE(CONFIG_TESTIO_DEBUG)
400TEST_IO_CMT=
Theodore Ts'o2a29f132003-05-05 12:08:47 -0400401)
Theodore Ts'oaf773652008-09-01 11:27:27 -0400402AC_SUBST(TEST_IO_CMT)
Theodore Ts'o2a29f132003-05-05 12:08:47 -0400403dnl
Scott James Remnant39fd3d42009-05-14 13:03:25 +0100404dnl handle --disable-libuuid
405dnl
406PKG_PROG_PKG_CONFIG
407LIBUUID=
408DEPLIBUUID=
409STATIC_LIBUUID=
410DEPSTATIC_LIBUUID=
411PROFILED_LIBUUID=
412DEPPROFILED_LIBUUID=
413UUID_CMT=
414AC_ARG_ENABLE([libuuid],
415[ --disable-libuuid do not build private uuid library],
416if test "$enableval" = "no"
417then
418 if test -z "$PKG_CONFIG"; then
419 AC_MSG_ERROR([pkg-config not installed; please install it.])
420 fi
421
422 AC_CHECK_LIB(uuid, uuid_generate,
423 [LIBUUID=`$PKG_CONFIG --libs uuid`;
424 STATIC_LIBUUID=`$PKG_CONFIG --static --libs uuid`],
425 [AC_MSG_ERROR([external uuid library not found])],
426 [$LIBUUID])
427 UUID_CMT=#
428 AC_MSG_RESULT([Disabling private uuid library])
429else
430 LIBUUID='$(LIB)/libuuid'$LIB_EXT
431 DEPLIBUUID=$LIBUUID
432 STATIC_LIBUUID='$(LIB)/libuuid'$STATIC_LIB_EXT
433 DEPSTATIC_LIBUUID=$STATIC_LIBUUID
434 PROFILED_LIBUUID='$(LIB)/libuuid'$PROFILED_LIB_EXT
435 DEPPROFILED_LIBUUID=$PROFILED_LIBUUID
436 AC_MSG_RESULT([Enabling private uuid library])
437fi
438,
439LIBUUID='$(LIB)/libuuid'$LIB_EXT
440DEPLIBUUID=$LIBUUID
441STATIC_LIBUUID='$(LIB)/libuuid'$STATIC_LIB_EXT
442DEPSTATIC_LIBUUID=$STATIC_LIBUUID
443PROFILED_LIBUUID='$(LIB)/libuuid'$PROFILED_LIB_EXT
444DEPPROFILED_LIBUUID=$PROFILED_LIBUUID
445AC_MSG_RESULT([Enabling private uuid library by default])
446)
447AC_SUBST(LIBUUID)
448AC_SUBST(DEPLIBUUID)
449AC_SUBST(STATIC_LIBUUID)
450AC_SUBST(DEPSTATIC_LIBUUID)
451AC_SUBST(PROFILED_LIBUUID)
452AC_SUBST(DEPPROFILED_LIBUUID)
453AC_SUBST(UUID_CMT)
454dnl
Theodore Ts'o14b596d2009-04-22 09:18:30 -0400455dnl handle --disable-libblkid
456dnl
457PKG_PROG_PKG_CONFIG
458LIBBLKID=
459DEPLIBBLKID=
460STATIC_LIBBLKID=
461DEPSTATIC_LIBBLKID=
462PROFILED_LIBBLKID=
463DEPPROFILED_LIBBLKID=
464BLKID_CMT=
465AC_ARG_ENABLE([libblkid],
466[ --disable-libblkid do not build private blkid library],
467if test "$enableval" = "no"
468then
469 if test -z "$PKG_CONFIG"; then
470 AC_MSG_ERROR([pkg-config not installed; please install it.])
471 fi
472
473 AC_CHECK_LIB(blkid, blkid_get_cache,
474 [LIBBLKID=`$PKG_CONFIG --libs blkid`;
475 STATIC_LIBBLKID=`$PKG_CONFIG --static --libs blkid`],
476 [AC_MSG_ERROR([external blkid library not found])],
477 [$LIBBLKID])
478 BLKID_CMT=#
479 AC_MSG_RESULT([Disabling private blkid library])
480else
481 LIBBLKID='$(LIB)/libblkid'$LIB_EXT
482 DEPLIBBLKID=$LIBBLKID
483 STATIC_LIBBLKID='$(LIB)/libblkid'$STATIC_LIB_EXT
484 DEPSTATIC_LIBBLKID=$STATIC_LIBBLKID
485 PROFILED_LIBBLKID='$(LIB)/libblkid'$PROFILED_LIB_EXT
486 DEPPROFILED_LIBBLKID=$PROFILED_LIBBLKID
487 AC_DEFINE(CONFIG_BUILD_FINDFS)
488 AC_MSG_RESULT([Enabling private blkid library])
489fi
490,
491LIBBLKID='$(LIB)/libblkid'$LIB_EXT
492DEPLIBBLKID=$LIBBLKID
493STATIC_LIBBLKID='$(LIB)/libblkid'$STATIC_LIB_EXT
494DEPSTATIC_LIBBLKID=$STATIC_LIBBLKID
495PROFILED_LIBBLKID='$(LIB)/libblkid'$PROFILED_LIB_EXT
496DEPPROFILED_LIBBLKID=$PROFILED_LIBBLKID
497AC_DEFINE(CONFIG_BUILD_FINDFS)
498AC_MSG_RESULT([Enabling private blkid library by default])
499)
500AC_SUBST(LIBBLKID)
501AC_SUBST(DEPLIBBLKID)
502AC_SUBST(STATIC_LIBBLKID)
503AC_SUBST(DEPSTATIC_LIBBLKID)
504AC_SUBST(PROFILED_LIBBLKID)
505AC_SUBST(DEPPROFILED_LIBBLKID)
506AC_SUBST(BLKID_CMT)
507dnl
Theodore Ts'ocdf186e2001-06-13 22:16:47 +0000508dnl handle --enable-debugfs
509dnl
510AC_ARG_ENABLE([debugfs],
511[ --disable-debugfs disable support of debugfs program],
512if test "$enableval" = "no"
513then
Theodore Ts'o02d04db2008-08-22 10:52:42 -0400514 AC_MSG_RESULT([Disabling debugfs support])
Theodore Ts'ocdf186e2001-06-13 22:16:47 +0000515 DEBUGFS_CMT="#"
516else
517 DEBUGFS_CMT=
Theodore Ts'o02d04db2008-08-22 10:52:42 -0400518 AC_MSG_RESULT([Enabling debugfs support])
Theodore Ts'ocdf186e2001-06-13 22:16:47 +0000519fi
520,
Theodore Ts'o02d04db2008-08-22 10:52:42 -0400521AC_MSG_RESULT([Enabling debugfs support by default])
Theodore Ts'ocdf186e2001-06-13 22:16:47 +0000522DEBUGFS_CMT=
523)
524AC_SUBST(DEBUGFS_CMT)
525dnl
526dnl handle --enable-imager
527dnl
528AC_ARG_ENABLE([imager],
529[ --disable-imager disable support of e2image program],
530if test "$enableval" = "no"
531then
Theodore Ts'o02d04db2008-08-22 10:52:42 -0400532 AC_MSG_RESULT([Disabling e2image support])
Theodore Ts'ocdf186e2001-06-13 22:16:47 +0000533 IMAGER_CMT="#"
534else
535 IMAGER_CMT=
Theodore Ts'o02d04db2008-08-22 10:52:42 -0400536 AC_MSG_RESULT([Enabling e2image support])
Theodore Ts'ocdf186e2001-06-13 22:16:47 +0000537fi
538,
Theodore Ts'o02d04db2008-08-22 10:52:42 -0400539AC_MSG_RESULT([Enabling e2image support by default])
Theodore Ts'ocdf186e2001-06-13 22:16:47 +0000540IMAGER_CMT=
541)
542AC_SUBST(IMAGER_CMT)
543dnl
544dnl handle --enable-resizer
545dnl
546AC_ARG_ENABLE([resizer],
547[ --disable-resizer disable support of e2resize program],
548if test "$enableval" = "no"
549then
Theodore Ts'o02d04db2008-08-22 10:52:42 -0400550 AC_MSG_RESULT([Disabling e2resize support])
Theodore Ts'ocdf186e2001-06-13 22:16:47 +0000551 RESIZER_CMT="#"
552else
553 RESIZER_CMT=
Theodore Ts'o02d04db2008-08-22 10:52:42 -0400554 AC_MSG_RESULT([Enabling e2resize support])
Theodore Ts'ocdf186e2001-06-13 22:16:47 +0000555fi
556,
Theodore Ts'o02d04db2008-08-22 10:52:42 -0400557AC_MSG_RESULT([Enabling e2resize support by default])
Theodore Ts'ocdf186e2001-06-13 22:16:47 +0000558RESIZER_CMT=
559)
560AC_SUBST(RESIZER_CMT)
561dnl
Theodore Ts'ofc6d9d51997-04-29 14:51:31 +0000562dnl See whether to install the `fsck' wrapper program (that calls e2fsck)
563dnl
564AC_ARG_ENABLE([fsck],
565[ --enable-fsck build fsck wrapper program],
566[if test "$enableval" = "no"
567then
568 FSCK_PROG='' FSCK_MAN=''
Theodore Ts'o02d04db2008-08-22 10:52:42 -0400569 AC_MSG_RESULT([Not building fsck wrapper])
Theodore Ts'ofc6d9d51997-04-29 14:51:31 +0000570else
571 FSCK_PROG=fsck FSCK_MAN=fsck.8
Theodore Ts'o02d04db2008-08-22 10:52:42 -0400572 AC_MSG_RESULT([Building fsck wrapper])
Theodore Ts'ofc6d9d51997-04-29 14:51:31 +0000573fi]
574,
575[case "$host_os" in
Theodore Ts'oe3632402004-05-04 19:39:54 -0400576 gnu*)
Theodore Ts'ofc6d9d51997-04-29 14:51:31 +0000577 FSCK_PROG='' FSCK_MAN=''
Theodore Ts'o02d04db2008-08-22 10:52:42 -0400578 AC_MSG_RESULT([Not building fsck wrapper by default])
Theodore Ts'ofc6d9d51997-04-29 14:51:31 +0000579 ;;
580 *)
581 FSCK_PROG=fsck FSCK_MAN=fsck.8
Theodore Ts'o02d04db2008-08-22 10:52:42 -0400582 AC_MSG_RESULT([Building fsck wrapper by default])
Theodore Ts'ofc6d9d51997-04-29 14:51:31 +0000583esac]
584)
585AC_SUBST(FSCK_PROG)
586AC_SUBST(FSCK_MAN)
587dnl
Theodore Ts'o5d407732004-09-18 14:53:14 -0400588dnl See whether to install the `e2initrd-helper' program
589dnl
590AC_ARG_ENABLE([e2initrd-helper],
591[ --enable-e2initrd-helper build e2initrd-helper program],
592[if test "$enableval" = "no"
593then
594 E2INITRD_PROG='' E2INITRD_MAN=''
Theodore Ts'o02d04db2008-08-22 10:52:42 -0400595 AC_MSG_RESULT([Not building e2initrd helper])
Theodore Ts'o5d407732004-09-18 14:53:14 -0400596else
597 E2INITRD_PROG=e2initrd_helper E2INITRD_MAN=e2initrd_helper.8
Theodore Ts'o02d04db2008-08-22 10:52:42 -0400598 AC_MSG_RESULT([Building e2initrd helper])
Theodore Ts'o5d407732004-09-18 14:53:14 -0400599fi]
600,
601E2INITRD_PROG=e2initrd_helper E2INITRD_MAN=e2initrd_helper.8
Theodore Ts'o02d04db2008-08-22 10:52:42 -0400602AC_MSG_RESULT([Building e2initrd helper by default])
Theodore Ts'o5d407732004-09-18 14:53:14 -0400603)
604AC_SUBST(E2INITRD_PROG)
605AC_SUBST(E2INITRD_MAN)
Karel Zak4db2f592006-03-08 14:17:28 -0500606dnl
Theodore Ts'o5d407732004-09-18 14:53:14 -0400607dnl
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000608dnl
Theodore Ts'o32493942007-12-31 10:45:01 -0500609AC_ARG_ENABLE([tls],
610[ --disable-tls disable use of thread local support],
611[if test "$enableval" = "no"
612then
613 try_tls=""
Theodore Ts'o02d04db2008-08-22 10:52:42 -0400614 AC_MSG_RESULT([Disabling thread local support])
Theodore Ts'o32493942007-12-31 10:45:01 -0500615else
616 try_tls="yes"
Theodore Ts'o02d04db2008-08-22 10:52:42 -0400617 AC_MSG_RESULT([Enabling thread local support])
Theodore Ts'o32493942007-12-31 10:45:01 -0500618fi]
619,
Theodore Ts'oeafba6c2008-07-10 10:21:42 -0400620if test -n "$WITH_DIET_LIBC"
621then
622 try_tls=""
Theodore Ts'o02d04db2008-08-22 10:52:42 -0400623 AC_MSG_RESULT([Diet libc does not support thread local support])
Theodore Ts'oeafba6c2008-07-10 10:21:42 -0400624else
625 try_tls="yes"
Theodore Ts'o02d04db2008-08-22 10:52:42 -0400626 AC_MSG_RESULT([Try using thread local support by default])
Theodore Ts'oeafba6c2008-07-10 10:21:42 -0400627fi
Theodore Ts'o32493942007-12-31 10:45:01 -0500628)
629if test "$try_tls" = "yes"
630then
631AX_TLS
632fi
633dnl
634dnl
635dnl
Theodore Ts'o5610f992007-12-31 11:16:56 -0500636AC_ARG_ENABLE([uuidd],
637[ --disable-uuidd disable building the uuid daemon],
638[if test "$enableval" = "no"
639then
Theodore Ts'o02d04db2008-08-22 10:52:42 -0400640 AC_MSG_RESULT([Not building uuidd])
Theodore Ts'o5610f992007-12-31 11:16:56 -0500641 UUIDD_CMT="#"
642else
643 AC_DEFINE(USE_UUIDD)
644 UUIDD_CMT=""
Theodore Ts'o02d04db2008-08-22 10:52:42 -0400645 AC_MSG_RESULT([Building uuidd])
Theodore Ts'o5610f992007-12-31 11:16:56 -0500646fi]
647,
648AC_DEFINE(USE_UUIDD)
649UUIDD_CMT=""
Theodore Ts'o02d04db2008-08-22 10:52:42 -0400650AC_MSG_RESULT([Building uuidd by default])
Theodore Ts'o5610f992007-12-31 11:16:56 -0500651)
652AC_SUBST(UUIDD_CMT)
653dnl
654dnl
655dnl
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000656MAKEFILE_LIBRARY=$srcdir/lib/Makefile.library
657AC_SUBST_FILE(MAKEFILE_LIBRARY)
658dnl
Theodore Ts'ocdf186e2001-06-13 22:16:47 +0000659dnl Add internationalization support, using gettext.
660dnl
Theodore Ts'ob0cacab2004-11-30 19:00:19 -0500661GETTEXT_PACKAGE=e2fsprogs
Theodore Ts'ocdf186e2001-06-13 22:16:47 +0000662PACKAGE=e2fsprogs
663VERSION="$E2FSPROGS_VERSION"
Theodore Ts'ob0cacab2004-11-30 19:00:19 -0500664VERSION=0.14.1
Theodore Ts'ocdf186e2001-06-13 22:16:47 +0000665AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE")
666AC_DEFINE_UNQUOTED(VERSION, "$VERSION")
Theodore Ts'ob0cacab2004-11-30 19:00:19 -0500667AC_SUBST(GETTEXT_PACKAGE)
Theodore Ts'ocdf186e2001-06-13 22:16:47 +0000668AC_SUBST(PACKAGE)
669AC_SUBST(VERSION)
670
Theodore Ts'ocdf186e2001-06-13 22:16:47 +0000671AM_GNU_GETTEXT
672dnl
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000673dnl End of configuration options
674dnl
Theodore Ts'o74becf31997-04-26 14:37:06 +0000675AC_SUBST(BINARY_TYPE)
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000676AC_PROG_MAKE_SET
Theodore Ts'obcb915b2009-07-02 18:19:10 -0400677CHECK_GNU_MAKE
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000678AC_PATH_PROG(LN, ln, ln)
Theodore Ts'ofc6d9d51997-04-29 14:51:31 +0000679AC_PROG_LN_S
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000680AC_PATH_PROG(MV, mv, mv)
681AC_PATH_PROG(CP, cp, cp)
682AC_PATH_PROG(RM, rm, rm)
683AC_PATH_PROG(CHMOD, chmod, :)
Theodore Ts'o32237012005-01-17 19:13:39 -0500684AC_PROG_AWK
685AC_PROG_EGREP
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000686AC_PATH_PROG(SED, sed, sed)
Theodore Ts'o9d564f71999-07-03 20:25:58 +0000687AC_PATH_PROG(PERL, perl, perl)
Theodore Ts'o250f79f2001-05-19 22:02:22 +0000688AC_PATH_PROG(LDCONFIG, ldconfig, :)
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000689AC_CHECK_TOOL(AR, ar, ar)
690AC_CHECK_TOOL(RANLIB, ranlib, :)
691AC_CHECK_TOOL(STRIP, strip, :)
Manish Katiyar7321d942008-04-14 17:20:03 +0530692AC_CHECK_PROG(MAKEINFO, makeinfo, makeinfo, )
693if test "_$MAKEINFO" = "_"; then
694 MAKEINFO="@echo Makeinfo is missing. Info documentation will not be built.;true"
695else
696 case "$MAKEINFO" in
697 */missing.*)
698 AC_MSG_WARN([
699*** Makeinfo is missing. Info documentation will not be built.])
700 ;;
701 *)
702 ;;
703 esac
704fi
705AC_SUBST(MAKEINFO)
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000706AC_PROG_INSTALL
Theodore Ts'o6c133521999-07-03 20:37:03 +0000707# See if we need a separate native compiler.
708if test $cross_compiling = no; then
709 BUILD_CC="$CC"
710 AC_SUBST(BUILD_CC)
711else
712 AC_CHECK_PROGS(BUILD_CC, gcc cc)
713fi
Theodore Ts'od7f45af2008-09-12 10:15:26 -0400714AC_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 -0500715AC_CHECK_HEADERS(sys/disk.h sys/mount.h,,,
716[[
717#if HAVE_SYS_QUEUE_H
718#include <sys/queue.h>
719#endif
720]])
721AC_CHECK_HEADERS(net/if.h,,,
722[[
723#if HAVE_SYS_TYPES_H
724#include <sys/types.h>
725#endif
726#if HAVE_SYS_SOCKET
727#include <sys/socket.h>
728#endif
729]])
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000730AC_FUNC_VPRINTF
Theodore Ts'offf45482003-04-13 00:44:19 -0400731dnl Check to see if dirent has member d_reclen. On cygwin those d_reclen
732dnl is not decleared.
Theodore Ts'o6c65d252005-01-19 12:59:48 -0500733AC_CHECK_MEMBER(struct dirent.d_reclen,[AC_DEFINE(HAVE_RECLEN_DIRENT)],,
734 [#include <dirent.h>])
Theodore Ts'offf45482003-04-13 00:44:19 -0400735dnl Check to see if ssize_t was decleared
Theodore Ts'o6c65d252005-01-19 12:59:48 -0500736AC_CHECK_TYPE(ssize_t,[AC_DEFINE(HAVE_TYPE_SSIZE_T)],,
737 [#include <sys/types.h>])
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000738dnl
Theodore Ts'ob0b9c4d1997-10-20 23:36:30 +0000739dnl Check to see if llseek() is declared in unistd.h. On some libc's
740dnl it is, and on others it isn't..... Thank you glibc developers....
741dnl
Theodore Ts'o6c65d252005-01-19 12:59:48 -0500742AC_CHECK_DECL(llseek,[AC_DEFINE(HAVE_LLSEEK_PROTOTYPE)],,
743 [#include <unistd.h>])
Theodore Ts'ob0b9c4d1997-10-20 23:36:30 +0000744dnl
Theodore Ts'o6928adc2000-05-25 23:28:50 +0000745dnl Check to see if lseek64() is declared in unistd.h. Glibc's header files
746dnl are so convoluted that I can't tell whether it will always be defined,
747dnl and if it isn't defined while lseek64 is defined in the library,
748dnl disaster will strike.
749dnl
750dnl Warning! Use of --enable-gcc-wall may throw off this test.
751dnl
752dnl
Theodore Ts'o6c65d252005-01-19 12:59:48 -0500753AC_CHECK_DECL(lseek64,[AC_DEFINE(HAVE_LSEEK64_PROTOTYPE)],,
754 [#define _LARGEFILE_SOURCE
755 #define _LARGEFILE64_SOURCE
756 #include <unistd.h>])
Theodore Ts'o6928adc2000-05-25 23:28:50 +0000757dnl
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000758dnl Word sizes...
759dnl
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000760AC_CHECK_SIZEOF(short)
761AC_CHECK_SIZEOF(int)
762AC_CHECK_SIZEOF(long)
Theodore Ts'ofc6d9d51997-04-29 14:51:31 +0000763AC_CHECK_SIZEOF(long long)
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000764SIZEOF_SHORT=$ac_cv_sizeof_short
765SIZEOF_INT=$ac_cv_sizeof_int
766SIZEOF_LONG=$ac_cv_sizeof_long
Theodore Ts'ofc6d9d51997-04-29 14:51:31 +0000767SIZEOF_LONG_LONG=$ac_cv_sizeof_long_long
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000768AC_SUBST(SIZEOF_SHORT)
769AC_SUBST(SIZEOF_INT)
770AC_SUBST(SIZEOF_LONG)
Theodore Ts'ofc6d9d51997-04-29 14:51:31 +0000771AC_SUBST(SIZEOF_LONG_LONG)
Theodore Ts'o877eb6d2001-06-11 06:54:13 +0000772AC_C_BIGENDIAN
Theodore Ts'o29a5dee2007-07-04 16:28:47 -0400773BUILD_CC="$BUILD_CC" CPP="$CPP" /bin/sh $ac_aux_dir/parse-types.sh
Theodore Ts'o4ea7ea02006-04-09 08:41:55 -0400774ASM_TYPES_HEADER=./asm_types.h
775AC_SUBST_FILE(ASM_TYPES_HEADER)
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000776dnl
Theodore Ts'o488c75a2008-06-07 08:55:21 -0400777dnl Save the configuration #defines needed for the public ext2fs.h
778dnl header file
779dnl
780echo "/* These defines are needed for the public ext2fs.h header file */" \
781 > public_config.h
782if grep HAVE_SYS_TYPES_H confdefs.h > tmp_config.$$; then
783 uniq tmp_config.$$ >> public_config.h
784else
785 echo "#undef HAVE_SYS_TYPES_H" >> public_config.h
786fi
787if grep WORDS_BIGENDIAN confdefs.h > tmp_config.$$; then
788 uniq tmp_config.$$ >> public_config.h
789else
790 echo "#undef WORDS_BIGENDIAN" >> public_config.h
791fi
792rm -f tmp_config.$$
793PUBLIC_CONFIG_HEADER=./public_config.h
794AC_SUBST_FILE(PUBLIC_CONFIG_HEADER)
795dnl
Theodore Ts'o0c193f82003-08-01 14:26:23 -0400796dnl See if we have inttypes.h and if intptr_t is defined
797dnl
798AC_CHECK_HEADERS([inttypes.h])
Theodore Ts'od2ee56d2005-01-09 00:57:45 -0500799AC_CHECK_TYPES(intptr_t)
Theodore Ts'o0c193f82003-08-01 14:26:23 -0400800dnl
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000801dnl See if struct stat has a st_flags field, in which case we can get file
802dnl flags somewhat portably. Also check for the analogous setter, chflags().
803dnl
804AC_MSG_CHECKING(whether struct stat has a st_flags field)
805AC_CACHE_VAL(e2fsprogs_cv_struct_st_flags,
806 AC_TRY_COMPILE([#include <sys/stat.h>],
807 [struct stat stat; stat.st_flags = 0;],
808 [e2fsprogs_cv_struct_st_flags=yes],
809 [e2fsprogs_cv_struct_st_flags=no]))
810AC_MSG_RESULT($e2fsprogs_cv_struct_st_flags)
811if test "$e2fsprogs_cv_struct_st_flags" = yes; then
Theodore Ts'oc03bc4e1999-10-20 18:20:36 +0000812 AC_MSG_CHECKING(whether st_flags field is useful)
813 AC_CACHE_VAL(e2fsprogs_cv_struct_st_flags_immut,
814 AC_TRY_COMPILE([#include <sys/stat.h>],
815 [struct stat stat; stat.st_flags |= UF_IMMUTABLE;],
816 [e2fsprogs_cv_struct_st_flags_immut=yes],
817 [e2fsprogs_cv_struct_st_flags_immut=no]))
818 AC_MSG_RESULT($e2fsprogs_cv_struct_st_flags_immut)
819 if test "$e2fsprogs_cv_struct_st_flags_immut" = yes; then
820 AC_DEFINE(HAVE_STAT_FLAGS)
821 fi
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000822fi
Theodore Ts'o84ea6e72004-03-19 19:29:17 -0500823dnl
824dnl Check for the presence of SA_LEN
825dnl
Theodore Ts'o6c65d252005-01-19 12:59:48 -0500826AC_CHECK_MEMBER(struct sockaddr.sa_len,
827 AC_DEFINE_UNQUOTED(HAVE_SA_LEN,1,[Define if struct sockaddr contains sa_len]),,
828 [#include <sys/types.h>
829 #include <sys/socket.h>])
Theodore Ts'o84ea6e72004-03-19 19:29:17 -0500830dnl
Theodore Ts'o1207e362009-04-15 13:05:09 -0400831AC_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)
Theodore Ts'ofc6d9d51997-04-29 14:51:31 +0000832dnl
Theodore Ts'ofc6d9d51997-04-29 14:51:31 +0000833dnl Check to see if -lsocket is required (solaris) to make something
834dnl that uses socket() to compile; this is needed for the UUID library
835dnl
836SOCKET_LIB=''
837AC_CHECK_LIB(socket, socket, [SOCKET_LIB=-lsocket])
838AC_SUBST(SOCKET_LIB)
839dnl
Theodore Ts'o3ae497e2003-03-16 06:26:25 -0500840dnl Check to see if libdl exists for the sake of dlopen
841dnl
842DLOPEN_LIB=''
843AC_CHECK_LIB(dl, dlopen,
844[DLOPEN_LIB=-ldl
845AC_DEFINE(HAVE_DLOPEN)])
846AC_SUBST(DLOPEN_LIB)
847dnl
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000848dnl See if optreset exists
849dnl
850AC_MSG_CHECKING(for optreset)
851AC_CACHE_VAL(ac_cv_have_optreset,
852[AC_EGREP_HEADER(optreset, unistd.h,
853 ac_cv_have_optreset=yes, ac_cv_have_optreset=no)])dnl
854AC_MSG_RESULT($ac_cv_have_optreset)
855if test $ac_cv_have_optreset = yes; then
856 AC_DEFINE(HAVE_OPTRESET)
857fi
858dnl
Theodore Ts'od7f45af2008-09-12 10:15:26 -0400859dnl Test for sem_init, and which library it might require:
860dnl
861SEM_INIT_LIB=''
862AC_CHECK_FUNC(sem_init, ,
863 AC_CHECK_LIB(pthread, sem_init,
864 AC_DEFINE(HAVE_SEM_INIT)
865 SEM_INIT_LIB=-lpthread,
866 AC_CHECK_LIB(rt, sem_init,
867 AC_DEFINE(HAVE_SEM_INIT)
868 SEM_INIT_LIB=-lrt,
869 AC_CHECK_LIB(posix4, sem_init,
870 AC_DEFINE(HAVE_SEM_INIT)
871 SEM_INIT_LIB=-lposix4))))dnl
872AC_SUBST(SEM_INIT_LIB)
873dnl
Theodore Ts'oe54635d2006-08-06 14:33:13 -0400874dnl Check for unified diff
875dnl
876AC_MSG_CHECKING(for unified diff option)
Theodore Ts'o27f991b2008-04-01 20:32:55 -0400877if diff -u $0 $0 > /dev/null 2>&1 ; then
Theodore Ts'oe54635d2006-08-06 14:33:13 -0400878 UNI_DIFF_OPTS=-u
879else
880 UNI_DIFF_OPTS=-c
881fi
882AC_MSG_RESULT($UNI_DIFF_OPTS)
883AC_SUBST(UNI_DIFF_OPTS)
884dnl
Theodore Ts'o8f3f29d2000-02-11 05:04:44 +0000885dnl We use the EXT2 ioctls only under Linux
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000886dnl
Theodore Ts'o8f3f29d2000-02-11 05:04:44 +0000887case "$host_os" in
888linux*)
889 AC_DEFINE(HAVE_EXT2_IOCTLS)
890 ;;
891esac
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000892dnl
Theodore Ts'offf45482003-04-13 00:44:19 -0400893dnl OS-specific uncomment control
Theodore Ts'oe6f2bda2002-08-18 03:37:10 -0400894dnl
895LINUX_CMT="#"
Theodore Ts'offf45482003-04-13 00:44:19 -0400896CYGWIN_CMT="#"
897UNIX_CMT=
Theodore Ts'oe6f2bda2002-08-18 03:37:10 -0400898case "$host_os" in
899linux*)
900 LINUX_CMT=
901 ;;
Theodore Ts'offf45482003-04-13 00:44:19 -0400902cygwin)
903 CYGWIN_CMT=
904 UNIX_CMT="#"
Theodore Ts'offf45482003-04-13 00:44:19 -0400905 ;;
Theodore Ts'oe6f2bda2002-08-18 03:37:10 -0400906esac
907AC_SUBST(LINUX_CMT)
Theodore Ts'offf45482003-04-13 00:44:19 -0400908AC_SUBST(CYGWIN_CMT)
909AC_SUBST(UNIX_CMT)
Theodore Ts'oe6f2bda2002-08-18 03:37:10 -0400910dnl
Theodore Ts'o6c133521999-07-03 20:37:03 +0000911dnl Linux and Hurd places root files in the / by default
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000912dnl
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000913case "$host_os" in
Theodore Ts'o93636bd2003-07-12 02:45:05 -0400914linux* | gnu* | k*bsd*-gnu)
Theodore Ts'oa4b2d3c1998-04-03 16:12:25 +0000915 if test "$prefix" = NONE -a "$root_prefix" = NONE ; then
916 root_prefix="";
Theodore Ts'o02d04db2008-08-22 10:52:42 -0400917 AC_MSG_RESULT([On $host_os systems, root_prefix defaults to ''])
Theodore Ts'ofc6d9d51997-04-29 14:51:31 +0000918 fi
919 ;;
920esac
Theodore Ts'ofc6d9d51997-04-29 14:51:31 +0000921dnl
Theodore Ts'oa4b2d3c1998-04-03 16:12:25 +0000922dnl On Linux/hurd, force the prefix to be /usr
Theodore Ts'ofc6d9d51997-04-29 14:51:31 +0000923dnl
924case "$host_os" in
Theodore Ts'o93636bd2003-07-12 02:45:05 -0400925linux* | gnu* | k*bsd*-gnu)
Theodore Ts'ofc6d9d51997-04-29 14:51:31 +0000926 if test "$prefix" = NONE ; then
Theodore Ts'oa4b2d3c1998-04-03 16:12:25 +0000927 prefix="/usr";
Theodore Ts'o02d04db2008-08-22 10:52:42 -0400928 AC_MSG_RESULT([On $host_os systems, prefix defaults to /usr])
Theodore Ts'obff61a72002-05-21 22:21:38 -0400929 if test "$mandir" = '${prefix}/man' ; then
Theodore Ts'o02d04db2008-08-22 10:52:42 -0400930 AC_MSG_RESULT([...and mandir defaults to /usr/share/man])
Theodore Ts'obff61a72002-05-21 22:21:38 -0400931 mandir=/usr/share/man
932 fi
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000933 fi
934;;
935esac
Theodore Ts'oa4b2d3c1998-04-03 16:12:25 +0000936if test "$root_prefix" = NONE ; then
Theodore Ts'offe19911998-04-08 06:05:49 +0000937 if test "$prefix" = NONE ; then
Theodore Ts'oa4b2d3c1998-04-03 16:12:25 +0000938 root_prefix="$ac_default_prefix"
939 else
940 root_prefix="$prefix"
941 fi
Theodore Ts'ob5ffead2002-05-11 19:17:00 -0400942 root_bindir=$bindir
943 root_sbindir=$sbindir
944 root_libdir=$libdir
945 root_sysconfdir=$sysconfdir
946else
947 root_bindir='${root_prefix}/bin'
948 root_sbindir='${root_prefix}/sbin'
949 root_libdir='${root_prefix}/lib'
950 root_sysconfdir='${root_prefix}/etc'
Theodore Ts'oa4b2d3c1998-04-03 16:12:25 +0000951fi
Theodore Ts'oc4ef11c2008-01-04 16:55:37 -0500952if test "$bindir" != '${exec_prefix}/bin'; then
953 root_bindir=$bindir
Theodore Ts'o02d04db2008-08-22 10:52:42 -0400954 AC_MSG_RESULT([Setting root_bindir to $root_bindir])
Theodore Ts'oc4ef11c2008-01-04 16:55:37 -0500955fi
956if test "$sbindir" != '${exec_prefix}/sbin'; then
957 root_sbindir=$sbindir
Theodore Ts'o02d04db2008-08-22 10:52:42 -0400958 AC_MSG_RESULT([Setting root_sbindir to $root_sbindir])
Theodore Ts'oc4ef11c2008-01-04 16:55:37 -0500959fi
960if test "$libdir" != '${exec_prefix}/lib'; then
961 root_libdir=$libdir
Theodore Ts'o02d04db2008-08-22 10:52:42 -0400962 AC_MSG_RESULT([Setting root_libdir to $root_libdir])
Theodore Ts'oc4ef11c2008-01-04 16:55:37 -0500963fi
964if test "$sysconfdir" != '${prefix}/etc'; then
965 root_sysconfdir=$sysconfdir
Theodore Ts'o02d04db2008-08-22 10:52:42 -0400966 AC_MSG_RESULT([Setting root_sysconfdir to $root_sysconfdir])
Theodore Ts'oc4ef11c2008-01-04 16:55:37 -0500967fi
Theodore Ts'oa4b2d3c1998-04-03 16:12:25 +0000968AC_SUBST(root_prefix)
Theodore Ts'ob5ffead2002-05-11 19:17:00 -0400969AC_SUBST(root_bindir)
970AC_SUBST(root_sbindir)
971AC_SUBST(root_libdir)
972AC_SUBST(root_sysconfdir)
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000973dnl
974dnl See if -static works.
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000975dnl
Theodore Ts'oae851481997-04-29 18:13:24 +0000976AC_MSG_CHECKING([whether linker accepts -static])
977AC_CACHE_VAL(ac_cv_e2fsprogs_use_static,
978[SAVE_LDFLAGS=$LDFLAGS; LDFLAGS="$LDFLAGS -static"
979AC_TRY_LINK([#include <stdio.h>],[fflush(stdout);],
980 ac_cv_e2fsprogs_use_static=yes, ac_cv_e2fsprogs_use_static=no)
981LDFLAGS=$SAVE_LDFLAGS])
Theodore Ts'odefde781999-01-04 07:39:19 +0000982dnl
983dnl Regardless of how the test turns out, Solaris doesn't handle -static
984dnl This is caused by the socket library requiring the nsl library, which
985dnl requires the -dl library, which only works for dynamically linked
986dnl programs. It basically means you can't have statically linked programs
987dnl which use the network under Solaris.
988dnl
989case "$host_os" in
990solaris2.*)
991 ac_cv_e2fsprogs_use_static=no
992;;
993esac
Theodore Ts'oae851481997-04-29 18:13:24 +0000994AC_MSG_RESULT($ac_cv_e2fsprogs_use_static)
Theodore Ts'o74becf31997-04-26 14:37:06 +0000995LDFLAG_STATIC=
Theodore Ts'oae851481997-04-29 18:13:24 +0000996if test $ac_cv_e2fsprogs_use_static = yes; then
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000997 LDFLAG_STATIC=-static
Theodore Ts'oae851481997-04-29 18:13:24 +0000998fi
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000999AC_SUBST(LDFLAG_STATIC)
1000dnl
Theodore Ts'o07a0db12003-07-05 14:50:24 -04001001dnl Work around mysterious Darwin / GNU libintl problem
1002dnl (__asm__ redirection doesn't work for some mysterious reason. Looks like
1003dnl Apple hacked gcc somehow?)
1004dnl
1005case "$host_os" in
1006darwin*)
Theodore Ts'o02d04db2008-08-22 10:52:42 -04001007 AC_MSG_RESULT([Using Apple Darwin / GNU libintl workaround])
Theodore Ts'o07a0db12003-07-05 14:50:24 -04001008 AC_DEFINE(_INTL_REDIRECT_MACROS)
1009 ;;
1010esac
1011dnl
Theodore Ts'o50e1e101997-04-26 13:58:21 +00001012dnl Make the ss and et directories work correctly.
1013dnl
1014SS_DIR=`cd ${srcdir}/lib/ss; pwd`
1015ET_DIR=`cd ${srcdir}/lib/et; pwd`
1016AC_SUBST(SS_DIR)
1017AC_SUBST(ET_DIR)
1018dnl
1019dnl Only try to run the test suite if we're not cross compiling.
1020dnl
1021if test "$cross_compiling" = yes ; then
1022 DO_TEST_SUITE=
1023else
1024 DO_TEST_SUITE=check
1025fi
1026AC_SUBST(DO_TEST_SUITE)
1027dnl
Theodore Ts'oc6f35b82003-05-17 16:29:27 -04001028dnl Only include the intl include files if we're building with them
1029dnl
1030INTL_FLAGS=
1031if test "$USE_INCLUDED_LIBINTL" = "yes" ; then
1032 INTL_FLAGS='-I$(top_builddir)/intl -I$(top_srcdir)/intl'
1033fi
1034AC_SUBST(INTL_FLAGS)
1035dnl
Theodore Ts'odd947da2005-11-09 18:37:07 -04001036dnl Build CFLAGS
1037dnl
1038if test $cross_compiling = no; then
1039 BUILD_CFLAGS="$CFLAGS"
1040 BUILD_LDFLAGS="$LDFLAGS"
1041else
1042 BUILD_CFLAGS=
1043 BUILD_LDFLAGS=
1044fi
1045AC_SUBST(BUILD_CFLAGS)
1046AC_SUBST(BUILD_LDFLAGS)
1047dnl
Theodore Ts'o50e1e101997-04-26 13:58:21 +00001048dnl Make our output files, being sure that we create the some miscellaneous
1049dnl directories
1050dnl
1051test -d lib || mkdir lib
1052test -d include || mkdir include
1053test -d include/linux || mkdir include/linux
Theodore Ts'odefde781999-01-04 07:39:19 +00001054test -d include/asm || mkdir include/asm
Theodore Ts'obff0cc92003-03-23 01:37:53 -05001055for i in MCONFIG Makefile e2fsprogs.spec \
1056 util/Makefile util/subst.conf util/gen-tarball \
Theodore Ts'o4ea7ea02006-04-09 08:41:55 -04001057 lib/et/Makefile lib/ss/Makefile lib/e2p/Makefile \
1058 lib/ext2fs/Makefile lib/ext2fs/ext2_types.h \
Theodore Ts'o94ba8c72003-03-02 02:07:14 -05001059 lib/uuid/Makefile lib/uuid/uuid_types.h \
1060 lib/blkid/Makefile lib/blkid/blkid_types.h \
Theodore Ts'oe6441862005-01-26 12:59:25 -05001061 lib/ss/ss.pc lib/uuid/uuid.pc lib/et/com_err.pc \
1062 lib/e2p/e2p.pc lib/blkid/blkid.pc lib/ext2fs/ext2fs.pc \
Theodore Ts'o921f4ad2004-11-19 17:25:27 -05001063 misc/Makefile ext2ed/Makefile e2fsck/Makefile \
Theodore Ts'o94ba8c72003-03-02 02:07:14 -05001064 debugfs/Makefile tests/Makefile tests/progs/Makefile \
Matthias Andree98a5ad62009-07-15 17:37:52 +02001065 resize/Makefile doc/Makefile intl/Makefile \
1066 intl/libgnuintl.h po/Makefile.in ; do
Theodore Ts'o94ba8c72003-03-02 02:07:14 -05001067 if test -d `dirname ${srcdir}/$i` ; then
1068 outlist="$outlist $i"
1069 fi
1070done
1071AC_OUTPUT($outlist)
Theodore Ts'oee683a12005-02-05 15:53:56 -05001072if test -f util/gen-tarball; then chmod +x util/gen-tarball; fi