blob: c462b7b19db0c926ffe216667acb911b31acef6c [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=
Theodore Ts'od21ae6c2003-05-05 09:00:24 -040054dnl
55dnl Use diet libc
56dnl
57AC_ARG_WITH([diet-libc],
58[ --with-diet-libc Use diet libc],
59CC="diet cc -nostdinc"
60EVMS_CMT="#"
61AC_MSG_RESULT(CC=$CC))dnl
62dnl
Theodore Ts'o74becf31997-04-26 14:37:06 +000063dnl set $(CC) from --with-cc=value
64dnl
65AC_ARG_WITH([cc],
66[ --with-cc=COMPILER select compiler to use],
67AC_MSG_RESULT(CC=$withval)
68CC=$withval,
69if test -z "$CC" ; then CC=cc; fi
70[AC_MSG_RESULT(CC defaults to $CC)])dnl
71export CC
72AC_SUBST([CC])
Theodore Ts'o73ae2d42000-02-02 16:13:14 +000073AC_PROG_CC
Theodore Ts'o74becf31997-04-26 14:37:06 +000074dnl
75dnl set $(LD) from --with-linker=value
76dnl
77AC_ARG_WITH([linker],
78[ --with-linker=LINKER select linker to use],
79AC_MSG_RESULT(LD=$withval)
80LD=$withval,
81if test -z "$LD" ; then LD=$CC; fi
82[AC_MSG_RESULT(LD defaults to $LD)])dnl
83export LD
84AC_SUBST([LD])
85dnl
86dnl set $(CCOPTS) from --with-ccopts=value
87dnl
88AC_ARG_WITH([ccopts],
89[ --with-ccopts=CCOPTS select compiler command line options],
90AC_MSG_RESULT(CCOPTS is $withval)
Theodore Ts'o877eb6d2001-06-11 06:54:13 +000091CFLAGS=$withval,
92)dnl
Theodore Ts'o74becf31997-04-26 14:37:06 +000093dnl
Theodore Ts'of8bd9801999-10-26 04:19:45 +000094dnl On systems without linux header files, we add an extra include directory
95dnl that holds enough to fake it (hopefully). Note that the $(top_srcdir) here
96dnl is quoted so that it gets expanded by make, not by configure.
97dnl
98AC_CHECK_HEADER(linux/fs.h, [linux_headers=yes], [linux_headers=no])
Theodore Ts'o73ae2d42000-02-02 16:13:14 +000099if test "$linux_headers" != yes; then
100 LINUX_INCLUDE='-I$(top_builddir)/include'
Theodore Ts'of8bd9801999-10-26 04:19:45 +0000101fi
102AC_SUBST(LINUX_INCLUDE)
103dnl
Theodore Ts'oa4d09611997-04-29 14:28:00 +0000104dnl Set default values for library extentions. Will be dealt with after
105dnl parsing configuration opions, which may modify these
106dnl
107LIB_EXT=.a
108STATIC_LIB_EXT=.a
109PROFILE_LIB_EXT=.a
110dnl
Theodore Ts'o74becf31997-04-26 14:37:06 +0000111dnl set $(LDFLAGS) from --with-ldopts=value
112dnl
113AC_ARG_WITH([ldopts],
114[ --with-ldopts=LDOPTS select linker command line options],
115AC_MSG_RESULT(LDFLAGS is $withval)
116LDFLAGS=$withval,
117LDFLAGS=)dnl
118AC_SUBST(LDFLAGS)
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000119dnl
Theodore Ts'oa4b2d3c1998-04-03 16:12:25 +0000120dnl Allow separate `root_prefix' to be specified
Theodore Ts'ofc6d9d51997-04-29 14:51:31 +0000121dnl
Theodore Ts'oa4b2d3c1998-04-03 16:12:25 +0000122AC_ARG_WITH([root-prefix],
123[ --with-root-prefix=PREFIX override prefix variable for files to be placed in the root],
124root_prefix=$withval,
125root_prefix=NONE)dnl
Theodore Ts'ofc6d9d51997-04-29 14:51:31 +0000126dnl
Theodore Ts'o19178752000-02-11 15:55:07 +0000127dnl handle --enable-compression
128dnl
129AC_ARG_ENABLE([compression],
130[ --enable-compression enable EXPERIMENTAL compression support],
131if test "$enableval" = "no"
132then
133 echo "Disabling compression support"
134else
135 AC_DEFINE(ENABLE_COMPRESSION)
136 echo "Enabling compression support"
137 echo "WARNING: Compression support is experimental"
138fi
139,
140echo "Disabling compression support by default"
141)
142dnl
Theodore Ts'o8fdc9982002-06-25 23:26:34 -0400143dnl handle --enable-htree
144dnl
145AC_ARG_ENABLE([htree],
146[ --enable-htree enable EXPERIMENTAL htree directory support],
147if test "$enableval" = "no"
148then
149 HTREE_CMT=#
150 echo "Disabling htree directory support"
151else
152 HTREE_CMT=
153 AC_DEFINE(ENABLE_HTREE)
154 echo "Enabling htree directory support"
Theodore Ts'o8fdc9982002-06-25 23:26:34 -0400155fi
156,
Theodore Ts'o559ca6c2002-08-18 03:48:55 -0400157HTREE_CMT=
158AC_DEFINE(ENABLE_HTREE)
159echo "Enabling htree directory support by default"
Theodore Ts'o8fdc9982002-06-25 23:26:34 -0400160)
161AC_SUBST(HTREE_CMT)
162dnl
163dnl handle --enable-clear-htree
164dnl
165AC_ARG_ENABLE([htree-clear],
166[ --enable-htree-clear clear htree because we don't trust e2fsck],
167if test "$enableval" = "no"
168then
169 HTREE_CLR_CMT=#
170 echo "Disabling htree clearing"
171else
172 HTREE_CLR_CMT=
173 AC_DEFINE(ENABLE_HTREE_CLEAR)
174 echo "Enabling htree clearing"
175fi
176,
177HTREE_CLR_CMT=#
178echo "Disabling htree clearing by default"
179)
180AC_SUBST(HTREE_CLR_CMT)
181dnl
Theodore Ts'od21ae6c2003-05-05 09:00:24 -0400182dnl handle --enable-evms
183dnl
184AC_ARG_ENABLE([evms],
185[ --disable-evms don't build EVMS plugin],
Theodore Ts'o5c70a502003-05-20 10:29:29 -0400186if test "$enableval" == "no"
Theodore Ts'od21ae6c2003-05-05 09:00:24 -0400187then
188 EVMS_CMT="#"
189 echo "Disabling EVMS plugin"
190fi
191)
192dnl
Theodore Ts'oa9d799a2002-11-08 13:50:51 -0500193dnl handle --enable-emvs-10
Theodore Ts'off6dbcc2002-05-24 22:44:42 -0400194dnl
Theodore Ts'oa9d799a2002-11-08 13:50:51 -0500195EVMS_ABI_CODE=120
196AC_ARG_ENABLE([evms-10],
197[ --enable-evms-10 use EVMS 1.0 ABI (instead of EVMS 1.2)],
198if test "$enableval" != "no"
Theodore Ts'off6dbcc2002-05-24 22:44:42 -0400199then
Theodore Ts'oa9d799a2002-11-08 13:50:51 -0500200 EVMS_ABI_CODE=100
Theodore Ts'off6dbcc2002-05-24 22:44:42 -0400201 echo "Enabling EVMS 1.0.0 ABI"
202fi
Theodore Ts'off6dbcc2002-05-24 22:44:42 -0400203)
204dnl
Theodore Ts'oa9d799a2002-11-08 13:50:51 -0500205dnl handle --enable-emvs-11
206dnl
207AC_ARG_ENABLE([evms-11],
Theodore Ts'obb988b22003-05-13 23:32:32 -0400208[ --enable-evms-11 use EVMS 1.1 ABI (instead of EVMS 1.2)],
Theodore Ts'oa9d799a2002-11-08 13:50:51 -0500209if test "$enableval" != "no"
210then
211 EVMS_ABI_CODE=110
212 echo "Enabling EVMS 1.1.0 ABI"
213fi
214)
215if test "$EVMS_ABI_CODE" = "120"
216then
217 echo "Using EVMS 1.2.0 ABI by default"
218fi
219AC_SUBST(EVMS_ABI_CODE)
220dnl
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000221dnl handle --enable-dll-shlibs
222dnl
223AC_ARG_ENABLE([dll-shlibs],
Theodore Ts'oa4d09611997-04-29 14:28:00 +0000224[ --enable-dll-shlibs select DLL libraries],
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000225if test "$enableval" = "no"
226then
227 DLL_CMT=#
228 MAKEFILE_DLL=/dev/null
229 echo "Disabling DLL shared libraries"
230else
231 DLL_CMT=
232 MAKEFILE_DLL=$srcdir/lib/Makefile.dll-lib
Theodore Ts'o74becf31997-04-26 14:37:06 +0000233 BINARY_TYPE=dllbin
Theodore Ts'oa4d09611997-04-29 14:28:00 +0000234 LIB_EXT=.sa
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000235 echo "Enabling DLL shared libraries"
236fi
237,
238MAKEFILE_DLL=/dev/null
239DLL_CMT=#
240echo "Disabling DLL shared libraries by default"
241)
242AC_SUBST(DLL_CMT)
243AC_SUBST_FILE(MAKEFILE_DLL)
244dnl
245dnl handle --enable-elf-shlibs
246dnl
247AC_ARG_ENABLE([elf-shlibs],
Theodore Ts'oa4d09611997-04-29 14:28:00 +0000248[ --enable-elf-shlibs select ELF shared libraries],
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000249if test "$enableval" = "no"
250then
251 ELF_CMT=#
252 MAKEFILE_ELF=/dev/null
253 echo "Disabling ELF shared libraries"
254else
255 ELF_CMT=
256 MAKEFILE_ELF=$srcdir/lib/Makefile.elf-lib
Theodore Ts'of5955dd2000-10-25 02:38:39 +0000257 [case "$host_os" in
258 solaris2.*)
259 MAKEFILE_ELF=$srcdir/lib/Makefile.solaris-lib
260 ;;
261 esac]
Theodore Ts'o74becf31997-04-26 14:37:06 +0000262 BINARY_TYPE=elfbin
Theodore Ts'oa4d09611997-04-29 14:28:00 +0000263 LIB_EXT=.so
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000264 echo "Enabling ELF shared libraries"
265fi
266,
267MAKEFILE_ELF=/dev/null
268ELF_CMT=#
269echo "Disabling ELF shared libraries by default"
270)
271AC_SUBST(ELF_CMT)
272AC_SUBST_FILE(MAKEFILE_ELF)
273dnl
274dnl handle --enable-bsd-shlibs
275dnl
276AC_ARG_ENABLE([bsd-shlibs],
Theodore Ts'oa4d09611997-04-29 14:28:00 +0000277[ --enable-bsd-shlibs select BSD shared libraries],
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000278if test "$enableval" = "no"
279then
280 BSDLIB_CMT=#
281 MAKEFILE_BSDLIB=/dev/null
282 echo "Disabling BSD shared libraries"
283else
284 BSDLIB_CMT=
285 MAKEFILE_BSDLIB=$srcdir/lib/Makefile.bsd-lib
Theodore Ts'oa4d09611997-04-29 14:28:00 +0000286 LIB_EXT=.so
Theodore Ts'oe71d8732003-03-14 02:13:48 -0500287 [case "$host_os" in
Theodore Ts'oaa75ecc2003-03-17 10:01:22 -0500288 darwin*)
Theodore Ts'oe71d8732003-03-14 02:13:48 -0500289 MAKEFILE_BSDLIB=$srcdir/lib/Makefile.darwin-lib
290 LIB_EXT=.dylib
291 ;;
292 esac]
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000293 echo "Enabling BSD shared libraries"
294fi
295,
296MAKEFILE_BSDLIB=/dev/null
297BSDLIB_CMT=#
298echo "Disabling BSD shared libraries by default"
299)
300AC_SUBST(BSDLIB_CMT)
301AC_SUBST_FILE(MAKEFILE_BSDLIB)
302dnl
303dnl handle --enable-profile
304dnl
305AC_ARG_ENABLE([profile],
Theodore Ts'oa4d09611997-04-29 14:28:00 +0000306[ --enable-profile build profiling libraries],
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000307if test "$enableval" = "no"
308then
309 PROFILE_CMT=#
310 MAKEFILE_PROFILE=/dev/null
311 echo "Disabling profiling libraries"
312else
313 PROFILE_CMT=
314 MAKEFILE_PROFILE=$srcdir/lib/Makefile.profile
Theodore Ts'oa4d09611997-04-29 14:28:00 +0000315 PROFILED_LIB_EXT=_p.a
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000316 echo "Building profiling libraries"
317fi
318,
319PROFILE_CMT=#
320MAKEFILE_PROFILE=/dev/null
321echo "Disabling profiling libraries by default"
322)
323AC_SUBST(PROFILE_CMT)
324AC_SUBST_FILE(MAKEFILE_PROFILE)
325dnl
326dnl handle --enable-checker
327dnl
328AC_ARG_ENABLE([checker],
Theodore Ts'oa4d09611997-04-29 14:28:00 +0000329[ --enable-checker build checker libraries],
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000330if test "$enableval" = "no"
331then
332 CHECKER_CMT=#
333 MAKEFILE_CHECKER=/dev/null
334 echo "Disabling checker libraries"
335else
336 CHECKER_CMT=
337 MAKEFILE_CHECKER=$srcdir/lib/Makefile.checker
338 echo "Building checker libraries"
339fi
340,
341CHECKER_CMT=#
342MAKEFILE_CHECKER=/dev/null
343echo "Disabling checker libraries by default"
344)
345AC_SUBST(CHECKER_CMT)
346AC_SUBST_FILE(MAKEFILE_CHECKER)
347dnl
Theodore Ts'oa4d09611997-04-29 14:28:00 +0000348dnl Substitute library extensions
349dnl
350AC_SUBST(LIB_EXT)
351AC_SUBST(STATIC_LIB_EXT)
352AC_SUBST(PROFILED_LIB_EXT)
353dnl
Theodore Ts'o782bebf2002-11-08 18:46:45 -0500354dnl handle --enable-jbd-debug
Theodore Ts'ocdf186e2001-06-13 22:16:47 +0000355dnl
Theodore Ts'o782bebf2002-11-08 18:46:45 -0500356AC_ARG_ENABLE([jbd-debug],
357[ --enable-jbd-debug enable journal debugging],
Theodore Ts'ocdf186e2001-06-13 22:16:47 +0000358if test "$enableval" = "no"
359then
360 echo "Disabling journal debugging"
361else
Theodore Ts'o8cf93332001-12-16 02:23:36 -0500362 AC_DEFINE(CONFIG_JBD_DEBUG)
Theodore Ts'ocdf186e2001-06-13 22:16:47 +0000363 echo "Enabling journal debugging"
364fi
365,
366echo "Disabling journal debugging by default"
367)
368dnl
Theodore Ts'of0a22d02003-02-22 13:19:53 -0500369dnl handle --enable-blkid-debug
370dnl
371AC_ARG_ENABLE([blkid-debug],
Theodore Ts'od21ae6c2003-05-05 09:00:24 -0400372[ --enable-blkid-debug enable blkid debugging],
Theodore Ts'of0a22d02003-02-22 13:19:53 -0500373if test "$enableval" = "no"
374then
375 echo "Disabling blkid debugging"
376else
377 AC_DEFINE(CONFIG_BLKID_DEBUG)
378 echo "Enabling blkid debugging"
379fi
380,
381echo "Disabling blkid debugging by default"
382)
383dnl
Theodore Ts'o2a29f132003-05-05 12:08:47 -0400384dnl handle --enable-testio-debug
385dnl
386AC_ARG_ENABLE([testio-debug],
387[ --enable-testio-debug enable the use of the test I/O manager for debugging],
388if test "$enableval" = "no"
389then
390 echo "Disabling testio debugging"
391else
392 AC_DEFINE(CONFIG_TESTIO_DEBUG)
393 echo "Enabling testio debugging"
394fi
395,
396echo "Disabling testio debugging by default"
397)
398dnl
Theodore Ts'ocdf186e2001-06-13 22:16:47 +0000399dnl handle --enable-swapfs
400dnl
401AC_ARG_ENABLE([swapfs],
402[ --disable-swapfs disable support of legacy byte-swapped filesystems],
403if test "$enableval" = "no"
404then
Theodore Ts'ofeb44c62002-11-08 14:55:38 -0500405 SWAPFS_CMT=#
Theodore Ts'ocdf186e2001-06-13 22:16:47 +0000406 echo "Disabling swapfs support"
407else
Theodore Ts'ofeb44c62002-11-08 14:55:38 -0500408 SWAPFS_CMT=
Theodore Ts'ocdf186e2001-06-13 22:16:47 +0000409 AC_DEFINE(ENABLE_SWAPFS)
410 echo "Enabling swapfs support"
411fi
412,
Theodore Ts'ofeb44c62002-11-08 14:55:38 -0500413SWAPFS_CMT=
Theodore Ts'ocdf186e2001-06-13 22:16:47 +0000414echo "Enabling swapfs support by default"
415AC_DEFINE(ENABLE_SWAPFS)
416)
Theodore Ts'ofeb44c62002-11-08 14:55:38 -0500417AC_SUBST(SWAPFS_CMT)
Theodore Ts'ocdf186e2001-06-13 22:16:47 +0000418dnl
419dnl handle --enable-debugfs
420dnl
421AC_ARG_ENABLE([debugfs],
422[ --disable-debugfs disable support of debugfs program],
423if test "$enableval" = "no"
424then
425 echo "Disabling debugfs support"
426 DEBUGFS_CMT="#"
427else
428 DEBUGFS_CMT=
429 echo "Enabling debugfs support"
430fi
431,
432echo "Enabling debugfs support by default"
433DEBUGFS_CMT=
434)
435AC_SUBST(DEBUGFS_CMT)
436dnl
437dnl handle --enable-imager
438dnl
439AC_ARG_ENABLE([imager],
440[ --disable-imager disable support of e2image program],
441if test "$enableval" = "no"
442then
443 echo "Disabling e2image support"
444 IMAGER_CMT="#"
445else
446 IMAGER_CMT=
447 echo "Enabling e2image support"
448fi
449,
450echo "Enabling e2image support by default"
451IMAGER_CMT=
452)
453AC_SUBST(IMAGER_CMT)
454dnl
455dnl handle --enable-resizer
456dnl
457AC_ARG_ENABLE([resizer],
458[ --disable-resizer disable support of e2resize program],
459if test "$enableval" = "no"
460then
461 echo "Disabling e2resize support"
462 RESIZER_CMT="#"
463else
464 RESIZER_CMT=
465 echo "Enabling e2resize support"
466fi
467,
468echo "Enabling e2resize support by default"
469RESIZER_CMT=
470)
471AC_SUBST(RESIZER_CMT)
472dnl
Theodore Ts'o4d0f3e12001-01-11 15:48:50 +0000473dnl handle --enable-dynamic-e2fsck
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000474dnl
Theodore Ts'oa4d09611997-04-29 14:28:00 +0000475AC_ARG_ENABLE([dynamic-e2fsck],
476[ --enable-dynamic-e2fsck build e2fsck dynamically],
477if test "$enableval" = "no"
478then
479 E2FSCK_TYPE=static
480 echo "Building e2fsck statically"
481else
482 E2FSCK_TYPE=shared
483 echo "Building e2fsck dynamically"
484fi
485,
486E2FSCK_TYPE=static
487echo "Building e2fsck statically by default"
488)
489AC_SUBST(E2FSCK_TYPE)
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000490dnl
Theodore Ts'ofc6d9d51997-04-29 14:51:31 +0000491dnl See whether to install the `fsck' wrapper program (that calls e2fsck)
492dnl
493AC_ARG_ENABLE([fsck],
494[ --enable-fsck build fsck wrapper program],
495[if test "$enableval" = "no"
496then
497 FSCK_PROG='' FSCK_MAN=''
498 echo "Not building fsck wrapper"
499else
500 FSCK_PROG=fsck FSCK_MAN=fsck.8
501 echo "Building fsck wrapper"
502fi]
503,
504[case "$host_os" in
Theodore Ts'o93636bd2003-07-12 02:45:05 -0400505 gnu* | k*bsd*-gnu)
Theodore Ts'ofc6d9d51997-04-29 14:51:31 +0000506 FSCK_PROG='' FSCK_MAN=''
507 echo "Not building fsck wrapper by default"
508 ;;
509 *)
510 FSCK_PROG=fsck FSCK_MAN=fsck.8
511 echo "Building fsck wrapper by default"
512esac]
513)
514AC_SUBST(FSCK_PROG)
515AC_SUBST(FSCK_MAN)
516dnl
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000517dnl
518MAKEFILE_LIBRARY=$srcdir/lib/Makefile.library
519AC_SUBST_FILE(MAKEFILE_LIBRARY)
520dnl
Theodore Ts'ofc6d9d51997-04-29 14:51:31 +0000521dnl
522AC_ARG_ENABLE([old-bitops],
523[ --enable-old-bitops Use old (non-standard but native) bitmask operations],
524if test "$enableval" = "no"
525then
526 echo "Using new (standard) bitmask operations"
527else
528 AC_DEFINE(EXT2_OLD_BITOPS)
529 echo "Using old (native) bitmask operations"
530
531fi
532,
533echo "Using standard bitmask operations by default"
534)
535dnl
Theodore Ts'ocdf186e2001-06-13 22:16:47 +0000536dnl Add internationalization support, using gettext.
537dnl
538PACKAGE=e2fsprogs
539VERSION="$E2FSPROGS_VERSION"
540AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE")
541AC_DEFINE_UNQUOTED(VERSION, "$VERSION")
542AC_SUBST(PACKAGE)
543AC_SUBST(VERSION)
544
Theodore Ts'ocdf186e2001-06-13 22:16:47 +0000545AM_GNU_GETTEXT
546dnl
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000547dnl End of configuration options
548dnl
Theodore Ts'o74becf31997-04-26 14:37:06 +0000549AC_SUBST(BINARY_TYPE)
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000550AC_PROG_MAKE_SET
551AC_PATH_PROG(LN, ln, ln)
Theodore Ts'ofc6d9d51997-04-29 14:51:31 +0000552AC_PROG_LN_S
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000553AC_PATH_PROG(MV, mv, mv)
554AC_PATH_PROG(CP, cp, cp)
555AC_PATH_PROG(RM, rm, rm)
556AC_PATH_PROG(CHMOD, chmod, :)
557AC_PATH_PROG(AWK, awk, awk)
558AC_PATH_PROG(SED, sed, sed)
Theodore Ts'o9d564f71999-07-03 20:25:58 +0000559AC_PATH_PROG(PERL, perl, perl)
Theodore Ts'o250f79f2001-05-19 22:02:22 +0000560AC_PATH_PROG(LDCONFIG, ldconfig, :)
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000561AC_CHECK_TOOL(AR, ar, ar)
562AC_CHECK_TOOL(RANLIB, ranlib, :)
563AC_CHECK_TOOL(STRIP, strip, :)
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000564AC_PROG_INSTALL
Theodore Ts'o6c133521999-07-03 20:37:03 +0000565# See if we need a separate native compiler.
566if test $cross_compiling = no; then
567 BUILD_CC="$CC"
568 AC_SUBST(BUILD_CC)
569else
570 AC_CHECK_PROGS(BUILD_CC, gcc cc)
571fi
Theodore Ts'offf45482003-04-13 00:44:19 -0400572AC_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 +0000573AC_FUNC_VPRINTF
Theodore Ts'offf45482003-04-13 00:44:19 -0400574dnl Check to see if dirent has member d_reclen. On cygwin those d_reclen
575dnl is not decleared.
576AC_MSG_CHECKING(whether d_reclen declared in dirent)
577AC_CACHE_VAL(e2fsprogs_cv_have_d_reclen_dirent,
578 AC_TRY_COMPILE(
579[#include <dirent.h>], [struct dirent de; de.d_reclen = 0; ],
580 [e2fsprogs_cv_have_d_reclen_dirent=yes],
581 [e2fsprogs_cv_have_d_reclen_dirent=no]))
582AC_MSG_RESULT($e2fsprogs_cv_have_d_reclen_dirent)
583if test "$e2fsprogs_cv_have_d_reclen_dirent" = yes; then
584 AC_DEFINE(HAVE_RECLEN_DIRENT)
585fi
586dnl Check to see if ssize_t was decleared
587AC_MSG_CHECKING(whether ssize_t declared)
588AC_CACHE_VAL(e2fsprogs_cv_have_ssize_t,
589 AC_TRY_COMPILE(
590[#include <sys/types.h>], [ssize_t a = 0; ],
591 [e2fsprogs_cv_have_ssize_t=yes],
592 [e2fsprogs_cv_have_ssize_t=no]))
593AC_MSG_RESULT($e2fsprogs_cv_have_ssize_t)
594if test "$e2fsprogs_cv_have_ssize_t" = yes; then
595 AC_DEFINE(HAVE_TYPE_SSIZE_T)
596fi
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000597dnl
Theodore Ts'ob0b9c4d1997-10-20 23:36:30 +0000598dnl Check to see if llseek() is declared in unistd.h. On some libc's
599dnl it is, and on others it isn't..... Thank you glibc developers....
600dnl
601dnl Warning! Use of --enable-gcc-wall may throw off this test.
602dnl
603dnl
604AC_MSG_CHECKING(whether llseek declared in unistd.h)
605AC_CACHE_VAL(e2fsprogs_cv_have_llseek_prototype,
606 AC_TRY_COMPILE(
607[#include <unistd.h>], [extern int llseek(int);],
608 [e2fsprogs_cv_have_llseek_prototype=no],
609 [e2fsprogs_cv_have_llseek_prototype=yes]))
610AC_MSG_RESULT($e2fsprogs_cv_have_llseek_prototype)
611if test "$e2fsprogs_cv_have_llseek_prototype" = yes; then
612 AC_DEFINE(HAVE_LLSEEK_PROTOTYPE)
613fi
614dnl
Theodore Ts'o6928adc2000-05-25 23:28:50 +0000615dnl Check to see if lseek64() is declared in unistd.h. Glibc's header files
616dnl are so convoluted that I can't tell whether it will always be defined,
617dnl and if it isn't defined while lseek64 is defined in the library,
618dnl disaster will strike.
619dnl
620dnl Warning! Use of --enable-gcc-wall may throw off this test.
621dnl
622dnl
623AC_MSG_CHECKING(whether lseek64 declared in unistd.h)
624AC_CACHE_VAL(e2fsprogs_cv_have_lseek64_prototype,
625 AC_TRY_COMPILE(
626[#define _LARGEFILE_SOURCE
627#define _LARGEFILE64_SOURCE
628#include <unistd.h>], [extern int lseek64(int);],
629 [e2fsprogs_cv_have_lseek64_prototype=no],
630 [e2fsprogs_cv_have_lseek64_prototype=yes]))
631AC_MSG_RESULT($e2fsprogs_cv_have_lseek64_prototype)
632if test "$e2fsprogs_cv_have_lseek64_prototype" = yes; then
633 AC_DEFINE(HAVE_LSEEK64_PROTOTYPE)
634fi
635dnl
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000636dnl Word sizes...
637dnl
638if test "$cross_compiling" = yes -a "$ac_cv_sizeof_long" = ""; then
639 # if cross-compiling, with no cached values, just assume something common.
640 ac_cv_sizeof_short=2
641 ac_cv_sizeof_int=4
642 ac_cv_sizeof_long=4
Theodore Ts'o6c133521999-07-03 20:37:03 +0000643 ac_cv_sizeof_long_long=8
644 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 +0000645fi
646AC_CHECK_SIZEOF(short)
647AC_CHECK_SIZEOF(int)
648AC_CHECK_SIZEOF(long)
Theodore Ts'ofc6d9d51997-04-29 14:51:31 +0000649AC_CHECK_SIZEOF(long long)
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000650SIZEOF_SHORT=$ac_cv_sizeof_short
651SIZEOF_INT=$ac_cv_sizeof_int
652SIZEOF_LONG=$ac_cv_sizeof_long
Theodore Ts'ofc6d9d51997-04-29 14:51:31 +0000653SIZEOF_LONG_LONG=$ac_cv_sizeof_long_long
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000654AC_SUBST(SIZEOF_SHORT)
655AC_SUBST(SIZEOF_INT)
656AC_SUBST(SIZEOF_LONG)
Theodore Ts'ofc6d9d51997-04-29 14:51:31 +0000657AC_SUBST(SIZEOF_LONG_LONG)
Theodore Ts'o877eb6d2001-06-11 06:54:13 +0000658AC_C_BIGENDIAN
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000659dnl
660dnl See if struct stat has a st_flags field, in which case we can get file
661dnl flags somewhat portably. Also check for the analogous setter, chflags().
662dnl
663AC_MSG_CHECKING(whether struct stat has a st_flags field)
664AC_CACHE_VAL(e2fsprogs_cv_struct_st_flags,
665 AC_TRY_COMPILE([#include <sys/stat.h>],
666 [struct stat stat; stat.st_flags = 0;],
667 [e2fsprogs_cv_struct_st_flags=yes],
668 [e2fsprogs_cv_struct_st_flags=no]))
669AC_MSG_RESULT($e2fsprogs_cv_struct_st_flags)
670if test "$e2fsprogs_cv_struct_st_flags" = yes; then
Theodore Ts'oc03bc4e1999-10-20 18:20:36 +0000671 AC_MSG_CHECKING(whether st_flags field is useful)
672 AC_CACHE_VAL(e2fsprogs_cv_struct_st_flags_immut,
673 AC_TRY_COMPILE([#include <sys/stat.h>],
674 [struct stat stat; stat.st_flags |= UF_IMMUTABLE;],
675 [e2fsprogs_cv_struct_st_flags_immut=yes],
676 [e2fsprogs_cv_struct_st_flags_immut=no]))
677 AC_MSG_RESULT($e2fsprogs_cv_struct_st_flags_immut)
678 if test "$e2fsprogs_cv_struct_st_flags_immut" = yes; then
679 AC_DEFINE(HAVE_STAT_FLAGS)
680 fi
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000681fi
Theodore Ts'o1c29b092003-07-12 16:01:45 -0400682AC_CHECK_FUNCS(chflags getrusage llseek lseek64 open64 getmntinfo strtoull strcasecmp srandom fchown mallinfo fdatasync strnlen strptime sysconf pathconf posix_memalign memalign valloc)
Theodore Ts'ofc6d9d51997-04-29 14:51:31 +0000683dnl
Theodore Ts'ofc6d9d51997-04-29 14:51:31 +0000684dnl Check to see if -lsocket is required (solaris) to make something
685dnl that uses socket() to compile; this is needed for the UUID library
686dnl
687SOCKET_LIB=''
688AC_CHECK_LIB(socket, socket, [SOCKET_LIB=-lsocket])
689AC_SUBST(SOCKET_LIB)
690dnl
Theodore Ts'o3ae497e2003-03-16 06:26:25 -0500691dnl Check to see if libdl exists for the sake of dlopen
692dnl
693DLOPEN_LIB=''
694AC_CHECK_LIB(dl, dlopen,
695[DLOPEN_LIB=-ldl
696AC_DEFINE(HAVE_DLOPEN)])
697AC_SUBST(DLOPEN_LIB)
698dnl
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000699dnl See if optreset exists
700dnl
701AC_MSG_CHECKING(for optreset)
702AC_CACHE_VAL(ac_cv_have_optreset,
703[AC_EGREP_HEADER(optreset, unistd.h,
704 ac_cv_have_optreset=yes, ac_cv_have_optreset=no)])dnl
705AC_MSG_RESULT($ac_cv_have_optreset)
706if test $ac_cv_have_optreset = yes; then
707 AC_DEFINE(HAVE_OPTRESET)
708fi
709dnl
Theodore Ts'o8f3f29d2000-02-11 05:04:44 +0000710dnl We use the EXT2 ioctls only under Linux
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000711dnl
Theodore Ts'o8f3f29d2000-02-11 05:04:44 +0000712case "$host_os" in
713linux*)
714 AC_DEFINE(HAVE_EXT2_IOCTLS)
715 ;;
716esac
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000717dnl
Theodore Ts'offf45482003-04-13 00:44:19 -0400718dnl OS-specific uncomment control
Theodore Ts'oe6f2bda2002-08-18 03:37:10 -0400719dnl
720LINUX_CMT="#"
Theodore Ts'offf45482003-04-13 00:44:19 -0400721CYGWIN_CMT="#"
722UNIX_CMT=
Theodore Ts'oe6f2bda2002-08-18 03:37:10 -0400723case "$host_os" in
724linux*)
725 LINUX_CMT=
726 ;;
Theodore Ts'offf45482003-04-13 00:44:19 -0400727cygwin)
728 CYGWIN_CMT=
729 UNIX_CMT="#"
Theodore Ts'od21ae6c2003-05-05 09:00:24 -0400730 EVMS_CMT="#"
Theodore Ts'offf45482003-04-13 00:44:19 -0400731 ;;
Theodore Ts'od21ae6c2003-05-05 09:00:24 -0400732*)
733 EVMS_CMT="#"
Theodore Ts'oe6f2bda2002-08-18 03:37:10 -0400734esac
735AC_SUBST(LINUX_CMT)
Theodore Ts'offf45482003-04-13 00:44:19 -0400736AC_SUBST(CYGWIN_CMT)
737AC_SUBST(UNIX_CMT)
Theodore Ts'o5c70a502003-05-20 10:29:29 -0400738AC_SUBST([EVMS_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'o93636bd2003-07-12 02:45:05 -0400743linux* | gnu* | k*bsd*-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
Theodore Ts'o93636bd2003-07-12 02:45:05 -0400754linux* | gnu* | k*bsd*-gnu)
Theodore Ts'ofc6d9d51997-04-29 14:51:31 +0000755 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'o07a0db12003-07-05 14:50:24 -0400814dnl Work around mysterious Darwin / GNU libintl problem
815dnl (__asm__ redirection doesn't work for some mysterious reason. Looks like
816dnl Apple hacked gcc somehow?)
817dnl
818case "$host_os" in
819darwin*)
820 echo "Using Apple Darwin / GNU libintl workaround"
821 AC_DEFINE(_INTL_REDIRECT_MACROS)
822 ;;
823esac
824dnl
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000825dnl Make the ss and et directories work correctly.
826dnl
827SS_DIR=`cd ${srcdir}/lib/ss; pwd`
828ET_DIR=`cd ${srcdir}/lib/et; pwd`
829AC_SUBST(SS_DIR)
830AC_SUBST(ET_DIR)
831dnl
832dnl Only try to run the test suite if we're not cross compiling.
833dnl
834if test "$cross_compiling" = yes ; then
835 DO_TEST_SUITE=
836else
837 DO_TEST_SUITE=check
838fi
839AC_SUBST(DO_TEST_SUITE)
840dnl
Theodore Ts'oc6f35b82003-05-17 16:29:27 -0400841dnl Only include the intl include files if we're building with them
842dnl
843INTL_FLAGS=
844if test "$USE_INCLUDED_LIBINTL" = "yes" ; then
845 INTL_FLAGS='-I$(top_builddir)/intl -I$(top_srcdir)/intl'
846fi
847AC_SUBST(INTL_FLAGS)
848dnl
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000849dnl Make our output files, being sure that we create the some miscellaneous
850dnl directories
851dnl
852test -d lib || mkdir lib
853test -d include || mkdir include
854test -d include/linux || mkdir include/linux
Theodore Ts'odefde781999-01-04 07:39:19 +0000855test -d include/asm || mkdir include/asm
Theodore Ts'obff0cc92003-03-23 01:37:53 -0500856for i in MCONFIG Makefile e2fsprogs.spec \
857 util/Makefile util/subst.conf util/gen-tarball \
858 lib/et/Makefile lib/ss/Makefile lib/ext2fs/Makefile lib/e2p/Makefile \
Theodore Ts'o94ba8c72003-03-02 02:07:14 -0500859 lib/uuid/Makefile lib/uuid/uuid_types.h \
860 lib/blkid/Makefile lib/blkid/blkid_types.h \
861 lib/evms/Makefile misc/Makefile ext2ed/Makefile e2fsck/Makefile \
862 debugfs/Makefile tests/Makefile tests/progs/Makefile \
863 resize/Makefile doc/Makefile intl/Makefile po/Makefile.in ; do
864 if test -d `dirname ${srcdir}/$i` ; then
865 outlist="$outlist $i"
866 fi
867done
868AC_OUTPUT($outlist)