blob: 89d83ced8e22213dbf26a6fc28a72456b03d28f4 [file] [log] [blame]
Theodore Ts'o50e1e101997-04-26 13:58:21 +00001AC_INIT(version.h)
Theodore Ts'oa4b2d3c1998-04-03 16:12:25 +00002AC_PREREQ(2.12)
Theodore Ts'o50e1e101997-04-26 13:58:21 +00003MCONFIG=./MCONFIG
4AC_SUBST_FILE(MCONFIG)
Theodore Ts'o74becf31997-04-26 14:37:06 +00005BINARY_TYPE=bin
6dnl
7dnl This is to figure out the version number and the date....
8dnl
9E2FSPROGS_VERSION=`grep E2FSPROGS_VERSION ${srcdir}/version.h \
10 | awk '{print $3}' | tr \" " " | awk '{print $1}'`
11DATE=`grep E2FSPROGS_DATE ${srcdir}/version.h | awk '{print $3}' \
12 | tr \" " "`
13MONTH=`echo $DATE | awk -F- '{print $2}'`
14YEAR=`echo $DATE | awk -F- '{print $3}'`
15
Theodore Ts'o40fa8cc1999-01-09 05:06:02 +000016if expr $YEAR ">" 1900 > /dev/null ; then
17 E2FSPROGS_YEAR=$YEAR
18elif expr $YEAR ">" 90 >/dev/null ; then
Theodore Ts'o74becf31997-04-26 14:37:06 +000019 E2FSPROGS_YEAR=19$YEAR
20else
21 E2FSPROGS_YEAR=20$YEAR
22fi
23
24case $MONTH in
25Jan) E2FSPROGS_MONTH="January" ;;
26Feb) E2FSPROGS_MONTH="February" ;;
27Mar) E2FSPROGS_MONTH="March" ;;
28Apr) E2FSPROGS_MONTH="April" ;;
29May) E2FSPROGS_MONTH="May" ;;
30Jun) E2FSPROGS_MONTH="June" ;;
31Jul) E2FSPROGS_MONTH="July" ;;
32Aug) E2FSPROGS_MONTH="August" ;;
33Sep) E2FSPROGS_MONTH="September" ;;
34Oct) E2FSPROGS_MONTH="October" ;;
35Nov) E2FSPROGS_MONTH="November" ;;
36Dec) E2FSPROGS_MONTH="December" ;;
37*) echo "Unknown month $MONTH??" ;;
38esac
39
40unset DATE MONTH YEAR
41echo "Generating configuration file for e2fsprogs version $E2FSPROGS_VERSION"
42echo "Release date is ${E2FSPROGS_MONTH}, ${E2FSPROGS_YEAR}"
43AC_SUBST(E2FSPROGS_YEAR)
44AC_SUBST(E2FSPROGS_MONTH)
45AC_SUBST(E2FSPROGS_VERSION)
Theodore Ts'oea97be52001-09-19 15:20:12 -040046AC_CANONICAL_HOST
Theodore Ts'o74becf31997-04-26 14:37:06 +000047dnl
48dnl set $(CC) from --with-cc=value
49dnl
50AC_ARG_WITH([cc],
51[ --with-cc=COMPILER select compiler to use],
52AC_MSG_RESULT(CC=$withval)
53CC=$withval,
54if test -z "$CC" ; then CC=cc; fi
55[AC_MSG_RESULT(CC defaults to $CC)])dnl
56export CC
57AC_SUBST([CC])
Theodore Ts'o73ae2d42000-02-02 16:13:14 +000058AC_PROG_CC
Theodore Ts'o74becf31997-04-26 14:37:06 +000059dnl
60dnl set $(LD) from --with-linker=value
61dnl
62AC_ARG_WITH([linker],
63[ --with-linker=LINKER select linker to use],
64AC_MSG_RESULT(LD=$withval)
65LD=$withval,
66if test -z "$LD" ; then LD=$CC; fi
67[AC_MSG_RESULT(LD defaults to $LD)])dnl
68export LD
69AC_SUBST([LD])
70dnl
71dnl set $(CCOPTS) from --with-ccopts=value
72dnl
73AC_ARG_WITH([ccopts],
74[ --with-ccopts=CCOPTS select compiler command line options],
75AC_MSG_RESULT(CCOPTS is $withval)
Theodore Ts'o877eb6d2001-06-11 06:54:13 +000076CFLAGS=$withval,
77)dnl
Theodore Ts'o74becf31997-04-26 14:37:06 +000078dnl
Theodore Ts'of8bd9801999-10-26 04:19:45 +000079dnl On systems without linux header files, we add an extra include directory
80dnl that holds enough to fake it (hopefully). Note that the $(top_srcdir) here
81dnl is quoted so that it gets expanded by make, not by configure.
82dnl
83AC_CHECK_HEADER(linux/fs.h, [linux_headers=yes], [linux_headers=no])
Theodore Ts'o73ae2d42000-02-02 16:13:14 +000084if test "$linux_headers" != yes; then
85 LINUX_INCLUDE='-I$(top_builddir)/include'
Theodore Ts'of8bd9801999-10-26 04:19:45 +000086fi
87AC_SUBST(LINUX_INCLUDE)
88dnl
Theodore Ts'oa4d09611997-04-29 14:28:00 +000089dnl Set default values for library extentions. Will be dealt with after
90dnl parsing configuration opions, which may modify these
91dnl
92LIB_EXT=.a
93STATIC_LIB_EXT=.a
94PROFILE_LIB_EXT=.a
95dnl
Theodore Ts'o74becf31997-04-26 14:37:06 +000096dnl set $(LDFLAGS) from --with-ldopts=value
97dnl
98AC_ARG_WITH([ldopts],
99[ --with-ldopts=LDOPTS select linker command line options],
100AC_MSG_RESULT(LDFLAGS is $withval)
101LDFLAGS=$withval,
102LDFLAGS=)dnl
103AC_SUBST(LDFLAGS)
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000104dnl
Theodore Ts'oa4b2d3c1998-04-03 16:12:25 +0000105dnl Allow separate `root_prefix' to be specified
Theodore Ts'ofc6d9d51997-04-29 14:51:31 +0000106dnl
Theodore Ts'oa4b2d3c1998-04-03 16:12:25 +0000107AC_ARG_WITH([root-prefix],
108[ --with-root-prefix=PREFIX override prefix variable for files to be placed in the root],
109root_prefix=$withval,
110root_prefix=NONE)dnl
Theodore Ts'ofc6d9d51997-04-29 14:51:31 +0000111dnl
Theodore Ts'o19178752000-02-11 15:55:07 +0000112dnl handle --enable-compression
113dnl
114AC_ARG_ENABLE([compression],
115[ --enable-compression enable EXPERIMENTAL compression support],
116if test "$enableval" = "no"
117then
118 echo "Disabling compression support"
119else
120 AC_DEFINE(ENABLE_COMPRESSION)
121 echo "Enabling compression support"
122 echo "WARNING: Compression support is experimental"
123fi
124,
125echo "Disabling compression support by default"
126)
127dnl
Theodore Ts'o8fdc9982002-06-25 23:26:34 -0400128dnl handle --enable-htree
129dnl
130AC_ARG_ENABLE([htree],
131[ --enable-htree enable EXPERIMENTAL htree directory support],
132if test "$enableval" = "no"
133then
134 HTREE_CMT=#
135 echo "Disabling htree directory support"
136else
137 HTREE_CMT=
138 AC_DEFINE(ENABLE_HTREE)
139 echo "Enabling htree directory support"
Theodore Ts'o8fdc9982002-06-25 23:26:34 -0400140fi
141,
Theodore Ts'o559ca6c2002-08-18 03:48:55 -0400142HTREE_CMT=
143AC_DEFINE(ENABLE_HTREE)
144echo "Enabling htree directory support by default"
Theodore Ts'o8fdc9982002-06-25 23:26:34 -0400145)
146AC_SUBST(HTREE_CMT)
147dnl
148dnl handle --enable-clear-htree
149dnl
150AC_ARG_ENABLE([htree-clear],
151[ --enable-htree-clear clear htree because we don't trust e2fsck],
152if test "$enableval" = "no"
153then
154 HTREE_CLR_CMT=#
155 echo "Disabling htree clearing"
156else
157 HTREE_CLR_CMT=
158 AC_DEFINE(ENABLE_HTREE_CLEAR)
159 echo "Enabling htree clearing"
160fi
161,
162HTREE_CLR_CMT=#
163echo "Disabling htree clearing by default"
164)
165AC_SUBST(HTREE_CLR_CMT)
166dnl
Theodore Ts'oa9d799a2002-11-08 13:50:51 -0500167dnl handle --enable-emvs-10
Theodore Ts'off6dbcc2002-05-24 22:44:42 -0400168dnl
Theodore Ts'oa9d799a2002-11-08 13:50:51 -0500169EVMS_ABI_CODE=120
170AC_ARG_ENABLE([evms-10],
171[ --enable-evms-10 use EVMS 1.0 ABI (instead of EVMS 1.2)],
172if test "$enableval" != "no"
Theodore Ts'off6dbcc2002-05-24 22:44:42 -0400173then
Theodore Ts'oa9d799a2002-11-08 13:50:51 -0500174 EVMS_ABI_CODE=100
Theodore Ts'off6dbcc2002-05-24 22:44:42 -0400175 echo "Enabling EVMS 1.0.0 ABI"
176fi
Theodore Ts'off6dbcc2002-05-24 22:44:42 -0400177)
178dnl
Theodore Ts'oa9d799a2002-11-08 13:50:51 -0500179dnl handle --enable-emvs-11
180dnl
181AC_ARG_ENABLE([evms-11],
182[ --enable-evms-11 use EVMS 1.1 ABI (instead of EVMS 1.1)],
183if test "$enableval" != "no"
184then
185 EVMS_ABI_CODE=110
186 echo "Enabling EVMS 1.1.0 ABI"
187fi
188)
189if test "$EVMS_ABI_CODE" = "120"
190then
191 echo "Using EVMS 1.2.0 ABI by default"
192fi
193AC_SUBST(EVMS_ABI_CODE)
194dnl
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000195dnl handle --enable-dll-shlibs
196dnl
197AC_ARG_ENABLE([dll-shlibs],
Theodore Ts'oa4d09611997-04-29 14:28:00 +0000198[ --enable-dll-shlibs select DLL libraries],
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000199if test "$enableval" = "no"
200then
201 DLL_CMT=#
202 MAKEFILE_DLL=/dev/null
203 echo "Disabling DLL shared libraries"
204else
205 DLL_CMT=
206 MAKEFILE_DLL=$srcdir/lib/Makefile.dll-lib
Theodore Ts'o74becf31997-04-26 14:37:06 +0000207 BINARY_TYPE=dllbin
Theodore Ts'oa4d09611997-04-29 14:28:00 +0000208 LIB_EXT=.sa
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000209 echo "Enabling DLL shared libraries"
210fi
211,
212MAKEFILE_DLL=/dev/null
213DLL_CMT=#
214echo "Disabling DLL shared libraries by default"
215)
216AC_SUBST(DLL_CMT)
217AC_SUBST_FILE(MAKEFILE_DLL)
218dnl
219dnl handle --enable-elf-shlibs
220dnl
221AC_ARG_ENABLE([elf-shlibs],
Theodore Ts'oa4d09611997-04-29 14:28:00 +0000222[ --enable-elf-shlibs select ELF shared libraries],
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000223if test "$enableval" = "no"
224then
225 ELF_CMT=#
226 MAKEFILE_ELF=/dev/null
227 echo "Disabling ELF shared libraries"
228else
229 ELF_CMT=
230 MAKEFILE_ELF=$srcdir/lib/Makefile.elf-lib
Theodore Ts'of5955dd2000-10-25 02:38:39 +0000231 [case "$host_os" in
232 solaris2.*)
233 MAKEFILE_ELF=$srcdir/lib/Makefile.solaris-lib
234 ;;
235 esac]
Theodore Ts'o74becf31997-04-26 14:37:06 +0000236 BINARY_TYPE=elfbin
Theodore Ts'oa4d09611997-04-29 14:28:00 +0000237 LIB_EXT=.so
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000238 echo "Enabling ELF shared libraries"
239fi
240,
241MAKEFILE_ELF=/dev/null
242ELF_CMT=#
243echo "Disabling ELF shared libraries by default"
244)
245AC_SUBST(ELF_CMT)
246AC_SUBST_FILE(MAKEFILE_ELF)
247dnl
248dnl handle --enable-bsd-shlibs
249dnl
250AC_ARG_ENABLE([bsd-shlibs],
Theodore Ts'oa4d09611997-04-29 14:28:00 +0000251[ --enable-bsd-shlibs select BSD shared libraries],
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000252if test "$enableval" = "no"
253then
254 BSDLIB_CMT=#
255 MAKEFILE_BSDLIB=/dev/null
256 echo "Disabling BSD shared libraries"
257else
258 BSDLIB_CMT=
259 MAKEFILE_BSDLIB=$srcdir/lib/Makefile.bsd-lib
Theodore Ts'oa4d09611997-04-29 14:28:00 +0000260 LIB_EXT=.so
Theodore Ts'oe71d8732003-03-14 02:13:48 -0500261 [case "$host_os" in
Theodore Ts'oaa75ecc2003-03-17 10:01:22 -0500262 darwin*)
Theodore Ts'oe71d8732003-03-14 02:13:48 -0500263 MAKEFILE_BSDLIB=$srcdir/lib/Makefile.darwin-lib
264 LIB_EXT=.dylib
265 ;;
266 esac]
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000267 echo "Enabling BSD shared libraries"
268fi
269,
270MAKEFILE_BSDLIB=/dev/null
271BSDLIB_CMT=#
272echo "Disabling BSD shared libraries by default"
273)
274AC_SUBST(BSDLIB_CMT)
275AC_SUBST_FILE(MAKEFILE_BSDLIB)
276dnl
277dnl handle --enable-profile
278dnl
279AC_ARG_ENABLE([profile],
Theodore Ts'oa4d09611997-04-29 14:28:00 +0000280[ --enable-profile build profiling libraries],
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000281if test "$enableval" = "no"
282then
283 PROFILE_CMT=#
284 MAKEFILE_PROFILE=/dev/null
285 echo "Disabling profiling libraries"
286else
287 PROFILE_CMT=
288 MAKEFILE_PROFILE=$srcdir/lib/Makefile.profile
Theodore Ts'oa4d09611997-04-29 14:28:00 +0000289 PROFILED_LIB_EXT=_p.a
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000290 echo "Building profiling libraries"
291fi
292,
293PROFILE_CMT=#
294MAKEFILE_PROFILE=/dev/null
295echo "Disabling profiling libraries by default"
296)
297AC_SUBST(PROFILE_CMT)
298AC_SUBST_FILE(MAKEFILE_PROFILE)
299dnl
300dnl handle --enable-checker
301dnl
302AC_ARG_ENABLE([checker],
Theodore Ts'oa4d09611997-04-29 14:28:00 +0000303[ --enable-checker build checker libraries],
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000304if test "$enableval" = "no"
305then
306 CHECKER_CMT=#
307 MAKEFILE_CHECKER=/dev/null
308 echo "Disabling checker libraries"
309else
310 CHECKER_CMT=
311 MAKEFILE_CHECKER=$srcdir/lib/Makefile.checker
312 echo "Building checker libraries"
313fi
314,
315CHECKER_CMT=#
316MAKEFILE_CHECKER=/dev/null
317echo "Disabling checker libraries by default"
318)
319AC_SUBST(CHECKER_CMT)
320AC_SUBST_FILE(MAKEFILE_CHECKER)
321dnl
Theodore Ts'oa4d09611997-04-29 14:28:00 +0000322dnl Substitute library extensions
323dnl
324AC_SUBST(LIB_EXT)
325AC_SUBST(STATIC_LIB_EXT)
326AC_SUBST(PROFILED_LIB_EXT)
327dnl
Theodore Ts'o782bebf2002-11-08 18:46:45 -0500328dnl handle --enable-jbd-debug
Theodore Ts'ocdf186e2001-06-13 22:16:47 +0000329dnl
Theodore Ts'o782bebf2002-11-08 18:46:45 -0500330AC_ARG_ENABLE([jbd-debug],
331[ --enable-jbd-debug enable journal debugging],
Theodore Ts'ocdf186e2001-06-13 22:16:47 +0000332if test "$enableval" = "no"
333then
334 echo "Disabling journal debugging"
335else
Theodore Ts'o8cf93332001-12-16 02:23:36 -0500336 AC_DEFINE(CONFIG_JBD_DEBUG)
Theodore Ts'ocdf186e2001-06-13 22:16:47 +0000337 echo "Enabling journal debugging"
338fi
339,
340echo "Disabling journal debugging by default"
341)
342dnl
Theodore Ts'of0a22d02003-02-22 13:19:53 -0500343dnl handle --enable-blkid-debug
344dnl
345AC_ARG_ENABLE([blkid-debug],
346[ --enable-blkid-debug enable blkid debugging],
347if test "$enableval" = "no"
348then
349 echo "Disabling blkid debugging"
350else
351 AC_DEFINE(CONFIG_BLKID_DEBUG)
352 echo "Enabling blkid debugging"
353fi
354,
355echo "Disabling blkid debugging by default"
356)
357dnl
Theodore Ts'ocdf186e2001-06-13 22:16:47 +0000358dnl handle --enable-swapfs
359dnl
360AC_ARG_ENABLE([swapfs],
361[ --disable-swapfs disable support of legacy byte-swapped filesystems],
362if test "$enableval" = "no"
363then
Theodore Ts'ofeb44c62002-11-08 14:55:38 -0500364 SWAPFS_CMT=#
Theodore Ts'ocdf186e2001-06-13 22:16:47 +0000365 echo "Disabling swapfs support"
366else
Theodore Ts'ofeb44c62002-11-08 14:55:38 -0500367 SWAPFS_CMT=
Theodore Ts'ocdf186e2001-06-13 22:16:47 +0000368 AC_DEFINE(ENABLE_SWAPFS)
369 echo "Enabling swapfs support"
370fi
371,
Theodore Ts'ofeb44c62002-11-08 14:55:38 -0500372SWAPFS_CMT=
Theodore Ts'ocdf186e2001-06-13 22:16:47 +0000373echo "Enabling swapfs support by default"
374AC_DEFINE(ENABLE_SWAPFS)
375)
Theodore Ts'ofeb44c62002-11-08 14:55:38 -0500376AC_SUBST(SWAPFS_CMT)
Theodore Ts'ocdf186e2001-06-13 22:16:47 +0000377dnl
378dnl handle --enable-debugfs
379dnl
380AC_ARG_ENABLE([debugfs],
381[ --disable-debugfs disable support of debugfs program],
382if test "$enableval" = "no"
383then
384 echo "Disabling debugfs support"
385 DEBUGFS_CMT="#"
386else
387 DEBUGFS_CMT=
388 echo "Enabling debugfs support"
389fi
390,
391echo "Enabling debugfs support by default"
392DEBUGFS_CMT=
393)
394AC_SUBST(DEBUGFS_CMT)
395dnl
396dnl handle --enable-imager
397dnl
398AC_ARG_ENABLE([imager],
399[ --disable-imager disable support of e2image program],
400if test "$enableval" = "no"
401then
402 echo "Disabling e2image support"
403 IMAGER_CMT="#"
404else
405 IMAGER_CMT=
406 echo "Enabling e2image support"
407fi
408,
409echo "Enabling e2image support by default"
410IMAGER_CMT=
411)
412AC_SUBST(IMAGER_CMT)
413dnl
414dnl handle --enable-resizer
415dnl
416AC_ARG_ENABLE([resizer],
417[ --disable-resizer disable support of e2resize program],
418if test "$enableval" = "no"
419then
420 echo "Disabling e2resize support"
421 RESIZER_CMT="#"
422else
423 RESIZER_CMT=
424 echo "Enabling e2resize support"
425fi
426,
427echo "Enabling e2resize support by default"
428RESIZER_CMT=
429)
430AC_SUBST(RESIZER_CMT)
431dnl
Theodore Ts'o4d0f3e12001-01-11 15:48:50 +0000432dnl handle --enable-dynamic-e2fsck
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000433dnl
Theodore Ts'oa4d09611997-04-29 14:28:00 +0000434AC_ARG_ENABLE([dynamic-e2fsck],
435[ --enable-dynamic-e2fsck build e2fsck dynamically],
436if test "$enableval" = "no"
437then
438 E2FSCK_TYPE=static
439 echo "Building e2fsck statically"
440else
441 E2FSCK_TYPE=shared
442 echo "Building e2fsck dynamically"
443fi
444,
445E2FSCK_TYPE=static
446echo "Building e2fsck statically by default"
447)
448AC_SUBST(E2FSCK_TYPE)
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000449dnl
Theodore Ts'ofc6d9d51997-04-29 14:51:31 +0000450dnl See whether to install the `fsck' wrapper program (that calls e2fsck)
451dnl
452AC_ARG_ENABLE([fsck],
453[ --enable-fsck build fsck wrapper program],
454[if test "$enableval" = "no"
455then
456 FSCK_PROG='' FSCK_MAN=''
457 echo "Not building fsck wrapper"
458else
459 FSCK_PROG=fsck FSCK_MAN=fsck.8
460 echo "Building fsck wrapper"
461fi]
462,
463[case "$host_os" in
464 gnu*)
465 FSCK_PROG='' FSCK_MAN=''
466 echo "Not building fsck wrapper by default"
467 ;;
468 *)
469 FSCK_PROG=fsck FSCK_MAN=fsck.8
470 echo "Building fsck wrapper by default"
471esac]
472)
473AC_SUBST(FSCK_PROG)
474AC_SUBST(FSCK_MAN)
475dnl
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000476dnl
477MAKEFILE_LIBRARY=$srcdir/lib/Makefile.library
478AC_SUBST_FILE(MAKEFILE_LIBRARY)
479dnl
Theodore Ts'ofc6d9d51997-04-29 14:51:31 +0000480dnl
481AC_ARG_ENABLE([old-bitops],
482[ --enable-old-bitops Use old (non-standard but native) bitmask operations],
483if test "$enableval" = "no"
484then
485 echo "Using new (standard) bitmask operations"
486else
487 AC_DEFINE(EXT2_OLD_BITOPS)
488 echo "Using old (native) bitmask operations"
489
490fi
491,
492echo "Using standard bitmask operations by default"
493)
494dnl
Theodore Ts'ocdf186e2001-06-13 22:16:47 +0000495dnl Add internationalization support, using gettext.
496dnl
497PACKAGE=e2fsprogs
498VERSION="$E2FSPROGS_VERSION"
499AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE")
500AC_DEFINE_UNQUOTED(VERSION, "$VERSION")
501AC_SUBST(PACKAGE)
502AC_SUBST(VERSION)
503
Theodore Ts'o0c897a92002-11-09 12:01:18 -0500504ALL_LINGUAS="it nyc tr de de-utf"
Theodore Ts'ocdf186e2001-06-13 22:16:47 +0000505AM_GNU_GETTEXT
506dnl
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000507dnl End of configuration options
508dnl
Theodore Ts'o74becf31997-04-26 14:37:06 +0000509AC_SUBST(BINARY_TYPE)
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000510AC_PROG_MAKE_SET
511AC_PATH_PROG(LN, ln, ln)
Theodore Ts'ofc6d9d51997-04-29 14:51:31 +0000512AC_PROG_LN_S
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000513AC_PATH_PROG(MV, mv, mv)
514AC_PATH_PROG(CP, cp, cp)
515AC_PATH_PROG(RM, rm, rm)
516AC_PATH_PROG(CHMOD, chmod, :)
517AC_PATH_PROG(AWK, awk, awk)
518AC_PATH_PROG(SED, sed, sed)
Theodore Ts'o9d564f71999-07-03 20:25:58 +0000519AC_PATH_PROG(PERL, perl, perl)
Theodore Ts'o250f79f2001-05-19 22:02:22 +0000520AC_PATH_PROG(LDCONFIG, ldconfig, :)
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000521AC_CHECK_TOOL(AR, ar, ar)
522AC_CHECK_TOOL(RANLIB, ranlib, :)
523AC_CHECK_TOOL(STRIP, strip, :)
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000524AC_PROG_INSTALL
Theodore Ts'o6c133521999-07-03 20:37:03 +0000525# See if we need a separate native compiler.
526if test $cross_compiling = no; then
527 BUILD_CC="$CC"
528 AC_SUBST(BUILD_CC)
529else
530 AC_CHECK_PROGS(BUILD_CC, gcc cc)
531fi
Theodore Ts'o31e29a12002-05-17 10:53:07 -0400532AC_CHECK_HEADERS(stdlib.h unistd.h stdarg.h errno.h malloc.h mntent.h paths.h dirent.h getopt.h setjmp.h signal.h termios.h linux/fd.h linux/major.h sys/disklabel.h sys/ioctl.h sys/mkdev.h sys/mount.h sys/sockio.h sys/sysmacros.h sys/time.h sys/stat.h sys/types.h net/if.h netinet/in.h)
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000533AC_FUNC_VPRINTF
534dnl
Theodore Ts'ob0b9c4d1997-10-20 23:36:30 +0000535dnl Check to see if llseek() is declared in unistd.h. On some libc's
536dnl it is, and on others it isn't..... Thank you glibc developers....
537dnl
538dnl Warning! Use of --enable-gcc-wall may throw off this test.
539dnl
540dnl
541AC_MSG_CHECKING(whether llseek declared in unistd.h)
542AC_CACHE_VAL(e2fsprogs_cv_have_llseek_prototype,
543 AC_TRY_COMPILE(
544[#include <unistd.h>], [extern int llseek(int);],
545 [e2fsprogs_cv_have_llseek_prototype=no],
546 [e2fsprogs_cv_have_llseek_prototype=yes]))
547AC_MSG_RESULT($e2fsprogs_cv_have_llseek_prototype)
548if test "$e2fsprogs_cv_have_llseek_prototype" = yes; then
549 AC_DEFINE(HAVE_LLSEEK_PROTOTYPE)
550fi
551dnl
Theodore Ts'o6928adc2000-05-25 23:28:50 +0000552dnl Check to see if lseek64() is declared in unistd.h. Glibc's header files
553dnl are so convoluted that I can't tell whether it will always be defined,
554dnl and if it isn't defined while lseek64 is defined in the library,
555dnl disaster will strike.
556dnl
557dnl Warning! Use of --enable-gcc-wall may throw off this test.
558dnl
559dnl
560AC_MSG_CHECKING(whether lseek64 declared in unistd.h)
561AC_CACHE_VAL(e2fsprogs_cv_have_lseek64_prototype,
562 AC_TRY_COMPILE(
563[#define _LARGEFILE_SOURCE
564#define _LARGEFILE64_SOURCE
565#include <unistd.h>], [extern int lseek64(int);],
566 [e2fsprogs_cv_have_lseek64_prototype=no],
567 [e2fsprogs_cv_have_lseek64_prototype=yes]))
568AC_MSG_RESULT($e2fsprogs_cv_have_lseek64_prototype)
569if test "$e2fsprogs_cv_have_lseek64_prototype" = yes; then
570 AC_DEFINE(HAVE_LSEEK64_PROTOTYPE)
571fi
572dnl
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000573dnl Word sizes...
574dnl
575if test "$cross_compiling" = yes -a "$ac_cv_sizeof_long" = ""; then
576 # if cross-compiling, with no cached values, just assume something common.
577 ac_cv_sizeof_short=2
578 ac_cv_sizeof_int=4
579 ac_cv_sizeof_long=4
Theodore Ts'o6c133521999-07-03 20:37:03 +0000580 ac_cv_sizeof_long_long=8
581 AC_MSG_WARN([Cross-compiling, so cannot check type sizes; assuming short=2, int=4, long=4, long long=8])
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000582fi
583AC_CHECK_SIZEOF(short)
584AC_CHECK_SIZEOF(int)
585AC_CHECK_SIZEOF(long)
Theodore Ts'ofc6d9d51997-04-29 14:51:31 +0000586AC_CHECK_SIZEOF(long long)
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000587SIZEOF_SHORT=$ac_cv_sizeof_short
588SIZEOF_INT=$ac_cv_sizeof_int
589SIZEOF_LONG=$ac_cv_sizeof_long
Theodore Ts'ofc6d9d51997-04-29 14:51:31 +0000590SIZEOF_LONG_LONG=$ac_cv_sizeof_long_long
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000591AC_SUBST(SIZEOF_SHORT)
592AC_SUBST(SIZEOF_INT)
593AC_SUBST(SIZEOF_LONG)
Theodore Ts'ofc6d9d51997-04-29 14:51:31 +0000594AC_SUBST(SIZEOF_LONG_LONG)
Theodore Ts'o877eb6d2001-06-11 06:54:13 +0000595AC_C_BIGENDIAN
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000596dnl
597dnl See if struct stat has a st_flags field, in which case we can get file
598dnl flags somewhat portably. Also check for the analogous setter, chflags().
599dnl
600AC_MSG_CHECKING(whether struct stat has a st_flags field)
601AC_CACHE_VAL(e2fsprogs_cv_struct_st_flags,
602 AC_TRY_COMPILE([#include <sys/stat.h>],
603 [struct stat stat; stat.st_flags = 0;],
604 [e2fsprogs_cv_struct_st_flags=yes],
605 [e2fsprogs_cv_struct_st_flags=no]))
606AC_MSG_RESULT($e2fsprogs_cv_struct_st_flags)
607if test "$e2fsprogs_cv_struct_st_flags" = yes; then
Theodore Ts'oc03bc4e1999-10-20 18:20:36 +0000608 AC_MSG_CHECKING(whether st_flags field is useful)
609 AC_CACHE_VAL(e2fsprogs_cv_struct_st_flags_immut,
610 AC_TRY_COMPILE([#include <sys/stat.h>],
611 [struct stat stat; stat.st_flags |= UF_IMMUTABLE;],
612 [e2fsprogs_cv_struct_st_flags_immut=yes],
613 [e2fsprogs_cv_struct_st_flags_immut=no]))
614 AC_MSG_RESULT($e2fsprogs_cv_struct_st_flags_immut)
615 if test "$e2fsprogs_cv_struct_st_flags_immut" = yes; then
616 AC_DEFINE(HAVE_STAT_FLAGS)
617 fi
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000618fi
Theodore Ts'oe12f2ae2003-01-23 16:45:16 -0500619AC_CHECK_FUNCS(chflags getrusage llseek lseek64 open64 getmntinfo strtoull strcasecmp srandom fchown mallinfo fdatasync strnlen sysconf pathconf)
Theodore Ts'ofc6d9d51997-04-29 14:51:31 +0000620dnl
Theodore Ts'ofc6d9d51997-04-29 14:51:31 +0000621dnl Check to see if -lsocket is required (solaris) to make something
622dnl that uses socket() to compile; this is needed for the UUID library
623dnl
624SOCKET_LIB=''
625AC_CHECK_LIB(socket, socket, [SOCKET_LIB=-lsocket])
626AC_SUBST(SOCKET_LIB)
627dnl
Theodore Ts'o3ae497e2003-03-16 06:26:25 -0500628dnl Check to see if libdl exists for the sake of dlopen
629dnl
630DLOPEN_LIB=''
631AC_CHECK_LIB(dl, dlopen,
632[DLOPEN_LIB=-ldl
633AC_DEFINE(HAVE_DLOPEN)])
634AC_SUBST(DLOPEN_LIB)
635dnl
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000636dnl See if optreset exists
637dnl
638AC_MSG_CHECKING(for optreset)
639AC_CACHE_VAL(ac_cv_have_optreset,
640[AC_EGREP_HEADER(optreset, unistd.h,
641 ac_cv_have_optreset=yes, ac_cv_have_optreset=no)])dnl
642AC_MSG_RESULT($ac_cv_have_optreset)
643if test $ac_cv_have_optreset = yes; then
644 AC_DEFINE(HAVE_OPTRESET)
645fi
646dnl
Theodore Ts'o8f3f29d2000-02-11 05:04:44 +0000647dnl We use the EXT2 ioctls only under Linux
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000648dnl
Theodore Ts'o8f3f29d2000-02-11 05:04:44 +0000649case "$host_os" in
650linux*)
651 AC_DEFINE(HAVE_EXT2_IOCTLS)
652 ;;
653esac
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000654dnl
Theodore Ts'oe6f2bda2002-08-18 03:37:10 -0400655dnl Uncomment only if Linux
656dnl
657LINUX_CMT="#"
658case "$host_os" in
659linux*)
660 LINUX_CMT=
661 ;;
662esac
663AC_SUBST(LINUX_CMT)
664dnl
Theodore Ts'o6c133521999-07-03 20:37:03 +0000665dnl Linux and Hurd places root files in the / by default
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000666dnl
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000667case "$host_os" in
Theodore Ts'o6c133521999-07-03 20:37:03 +0000668linux* | gnu*)
Theodore Ts'oa4b2d3c1998-04-03 16:12:25 +0000669 if test "$prefix" = NONE -a "$root_prefix" = NONE ; then
670 root_prefix="";
671 echo "On $host_os systems, root_prefix defaults to ''"
Theodore Ts'ofc6d9d51997-04-29 14:51:31 +0000672 fi
673 ;;
674esac
Theodore Ts'ofc6d9d51997-04-29 14:51:31 +0000675dnl
Theodore Ts'oa4b2d3c1998-04-03 16:12:25 +0000676dnl On Linux/hurd, force the prefix to be /usr
Theodore Ts'ofc6d9d51997-04-29 14:51:31 +0000677dnl
678case "$host_os" in
679linux* | gnu*)
680 if test "$prefix" = NONE ; then
Theodore Ts'oa4b2d3c1998-04-03 16:12:25 +0000681 prefix="/usr";
682 echo "On $host_os systems, prefix defaults to /usr"
Theodore Ts'obff61a72002-05-21 22:21:38 -0400683 if test "$mandir" = '${prefix}/man' ; then
684 echo "...and mandir defaults to /usr/share/man"
685 mandir=/usr/share/man
686 fi
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000687 fi
688;;
689esac
Theodore Ts'oa4b2d3c1998-04-03 16:12:25 +0000690if test "$root_prefix" = NONE ; then
Theodore Ts'offe19911998-04-08 06:05:49 +0000691 if test "$prefix" = NONE ; then
Theodore Ts'oa4b2d3c1998-04-03 16:12:25 +0000692 root_prefix="$ac_default_prefix"
693 else
694 root_prefix="$prefix"
695 fi
Theodore Ts'ob5ffead2002-05-11 19:17:00 -0400696 root_bindir=$bindir
697 root_sbindir=$sbindir
698 root_libdir=$libdir
699 root_sysconfdir=$sysconfdir
700else
701 root_bindir='${root_prefix}/bin'
702 root_sbindir='${root_prefix}/sbin'
703 root_libdir='${root_prefix}/lib'
704 root_sysconfdir='${root_prefix}/etc'
Theodore Ts'oa4b2d3c1998-04-03 16:12:25 +0000705fi
706AC_SUBST(root_prefix)
Theodore Ts'ob5ffead2002-05-11 19:17:00 -0400707AC_SUBST(root_bindir)
708AC_SUBST(root_sbindir)
709AC_SUBST(root_libdir)
710AC_SUBST(root_sysconfdir)
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000711dnl
712dnl See if -static works.
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000713dnl
Theodore Ts'oae851481997-04-29 18:13:24 +0000714AC_MSG_CHECKING([whether linker accepts -static])
715AC_CACHE_VAL(ac_cv_e2fsprogs_use_static,
716[SAVE_LDFLAGS=$LDFLAGS; LDFLAGS="$LDFLAGS -static"
717AC_TRY_LINK([#include <stdio.h>],[fflush(stdout);],
718 ac_cv_e2fsprogs_use_static=yes, ac_cv_e2fsprogs_use_static=no)
719LDFLAGS=$SAVE_LDFLAGS])
Theodore Ts'odefde781999-01-04 07:39:19 +0000720dnl
721dnl Regardless of how the test turns out, Solaris doesn't handle -static
722dnl This is caused by the socket library requiring the nsl library, which
723dnl requires the -dl library, which only works for dynamically linked
724dnl programs. It basically means you can't have statically linked programs
725dnl which use the network under Solaris.
726dnl
727case "$host_os" in
728solaris2.*)
729 ac_cv_e2fsprogs_use_static=no
730;;
731esac
Theodore Ts'oae851481997-04-29 18:13:24 +0000732AC_MSG_RESULT($ac_cv_e2fsprogs_use_static)
Theodore Ts'o74becf31997-04-26 14:37:06 +0000733LDFLAG_STATIC=
Theodore Ts'oae851481997-04-29 18:13:24 +0000734if test $ac_cv_e2fsprogs_use_static = yes; then
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000735 LDFLAG_STATIC=-static
Theodore Ts'oae851481997-04-29 18:13:24 +0000736fi
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000737AC_SUBST(LDFLAG_STATIC)
738dnl
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000739dnl Make the ss and et directories work correctly.
740dnl
741SS_DIR=`cd ${srcdir}/lib/ss; pwd`
742ET_DIR=`cd ${srcdir}/lib/et; pwd`
743AC_SUBST(SS_DIR)
744AC_SUBST(ET_DIR)
745dnl
746dnl Only try to run the test suite if we're not cross compiling.
747dnl
748if test "$cross_compiling" = yes ; then
749 DO_TEST_SUITE=
750else
751 DO_TEST_SUITE=check
752fi
753AC_SUBST(DO_TEST_SUITE)
754dnl
755dnl Make our output files, being sure that we create the some miscellaneous
756dnl directories
757dnl
758test -d lib || mkdir lib
759test -d include || mkdir include
760test -d include/linux || mkdir include/linux
Theodore Ts'odefde781999-01-04 07:39:19 +0000761test -d include/asm || mkdir include/asm
Theodore Ts'o94ba8c72003-03-02 02:07:14 -0500762for i in MCONFIG Makefile util/Makefile util/subst.conf lib/et/Makefile \
763 lib/ss/Makefile lib/ext2fs/Makefile lib/e2p/Makefile \
764 lib/uuid/Makefile lib/uuid/uuid_types.h \
765 lib/blkid/Makefile lib/blkid/blkid_types.h \
766 lib/evms/Makefile misc/Makefile ext2ed/Makefile e2fsck/Makefile \
767 debugfs/Makefile tests/Makefile tests/progs/Makefile \
768 resize/Makefile doc/Makefile intl/Makefile po/Makefile.in ; do
769 if test -d `dirname ${srcdir}/$i` ; then
770 outlist="$outlist $i"
771 fi
772done
773AC_OUTPUT($outlist)