blob: df6fa4a70c9c7097faa2e2df671a1294fa35c913 [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 \" " "`
Theodore Ts'obff0cc92003-03-23 01:37:53 -050013E2FSPROGS_DAY=`echo $DATE | awk -F- '{print $1}'`
Theodore Ts'o74becf31997-04-26 14:37:06 +000014MONTH=`echo $DATE | awk -F- '{print $2}'`
15YEAR=`echo $DATE | awk -F- '{print $3}'`
16
Theodore Ts'o40fa8cc1999-01-09 05:06:02 +000017if expr $YEAR ">" 1900 > /dev/null ; then
18 E2FSPROGS_YEAR=$YEAR
19elif expr $YEAR ">" 90 >/dev/null ; then
Theodore Ts'o74becf31997-04-26 14:37:06 +000020 E2FSPROGS_YEAR=19$YEAR
21else
22 E2FSPROGS_YEAR=20$YEAR
23fi
24
25case $MONTH in
26Jan) E2FSPROGS_MONTH="January" ;;
27Feb) E2FSPROGS_MONTH="February" ;;
28Mar) E2FSPROGS_MONTH="March" ;;
29Apr) E2FSPROGS_MONTH="April" ;;
30May) E2FSPROGS_MONTH="May" ;;
31Jun) E2FSPROGS_MONTH="June" ;;
32Jul) E2FSPROGS_MONTH="July" ;;
33Aug) E2FSPROGS_MONTH="August" ;;
34Sep) E2FSPROGS_MONTH="September" ;;
35Oct) E2FSPROGS_MONTH="October" ;;
36Nov) E2FSPROGS_MONTH="November" ;;
37Dec) E2FSPROGS_MONTH="December" ;;
38*) echo "Unknown month $MONTH??" ;;
39esac
40
41unset DATE MONTH YEAR
42echo "Generating configuration file for e2fsprogs version $E2FSPROGS_VERSION"
43echo "Release date is ${E2FSPROGS_MONTH}, ${E2FSPROGS_YEAR}"
44AC_SUBST(E2FSPROGS_YEAR)
45AC_SUBST(E2FSPROGS_MONTH)
Theodore Ts'obff0cc92003-03-23 01:37:53 -050046AC_SUBST(E2FSPROGS_DAY)
Theodore Ts'o74becf31997-04-26 14:37:06 +000047AC_SUBST(E2FSPROGS_VERSION)
Theodore Ts'oea97be52001-09-19 15:20:12 -040048AC_CANONICAL_HOST
Theodore Ts'o74becf31997-04-26 14:37:06 +000049dnl
Theodore Ts'od21ae6c2003-05-05 09:00:24 -040050dnl Should we compile EVMS plugin or not. Complicated logic, spread
51dnl over several different command-line options...
52dnl
53EVMS_CMT=
54AC_SUBST([EVMS_CMT])
55dnl
56dnl Use diet libc
57dnl
58AC_ARG_WITH([diet-libc],
59[ --with-diet-libc Use diet libc],
60CC="diet cc -nostdinc"
61EVMS_CMT="#"
62AC_MSG_RESULT(CC=$CC))dnl
63dnl
Theodore Ts'o74becf31997-04-26 14:37:06 +000064dnl set $(CC) from --with-cc=value
65dnl
66AC_ARG_WITH([cc],
67[ --with-cc=COMPILER select compiler to use],
68AC_MSG_RESULT(CC=$withval)
69CC=$withval,
70if test -z "$CC" ; then CC=cc; fi
71[AC_MSG_RESULT(CC defaults to $CC)])dnl
72export CC
73AC_SUBST([CC])
Theodore Ts'o73ae2d42000-02-02 16:13:14 +000074AC_PROG_CC
Theodore Ts'o74becf31997-04-26 14:37:06 +000075dnl
76dnl set $(LD) from --with-linker=value
77dnl
78AC_ARG_WITH([linker],
79[ --with-linker=LINKER select linker to use],
80AC_MSG_RESULT(LD=$withval)
81LD=$withval,
82if test -z "$LD" ; then LD=$CC; fi
83[AC_MSG_RESULT(LD defaults to $LD)])dnl
84export LD
85AC_SUBST([LD])
86dnl
87dnl set $(CCOPTS) from --with-ccopts=value
88dnl
89AC_ARG_WITH([ccopts],
90[ --with-ccopts=CCOPTS select compiler command line options],
91AC_MSG_RESULT(CCOPTS is $withval)
Theodore Ts'o877eb6d2001-06-11 06:54:13 +000092CFLAGS=$withval,
93)dnl
Theodore Ts'o74becf31997-04-26 14:37:06 +000094dnl
Theodore Ts'of8bd9801999-10-26 04:19:45 +000095dnl On systems without linux header files, we add an extra include directory
96dnl that holds enough to fake it (hopefully). Note that the $(top_srcdir) here
97dnl is quoted so that it gets expanded by make, not by configure.
98dnl
99AC_CHECK_HEADER(linux/fs.h, [linux_headers=yes], [linux_headers=no])
Theodore Ts'o73ae2d42000-02-02 16:13:14 +0000100if test "$linux_headers" != yes; then
101 LINUX_INCLUDE='-I$(top_builddir)/include'
Theodore Ts'of8bd9801999-10-26 04:19:45 +0000102fi
103AC_SUBST(LINUX_INCLUDE)
104dnl
Theodore Ts'oa4d09611997-04-29 14:28:00 +0000105dnl Set default values for library extentions. Will be dealt with after
106dnl parsing configuration opions, which may modify these
107dnl
108LIB_EXT=.a
109STATIC_LIB_EXT=.a
110PROFILE_LIB_EXT=.a
111dnl
Theodore Ts'o74becf31997-04-26 14:37:06 +0000112dnl set $(LDFLAGS) from --with-ldopts=value
113dnl
114AC_ARG_WITH([ldopts],
115[ --with-ldopts=LDOPTS select linker command line options],
116AC_MSG_RESULT(LDFLAGS is $withval)
117LDFLAGS=$withval,
118LDFLAGS=)dnl
119AC_SUBST(LDFLAGS)
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000120dnl
Theodore Ts'oa4b2d3c1998-04-03 16:12:25 +0000121dnl Allow separate `root_prefix' to be specified
Theodore Ts'ofc6d9d51997-04-29 14:51:31 +0000122dnl
Theodore Ts'oa4b2d3c1998-04-03 16:12:25 +0000123AC_ARG_WITH([root-prefix],
124[ --with-root-prefix=PREFIX override prefix variable for files to be placed in the root],
125root_prefix=$withval,
126root_prefix=NONE)dnl
Theodore Ts'ofc6d9d51997-04-29 14:51:31 +0000127dnl
Theodore Ts'o19178752000-02-11 15:55:07 +0000128dnl handle --enable-compression
129dnl
130AC_ARG_ENABLE([compression],
131[ --enable-compression enable EXPERIMENTAL compression support],
132if test "$enableval" = "no"
133then
134 echo "Disabling compression support"
135else
136 AC_DEFINE(ENABLE_COMPRESSION)
137 echo "Enabling compression support"
138 echo "WARNING: Compression support is experimental"
139fi
140,
141echo "Disabling compression support by default"
142)
143dnl
Theodore Ts'o8fdc9982002-06-25 23:26:34 -0400144dnl handle --enable-htree
145dnl
146AC_ARG_ENABLE([htree],
147[ --enable-htree enable EXPERIMENTAL htree directory support],
148if test "$enableval" = "no"
149then
150 HTREE_CMT=#
151 echo "Disabling htree directory support"
152else
153 HTREE_CMT=
154 AC_DEFINE(ENABLE_HTREE)
155 echo "Enabling htree directory support"
Theodore Ts'o8fdc9982002-06-25 23:26:34 -0400156fi
157,
Theodore Ts'o559ca6c2002-08-18 03:48:55 -0400158HTREE_CMT=
159AC_DEFINE(ENABLE_HTREE)
160echo "Enabling htree directory support by default"
Theodore Ts'o8fdc9982002-06-25 23:26:34 -0400161)
162AC_SUBST(HTREE_CMT)
163dnl
164dnl handle --enable-clear-htree
165dnl
166AC_ARG_ENABLE([htree-clear],
167[ --enable-htree-clear clear htree because we don't trust e2fsck],
168if test "$enableval" = "no"
169then
170 HTREE_CLR_CMT=#
171 echo "Disabling htree clearing"
172else
173 HTREE_CLR_CMT=
174 AC_DEFINE(ENABLE_HTREE_CLEAR)
175 echo "Enabling htree clearing"
176fi
177,
178HTREE_CLR_CMT=#
179echo "Disabling htree clearing by default"
180)
181AC_SUBST(HTREE_CLR_CMT)
182dnl
Theodore Ts'od21ae6c2003-05-05 09:00:24 -0400183dnl handle --enable-evms
184dnl
185AC_ARG_ENABLE([evms],
186[ --disable-evms don't build EVMS plugin],
187if test "$enableval" != "no"
188then
189 EVMS_CMT="#"
190 echo "Disabling EVMS plugin"
191fi
192)
193dnl
Theodore Ts'oa9d799a2002-11-08 13:50:51 -0500194dnl handle --enable-emvs-10
Theodore Ts'off6dbcc2002-05-24 22:44:42 -0400195dnl
Theodore Ts'oa9d799a2002-11-08 13:50:51 -0500196EVMS_ABI_CODE=120
197AC_ARG_ENABLE([evms-10],
198[ --enable-evms-10 use EVMS 1.0 ABI (instead of EVMS 1.2)],
199if test "$enableval" != "no"
Theodore Ts'off6dbcc2002-05-24 22:44:42 -0400200then
Theodore Ts'oa9d799a2002-11-08 13:50:51 -0500201 EVMS_ABI_CODE=100
Theodore Ts'off6dbcc2002-05-24 22:44:42 -0400202 echo "Enabling EVMS 1.0.0 ABI"
203fi
Theodore Ts'off6dbcc2002-05-24 22:44:42 -0400204)
205dnl
Theodore Ts'oa9d799a2002-11-08 13:50:51 -0500206dnl handle --enable-emvs-11
207dnl
208AC_ARG_ENABLE([evms-11],
209[ --enable-evms-11 use EVMS 1.1 ABI (instead of EVMS 1.1)],
210if test "$enableval" != "no"
211then
212 EVMS_ABI_CODE=110
213 echo "Enabling EVMS 1.1.0 ABI"
214fi
215)
216if test "$EVMS_ABI_CODE" = "120"
217then
218 echo "Using EVMS 1.2.0 ABI by default"
219fi
220AC_SUBST(EVMS_ABI_CODE)
221dnl
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000222dnl handle --enable-dll-shlibs
223dnl
224AC_ARG_ENABLE([dll-shlibs],
Theodore Ts'oa4d09611997-04-29 14:28:00 +0000225[ --enable-dll-shlibs select DLL libraries],
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000226if test "$enableval" = "no"
227then
228 DLL_CMT=#
229 MAKEFILE_DLL=/dev/null
230 echo "Disabling DLL shared libraries"
231else
232 DLL_CMT=
233 MAKEFILE_DLL=$srcdir/lib/Makefile.dll-lib
Theodore Ts'o74becf31997-04-26 14:37:06 +0000234 BINARY_TYPE=dllbin
Theodore Ts'oa4d09611997-04-29 14:28:00 +0000235 LIB_EXT=.sa
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000236 echo "Enabling DLL shared libraries"
237fi
238,
239MAKEFILE_DLL=/dev/null
240DLL_CMT=#
241echo "Disabling DLL shared libraries by default"
242)
243AC_SUBST(DLL_CMT)
244AC_SUBST_FILE(MAKEFILE_DLL)
245dnl
246dnl handle --enable-elf-shlibs
247dnl
248AC_ARG_ENABLE([elf-shlibs],
Theodore Ts'oa4d09611997-04-29 14:28:00 +0000249[ --enable-elf-shlibs select ELF shared libraries],
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000250if test "$enableval" = "no"
251then
252 ELF_CMT=#
253 MAKEFILE_ELF=/dev/null
254 echo "Disabling ELF shared libraries"
255else
256 ELF_CMT=
257 MAKEFILE_ELF=$srcdir/lib/Makefile.elf-lib
Theodore Ts'of5955dd2000-10-25 02:38:39 +0000258 [case "$host_os" in
259 solaris2.*)
260 MAKEFILE_ELF=$srcdir/lib/Makefile.solaris-lib
261 ;;
262 esac]
Theodore Ts'o74becf31997-04-26 14:37:06 +0000263 BINARY_TYPE=elfbin
Theodore Ts'oa4d09611997-04-29 14:28:00 +0000264 LIB_EXT=.so
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000265 echo "Enabling ELF shared libraries"
266fi
267,
268MAKEFILE_ELF=/dev/null
269ELF_CMT=#
270echo "Disabling ELF shared libraries by default"
271)
272AC_SUBST(ELF_CMT)
273AC_SUBST_FILE(MAKEFILE_ELF)
274dnl
275dnl handle --enable-bsd-shlibs
276dnl
277AC_ARG_ENABLE([bsd-shlibs],
Theodore Ts'oa4d09611997-04-29 14:28:00 +0000278[ --enable-bsd-shlibs select BSD shared libraries],
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000279if test "$enableval" = "no"
280then
281 BSDLIB_CMT=#
282 MAKEFILE_BSDLIB=/dev/null
283 echo "Disabling BSD shared libraries"
284else
285 BSDLIB_CMT=
286 MAKEFILE_BSDLIB=$srcdir/lib/Makefile.bsd-lib
Theodore Ts'oa4d09611997-04-29 14:28:00 +0000287 LIB_EXT=.so
Theodore Ts'oe71d8732003-03-14 02:13:48 -0500288 [case "$host_os" in
Theodore Ts'oaa75ecc2003-03-17 10:01:22 -0500289 darwin*)
Theodore Ts'oe71d8732003-03-14 02:13:48 -0500290 MAKEFILE_BSDLIB=$srcdir/lib/Makefile.darwin-lib
291 LIB_EXT=.dylib
292 ;;
293 esac]
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000294 echo "Enabling BSD shared libraries"
295fi
296,
297MAKEFILE_BSDLIB=/dev/null
298BSDLIB_CMT=#
299echo "Disabling BSD shared libraries by default"
300)
301AC_SUBST(BSDLIB_CMT)
302AC_SUBST_FILE(MAKEFILE_BSDLIB)
303dnl
304dnl handle --enable-profile
305dnl
306AC_ARG_ENABLE([profile],
Theodore Ts'oa4d09611997-04-29 14:28:00 +0000307[ --enable-profile build profiling libraries],
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000308if test "$enableval" = "no"
309then
310 PROFILE_CMT=#
311 MAKEFILE_PROFILE=/dev/null
312 echo "Disabling profiling libraries"
313else
314 PROFILE_CMT=
315 MAKEFILE_PROFILE=$srcdir/lib/Makefile.profile
Theodore Ts'oa4d09611997-04-29 14:28:00 +0000316 PROFILED_LIB_EXT=_p.a
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000317 echo "Building profiling libraries"
318fi
319,
320PROFILE_CMT=#
321MAKEFILE_PROFILE=/dev/null
322echo "Disabling profiling libraries by default"
323)
324AC_SUBST(PROFILE_CMT)
325AC_SUBST_FILE(MAKEFILE_PROFILE)
326dnl
327dnl handle --enable-checker
328dnl
329AC_ARG_ENABLE([checker],
Theodore Ts'oa4d09611997-04-29 14:28:00 +0000330[ --enable-checker build checker libraries],
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000331if test "$enableval" = "no"
332then
333 CHECKER_CMT=#
334 MAKEFILE_CHECKER=/dev/null
335 echo "Disabling checker libraries"
336else
337 CHECKER_CMT=
338 MAKEFILE_CHECKER=$srcdir/lib/Makefile.checker
339 echo "Building checker libraries"
340fi
341,
342CHECKER_CMT=#
343MAKEFILE_CHECKER=/dev/null
344echo "Disabling checker libraries by default"
345)
346AC_SUBST(CHECKER_CMT)
347AC_SUBST_FILE(MAKEFILE_CHECKER)
348dnl
Theodore Ts'oa4d09611997-04-29 14:28:00 +0000349dnl Substitute library extensions
350dnl
351AC_SUBST(LIB_EXT)
352AC_SUBST(STATIC_LIB_EXT)
353AC_SUBST(PROFILED_LIB_EXT)
354dnl
Theodore Ts'o782bebf2002-11-08 18:46:45 -0500355dnl handle --enable-jbd-debug
Theodore Ts'ocdf186e2001-06-13 22:16:47 +0000356dnl
Theodore Ts'o782bebf2002-11-08 18:46:45 -0500357AC_ARG_ENABLE([jbd-debug],
358[ --enable-jbd-debug enable journal debugging],
Theodore Ts'ocdf186e2001-06-13 22:16:47 +0000359if test "$enableval" = "no"
360then
361 echo "Disabling journal debugging"
362else
Theodore Ts'o8cf93332001-12-16 02:23:36 -0500363 AC_DEFINE(CONFIG_JBD_DEBUG)
Theodore Ts'ocdf186e2001-06-13 22:16:47 +0000364 echo "Enabling journal debugging"
365fi
366,
367echo "Disabling journal debugging by default"
368)
369dnl
Theodore Ts'of0a22d02003-02-22 13:19:53 -0500370dnl handle --enable-blkid-debug
371dnl
372AC_ARG_ENABLE([blkid-debug],
Theodore Ts'od21ae6c2003-05-05 09:00:24 -0400373[ --enable-blkid-debug enable blkid debugging],
Theodore Ts'of0a22d02003-02-22 13:19:53 -0500374if test "$enableval" = "no"
375then
376 echo "Disabling blkid debugging"
377else
378 AC_DEFINE(CONFIG_BLKID_DEBUG)
379 echo "Enabling blkid debugging"
380fi
381,
382echo "Disabling blkid debugging by default"
383)
384dnl
Theodore Ts'o2a29f132003-05-05 12:08:47 -0400385dnl handle --enable-testio-debug
386dnl
387AC_ARG_ENABLE([testio-debug],
388[ --enable-testio-debug enable the use of the test I/O manager for debugging],
389if test "$enableval" = "no"
390then
391 echo "Disabling testio debugging"
392else
393 AC_DEFINE(CONFIG_TESTIO_DEBUG)
394 echo "Enabling testio debugging"
395fi
396,
397echo "Disabling testio debugging by default"
398)
399dnl
Theodore Ts'ocdf186e2001-06-13 22:16:47 +0000400dnl handle --enable-swapfs
401dnl
402AC_ARG_ENABLE([swapfs],
403[ --disable-swapfs disable support of legacy byte-swapped filesystems],
404if test "$enableval" = "no"
405then
Theodore Ts'ofeb44c62002-11-08 14:55:38 -0500406 SWAPFS_CMT=#
Theodore Ts'ocdf186e2001-06-13 22:16:47 +0000407 echo "Disabling swapfs support"
408else
Theodore Ts'ofeb44c62002-11-08 14:55:38 -0500409 SWAPFS_CMT=
Theodore Ts'ocdf186e2001-06-13 22:16:47 +0000410 AC_DEFINE(ENABLE_SWAPFS)
411 echo "Enabling swapfs support"
412fi
413,
Theodore Ts'ofeb44c62002-11-08 14:55:38 -0500414SWAPFS_CMT=
Theodore Ts'ocdf186e2001-06-13 22:16:47 +0000415echo "Enabling swapfs support by default"
416AC_DEFINE(ENABLE_SWAPFS)
417)
Theodore Ts'ofeb44c62002-11-08 14:55:38 -0500418AC_SUBST(SWAPFS_CMT)
Theodore Ts'ocdf186e2001-06-13 22:16:47 +0000419dnl
420dnl handle --enable-debugfs
421dnl
422AC_ARG_ENABLE([debugfs],
423[ --disable-debugfs disable support of debugfs program],
424if test "$enableval" = "no"
425then
426 echo "Disabling debugfs support"
427 DEBUGFS_CMT="#"
428else
429 DEBUGFS_CMT=
430 echo "Enabling debugfs support"
431fi
432,
433echo "Enabling debugfs support by default"
434DEBUGFS_CMT=
435)
436AC_SUBST(DEBUGFS_CMT)
437dnl
438dnl handle --enable-imager
439dnl
440AC_ARG_ENABLE([imager],
441[ --disable-imager disable support of e2image program],
442if test "$enableval" = "no"
443then
444 echo "Disabling e2image support"
445 IMAGER_CMT="#"
446else
447 IMAGER_CMT=
448 echo "Enabling e2image support"
449fi
450,
451echo "Enabling e2image support by default"
452IMAGER_CMT=
453)
454AC_SUBST(IMAGER_CMT)
455dnl
456dnl handle --enable-resizer
457dnl
458AC_ARG_ENABLE([resizer],
459[ --disable-resizer disable support of e2resize program],
460if test "$enableval" = "no"
461then
462 echo "Disabling e2resize support"
463 RESIZER_CMT="#"
464else
465 RESIZER_CMT=
466 echo "Enabling e2resize support"
467fi
468,
469echo "Enabling e2resize support by default"
470RESIZER_CMT=
471)
472AC_SUBST(RESIZER_CMT)
473dnl
Theodore Ts'o4d0f3e12001-01-11 15:48:50 +0000474dnl handle --enable-dynamic-e2fsck
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000475dnl
Theodore Ts'oa4d09611997-04-29 14:28:00 +0000476AC_ARG_ENABLE([dynamic-e2fsck],
477[ --enable-dynamic-e2fsck build e2fsck dynamically],
478if test "$enableval" = "no"
479then
480 E2FSCK_TYPE=static
481 echo "Building e2fsck statically"
482else
483 E2FSCK_TYPE=shared
484 echo "Building e2fsck dynamically"
485fi
486,
487E2FSCK_TYPE=static
488echo "Building e2fsck statically by default"
489)
490AC_SUBST(E2FSCK_TYPE)
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000491dnl
Theodore Ts'ofc6d9d51997-04-29 14:51:31 +0000492dnl See whether to install the `fsck' wrapper program (that calls e2fsck)
493dnl
494AC_ARG_ENABLE([fsck],
495[ --enable-fsck build fsck wrapper program],
496[if test "$enableval" = "no"
497then
498 FSCK_PROG='' FSCK_MAN=''
499 echo "Not building fsck wrapper"
500else
501 FSCK_PROG=fsck FSCK_MAN=fsck.8
502 echo "Building fsck wrapper"
503fi]
504,
505[case "$host_os" in
506 gnu*)
507 FSCK_PROG='' FSCK_MAN=''
508 echo "Not building fsck wrapper by default"
509 ;;
510 *)
511 FSCK_PROG=fsck FSCK_MAN=fsck.8
512 echo "Building fsck wrapper by default"
513esac]
514)
515AC_SUBST(FSCK_PROG)
516AC_SUBST(FSCK_MAN)
517dnl
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000518dnl
519MAKEFILE_LIBRARY=$srcdir/lib/Makefile.library
520AC_SUBST_FILE(MAKEFILE_LIBRARY)
521dnl
Theodore Ts'ofc6d9d51997-04-29 14:51:31 +0000522dnl
523AC_ARG_ENABLE([old-bitops],
524[ --enable-old-bitops Use old (non-standard but native) bitmask operations],
525if test "$enableval" = "no"
526then
527 echo "Using new (standard) bitmask operations"
528else
529 AC_DEFINE(EXT2_OLD_BITOPS)
530 echo "Using old (native) bitmask operations"
531
532fi
533,
534echo "Using standard bitmask operations by default"
535)
536dnl
Theodore Ts'ocdf186e2001-06-13 22:16:47 +0000537dnl Add internationalization support, using gettext.
538dnl
539PACKAGE=e2fsprogs
540VERSION="$E2FSPROGS_VERSION"
541AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE")
542AC_DEFINE_UNQUOTED(VERSION, "$VERSION")
543AC_SUBST(PACKAGE)
544AC_SUBST(VERSION)
545
Theodore Ts'ocdf186e2001-06-13 22:16:47 +0000546AM_GNU_GETTEXT
547dnl
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000548dnl End of configuration options
549dnl
Theodore Ts'o74becf31997-04-26 14:37:06 +0000550AC_SUBST(BINARY_TYPE)
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000551AC_PROG_MAKE_SET
552AC_PATH_PROG(LN, ln, ln)
Theodore Ts'ofc6d9d51997-04-29 14:51:31 +0000553AC_PROG_LN_S
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000554AC_PATH_PROG(MV, mv, mv)
555AC_PATH_PROG(CP, cp, cp)
556AC_PATH_PROG(RM, rm, rm)
557AC_PATH_PROG(CHMOD, chmod, :)
558AC_PATH_PROG(AWK, awk, awk)
559AC_PATH_PROG(SED, sed, sed)
Theodore Ts'o9d564f71999-07-03 20:25:58 +0000560AC_PATH_PROG(PERL, perl, perl)
Theodore Ts'o250f79f2001-05-19 22:02:22 +0000561AC_PATH_PROG(LDCONFIG, ldconfig, :)
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000562AC_CHECK_TOOL(AR, ar, ar)
563AC_CHECK_TOOL(RANLIB, ranlib, :)
564AC_CHECK_TOOL(STRIP, strip, :)
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000565AC_PROG_INSTALL
Theodore Ts'o6c133521999-07-03 20:37:03 +0000566# See if we need a separate native compiler.
567if test $cross_compiling = no; then
568 BUILD_CC="$CC"
569 AC_SUBST(BUILD_CC)
570else
571 AC_CHECK_PROGS(BUILD_CC, gcc cc)
572fi
Theodore Ts'offf45482003-04-13 00:44:19 -0400573AC_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/socket.h sys/sysmacros.h sys/time.h sys/stat.h sys/types.h sys/wait.h sys/resource.h net/if.h netinet/in.h)
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000574AC_FUNC_VPRINTF
Theodore Ts'offf45482003-04-13 00:44:19 -0400575dnl Check to see if dirent has member d_reclen. On cygwin those d_reclen
576dnl is not decleared.
577AC_MSG_CHECKING(whether d_reclen declared in dirent)
578AC_CACHE_VAL(e2fsprogs_cv_have_d_reclen_dirent,
579 AC_TRY_COMPILE(
580[#include <dirent.h>], [struct dirent de; de.d_reclen = 0; ],
581 [e2fsprogs_cv_have_d_reclen_dirent=yes],
582 [e2fsprogs_cv_have_d_reclen_dirent=no]))
583AC_MSG_RESULT($e2fsprogs_cv_have_d_reclen_dirent)
584if test "$e2fsprogs_cv_have_d_reclen_dirent" = yes; then
585 AC_DEFINE(HAVE_RECLEN_DIRENT)
586fi
587dnl Check to see if ssize_t was decleared
588AC_MSG_CHECKING(whether ssize_t declared)
589AC_CACHE_VAL(e2fsprogs_cv_have_ssize_t,
590 AC_TRY_COMPILE(
591[#include <sys/types.h>], [ssize_t a = 0; ],
592 [e2fsprogs_cv_have_ssize_t=yes],
593 [e2fsprogs_cv_have_ssize_t=no]))
594AC_MSG_RESULT($e2fsprogs_cv_have_ssize_t)
595if test "$e2fsprogs_cv_have_ssize_t" = yes; then
596 AC_DEFINE(HAVE_TYPE_SSIZE_T)
597fi
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000598dnl
Theodore Ts'ob0b9c4d1997-10-20 23:36:30 +0000599dnl Check to see if llseek() is declared in unistd.h. On some libc's
600dnl it is, and on others it isn't..... Thank you glibc developers....
601dnl
602dnl Warning! Use of --enable-gcc-wall may throw off this test.
603dnl
604dnl
605AC_MSG_CHECKING(whether llseek declared in unistd.h)
606AC_CACHE_VAL(e2fsprogs_cv_have_llseek_prototype,
607 AC_TRY_COMPILE(
608[#include <unistd.h>], [extern int llseek(int);],
609 [e2fsprogs_cv_have_llseek_prototype=no],
610 [e2fsprogs_cv_have_llseek_prototype=yes]))
611AC_MSG_RESULT($e2fsprogs_cv_have_llseek_prototype)
612if test "$e2fsprogs_cv_have_llseek_prototype" = yes; then
613 AC_DEFINE(HAVE_LLSEEK_PROTOTYPE)
614fi
615dnl
Theodore Ts'o6928adc2000-05-25 23:28:50 +0000616dnl Check to see if lseek64() is declared in unistd.h. Glibc's header files
617dnl are so convoluted that I can't tell whether it will always be defined,
618dnl and if it isn't defined while lseek64 is defined in the library,
619dnl disaster will strike.
620dnl
621dnl Warning! Use of --enable-gcc-wall may throw off this test.
622dnl
623dnl
624AC_MSG_CHECKING(whether lseek64 declared in unistd.h)
625AC_CACHE_VAL(e2fsprogs_cv_have_lseek64_prototype,
626 AC_TRY_COMPILE(
627[#define _LARGEFILE_SOURCE
628#define _LARGEFILE64_SOURCE
629#include <unistd.h>], [extern int lseek64(int);],
630 [e2fsprogs_cv_have_lseek64_prototype=no],
631 [e2fsprogs_cv_have_lseek64_prototype=yes]))
632AC_MSG_RESULT($e2fsprogs_cv_have_lseek64_prototype)
633if test "$e2fsprogs_cv_have_lseek64_prototype" = yes; then
634 AC_DEFINE(HAVE_LSEEK64_PROTOTYPE)
635fi
636dnl
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000637dnl Word sizes...
638dnl
639if test "$cross_compiling" = yes -a "$ac_cv_sizeof_long" = ""; then
640 # if cross-compiling, with no cached values, just assume something common.
641 ac_cv_sizeof_short=2
642 ac_cv_sizeof_int=4
643 ac_cv_sizeof_long=4
Theodore Ts'o6c133521999-07-03 20:37:03 +0000644 ac_cv_sizeof_long_long=8
645 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 +0000646fi
647AC_CHECK_SIZEOF(short)
648AC_CHECK_SIZEOF(int)
649AC_CHECK_SIZEOF(long)
Theodore Ts'ofc6d9d51997-04-29 14:51:31 +0000650AC_CHECK_SIZEOF(long long)
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000651SIZEOF_SHORT=$ac_cv_sizeof_short
652SIZEOF_INT=$ac_cv_sizeof_int
653SIZEOF_LONG=$ac_cv_sizeof_long
Theodore Ts'ofc6d9d51997-04-29 14:51:31 +0000654SIZEOF_LONG_LONG=$ac_cv_sizeof_long_long
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000655AC_SUBST(SIZEOF_SHORT)
656AC_SUBST(SIZEOF_INT)
657AC_SUBST(SIZEOF_LONG)
Theodore Ts'ofc6d9d51997-04-29 14:51:31 +0000658AC_SUBST(SIZEOF_LONG_LONG)
Theodore Ts'o877eb6d2001-06-11 06:54:13 +0000659AC_C_BIGENDIAN
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000660dnl
661dnl See if struct stat has a st_flags field, in which case we can get file
662dnl flags somewhat portably. Also check for the analogous setter, chflags().
663dnl
664AC_MSG_CHECKING(whether struct stat has a st_flags field)
665AC_CACHE_VAL(e2fsprogs_cv_struct_st_flags,
666 AC_TRY_COMPILE([#include <sys/stat.h>],
667 [struct stat stat; stat.st_flags = 0;],
668 [e2fsprogs_cv_struct_st_flags=yes],
669 [e2fsprogs_cv_struct_st_flags=no]))
670AC_MSG_RESULT($e2fsprogs_cv_struct_st_flags)
671if test "$e2fsprogs_cv_struct_st_flags" = yes; then
Theodore Ts'oc03bc4e1999-10-20 18:20:36 +0000672 AC_MSG_CHECKING(whether st_flags field is useful)
673 AC_CACHE_VAL(e2fsprogs_cv_struct_st_flags_immut,
674 AC_TRY_COMPILE([#include <sys/stat.h>],
675 [struct stat stat; stat.st_flags |= UF_IMMUTABLE;],
676 [e2fsprogs_cv_struct_st_flags_immut=yes],
677 [e2fsprogs_cv_struct_st_flags_immut=no]))
678 AC_MSG_RESULT($e2fsprogs_cv_struct_st_flags_immut)
679 if test "$e2fsprogs_cv_struct_st_flags_immut" = yes; then
680 AC_DEFINE(HAVE_STAT_FLAGS)
681 fi
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000682fi
Theodore Ts'oa04eba32003-05-03 16:35:17 -0400683AC_CHECK_FUNCS(chflags getrusage llseek lseek64 open64 getmntinfo strtoull strcasecmp srandom fchown mallinfo fdatasync strnlen strptime sysconf pathconf)
Theodore Ts'ofc6d9d51997-04-29 14:51:31 +0000684dnl
Theodore Ts'ofc6d9d51997-04-29 14:51:31 +0000685dnl Check to see if -lsocket is required (solaris) to make something
686dnl that uses socket() to compile; this is needed for the UUID library
687dnl
688SOCKET_LIB=''
689AC_CHECK_LIB(socket, socket, [SOCKET_LIB=-lsocket])
690AC_SUBST(SOCKET_LIB)
691dnl
Theodore Ts'o3ae497e2003-03-16 06:26:25 -0500692dnl Check to see if libdl exists for the sake of dlopen
693dnl
694DLOPEN_LIB=''
695AC_CHECK_LIB(dl, dlopen,
696[DLOPEN_LIB=-ldl
697AC_DEFINE(HAVE_DLOPEN)])
698AC_SUBST(DLOPEN_LIB)
699dnl
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000700dnl See if optreset exists
701dnl
702AC_MSG_CHECKING(for optreset)
703AC_CACHE_VAL(ac_cv_have_optreset,
704[AC_EGREP_HEADER(optreset, unistd.h,
705 ac_cv_have_optreset=yes, ac_cv_have_optreset=no)])dnl
706AC_MSG_RESULT($ac_cv_have_optreset)
707if test $ac_cv_have_optreset = yes; then
708 AC_DEFINE(HAVE_OPTRESET)
709fi
710dnl
Theodore Ts'o8f3f29d2000-02-11 05:04:44 +0000711dnl We use the EXT2 ioctls only under Linux
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000712dnl
Theodore Ts'o8f3f29d2000-02-11 05:04:44 +0000713case "$host_os" in
714linux*)
715 AC_DEFINE(HAVE_EXT2_IOCTLS)
716 ;;
717esac
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000718dnl
Theodore Ts'offf45482003-04-13 00:44:19 -0400719dnl OS-specific uncomment control
Theodore Ts'oe6f2bda2002-08-18 03:37:10 -0400720dnl
721LINUX_CMT="#"
Theodore Ts'offf45482003-04-13 00:44:19 -0400722CYGWIN_CMT="#"
723UNIX_CMT=
Theodore Ts'oe6f2bda2002-08-18 03:37:10 -0400724case "$host_os" in
725linux*)
726 LINUX_CMT=
727 ;;
Theodore Ts'offf45482003-04-13 00:44:19 -0400728cygwin)
729 CYGWIN_CMT=
730 UNIX_CMT="#"
Theodore Ts'od21ae6c2003-05-05 09:00:24 -0400731 EVMS_CMT="#"
Theodore Ts'offf45482003-04-13 00:44:19 -0400732 ;;
Theodore Ts'od21ae6c2003-05-05 09:00:24 -0400733*)
734 EVMS_CMT="#"
Theodore Ts'oe6f2bda2002-08-18 03:37:10 -0400735esac
736AC_SUBST(LINUX_CMT)
Theodore Ts'offf45482003-04-13 00:44:19 -0400737AC_SUBST(CYGWIN_CMT)
738AC_SUBST(UNIX_CMT)
Theodore Ts'oe6f2bda2002-08-18 03:37:10 -0400739dnl
Theodore Ts'o6c133521999-07-03 20:37:03 +0000740dnl Linux and Hurd places root files in the / by default
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000741dnl
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000742case "$host_os" in
Theodore Ts'o6c133521999-07-03 20:37:03 +0000743linux* | gnu*)
Theodore Ts'oa4b2d3c1998-04-03 16:12:25 +0000744 if test "$prefix" = NONE -a "$root_prefix" = NONE ; then
745 root_prefix="";
746 echo "On $host_os systems, root_prefix defaults to ''"
Theodore Ts'ofc6d9d51997-04-29 14:51:31 +0000747 fi
748 ;;
749esac
Theodore Ts'ofc6d9d51997-04-29 14:51:31 +0000750dnl
Theodore Ts'oa4b2d3c1998-04-03 16:12:25 +0000751dnl On Linux/hurd, force the prefix to be /usr
Theodore Ts'ofc6d9d51997-04-29 14:51:31 +0000752dnl
753case "$host_os" in
754linux* | gnu*)
755 if test "$prefix" = NONE ; then
Theodore Ts'oa4b2d3c1998-04-03 16:12:25 +0000756 prefix="/usr";
757 echo "On $host_os systems, prefix defaults to /usr"
Theodore Ts'obff61a72002-05-21 22:21:38 -0400758 if test "$mandir" = '${prefix}/man' ; then
759 echo "...and mandir defaults to /usr/share/man"
760 mandir=/usr/share/man
761 fi
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000762 fi
763;;
764esac
Theodore Ts'oa4b2d3c1998-04-03 16:12:25 +0000765if test "$root_prefix" = NONE ; then
Theodore Ts'offe19911998-04-08 06:05:49 +0000766 if test "$prefix" = NONE ; then
Theodore Ts'oa4b2d3c1998-04-03 16:12:25 +0000767 root_prefix="$ac_default_prefix"
768 else
769 root_prefix="$prefix"
770 fi
Theodore Ts'ob5ffead2002-05-11 19:17:00 -0400771 root_bindir=$bindir
772 root_sbindir=$sbindir
773 root_libdir=$libdir
774 root_sysconfdir=$sysconfdir
775else
776 root_bindir='${root_prefix}/bin'
777 root_sbindir='${root_prefix}/sbin'
778 root_libdir='${root_prefix}/lib'
779 root_sysconfdir='${root_prefix}/etc'
Theodore Ts'oa4b2d3c1998-04-03 16:12:25 +0000780fi
781AC_SUBST(root_prefix)
Theodore Ts'ob5ffead2002-05-11 19:17:00 -0400782AC_SUBST(root_bindir)
783AC_SUBST(root_sbindir)
784AC_SUBST(root_libdir)
785AC_SUBST(root_sysconfdir)
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000786dnl
787dnl See if -static works.
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000788dnl
Theodore Ts'oae851481997-04-29 18:13:24 +0000789AC_MSG_CHECKING([whether linker accepts -static])
790AC_CACHE_VAL(ac_cv_e2fsprogs_use_static,
791[SAVE_LDFLAGS=$LDFLAGS; LDFLAGS="$LDFLAGS -static"
792AC_TRY_LINK([#include <stdio.h>],[fflush(stdout);],
793 ac_cv_e2fsprogs_use_static=yes, ac_cv_e2fsprogs_use_static=no)
794LDFLAGS=$SAVE_LDFLAGS])
Theodore Ts'odefde781999-01-04 07:39:19 +0000795dnl
796dnl Regardless of how the test turns out, Solaris doesn't handle -static
797dnl This is caused by the socket library requiring the nsl library, which
798dnl requires the -dl library, which only works for dynamically linked
799dnl programs. It basically means you can't have statically linked programs
800dnl which use the network under Solaris.
801dnl
802case "$host_os" in
803solaris2.*)
804 ac_cv_e2fsprogs_use_static=no
805;;
806esac
Theodore Ts'oae851481997-04-29 18:13:24 +0000807AC_MSG_RESULT($ac_cv_e2fsprogs_use_static)
Theodore Ts'o74becf31997-04-26 14:37:06 +0000808LDFLAG_STATIC=
Theodore Ts'oae851481997-04-29 18:13:24 +0000809if test $ac_cv_e2fsprogs_use_static = yes; then
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000810 LDFLAG_STATIC=-static
Theodore Ts'oae851481997-04-29 18:13:24 +0000811fi
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000812AC_SUBST(LDFLAG_STATIC)
813dnl
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000814dnl Make the ss and et directories work correctly.
815dnl
816SS_DIR=`cd ${srcdir}/lib/ss; pwd`
817ET_DIR=`cd ${srcdir}/lib/et; pwd`
818AC_SUBST(SS_DIR)
819AC_SUBST(ET_DIR)
820dnl
821dnl Only try to run the test suite if we're not cross compiling.
822dnl
823if test "$cross_compiling" = yes ; then
824 DO_TEST_SUITE=
825else
826 DO_TEST_SUITE=check
827fi
828AC_SUBST(DO_TEST_SUITE)
829dnl
830dnl Make our output files, being sure that we create the some miscellaneous
831dnl directories
832dnl
833test -d lib || mkdir lib
834test -d include || mkdir include
835test -d include/linux || mkdir include/linux
Theodore Ts'odefde781999-01-04 07:39:19 +0000836test -d include/asm || mkdir include/asm
Theodore Ts'obff0cc92003-03-23 01:37:53 -0500837for i in MCONFIG Makefile e2fsprogs.spec \
838 util/Makefile util/subst.conf util/gen-tarball \
839 lib/et/Makefile lib/ss/Makefile lib/ext2fs/Makefile lib/e2p/Makefile \
Theodore Ts'o94ba8c72003-03-02 02:07:14 -0500840 lib/uuid/Makefile lib/uuid/uuid_types.h \
841 lib/blkid/Makefile lib/blkid/blkid_types.h \
842 lib/evms/Makefile misc/Makefile ext2ed/Makefile e2fsck/Makefile \
843 debugfs/Makefile tests/Makefile tests/progs/Makefile \
844 resize/Makefile doc/Makefile intl/Makefile po/Makefile.in ; do
845 if test -d `dirname ${srcdir}/$i` ; then
846 outlist="$outlist $i"
847 fi
848done
849AC_OUTPUT($outlist)