blob: 3441bee6260799fd052f755a89917943fc720266 [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'o57aa50d2009-11-26 10:38:04 -050066dnl Check to see if libdl exists for the sake of dlopen
67dnl
68DLOPEN_LIB=''
69AC_CHECK_LIB(dl, dlopen,
70[DLOPEN_LIB=-ldl
71AC_DEFINE(HAVE_DLOPEN)])
72AC_SUBST(DLOPEN_LIB)
73dnl
Theodore Ts'od21ae6c2003-05-05 09:00:24 -040074dnl Use diet libc
75dnl
Theodore Ts'oeafba6c2008-07-10 10:21:42 -040076WITH_DIET_LIBC=
Theodore Ts'od21ae6c2003-05-05 09:00:24 -040077AC_ARG_WITH([diet-libc],
Theodore Ts'o32493942007-12-31 10:45:01 -050078[ --with-diet-libc use diet libc],
Theodore Ts'od21ae6c2003-05-05 09:00:24 -040079CC="diet cc -nostdinc"
Theodore Ts'oeafba6c2008-07-10 10:21:42 -040080WITH_DIET_LIBC=yes
Theodore Ts'od21ae6c2003-05-05 09:00:24 -040081AC_MSG_RESULT(CC=$CC))dnl
82dnl
Theodore Ts'o74becf31997-04-26 14:37:06 +000083AC_ARG_WITH([cc],
Theodore Ts'o0b5b9f92009-09-06 21:28:47 -040084AC_HELP_STRING([--with-cc],[no longer supported, use CC= instead]),
85AC_MSG_ERROR([--with-cc no longer supported; use CC= instead]))
Theodore Ts'o74becf31997-04-26 14:37:06 +000086dnl
87AC_ARG_WITH([ccopts],
Theodore Ts'o0b5b9f92009-09-06 21:28:47 -040088AC_HELP_STRING([--with-ccopts],[no longer supported, use CFLAGS= instead]),
89AC_MSG_ERROR([--with-ccopts no longer supported; use CFLAGS= instead]))
90dnl
91AC_ARG_WITH([ldopts],
92AC_HELP_STRING([--with-ldopts],[no longer supported, use LDFLAGS= instead]),
93AC_MSG_ERROR([--with-ldopts no longer supported; use LDFLAGS= instead]))
94dnl
95AC_PROG_CC
96AC_PROG_CPP
Theodore Ts'o74becf31997-04-26 14:37:06 +000097dnl
Theodore Ts'of8bd9801999-10-26 04:19:45 +000098dnl On systems without linux header files, we add an extra include directory
99dnl that holds enough to fake it (hopefully). Note that the $(top_srcdir) here
100dnl is quoted so that it gets expanded by make, not by configure.
101dnl
102AC_CHECK_HEADER(linux/fs.h, [linux_headers=yes], [linux_headers=no])
Theodore Ts'o73ae2d42000-02-02 16:13:14 +0000103if test "$linux_headers" != yes; then
104 LINUX_INCLUDE='-I$(top_builddir)/include'
Theodore Ts'of8bd9801999-10-26 04:19:45 +0000105fi
106AC_SUBST(LINUX_INCLUDE)
107dnl
Matthias Andreeb1c92f92004-02-23 21:30:11 +0100108dnl Alpha computers use fast and imprecise floating point code that may
109dnl miss exceptions by default. Force sane options if we're using GCC.
110AC_MSG_CHECKING(for additional special compiler flags)
111if test "$GCC" = yes
112then
113 case "$host_cpu" in
114 alpha) addcflags="-mieee" ;;
115 esac
116fi
117if test "x$addcflags" != x
118then
119 AC_MSG_RESULT($addcflags)
120 CFLAGS="$addcflags $CFLAGS"
121else
122 AC_MSG_RESULT([[(none)]])
123fi
124dnl
Theodore Ts'oa4d09611997-04-29 14:28:00 +0000125dnl Set default values for library extentions. Will be dealt with after
126dnl parsing configuration opions, which may modify these
127dnl
128LIB_EXT=.a
129STATIC_LIB_EXT=.a
Theodore Ts'o14b596d2009-04-22 09:18:30 -0400130PROFILED_LIB_EXT=.a
Theodore Ts'oa4d09611997-04-29 14:28:00 +0000131dnl
Theodore Ts'oa4b2d3c1998-04-03 16:12:25 +0000132dnl Allow separate `root_prefix' to be specified
Theodore Ts'ofc6d9d51997-04-29 14:51:31 +0000133dnl
Theodore Ts'oa4b2d3c1998-04-03 16:12:25 +0000134AC_ARG_WITH([root-prefix],
135[ --with-root-prefix=PREFIX override prefix variable for files to be placed in the root],
136root_prefix=$withval,
137root_prefix=NONE)dnl
Theodore Ts'ofc6d9d51997-04-29 14:51:31 +0000138dnl
Theodore Ts'o98919bd2005-02-04 10:43:58 -0500139dnl handle --enable-maintainer-mode
140dnl
141AC_ARG_ENABLE([maintainer-mode],
142[ --enable-maintainer-mode enable makefile rules useful for maintainers],
143if test "$enableval" = "no"
144then
145 MAINTAINER_CMT=#
Theodore Ts'o02d04db2008-08-22 10:52:42 -0400146 AC_MSG_RESULT([Disabling maintainer mode])
Theodore Ts'o98919bd2005-02-04 10:43:58 -0500147else
148 MAINTAINER_CMT=
Theodore Ts'o02d04db2008-08-22 10:52:42 -0400149 AC_MSG_RESULT([Enabling maintainer mode])
Theodore Ts'o98919bd2005-02-04 10:43:58 -0500150fi
151,
152MAINTAINER_CMT=#
Theodore Ts'o02d04db2008-08-22 10:52:42 -0400153AC_MSG_RESULT([Disabling maintainer mode by default])
Theodore Ts'o98919bd2005-02-04 10:43:58 -0500154)
155AC_SUBST(MAINTAINER_CMT)
156dnl
Theodore Ts'o5aa6c3f2010-05-17 19:21:42 -0400157dnl handle --enable-symlink-install
158dnl
159AC_ARG_ENABLE([symlink-install],
160[ --enable-symlink-install use symlinks when installing instead of hard links],
161if test "$enableval" = "no"
162then
163 LINK_INSTALL_FLAGS=-f
164 AC_MSG_RESULT([Disabling symlinks for install])
165else
166 LINK_INSTALL_FLAGS=-sf
167 AC_MSG_RESULT([Enabling symlinks for install])
168fi
169,
170LINK_INSTALL_FLAGS=-f
171AC_MSG_RESULT([Disabling symlinks for install])
172)
173AC_SUBST(LINK_INSTALL_FLAGS)
174dnl
175dnl handle --enable-symlink-build
176dnl
177AC_ARG_ENABLE([symlink-build],
178[ --enable-symlink-build use symlinks while building instead of hard links],
179if test "$enableval" = "no"
180then
181 LINK_BUILD_FLAGS=
182 AC_MSG_RESULT([Disabling symlinks for build])
183else
184 LINK_BUILD_FLAGS=-s
185 AC_MSG_RESULT([Enabling symlinks for build])
186fi
187,
188LINK_BUILD_FLAGS=
189AC_MSG_RESULT([Disabling symlinks for build])
190)
191AC_SUBST(LINK_BUILD_FLAGS)
192dnl
Theodore Ts'oc13351f2009-07-02 00:11:17 -0400193dnl handle --enable-verbose-makecmds
194dnl
195AC_ARG_ENABLE([verbose-makecmds],
Theodore Ts'o5aa6c3f2010-05-17 19:21:42 -0400196[ --enable-verbose-makecmds enable verbose make command output],
Theodore Ts'oc13351f2009-07-02 00:11:17 -0400197if test "$enableval" = "no"
198then
199 AC_MSG_RESULT([Disabling verbose make commands])
200 E=@echo
201 Q=@
202else
203 AC_MSG_RESULT([Enabling verbose make commands])
204 E=@\\#
205 Q=
206fi
207,
208AC_MSG_RESULT([Disabling verbose make commands])
209E=@echo
210Q=@
211)
212AC_SUBST(E)
213AC_SUBST(Q)
214dnl
Theodore Ts'o19178752000-02-11 15:55:07 +0000215dnl handle --enable-compression
216dnl
217AC_ARG_ENABLE([compression],
218[ --enable-compression enable EXPERIMENTAL compression support],
219if test "$enableval" = "no"
220then
Theodore Ts'o02d04db2008-08-22 10:52:42 -0400221 AC_MSG_RESULT([Disabling compression support])
Theodore Ts'o19178752000-02-11 15:55:07 +0000222else
223 AC_DEFINE(ENABLE_COMPRESSION)
Theodore Ts'o02d04db2008-08-22 10:52:42 -0400224 AC_MSG_RESULT([Enabling compression support])
225 AC_MSG_WARN([Compression support is experimental])
Theodore Ts'o19178752000-02-11 15:55:07 +0000226fi
227,
Theodore Ts'o02d04db2008-08-22 10:52:42 -0400228AC_MSG_RESULT([Disabling compression support by default])
Theodore Ts'o19178752000-02-11 15:55:07 +0000229)
230dnl
Theodore Ts'o8fdc9982002-06-25 23:26:34 -0400231dnl handle --enable-htree
232dnl
233AC_ARG_ENABLE([htree],
234[ --enable-htree enable EXPERIMENTAL htree directory support],
235if test "$enableval" = "no"
236then
237 HTREE_CMT=#
Theodore Ts'o02d04db2008-08-22 10:52:42 -0400238 AC_MSG_RESULT([Disabling htree directory support])
Theodore Ts'o8fdc9982002-06-25 23:26:34 -0400239else
240 HTREE_CMT=
241 AC_DEFINE(ENABLE_HTREE)
Theodore Ts'o02d04db2008-08-22 10:52:42 -0400242 AC_MSG_RESULT([Enabling htree directory support])
Theodore Ts'o8fdc9982002-06-25 23:26:34 -0400243fi
244,
Theodore Ts'o559ca6c2002-08-18 03:48:55 -0400245HTREE_CMT=
246AC_DEFINE(ENABLE_HTREE)
Theodore Ts'o02d04db2008-08-22 10:52:42 -0400247AC_MSG_RESULT([Enabling htree directory support by default])
Theodore Ts'o8fdc9982002-06-25 23:26:34 -0400248)
249AC_SUBST(HTREE_CMT)
250dnl
Theodore Ts'oa4ece352008-01-01 20:05:04 -0500251dnl This needs to be before all of the --enable-*-shlibs options
252dnl
253E2_PKG_CONFIG_STATIC=--static
Theodore Ts'o55da9872008-09-02 23:12:38 -0400254LDFLAG_DYNAMIC=
255PRIVATE_LIBS_CMT=
Theodore Ts'oa4ece352008-01-01 20:05:04 -0500256dnl
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000257dnl handle --enable-elf-shlibs
258dnl
259AC_ARG_ENABLE([elf-shlibs],
Theodore Ts'oa4d09611997-04-29 14:28:00 +0000260[ --enable-elf-shlibs select ELF shared libraries],
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000261if test "$enableval" = "no"
262then
263 ELF_CMT=#
264 MAKEFILE_ELF=/dev/null
Theodore Ts'o02d04db2008-08-22 10:52:42 -0400265 AC_MSG_RESULT([Disabling ELF shared libraries])
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000266else
Theodore Ts'oa4ece352008-01-01 20:05:04 -0500267 E2_PKG_CONFIG_STATIC=
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000268 ELF_CMT=
269 MAKEFILE_ELF=$srcdir/lib/Makefile.elf-lib
Theodore Ts'of5955dd2000-10-25 02:38:39 +0000270 [case "$host_os" in
271 solaris2.*)
272 MAKEFILE_ELF=$srcdir/lib/Makefile.solaris-lib
273 ;;
274 esac]
Theodore Ts'o74becf31997-04-26 14:37:06 +0000275 BINARY_TYPE=elfbin
Theodore Ts'oa4d09611997-04-29 14:28:00 +0000276 LIB_EXT=.so
Theodore Ts'o55da9872008-09-02 23:12:38 -0400277 PRIVATE_LIBS_CMT=#
278 LDFLAG_DYNAMIC=['-Wl,-rpath-link,$(top_builddir)/lib']
Theodore Ts'o02d04db2008-08-22 10:52:42 -0400279 AC_MSG_RESULT([Enabling ELF shared libraries])
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000280fi
281,
282MAKEFILE_ELF=/dev/null
283ELF_CMT=#
Theodore Ts'o02d04db2008-08-22 10:52:42 -0400284AC_MSG_RESULT([Disabling ELF shared libraries by default])
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000285)
286AC_SUBST(ELF_CMT)
287AC_SUBST_FILE(MAKEFILE_ELF)
288dnl
289dnl handle --enable-bsd-shlibs
290dnl
291AC_ARG_ENABLE([bsd-shlibs],
Theodore Ts'oa4d09611997-04-29 14:28:00 +0000292[ --enable-bsd-shlibs select BSD shared libraries],
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000293if test "$enableval" = "no"
294then
295 BSDLIB_CMT=#
296 MAKEFILE_BSDLIB=/dev/null
Theodore Ts'o02d04db2008-08-22 10:52:42 -0400297 AC_MSG_RESULT([Disabling BSD shared libraries])
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000298else
Theodore Ts'oa4ece352008-01-01 20:05:04 -0500299 E2_PKG_CONFIG_STATIC=
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000300 BSDLIB_CMT=
301 MAKEFILE_BSDLIB=$srcdir/lib/Makefile.bsd-lib
Theodore Ts'oa4d09611997-04-29 14:28:00 +0000302 LIB_EXT=.so
Theodore Ts'oe71d8732003-03-14 02:13:48 -0500303 [case "$host_os" in
Theodore Ts'oaa75ecc2003-03-17 10:01:22 -0500304 darwin*)
Theodore Ts'oe71d8732003-03-14 02:13:48 -0500305 MAKEFILE_BSDLIB=$srcdir/lib/Makefile.darwin-lib
306 LIB_EXT=.dylib
307 ;;
308 esac]
Theodore Ts'o02d04db2008-08-22 10:52:42 -0400309 AC_MSG_RESULT([Enabling BSD shared libraries])
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000310fi
311,
312MAKEFILE_BSDLIB=/dev/null
313BSDLIB_CMT=#
Theodore Ts'o02d04db2008-08-22 10:52:42 -0400314AC_MSG_RESULT([Disabling BSD shared libraries by default])
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000315)
316AC_SUBST(BSDLIB_CMT)
317AC_SUBST_FILE(MAKEFILE_BSDLIB)
318dnl
319dnl handle --enable-profile
320dnl
321AC_ARG_ENABLE([profile],
Theodore Ts'oa4d09611997-04-29 14:28:00 +0000322[ --enable-profile build profiling libraries],
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000323if test "$enableval" = "no"
324then
325 PROFILE_CMT=#
326 MAKEFILE_PROFILE=/dev/null
Theodore Ts'o02d04db2008-08-22 10:52:42 -0400327 AC_MSG_RESULT([Disabling profiling libraries])
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000328else
329 PROFILE_CMT=
330 MAKEFILE_PROFILE=$srcdir/lib/Makefile.profile
Theodore Ts'oa4d09611997-04-29 14:28:00 +0000331 PROFILED_LIB_EXT=_p.a
Theodore Ts'o02d04db2008-08-22 10:52:42 -0400332 AC_MSG_RESULT([Building profiling libraries])
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000333fi
334,
335PROFILE_CMT=#
336MAKEFILE_PROFILE=/dev/null
Theodore Ts'o02d04db2008-08-22 10:52:42 -0400337AC_MSG_RESULT([Disabling profiling libraries by default])
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000338)
339AC_SUBST(PROFILE_CMT)
340AC_SUBST_FILE(MAKEFILE_PROFILE)
341dnl
342dnl handle --enable-checker
343dnl
344AC_ARG_ENABLE([checker],
Theodore Ts'oa4d09611997-04-29 14:28:00 +0000345[ --enable-checker build checker libraries],
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000346if test "$enableval" = "no"
347then
348 CHECKER_CMT=#
349 MAKEFILE_CHECKER=/dev/null
Theodore Ts'o02d04db2008-08-22 10:52:42 -0400350 AC_MSG_RESULT([Disabling checker libraries])
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000351else
352 CHECKER_CMT=
353 MAKEFILE_CHECKER=$srcdir/lib/Makefile.checker
Theodore Ts'o02d04db2008-08-22 10:52:42 -0400354 AC_MSG_RESULT([Building checker libraries])
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000355fi
356,
357CHECKER_CMT=#
358MAKEFILE_CHECKER=/dev/null
Theodore Ts'o02d04db2008-08-22 10:52:42 -0400359AC_MSG_RESULT([Disabling checker libraries by default])
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000360)
361AC_SUBST(CHECKER_CMT)
362AC_SUBST_FILE(MAKEFILE_CHECKER)
363dnl
Theodore Ts'oa4d09611997-04-29 14:28:00 +0000364dnl Substitute library extensions
365dnl
366AC_SUBST(LIB_EXT)
367AC_SUBST(STATIC_LIB_EXT)
368AC_SUBST(PROFILED_LIB_EXT)
Theodore Ts'o55da9872008-09-02 23:12:38 -0400369AC_SUBST(LDFLAG_DYNAMIC)
370AC_SUBST(PRIVATE_LIBS_CMT)
Theodore Ts'oa4d09611997-04-29 14:28:00 +0000371dnl
Theodore Ts'o782bebf2002-11-08 18:46:45 -0500372dnl handle --enable-jbd-debug
Theodore Ts'ocdf186e2001-06-13 22:16:47 +0000373dnl
Theodore Ts'o782bebf2002-11-08 18:46:45 -0500374AC_ARG_ENABLE([jbd-debug],
375[ --enable-jbd-debug enable journal debugging],
Theodore Ts'ocdf186e2001-06-13 22:16:47 +0000376if test "$enableval" = "no"
377then
Theodore Ts'o02d04db2008-08-22 10:52:42 -0400378 AC_MSG_RESULT([Disabling journal debugging])
Theodore Ts'ocdf186e2001-06-13 22:16:47 +0000379else
Theodore Ts'o8cf93332001-12-16 02:23:36 -0500380 AC_DEFINE(CONFIG_JBD_DEBUG)
Theodore Ts'o02d04db2008-08-22 10:52:42 -0400381 AC_MSG_RESULT([Enabling journal debugging])
Theodore Ts'ocdf186e2001-06-13 22:16:47 +0000382fi
383,
Theodore Ts'o02d04db2008-08-22 10:52:42 -0400384AC_MSG_RESULT([Disabling journal debugging by default])
Theodore Ts'ocdf186e2001-06-13 22:16:47 +0000385)
386dnl
Theodore Ts'of0a22d02003-02-22 13:19:53 -0500387dnl handle --enable-blkid-debug
388dnl
389AC_ARG_ENABLE([blkid-debug],
Theodore Ts'od21ae6c2003-05-05 09:00:24 -0400390[ --enable-blkid-debug enable blkid debugging],
Theodore Ts'of0a22d02003-02-22 13:19:53 -0500391if test "$enableval" = "no"
392then
Theodore Ts'o02d04db2008-08-22 10:52:42 -0400393 AC_MSG_RESULT([Disabling blkid debugging])
Theodore Ts'of0a22d02003-02-22 13:19:53 -0500394else
395 AC_DEFINE(CONFIG_BLKID_DEBUG)
Theodore Ts'o02d04db2008-08-22 10:52:42 -0400396 AC_MSG_RESULT([Enabling blkid debugging])
Theodore Ts'of0a22d02003-02-22 13:19:53 -0500397fi
398,
Theodore Ts'o02d04db2008-08-22 10:52:42 -0400399AC_MSG_RESULT([Disabling blkid debugging by default])
Theodore Ts'of0a22d02003-02-22 13:19:53 -0500400)
401dnl
Theodore Ts'o2a29f132003-05-05 12:08:47 -0400402dnl handle --enable-testio-debug
403dnl
404AC_ARG_ENABLE([testio-debug],
Theodore Ts'oaf773652008-09-01 11:27:27 -0400405[ --disable-testio-debug disable the use of the test I/O manager for debugging],
Theodore Ts'o2a29f132003-05-05 12:08:47 -0400406if test "$enableval" = "no"
407then
Theodore Ts'o02d04db2008-08-22 10:52:42 -0400408 AC_MSG_RESULT([Disabling testio debugging])
Theodore Ts'oaf773652008-09-01 11:27:27 -0400409 TEST_IO_CMT="#"
Theodore Ts'o2a29f132003-05-05 12:08:47 -0400410else
Theodore Ts'oaf773652008-09-01 11:27:27 -0400411 TEST_IO_CMT=
Theodore Ts'o2a29f132003-05-05 12:08:47 -0400412 AC_DEFINE(CONFIG_TESTIO_DEBUG)
Theodore Ts'o02d04db2008-08-22 10:52:42 -0400413 AC_MSG_RESULT([Enabling testio debugging])
Theodore Ts'o2a29f132003-05-05 12:08:47 -0400414fi
415,
Theodore Ts'oaf773652008-09-01 11:27:27 -0400416AC_MSG_RESULT([Enabling testio debugging by default])
417AC_DEFINE(CONFIG_TESTIO_DEBUG)
418TEST_IO_CMT=
Theodore Ts'o2a29f132003-05-05 12:08:47 -0400419)
Theodore Ts'oaf773652008-09-01 11:27:27 -0400420AC_SUBST(TEST_IO_CMT)
Theodore Ts'o2a29f132003-05-05 12:08:47 -0400421dnl
Scott James Remnant39fd3d42009-05-14 13:03:25 +0100422dnl handle --disable-libuuid
423dnl
424PKG_PROG_PKG_CONFIG
425LIBUUID=
426DEPLIBUUID=
427STATIC_LIBUUID=
428DEPSTATIC_LIBUUID=
429PROFILED_LIBUUID=
430DEPPROFILED_LIBUUID=
431UUID_CMT=
432AC_ARG_ENABLE([libuuid],
433[ --disable-libuuid do not build private uuid library],
434if test "$enableval" = "no"
435then
436 if test -z "$PKG_CONFIG"; then
437 AC_MSG_ERROR([pkg-config not installed; please install it.])
438 fi
439
440 AC_CHECK_LIB(uuid, uuid_generate,
441 [LIBUUID=`$PKG_CONFIG --libs uuid`;
442 STATIC_LIBUUID=`$PKG_CONFIG --static --libs uuid`],
443 [AC_MSG_ERROR([external uuid library not found])],
444 [$LIBUUID])
445 UUID_CMT=#
446 AC_MSG_RESULT([Disabling private uuid library])
447else
448 LIBUUID='$(LIB)/libuuid'$LIB_EXT
449 DEPLIBUUID=$LIBUUID
450 STATIC_LIBUUID='$(LIB)/libuuid'$STATIC_LIB_EXT
451 DEPSTATIC_LIBUUID=$STATIC_LIBUUID
452 PROFILED_LIBUUID='$(LIB)/libuuid'$PROFILED_LIB_EXT
453 DEPPROFILED_LIBUUID=$PROFILED_LIBUUID
454 AC_MSG_RESULT([Enabling private uuid library])
455fi
456,
457LIBUUID='$(LIB)/libuuid'$LIB_EXT
458DEPLIBUUID=$LIBUUID
459STATIC_LIBUUID='$(LIB)/libuuid'$STATIC_LIB_EXT
460DEPSTATIC_LIBUUID=$STATIC_LIBUUID
461PROFILED_LIBUUID='$(LIB)/libuuid'$PROFILED_LIB_EXT
462DEPPROFILED_LIBUUID=$PROFILED_LIBUUID
463AC_MSG_RESULT([Enabling private uuid library by default])
464)
465AC_SUBST(LIBUUID)
466AC_SUBST(DEPLIBUUID)
467AC_SUBST(STATIC_LIBUUID)
468AC_SUBST(DEPSTATIC_LIBUUID)
469AC_SUBST(PROFILED_LIBUUID)
470AC_SUBST(DEPPROFILED_LIBUUID)
471AC_SUBST(UUID_CMT)
472dnl
Theodore Ts'o14b596d2009-04-22 09:18:30 -0400473dnl handle --disable-libblkid
474dnl
475PKG_PROG_PKG_CONFIG
476LIBBLKID=
477DEPLIBBLKID=
478STATIC_LIBBLKID=
479DEPSTATIC_LIBBLKID=
480PROFILED_LIBBLKID=
481DEPPROFILED_LIBBLKID=
482BLKID_CMT=
483AC_ARG_ENABLE([libblkid],
484[ --disable-libblkid do not build private blkid library],
485if test "$enableval" = "no"
486then
487 if test -z "$PKG_CONFIG"; then
488 AC_MSG_ERROR([pkg-config not installed; please install it.])
489 fi
490
491 AC_CHECK_LIB(blkid, blkid_get_cache,
492 [LIBBLKID=`$PKG_CONFIG --libs blkid`;
493 STATIC_LIBBLKID=`$PKG_CONFIG --static --libs blkid`],
494 [AC_MSG_ERROR([external blkid library not found])],
495 [$LIBBLKID])
496 BLKID_CMT=#
497 AC_MSG_RESULT([Disabling private blkid library])
498else
499 LIBBLKID='$(LIB)/libblkid'$LIB_EXT
500 DEPLIBBLKID=$LIBBLKID
501 STATIC_LIBBLKID='$(LIB)/libblkid'$STATIC_LIB_EXT
502 DEPSTATIC_LIBBLKID=$STATIC_LIBBLKID
503 PROFILED_LIBBLKID='$(LIB)/libblkid'$PROFILED_LIB_EXT
504 DEPPROFILED_LIBBLKID=$PROFILED_LIBBLKID
505 AC_DEFINE(CONFIG_BUILD_FINDFS)
506 AC_MSG_RESULT([Enabling private blkid library])
507fi
508,
509LIBBLKID='$(LIB)/libblkid'$LIB_EXT
510DEPLIBBLKID=$LIBBLKID
511STATIC_LIBBLKID='$(LIB)/libblkid'$STATIC_LIB_EXT
512DEPSTATIC_LIBBLKID=$STATIC_LIBBLKID
513PROFILED_LIBBLKID='$(LIB)/libblkid'$PROFILED_LIB_EXT
514DEPPROFILED_LIBBLKID=$PROFILED_LIBBLKID
515AC_DEFINE(CONFIG_BUILD_FINDFS)
516AC_MSG_RESULT([Enabling private blkid library by default])
517)
518AC_SUBST(LIBBLKID)
519AC_SUBST(DEPLIBBLKID)
520AC_SUBST(STATIC_LIBBLKID)
521AC_SUBST(DEPSTATIC_LIBBLKID)
522AC_SUBST(PROFILED_LIBBLKID)
523AC_SUBST(DEPPROFILED_LIBBLKID)
524AC_SUBST(BLKID_CMT)
525dnl
Theodore Ts'ocdf186e2001-06-13 22:16:47 +0000526dnl handle --enable-debugfs
527dnl
528AC_ARG_ENABLE([debugfs],
529[ --disable-debugfs disable support of debugfs program],
530if test "$enableval" = "no"
531then
Theodore Ts'o02d04db2008-08-22 10:52:42 -0400532 AC_MSG_RESULT([Disabling debugfs support])
Theodore Ts'ocdf186e2001-06-13 22:16:47 +0000533 DEBUGFS_CMT="#"
534else
535 DEBUGFS_CMT=
Theodore Ts'o02d04db2008-08-22 10:52:42 -0400536 AC_MSG_RESULT([Enabling debugfs support])
Theodore Ts'ocdf186e2001-06-13 22:16:47 +0000537fi
538,
Theodore Ts'o02d04db2008-08-22 10:52:42 -0400539AC_MSG_RESULT([Enabling debugfs support by default])
Theodore Ts'ocdf186e2001-06-13 22:16:47 +0000540DEBUGFS_CMT=
541)
542AC_SUBST(DEBUGFS_CMT)
543dnl
544dnl handle --enable-imager
545dnl
546AC_ARG_ENABLE([imager],
547[ --disable-imager disable support of e2image program],
548if test "$enableval" = "no"
549then
Theodore Ts'o02d04db2008-08-22 10:52:42 -0400550 AC_MSG_RESULT([Disabling e2image support])
Theodore Ts'ocdf186e2001-06-13 22:16:47 +0000551 IMAGER_CMT="#"
552else
553 IMAGER_CMT=
Theodore Ts'o02d04db2008-08-22 10:52:42 -0400554 AC_MSG_RESULT([Enabling e2image support])
Theodore Ts'ocdf186e2001-06-13 22:16:47 +0000555fi
556,
Theodore Ts'o02d04db2008-08-22 10:52:42 -0400557AC_MSG_RESULT([Enabling e2image support by default])
Theodore Ts'ocdf186e2001-06-13 22:16:47 +0000558IMAGER_CMT=
559)
560AC_SUBST(IMAGER_CMT)
561dnl
562dnl handle --enable-resizer
563dnl
564AC_ARG_ENABLE([resizer],
565[ --disable-resizer disable support of e2resize program],
566if test "$enableval" = "no"
567then
Theodore Ts'o02d04db2008-08-22 10:52:42 -0400568 AC_MSG_RESULT([Disabling e2resize support])
Theodore Ts'ocdf186e2001-06-13 22:16:47 +0000569 RESIZER_CMT="#"
570else
571 RESIZER_CMT=
Theodore Ts'o02d04db2008-08-22 10:52:42 -0400572 AC_MSG_RESULT([Enabling e2resize support])
Theodore Ts'ocdf186e2001-06-13 22:16:47 +0000573fi
574,
Theodore Ts'o02d04db2008-08-22 10:52:42 -0400575AC_MSG_RESULT([Enabling e2resize support by default])
Theodore Ts'ocdf186e2001-06-13 22:16:47 +0000576RESIZER_CMT=
577)
578AC_SUBST(RESIZER_CMT)
579dnl
Theodore Ts'ofc6d9d51997-04-29 14:51:31 +0000580dnl See whether to install the `fsck' wrapper program (that calls e2fsck)
581dnl
582AC_ARG_ENABLE([fsck],
583[ --enable-fsck build fsck wrapper program],
584[if test "$enableval" = "no"
585then
586 FSCK_PROG='' FSCK_MAN=''
Theodore Ts'o02d04db2008-08-22 10:52:42 -0400587 AC_MSG_RESULT([Not building fsck wrapper])
Theodore Ts'ofc6d9d51997-04-29 14:51:31 +0000588else
589 FSCK_PROG=fsck FSCK_MAN=fsck.8
Theodore Ts'o02d04db2008-08-22 10:52:42 -0400590 AC_MSG_RESULT([Building fsck wrapper])
Theodore Ts'ofc6d9d51997-04-29 14:51:31 +0000591fi]
592,
593[case "$host_os" in
Theodore Ts'oe3632402004-05-04 19:39:54 -0400594 gnu*)
Theodore Ts'ofc6d9d51997-04-29 14:51:31 +0000595 FSCK_PROG='' FSCK_MAN=''
Theodore Ts'o02d04db2008-08-22 10:52:42 -0400596 AC_MSG_RESULT([Not building fsck wrapper by default])
Theodore Ts'ofc6d9d51997-04-29 14:51:31 +0000597 ;;
598 *)
599 FSCK_PROG=fsck FSCK_MAN=fsck.8
Theodore Ts'o02d04db2008-08-22 10:52:42 -0400600 AC_MSG_RESULT([Building fsck wrapper by default])
Theodore Ts'ofc6d9d51997-04-29 14:51:31 +0000601esac]
602)
603AC_SUBST(FSCK_PROG)
604AC_SUBST(FSCK_MAN)
605dnl
Theodore Ts'o5d407732004-09-18 14:53:14 -0400606dnl See whether to install the `e2initrd-helper' program
607dnl
608AC_ARG_ENABLE([e2initrd-helper],
609[ --enable-e2initrd-helper build e2initrd-helper program],
610[if test "$enableval" = "no"
611then
612 E2INITRD_PROG='' E2INITRD_MAN=''
Theodore Ts'o02d04db2008-08-22 10:52:42 -0400613 AC_MSG_RESULT([Not building e2initrd helper])
Theodore Ts'o5d407732004-09-18 14:53:14 -0400614else
615 E2INITRD_PROG=e2initrd_helper E2INITRD_MAN=e2initrd_helper.8
Theodore Ts'o02d04db2008-08-22 10:52:42 -0400616 AC_MSG_RESULT([Building e2initrd helper])
Theodore Ts'o5d407732004-09-18 14:53:14 -0400617fi]
618,
619E2INITRD_PROG=e2initrd_helper E2INITRD_MAN=e2initrd_helper.8
Theodore Ts'o02d04db2008-08-22 10:52:42 -0400620AC_MSG_RESULT([Building e2initrd helper by default])
Theodore Ts'o5d407732004-09-18 14:53:14 -0400621)
622AC_SUBST(E2INITRD_PROG)
623AC_SUBST(E2INITRD_MAN)
Karel Zak4db2f592006-03-08 14:17:28 -0500624dnl
Theodore Ts'o5d407732004-09-18 14:53:14 -0400625dnl
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000626dnl
Theodore Ts'o32493942007-12-31 10:45:01 -0500627AC_ARG_ENABLE([tls],
628[ --disable-tls disable use of thread local support],
629[if test "$enableval" = "no"
630then
631 try_tls=""
Theodore Ts'o02d04db2008-08-22 10:52:42 -0400632 AC_MSG_RESULT([Disabling thread local support])
Theodore Ts'o32493942007-12-31 10:45:01 -0500633else
634 try_tls="yes"
Theodore Ts'o02d04db2008-08-22 10:52:42 -0400635 AC_MSG_RESULT([Enabling thread local support])
Theodore Ts'o32493942007-12-31 10:45:01 -0500636fi]
637,
Theodore Ts'oeafba6c2008-07-10 10:21:42 -0400638if test -n "$WITH_DIET_LIBC"
639then
640 try_tls=""
Theodore Ts'o02d04db2008-08-22 10:52:42 -0400641 AC_MSG_RESULT([Diet libc does not support thread local support])
Theodore Ts'oeafba6c2008-07-10 10:21:42 -0400642else
643 try_tls="yes"
Theodore Ts'o02d04db2008-08-22 10:52:42 -0400644 AC_MSG_RESULT([Try using thread local support by default])
Theodore Ts'oeafba6c2008-07-10 10:21:42 -0400645fi
Theodore Ts'o32493942007-12-31 10:45:01 -0500646)
647if test "$try_tls" = "yes"
648then
649AX_TLS
650fi
651dnl
652dnl
653dnl
Theodore Ts'o5610f992007-12-31 11:16:56 -0500654AC_ARG_ENABLE([uuidd],
655[ --disable-uuidd disable building the uuid daemon],
656[if test "$enableval" = "no"
657then
Theodore Ts'o02d04db2008-08-22 10:52:42 -0400658 AC_MSG_RESULT([Not building uuidd])
Theodore Ts'o5610f992007-12-31 11:16:56 -0500659 UUIDD_CMT="#"
660else
661 AC_DEFINE(USE_UUIDD)
662 UUIDD_CMT=""
Theodore Ts'o02d04db2008-08-22 10:52:42 -0400663 AC_MSG_RESULT([Building uuidd])
Theodore Ts'o5610f992007-12-31 11:16:56 -0500664fi]
665,
666AC_DEFINE(USE_UUIDD)
667UUIDD_CMT=""
Theodore Ts'o02d04db2008-08-22 10:52:42 -0400668AC_MSG_RESULT([Building uuidd by default])
Theodore Ts'o5610f992007-12-31 11:16:56 -0500669)
670AC_SUBST(UUIDD_CMT)
671dnl
672dnl
673dnl
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000674MAKEFILE_LIBRARY=$srcdir/lib/Makefile.library
675AC_SUBST_FILE(MAKEFILE_LIBRARY)
676dnl
Theodore Ts'ocdf186e2001-06-13 22:16:47 +0000677dnl Add internationalization support, using gettext.
678dnl
Theodore Ts'ob0cacab2004-11-30 19:00:19 -0500679GETTEXT_PACKAGE=e2fsprogs
Theodore Ts'ocdf186e2001-06-13 22:16:47 +0000680PACKAGE=e2fsprogs
681VERSION="$E2FSPROGS_VERSION"
Theodore Ts'ob0cacab2004-11-30 19:00:19 -0500682VERSION=0.14.1
Theodore Ts'ocdf186e2001-06-13 22:16:47 +0000683AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE")
684AC_DEFINE_UNQUOTED(VERSION, "$VERSION")
Theodore Ts'ob0cacab2004-11-30 19:00:19 -0500685AC_SUBST(GETTEXT_PACKAGE)
Theodore Ts'ocdf186e2001-06-13 22:16:47 +0000686AC_SUBST(PACKAGE)
687AC_SUBST(VERSION)
688
Theodore Ts'ocdf186e2001-06-13 22:16:47 +0000689AM_GNU_GETTEXT
690dnl
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000691dnl End of configuration options
692dnl
Theodore Ts'o74becf31997-04-26 14:37:06 +0000693AC_SUBST(BINARY_TYPE)
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000694AC_PROG_MAKE_SET
Theodore Ts'obcb915b2009-07-02 18:19:10 -0400695CHECK_GNU_MAKE
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000696AC_PATH_PROG(LN, ln, ln)
Theodore Ts'ofc6d9d51997-04-29 14:51:31 +0000697AC_PROG_LN_S
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000698AC_PATH_PROG(MV, mv, mv)
699AC_PATH_PROG(CP, cp, cp)
700AC_PATH_PROG(RM, rm, rm)
701AC_PATH_PROG(CHMOD, chmod, :)
Theodore Ts'o32237012005-01-17 19:13:39 -0500702AC_PROG_AWK
703AC_PROG_EGREP
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000704AC_PATH_PROG(SED, sed, sed)
Theodore Ts'o9d564f71999-07-03 20:25:58 +0000705AC_PATH_PROG(PERL, perl, perl)
Theodore Ts'o250f79f2001-05-19 22:02:22 +0000706AC_PATH_PROG(LDCONFIG, ldconfig, :)
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000707AC_CHECK_TOOL(AR, ar, ar)
708AC_CHECK_TOOL(RANLIB, ranlib, :)
709AC_CHECK_TOOL(STRIP, strip, :)
Manish Katiyar7321d942008-04-14 17:20:03 +0530710AC_CHECK_PROG(MAKEINFO, makeinfo, makeinfo, )
711if test "_$MAKEINFO" = "_"; then
712 MAKEINFO="@echo Makeinfo is missing. Info documentation will not be built.;true"
713else
714 case "$MAKEINFO" in
715 */missing.*)
716 AC_MSG_WARN([
717*** Makeinfo is missing. Info documentation will not be built.])
718 ;;
719 *)
720 ;;
721 esac
722fi
723AC_SUBST(MAKEINFO)
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000724AC_PROG_INSTALL
Theodore Ts'o6c133521999-07-03 20:37:03 +0000725# See if we need a separate native compiler.
726if test $cross_compiling = no; then
727 BUILD_CC="$CC"
728 AC_SUBST(BUILD_CC)
729else
730 AC_CHECK_PROGS(BUILD_CC, gcc cc)
731fi
Theodore Ts'od7f45af2008-09-12 10:15:26 -0400732AC_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 -0500733AC_CHECK_HEADERS(sys/disk.h sys/mount.h,,,
734[[
735#if HAVE_SYS_QUEUE_H
736#include <sys/queue.h>
737#endif
738]])
739AC_CHECK_HEADERS(net/if.h,,,
740[[
741#if HAVE_SYS_TYPES_H
742#include <sys/types.h>
743#endif
744#if HAVE_SYS_SOCKET
745#include <sys/socket.h>
746#endif
747]])
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000748AC_FUNC_VPRINTF
Theodore Ts'offf45482003-04-13 00:44:19 -0400749dnl Check to see if dirent has member d_reclen. On cygwin those d_reclen
750dnl is not decleared.
Theodore Ts'o6c65d252005-01-19 12:59:48 -0500751AC_CHECK_MEMBER(struct dirent.d_reclen,[AC_DEFINE(HAVE_RECLEN_DIRENT)],,
752 [#include <dirent.h>])
Theodore Ts'offf45482003-04-13 00:44:19 -0400753dnl Check to see if ssize_t was decleared
Theodore Ts'o6c65d252005-01-19 12:59:48 -0500754AC_CHECK_TYPE(ssize_t,[AC_DEFINE(HAVE_TYPE_SSIZE_T)],,
755 [#include <sys/types.h>])
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000756dnl
Theodore Ts'ob0b9c4d1997-10-20 23:36:30 +0000757dnl Check to see if llseek() is declared in unistd.h. On some libc's
758dnl it is, and on others it isn't..... Thank you glibc developers....
759dnl
Theodore Ts'o6c65d252005-01-19 12:59:48 -0500760AC_CHECK_DECL(llseek,[AC_DEFINE(HAVE_LLSEEK_PROTOTYPE)],,
761 [#include <unistd.h>])
Theodore Ts'ob0b9c4d1997-10-20 23:36:30 +0000762dnl
Theodore Ts'o6928adc2000-05-25 23:28:50 +0000763dnl Check to see if lseek64() is declared in unistd.h. Glibc's header files
764dnl are so convoluted that I can't tell whether it will always be defined,
765dnl and if it isn't defined while lseek64 is defined in the library,
766dnl disaster will strike.
767dnl
768dnl Warning! Use of --enable-gcc-wall may throw off this test.
769dnl
770dnl
Theodore Ts'o6c65d252005-01-19 12:59:48 -0500771AC_CHECK_DECL(lseek64,[AC_DEFINE(HAVE_LSEEK64_PROTOTYPE)],,
772 [#define _LARGEFILE_SOURCE
773 #define _LARGEFILE64_SOURCE
774 #include <unistd.h>])
Theodore Ts'o6928adc2000-05-25 23:28:50 +0000775dnl
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000776dnl Word sizes...
777dnl
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000778AC_CHECK_SIZEOF(short)
779AC_CHECK_SIZEOF(int)
780AC_CHECK_SIZEOF(long)
Theodore Ts'ofc6d9d51997-04-29 14:51:31 +0000781AC_CHECK_SIZEOF(long long)
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000782SIZEOF_SHORT=$ac_cv_sizeof_short
783SIZEOF_INT=$ac_cv_sizeof_int
784SIZEOF_LONG=$ac_cv_sizeof_long
Theodore Ts'ofc6d9d51997-04-29 14:51:31 +0000785SIZEOF_LONG_LONG=$ac_cv_sizeof_long_long
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000786AC_SUBST(SIZEOF_SHORT)
787AC_SUBST(SIZEOF_INT)
788AC_SUBST(SIZEOF_LONG)
Theodore Ts'ofc6d9d51997-04-29 14:51:31 +0000789AC_SUBST(SIZEOF_LONG_LONG)
Theodore Ts'o877eb6d2001-06-11 06:54:13 +0000790AC_C_BIGENDIAN
Theodore Ts'o29a5dee2007-07-04 16:28:47 -0400791BUILD_CC="$BUILD_CC" CPP="$CPP" /bin/sh $ac_aux_dir/parse-types.sh
Theodore Ts'o4ea7ea02006-04-09 08:41:55 -0400792ASM_TYPES_HEADER=./asm_types.h
793AC_SUBST_FILE(ASM_TYPES_HEADER)
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000794dnl
Theodore Ts'o488c75a2008-06-07 08:55:21 -0400795dnl Save the configuration #defines needed for the public ext2fs.h
796dnl header file
797dnl
798echo "/* These defines are needed for the public ext2fs.h header file */" \
799 > public_config.h
800if grep HAVE_SYS_TYPES_H confdefs.h > tmp_config.$$; then
801 uniq tmp_config.$$ >> public_config.h
802else
803 echo "#undef HAVE_SYS_TYPES_H" >> public_config.h
804fi
805if grep WORDS_BIGENDIAN confdefs.h > tmp_config.$$; then
806 uniq tmp_config.$$ >> public_config.h
807else
808 echo "#undef WORDS_BIGENDIAN" >> public_config.h
809fi
810rm -f tmp_config.$$
811PUBLIC_CONFIG_HEADER=./public_config.h
812AC_SUBST_FILE(PUBLIC_CONFIG_HEADER)
813dnl
Theodore Ts'o0c193f82003-08-01 14:26:23 -0400814dnl See if we have inttypes.h and if intptr_t is defined
815dnl
816AC_CHECK_HEADERS([inttypes.h])
Theodore Ts'od2ee56d2005-01-09 00:57:45 -0500817AC_CHECK_TYPES(intptr_t)
Theodore Ts'o0c193f82003-08-01 14:26:23 -0400818dnl
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000819dnl See if struct stat has a st_flags field, in which case we can get file
820dnl flags somewhat portably. Also check for the analogous setter, chflags().
821dnl
822AC_MSG_CHECKING(whether struct stat has a st_flags field)
823AC_CACHE_VAL(e2fsprogs_cv_struct_st_flags,
824 AC_TRY_COMPILE([#include <sys/stat.h>],
825 [struct stat stat; stat.st_flags = 0;],
826 [e2fsprogs_cv_struct_st_flags=yes],
827 [e2fsprogs_cv_struct_st_flags=no]))
828AC_MSG_RESULT($e2fsprogs_cv_struct_st_flags)
829if test "$e2fsprogs_cv_struct_st_flags" = yes; then
Theodore Ts'oc03bc4e1999-10-20 18:20:36 +0000830 AC_MSG_CHECKING(whether st_flags field is useful)
831 AC_CACHE_VAL(e2fsprogs_cv_struct_st_flags_immut,
832 AC_TRY_COMPILE([#include <sys/stat.h>],
833 [struct stat stat; stat.st_flags |= UF_IMMUTABLE;],
834 [e2fsprogs_cv_struct_st_flags_immut=yes],
835 [e2fsprogs_cv_struct_st_flags_immut=no]))
836 AC_MSG_RESULT($e2fsprogs_cv_struct_st_flags_immut)
837 if test "$e2fsprogs_cv_struct_st_flags_immut" = yes; then
838 AC_DEFINE(HAVE_STAT_FLAGS)
839 fi
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000840fi
Theodore Ts'o84ea6e72004-03-19 19:29:17 -0500841dnl
842dnl Check for the presence of SA_LEN
843dnl
Theodore Ts'o6c65d252005-01-19 12:59:48 -0500844AC_CHECK_MEMBER(struct sockaddr.sa_len,
845 AC_DEFINE_UNQUOTED(HAVE_SA_LEN,1,[Define if struct sockaddr contains sa_len]),,
846 [#include <sys/types.h>
847 #include <sys/socket.h>])
Theodore Ts'o84ea6e72004-03-19 19:29:17 -0500848dnl
Eric Sandeen9ed8e5f2009-10-02 11:32:42 -0500849dnl This will add -lblkid to the AC_CHECK_FUNCS search if we are using
850dnl the system-provided blkid library
851dnl
852if test -n "$BLKID_CMT"; then
853 AC_SEARCH_LIBS([blkid_probe_all], [blkid])
854fi
855dnl
Eric Sandeenbeb736b2009-10-21 03:43:02 -0400856AC_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_topology)
Theodore Ts'ofc6d9d51997-04-29 14:51:31 +0000857dnl
Theodore Ts'ofc6d9d51997-04-29 14:51:31 +0000858dnl Check to see if -lsocket is required (solaris) to make something
859dnl that uses socket() to compile; this is needed for the UUID library
860dnl
861SOCKET_LIB=''
862AC_CHECK_LIB(socket, socket, [SOCKET_LIB=-lsocket])
863AC_SUBST(SOCKET_LIB)
864dnl
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000865dnl See if optreset exists
866dnl
867AC_MSG_CHECKING(for optreset)
868AC_CACHE_VAL(ac_cv_have_optreset,
869[AC_EGREP_HEADER(optreset, unistd.h,
870 ac_cv_have_optreset=yes, ac_cv_have_optreset=no)])dnl
871AC_MSG_RESULT($ac_cv_have_optreset)
872if test $ac_cv_have_optreset = yes; then
873 AC_DEFINE(HAVE_OPTRESET)
874fi
875dnl
Theodore Ts'od7f45af2008-09-12 10:15:26 -0400876dnl Test for sem_init, and which library it might require:
877dnl
878SEM_INIT_LIB=''
879AC_CHECK_FUNC(sem_init, ,
880 AC_CHECK_LIB(pthread, sem_init,
881 AC_DEFINE(HAVE_SEM_INIT)
882 SEM_INIT_LIB=-lpthread,
883 AC_CHECK_LIB(rt, sem_init,
884 AC_DEFINE(HAVE_SEM_INIT)
885 SEM_INIT_LIB=-lrt,
886 AC_CHECK_LIB(posix4, sem_init,
887 AC_DEFINE(HAVE_SEM_INIT)
888 SEM_INIT_LIB=-lposix4))))dnl
889AC_SUBST(SEM_INIT_LIB)
890dnl
Theodore Ts'oe54635d2006-08-06 14:33:13 -0400891dnl Check for unified diff
892dnl
893AC_MSG_CHECKING(for unified diff option)
Theodore Ts'o27f991b2008-04-01 20:32:55 -0400894if diff -u $0 $0 > /dev/null 2>&1 ; then
Theodore Ts'oe54635d2006-08-06 14:33:13 -0400895 UNI_DIFF_OPTS=-u
896else
897 UNI_DIFF_OPTS=-c
898fi
899AC_MSG_RESULT($UNI_DIFF_OPTS)
900AC_SUBST(UNI_DIFF_OPTS)
901dnl
Theodore Ts'o8f3f29d2000-02-11 05:04:44 +0000902dnl We use the EXT2 ioctls only under Linux
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000903dnl
Theodore Ts'o8f3f29d2000-02-11 05:04:44 +0000904case "$host_os" in
905linux*)
906 AC_DEFINE(HAVE_EXT2_IOCTLS)
907 ;;
908esac
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000909dnl
Theodore Ts'offf45482003-04-13 00:44:19 -0400910dnl OS-specific uncomment control
Theodore Ts'oe6f2bda2002-08-18 03:37:10 -0400911dnl
912LINUX_CMT="#"
Theodore Ts'offf45482003-04-13 00:44:19 -0400913CYGWIN_CMT="#"
914UNIX_CMT=
Theodore Ts'oe6f2bda2002-08-18 03:37:10 -0400915case "$host_os" in
916linux*)
917 LINUX_CMT=
918 ;;
Theodore Ts'offf45482003-04-13 00:44:19 -0400919cygwin)
920 CYGWIN_CMT=
921 UNIX_CMT="#"
Theodore Ts'offf45482003-04-13 00:44:19 -0400922 ;;
Theodore Ts'oe6f2bda2002-08-18 03:37:10 -0400923esac
924AC_SUBST(LINUX_CMT)
Theodore Ts'offf45482003-04-13 00:44:19 -0400925AC_SUBST(CYGWIN_CMT)
926AC_SUBST(UNIX_CMT)
Theodore Ts'oe6f2bda2002-08-18 03:37:10 -0400927dnl
Theodore Ts'o6c133521999-07-03 20:37:03 +0000928dnl Linux and Hurd places root files in the / by default
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000929dnl
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000930case "$host_os" in
Theodore Ts'o93636bd2003-07-12 02:45:05 -0400931linux* | gnu* | k*bsd*-gnu)
Theodore Ts'oa4b2d3c1998-04-03 16:12:25 +0000932 if test "$prefix" = NONE -a "$root_prefix" = NONE ; then
933 root_prefix="";
Theodore Ts'o02d04db2008-08-22 10:52:42 -0400934 AC_MSG_RESULT([On $host_os systems, root_prefix defaults to ''])
Theodore Ts'ofc6d9d51997-04-29 14:51:31 +0000935 fi
936 ;;
937esac
Theodore Ts'ofc6d9d51997-04-29 14:51:31 +0000938dnl
Theodore Ts'oa4b2d3c1998-04-03 16:12:25 +0000939dnl On Linux/hurd, force the prefix to be /usr
Theodore Ts'ofc6d9d51997-04-29 14:51:31 +0000940dnl
941case "$host_os" in
Theodore Ts'o93636bd2003-07-12 02:45:05 -0400942linux* | gnu* | k*bsd*-gnu)
Theodore Ts'ofc6d9d51997-04-29 14:51:31 +0000943 if test "$prefix" = NONE ; then
Theodore Ts'oa4b2d3c1998-04-03 16:12:25 +0000944 prefix="/usr";
Theodore Ts'o02d04db2008-08-22 10:52:42 -0400945 AC_MSG_RESULT([On $host_os systems, prefix defaults to /usr])
Theodore Ts'obff61a72002-05-21 22:21:38 -0400946 if test "$mandir" = '${prefix}/man' ; then
Theodore Ts'o02d04db2008-08-22 10:52:42 -0400947 AC_MSG_RESULT([...and mandir defaults to /usr/share/man])
Theodore Ts'obff61a72002-05-21 22:21:38 -0400948 mandir=/usr/share/man
949 fi
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000950 fi
951;;
952esac
Theodore Ts'oa4b2d3c1998-04-03 16:12:25 +0000953if test "$root_prefix" = NONE ; then
Theodore Ts'offe19911998-04-08 06:05:49 +0000954 if test "$prefix" = NONE ; then
Theodore Ts'oa4b2d3c1998-04-03 16:12:25 +0000955 root_prefix="$ac_default_prefix"
956 else
957 root_prefix="$prefix"
958 fi
Theodore Ts'ob5ffead2002-05-11 19:17:00 -0400959 root_bindir=$bindir
960 root_sbindir=$sbindir
961 root_libdir=$libdir
962 root_sysconfdir=$sysconfdir
963else
964 root_bindir='${root_prefix}/bin'
965 root_sbindir='${root_prefix}/sbin'
966 root_libdir='${root_prefix}/lib'
967 root_sysconfdir='${root_prefix}/etc'
Theodore Ts'oa4b2d3c1998-04-03 16:12:25 +0000968fi
Theodore Ts'oc4ef11c2008-01-04 16:55:37 -0500969if test "$bindir" != '${exec_prefix}/bin'; then
970 root_bindir=$bindir
Theodore Ts'o02d04db2008-08-22 10:52:42 -0400971 AC_MSG_RESULT([Setting root_bindir to $root_bindir])
Theodore Ts'oc4ef11c2008-01-04 16:55:37 -0500972fi
973if test "$sbindir" != '${exec_prefix}/sbin'; then
974 root_sbindir=$sbindir
Theodore Ts'o02d04db2008-08-22 10:52:42 -0400975 AC_MSG_RESULT([Setting root_sbindir to $root_sbindir])
Theodore Ts'oc4ef11c2008-01-04 16:55:37 -0500976fi
977if test "$libdir" != '${exec_prefix}/lib'; then
978 root_libdir=$libdir
Theodore Ts'o02d04db2008-08-22 10:52:42 -0400979 AC_MSG_RESULT([Setting root_libdir to $root_libdir])
Theodore Ts'oc4ef11c2008-01-04 16:55:37 -0500980fi
981if test "$sysconfdir" != '${prefix}/etc'; then
982 root_sysconfdir=$sysconfdir
Theodore Ts'o02d04db2008-08-22 10:52:42 -0400983 AC_MSG_RESULT([Setting root_sysconfdir to $root_sysconfdir])
Theodore Ts'oc4ef11c2008-01-04 16:55:37 -0500984fi
Theodore Ts'oa4b2d3c1998-04-03 16:12:25 +0000985AC_SUBST(root_prefix)
Theodore Ts'ob5ffead2002-05-11 19:17:00 -0400986AC_SUBST(root_bindir)
987AC_SUBST(root_sbindir)
988AC_SUBST(root_libdir)
989AC_SUBST(root_sysconfdir)
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000990dnl
991dnl See if -static works.
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000992dnl
Theodore Ts'oae851481997-04-29 18:13:24 +0000993AC_MSG_CHECKING([whether linker accepts -static])
994AC_CACHE_VAL(ac_cv_e2fsprogs_use_static,
995[SAVE_LDFLAGS=$LDFLAGS; LDFLAGS="$LDFLAGS -static"
996AC_TRY_LINK([#include <stdio.h>],[fflush(stdout);],
997 ac_cv_e2fsprogs_use_static=yes, ac_cv_e2fsprogs_use_static=no)
998LDFLAGS=$SAVE_LDFLAGS])
Theodore Ts'odefde781999-01-04 07:39:19 +0000999dnl
1000dnl Regardless of how the test turns out, Solaris doesn't handle -static
1001dnl This is caused by the socket library requiring the nsl library, which
1002dnl requires the -dl library, which only works for dynamically linked
1003dnl programs. It basically means you can't have statically linked programs
1004dnl which use the network under Solaris.
1005dnl
1006case "$host_os" in
1007solaris2.*)
1008 ac_cv_e2fsprogs_use_static=no
1009;;
1010esac
Theodore Ts'oae851481997-04-29 18:13:24 +00001011AC_MSG_RESULT($ac_cv_e2fsprogs_use_static)
Theodore Ts'o74becf31997-04-26 14:37:06 +00001012LDFLAG_STATIC=
Theodore Ts'oae851481997-04-29 18:13:24 +00001013if test $ac_cv_e2fsprogs_use_static = yes; then
Theodore Ts'o50e1e101997-04-26 13:58:21 +00001014 LDFLAG_STATIC=-static
Theodore Ts'oae851481997-04-29 18:13:24 +00001015fi
Theodore Ts'o50e1e101997-04-26 13:58:21 +00001016AC_SUBST(LDFLAG_STATIC)
1017dnl
Theodore Ts'o07a0db12003-07-05 14:50:24 -04001018dnl Work around mysterious Darwin / GNU libintl problem
1019dnl (__asm__ redirection doesn't work for some mysterious reason. Looks like
1020dnl Apple hacked gcc somehow?)
1021dnl
1022case "$host_os" in
1023darwin*)
Theodore Ts'o02d04db2008-08-22 10:52:42 -04001024 AC_MSG_RESULT([Using Apple Darwin / GNU libintl workaround])
Theodore Ts'o07a0db12003-07-05 14:50:24 -04001025 AC_DEFINE(_INTL_REDIRECT_MACROS)
1026 ;;
1027esac
1028dnl
Theodore Ts'o50e1e101997-04-26 13:58:21 +00001029dnl Make the ss and et directories work correctly.
1030dnl
1031SS_DIR=`cd ${srcdir}/lib/ss; pwd`
1032ET_DIR=`cd ${srcdir}/lib/et; pwd`
1033AC_SUBST(SS_DIR)
1034AC_SUBST(ET_DIR)
1035dnl
1036dnl Only try to run the test suite if we're not cross compiling.
1037dnl
1038if test "$cross_compiling" = yes ; then
1039 DO_TEST_SUITE=
1040else
1041 DO_TEST_SUITE=check
1042fi
1043AC_SUBST(DO_TEST_SUITE)
1044dnl
Theodore Ts'oc6f35b82003-05-17 16:29:27 -04001045dnl Only include the intl include files if we're building with them
1046dnl
1047INTL_FLAGS=
1048if test "$USE_INCLUDED_LIBINTL" = "yes" ; then
1049 INTL_FLAGS='-I$(top_builddir)/intl -I$(top_srcdir)/intl'
1050fi
1051AC_SUBST(INTL_FLAGS)
1052dnl
Theodore Ts'odd947da2005-11-09 18:37:07 -04001053dnl Build CFLAGS
1054dnl
1055if test $cross_compiling = no; then
1056 BUILD_CFLAGS="$CFLAGS"
1057 BUILD_LDFLAGS="$LDFLAGS"
1058else
1059 BUILD_CFLAGS=
1060 BUILD_LDFLAGS=
1061fi
1062AC_SUBST(BUILD_CFLAGS)
1063AC_SUBST(BUILD_LDFLAGS)
1064dnl
Theodore Ts'o50e1e101997-04-26 13:58:21 +00001065dnl Make our output files, being sure that we create the some miscellaneous
1066dnl directories
1067dnl
1068test -d lib || mkdir lib
1069test -d include || mkdir include
1070test -d include/linux || mkdir include/linux
Theodore Ts'odefde781999-01-04 07:39:19 +00001071test -d include/asm || mkdir include/asm
Theodore Ts'obff0cc92003-03-23 01:37:53 -05001072for i in MCONFIG Makefile e2fsprogs.spec \
1073 util/Makefile util/subst.conf util/gen-tarball \
Theodore Ts'o4ea7ea02006-04-09 08:41:55 -04001074 lib/et/Makefile lib/ss/Makefile lib/e2p/Makefile \
1075 lib/ext2fs/Makefile lib/ext2fs/ext2_types.h \
Theodore Ts'o94ba8c72003-03-02 02:07:14 -05001076 lib/uuid/Makefile lib/uuid/uuid_types.h \
1077 lib/blkid/Makefile lib/blkid/blkid_types.h \
Theodore Ts'oe6441862005-01-26 12:59:25 -05001078 lib/ss/ss.pc lib/uuid/uuid.pc lib/et/com_err.pc \
1079 lib/e2p/e2p.pc lib/blkid/blkid.pc lib/ext2fs/ext2fs.pc \
Theodore Ts'o921f4ad2004-11-19 17:25:27 -05001080 misc/Makefile ext2ed/Makefile e2fsck/Makefile \
Theodore Ts'o94ba8c72003-03-02 02:07:14 -05001081 debugfs/Makefile tests/Makefile tests/progs/Makefile \
Matthias Andree98a5ad62009-07-15 17:37:52 +02001082 resize/Makefile doc/Makefile intl/Makefile \
1083 intl/libgnuintl.h po/Makefile.in ; do
Theodore Ts'o94ba8c72003-03-02 02:07:14 -05001084 if test -d `dirname ${srcdir}/$i` ; then
1085 outlist="$outlist $i"
1086 fi
1087done
1088AC_OUTPUT($outlist)
Theodore Ts'oee683a12005-02-05 15:53:56 -05001089if test -f util/gen-tarball; then chmod +x util/gen-tarball; fi