blob: 04dbd16815d0de86fad87b01ffa63265e243c28e [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
Matthias Andreeb1c92f92004-02-23 21:30:11 +0100104dnl Alpha computers use fast and imprecise floating point code that may
105dnl miss exceptions by default. Force sane options if we're using GCC.
106AC_MSG_CHECKING(for additional special compiler flags)
107if test "$GCC" = yes
108then
109 case "$host_cpu" in
110 alpha) addcflags="-mieee" ;;
111 esac
112fi
113if test "x$addcflags" != x
114then
115 AC_MSG_RESULT($addcflags)
116 CFLAGS="$addcflags $CFLAGS"
117else
118 AC_MSG_RESULT([[(none)]])
119fi
120dnl
Theodore Ts'oa4d09611997-04-29 14:28:00 +0000121dnl Set default values for library extentions. Will be dealt with after
122dnl parsing configuration opions, which may modify these
123dnl
124LIB_EXT=.a
125STATIC_LIB_EXT=.a
126PROFILE_LIB_EXT=.a
127dnl
Theodore Ts'o74becf31997-04-26 14:37:06 +0000128dnl set $(LDFLAGS) from --with-ldopts=value
129dnl
130AC_ARG_WITH([ldopts],
131[ --with-ldopts=LDOPTS select linker command line options],
132AC_MSG_RESULT(LDFLAGS is $withval)
133LDFLAGS=$withval,
134LDFLAGS=)dnl
135AC_SUBST(LDFLAGS)
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000136dnl
Theodore Ts'oa4b2d3c1998-04-03 16:12:25 +0000137dnl Allow separate `root_prefix' to be specified
Theodore Ts'ofc6d9d51997-04-29 14:51:31 +0000138dnl
Theodore Ts'oa4b2d3c1998-04-03 16:12:25 +0000139AC_ARG_WITH([root-prefix],
140[ --with-root-prefix=PREFIX override prefix variable for files to be placed in the root],
141root_prefix=$withval,
142root_prefix=NONE)dnl
Theodore Ts'ofc6d9d51997-04-29 14:51:31 +0000143dnl
Theodore Ts'o19178752000-02-11 15:55:07 +0000144dnl handle --enable-compression
145dnl
146AC_ARG_ENABLE([compression],
147[ --enable-compression enable EXPERIMENTAL compression support],
148if test "$enableval" = "no"
149then
150 echo "Disabling compression support"
151else
152 AC_DEFINE(ENABLE_COMPRESSION)
153 echo "Enabling compression support"
154 echo "WARNING: Compression support is experimental"
155fi
156,
157echo "Disabling compression support by default"
158)
159dnl
Theodore Ts'o8fdc9982002-06-25 23:26:34 -0400160dnl handle --enable-htree
161dnl
162AC_ARG_ENABLE([htree],
163[ --enable-htree enable EXPERIMENTAL htree directory support],
164if test "$enableval" = "no"
165then
166 HTREE_CMT=#
167 echo "Disabling htree directory support"
168else
169 HTREE_CMT=
170 AC_DEFINE(ENABLE_HTREE)
171 echo "Enabling htree directory support"
Theodore Ts'o8fdc9982002-06-25 23:26:34 -0400172fi
173,
Theodore Ts'o559ca6c2002-08-18 03:48:55 -0400174HTREE_CMT=
175AC_DEFINE(ENABLE_HTREE)
176echo "Enabling htree directory support by default"
Theodore Ts'o8fdc9982002-06-25 23:26:34 -0400177)
178AC_SUBST(HTREE_CMT)
179dnl
180dnl handle --enable-clear-htree
181dnl
182AC_ARG_ENABLE([htree-clear],
183[ --enable-htree-clear clear htree because we don't trust e2fsck],
184if test "$enableval" = "no"
185then
186 HTREE_CLR_CMT=#
187 echo "Disabling htree clearing"
188else
189 HTREE_CLR_CMT=
190 AC_DEFINE(ENABLE_HTREE_CLEAR)
191 echo "Enabling htree clearing"
192fi
193,
194HTREE_CLR_CMT=#
195echo "Disabling htree clearing by default"
196)
197AC_SUBST(HTREE_CLR_CMT)
198dnl
Theodore Ts'od21ae6c2003-05-05 09:00:24 -0400199dnl handle --enable-evms
200dnl
201AC_ARG_ENABLE([evms],
202[ --disable-evms don't build EVMS plugin],
Theodore Ts'o5c70a502003-05-20 10:29:29 -0400203if test "$enableval" == "no"
Theodore Ts'od21ae6c2003-05-05 09:00:24 -0400204then
205 EVMS_CMT="#"
206 echo "Disabling EVMS plugin"
207fi
208)
209dnl
Theodore Ts'oa9d799a2002-11-08 13:50:51 -0500210dnl handle --enable-emvs-10
Theodore Ts'off6dbcc2002-05-24 22:44:42 -0400211dnl
Theodore Ts'oa9d799a2002-11-08 13:50:51 -0500212EVMS_ABI_CODE=120
213AC_ARG_ENABLE([evms-10],
214[ --enable-evms-10 use EVMS 1.0 ABI (instead of EVMS 1.2)],
215if test "$enableval" != "no"
Theodore Ts'off6dbcc2002-05-24 22:44:42 -0400216then
Theodore Ts'oa9d799a2002-11-08 13:50:51 -0500217 EVMS_ABI_CODE=100
Theodore Ts'off6dbcc2002-05-24 22:44:42 -0400218 echo "Enabling EVMS 1.0.0 ABI"
219fi
Theodore Ts'off6dbcc2002-05-24 22:44:42 -0400220)
221dnl
Theodore Ts'oa9d799a2002-11-08 13:50:51 -0500222dnl handle --enable-emvs-11
223dnl
224AC_ARG_ENABLE([evms-11],
Theodore Ts'obb988b22003-05-13 23:32:32 -0400225[ --enable-evms-11 use EVMS 1.1 ABI (instead of EVMS 1.2)],
Theodore Ts'oa9d799a2002-11-08 13:50:51 -0500226if test "$enableval" != "no"
227then
228 EVMS_ABI_CODE=110
229 echo "Enabling EVMS 1.1.0 ABI"
230fi
231)
232if test "$EVMS_ABI_CODE" = "120"
233then
234 echo "Using EVMS 1.2.0 ABI by default"
235fi
236AC_SUBST(EVMS_ABI_CODE)
237dnl
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000238dnl handle --enable-dll-shlibs
239dnl
240AC_ARG_ENABLE([dll-shlibs],
Theodore Ts'oa4d09611997-04-29 14:28:00 +0000241[ --enable-dll-shlibs select DLL libraries],
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000242if test "$enableval" = "no"
243then
244 DLL_CMT=#
245 MAKEFILE_DLL=/dev/null
246 echo "Disabling DLL shared libraries"
247else
248 DLL_CMT=
249 MAKEFILE_DLL=$srcdir/lib/Makefile.dll-lib
Theodore Ts'o74becf31997-04-26 14:37:06 +0000250 BINARY_TYPE=dllbin
Theodore Ts'oa4d09611997-04-29 14:28:00 +0000251 LIB_EXT=.sa
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000252 echo "Enabling DLL shared libraries"
253fi
254,
255MAKEFILE_DLL=/dev/null
256DLL_CMT=#
257echo "Disabling DLL shared libraries by default"
258)
259AC_SUBST(DLL_CMT)
260AC_SUBST_FILE(MAKEFILE_DLL)
261dnl
262dnl handle --enable-elf-shlibs
263dnl
264AC_ARG_ENABLE([elf-shlibs],
Theodore Ts'oa4d09611997-04-29 14:28:00 +0000265[ --enable-elf-shlibs select ELF shared libraries],
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000266if test "$enableval" = "no"
267then
268 ELF_CMT=#
269 MAKEFILE_ELF=/dev/null
270 echo "Disabling ELF shared libraries"
271else
272 ELF_CMT=
273 MAKEFILE_ELF=$srcdir/lib/Makefile.elf-lib
Theodore Ts'of5955dd2000-10-25 02:38:39 +0000274 [case "$host_os" in
275 solaris2.*)
276 MAKEFILE_ELF=$srcdir/lib/Makefile.solaris-lib
277 ;;
278 esac]
Theodore Ts'o74becf31997-04-26 14:37:06 +0000279 BINARY_TYPE=elfbin
Theodore Ts'oa4d09611997-04-29 14:28:00 +0000280 LIB_EXT=.so
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000281 echo "Enabling ELF shared libraries"
282fi
283,
284MAKEFILE_ELF=/dev/null
285ELF_CMT=#
286echo "Disabling ELF shared libraries by default"
287)
288AC_SUBST(ELF_CMT)
289AC_SUBST_FILE(MAKEFILE_ELF)
290dnl
291dnl handle --enable-bsd-shlibs
292dnl
293AC_ARG_ENABLE([bsd-shlibs],
Theodore Ts'oa4d09611997-04-29 14:28:00 +0000294[ --enable-bsd-shlibs select BSD shared libraries],
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000295if test "$enableval" = "no"
296then
297 BSDLIB_CMT=#
298 MAKEFILE_BSDLIB=/dev/null
299 echo "Disabling BSD shared libraries"
300else
301 BSDLIB_CMT=
302 MAKEFILE_BSDLIB=$srcdir/lib/Makefile.bsd-lib
Theodore Ts'oa4d09611997-04-29 14:28:00 +0000303 LIB_EXT=.so
Theodore Ts'oe71d8732003-03-14 02:13:48 -0500304 [case "$host_os" in
Theodore Ts'oaa75ecc2003-03-17 10:01:22 -0500305 darwin*)
Theodore Ts'oe71d8732003-03-14 02:13:48 -0500306 MAKEFILE_BSDLIB=$srcdir/lib/Makefile.darwin-lib
307 LIB_EXT=.dylib
308 ;;
309 esac]
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000310 echo "Enabling BSD shared libraries"
311fi
312,
313MAKEFILE_BSDLIB=/dev/null
314BSDLIB_CMT=#
315echo "Disabling BSD shared libraries by default"
316)
317AC_SUBST(BSDLIB_CMT)
318AC_SUBST_FILE(MAKEFILE_BSDLIB)
319dnl
320dnl handle --enable-profile
321dnl
322AC_ARG_ENABLE([profile],
Theodore Ts'oa4d09611997-04-29 14:28:00 +0000323[ --enable-profile build profiling libraries],
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000324if test "$enableval" = "no"
325then
326 PROFILE_CMT=#
327 MAKEFILE_PROFILE=/dev/null
328 echo "Disabling profiling libraries"
329else
330 PROFILE_CMT=
331 MAKEFILE_PROFILE=$srcdir/lib/Makefile.profile
Theodore Ts'oa4d09611997-04-29 14:28:00 +0000332 PROFILED_LIB_EXT=_p.a
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000333 echo "Building profiling libraries"
334fi
335,
336PROFILE_CMT=#
337MAKEFILE_PROFILE=/dev/null
338echo "Disabling profiling libraries by default"
339)
340AC_SUBST(PROFILE_CMT)
341AC_SUBST_FILE(MAKEFILE_PROFILE)
342dnl
343dnl handle --enable-checker
344dnl
345AC_ARG_ENABLE([checker],
Theodore Ts'oa4d09611997-04-29 14:28:00 +0000346[ --enable-checker build checker libraries],
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000347if test "$enableval" = "no"
348then
349 CHECKER_CMT=#
350 MAKEFILE_CHECKER=/dev/null
351 echo "Disabling checker libraries"
352else
353 CHECKER_CMT=
354 MAKEFILE_CHECKER=$srcdir/lib/Makefile.checker
355 echo "Building checker libraries"
356fi
357,
358CHECKER_CMT=#
359MAKEFILE_CHECKER=/dev/null
360echo "Disabling checker libraries by default"
361)
362AC_SUBST(CHECKER_CMT)
363AC_SUBST_FILE(MAKEFILE_CHECKER)
364dnl
Theodore Ts'oa4d09611997-04-29 14:28:00 +0000365dnl Substitute library extensions
366dnl
367AC_SUBST(LIB_EXT)
368AC_SUBST(STATIC_LIB_EXT)
369AC_SUBST(PROFILED_LIB_EXT)
370dnl
Theodore Ts'o782bebf2002-11-08 18:46:45 -0500371dnl handle --enable-jbd-debug
Theodore Ts'ocdf186e2001-06-13 22:16:47 +0000372dnl
Theodore Ts'o782bebf2002-11-08 18:46:45 -0500373AC_ARG_ENABLE([jbd-debug],
374[ --enable-jbd-debug enable journal debugging],
Theodore Ts'ocdf186e2001-06-13 22:16:47 +0000375if test "$enableval" = "no"
376then
377 echo "Disabling journal debugging"
378else
Theodore Ts'o8cf93332001-12-16 02:23:36 -0500379 AC_DEFINE(CONFIG_JBD_DEBUG)
Theodore Ts'ocdf186e2001-06-13 22:16:47 +0000380 echo "Enabling journal debugging"
381fi
382,
383echo "Disabling journal debugging by default"
384)
385dnl
Theodore Ts'of0a22d02003-02-22 13:19:53 -0500386dnl handle --enable-blkid-debug
387dnl
388AC_ARG_ENABLE([blkid-debug],
Theodore Ts'od21ae6c2003-05-05 09:00:24 -0400389[ --enable-blkid-debug enable blkid debugging],
Theodore Ts'of0a22d02003-02-22 13:19:53 -0500390if test "$enableval" = "no"
391then
392 echo "Disabling blkid debugging"
393else
394 AC_DEFINE(CONFIG_BLKID_DEBUG)
395 echo "Enabling blkid debugging"
396fi
397,
398echo "Disabling blkid debugging by default"
399)
400dnl
Theodore Ts'o2a29f132003-05-05 12:08:47 -0400401dnl handle --enable-testio-debug
402dnl
403AC_ARG_ENABLE([testio-debug],
404[ --enable-testio-debug enable the use of the test I/O manager for debugging],
405if test "$enableval" = "no"
406then
407 echo "Disabling testio debugging"
408else
409 AC_DEFINE(CONFIG_TESTIO_DEBUG)
410 echo "Enabling testio debugging"
411fi
412,
413echo "Disabling testio debugging by default"
414)
415dnl
Theodore Ts'ocdf186e2001-06-13 22:16:47 +0000416dnl handle --enable-swapfs
417dnl
418AC_ARG_ENABLE([swapfs],
419[ --disable-swapfs disable support of legacy byte-swapped filesystems],
420if test "$enableval" = "no"
421then
Theodore Ts'ofeb44c62002-11-08 14:55:38 -0500422 SWAPFS_CMT=#
Theodore Ts'ocdf186e2001-06-13 22:16:47 +0000423 echo "Disabling swapfs support"
424else
Theodore Ts'ofeb44c62002-11-08 14:55:38 -0500425 SWAPFS_CMT=
Theodore Ts'ocdf186e2001-06-13 22:16:47 +0000426 AC_DEFINE(ENABLE_SWAPFS)
427 echo "Enabling swapfs support"
428fi
429,
Theodore Ts'ofeb44c62002-11-08 14:55:38 -0500430SWAPFS_CMT=
Theodore Ts'ocdf186e2001-06-13 22:16:47 +0000431echo "Enabling swapfs support by default"
432AC_DEFINE(ENABLE_SWAPFS)
433)
Theodore Ts'ofeb44c62002-11-08 14:55:38 -0500434AC_SUBST(SWAPFS_CMT)
Theodore Ts'ocdf186e2001-06-13 22:16:47 +0000435dnl
436dnl handle --enable-debugfs
437dnl
438AC_ARG_ENABLE([debugfs],
439[ --disable-debugfs disable support of debugfs program],
440if test "$enableval" = "no"
441then
442 echo "Disabling debugfs support"
443 DEBUGFS_CMT="#"
444else
445 DEBUGFS_CMT=
446 echo "Enabling debugfs support"
447fi
448,
449echo "Enabling debugfs support by default"
450DEBUGFS_CMT=
451)
452AC_SUBST(DEBUGFS_CMT)
453dnl
454dnl handle --enable-imager
455dnl
456AC_ARG_ENABLE([imager],
457[ --disable-imager disable support of e2image program],
458if test "$enableval" = "no"
459then
460 echo "Disabling e2image support"
461 IMAGER_CMT="#"
462else
463 IMAGER_CMT=
464 echo "Enabling e2image support"
465fi
466,
467echo "Enabling e2image support by default"
468IMAGER_CMT=
469)
470AC_SUBST(IMAGER_CMT)
471dnl
472dnl handle --enable-resizer
473dnl
474AC_ARG_ENABLE([resizer],
475[ --disable-resizer disable support of e2resize program],
476if test "$enableval" = "no"
477then
478 echo "Disabling e2resize support"
479 RESIZER_CMT="#"
480else
481 RESIZER_CMT=
482 echo "Enabling e2resize support"
483fi
484,
485echo "Enabling e2resize support by default"
486RESIZER_CMT=
487)
488AC_SUBST(RESIZER_CMT)
489dnl
Theodore Ts'o4d0f3e12001-01-11 15:48:50 +0000490dnl handle --enable-dynamic-e2fsck
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000491dnl
Theodore Ts'oa4d09611997-04-29 14:28:00 +0000492AC_ARG_ENABLE([dynamic-e2fsck],
493[ --enable-dynamic-e2fsck build e2fsck dynamically],
494if test "$enableval" = "no"
495then
496 E2FSCK_TYPE=static
497 echo "Building e2fsck statically"
498else
499 E2FSCK_TYPE=shared
500 echo "Building e2fsck dynamically"
501fi
502,
503E2FSCK_TYPE=static
504echo "Building e2fsck statically by default"
505)
506AC_SUBST(E2FSCK_TYPE)
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000507dnl
Theodore Ts'ofc6d9d51997-04-29 14:51:31 +0000508dnl See whether to install the `fsck' wrapper program (that calls e2fsck)
509dnl
510AC_ARG_ENABLE([fsck],
511[ --enable-fsck build fsck wrapper program],
512[if test "$enableval" = "no"
513then
514 FSCK_PROG='' FSCK_MAN=''
515 echo "Not building fsck wrapper"
516else
517 FSCK_PROG=fsck FSCK_MAN=fsck.8
518 echo "Building fsck wrapper"
519fi]
520,
521[case "$host_os" in
Theodore Ts'o93636bd2003-07-12 02:45:05 -0400522 gnu* | k*bsd*-gnu)
Theodore Ts'ofc6d9d51997-04-29 14:51:31 +0000523 FSCK_PROG='' FSCK_MAN=''
524 echo "Not building fsck wrapper by default"
525 ;;
526 *)
527 FSCK_PROG=fsck FSCK_MAN=fsck.8
528 echo "Building fsck wrapper by default"
529esac]
530)
531AC_SUBST(FSCK_PROG)
532AC_SUBST(FSCK_MAN)
533dnl
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000534dnl
535MAKEFILE_LIBRARY=$srcdir/lib/Makefile.library
536AC_SUBST_FILE(MAKEFILE_LIBRARY)
537dnl
Theodore Ts'ofc6d9d51997-04-29 14:51:31 +0000538dnl
539AC_ARG_ENABLE([old-bitops],
540[ --enable-old-bitops Use old (non-standard but native) bitmask operations],
541if test "$enableval" = "no"
542then
543 echo "Using new (standard) bitmask operations"
544else
545 AC_DEFINE(EXT2_OLD_BITOPS)
546 echo "Using old (native) bitmask operations"
547
548fi
549,
550echo "Using standard bitmask operations by default"
551)
552dnl
Theodore Ts'ocdf186e2001-06-13 22:16:47 +0000553dnl Add internationalization support, using gettext.
554dnl
555PACKAGE=e2fsprogs
556VERSION="$E2FSPROGS_VERSION"
557AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE")
558AC_DEFINE_UNQUOTED(VERSION, "$VERSION")
559AC_SUBST(PACKAGE)
560AC_SUBST(VERSION)
561
Theodore Ts'ocdf186e2001-06-13 22:16:47 +0000562AM_GNU_GETTEXT
563dnl
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000564dnl End of configuration options
565dnl
Theodore Ts'o74becf31997-04-26 14:37:06 +0000566AC_SUBST(BINARY_TYPE)
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000567AC_PROG_MAKE_SET
568AC_PATH_PROG(LN, ln, ln)
Theodore Ts'ofc6d9d51997-04-29 14:51:31 +0000569AC_PROG_LN_S
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000570AC_PATH_PROG(MV, mv, mv)
571AC_PATH_PROG(CP, cp, cp)
572AC_PATH_PROG(RM, rm, rm)
573AC_PATH_PROG(CHMOD, chmod, :)
574AC_PATH_PROG(AWK, awk, awk)
575AC_PATH_PROG(SED, sed, sed)
Theodore Ts'o9d564f71999-07-03 20:25:58 +0000576AC_PATH_PROG(PERL, perl, perl)
Theodore Ts'o250f79f2001-05-19 22:02:22 +0000577AC_PATH_PROG(LDCONFIG, ldconfig, :)
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000578AC_CHECK_TOOL(AR, ar, ar)
579AC_CHECK_TOOL(RANLIB, ranlib, :)
580AC_CHECK_TOOL(STRIP, strip, :)
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000581AC_PROG_INSTALL
Theodore Ts'o6c133521999-07-03 20:37:03 +0000582# See if we need a separate native compiler.
583if test $cross_compiling = no; then
584 BUILD_CC="$CC"
585 AC_SUBST(BUILD_CC)
586else
587 AC_CHECK_PROGS(BUILD_CC, gcc cc)
588fi
Theodore Ts'o26258032004-04-03 10:20:26 -0500589AC_CHECK_HEADERS(stdlib.h unistd.h stdarg.h stdint.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/disk.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 net/if_dl.h netinet/in.h)
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000590AC_FUNC_VPRINTF
Theodore Ts'offf45482003-04-13 00:44:19 -0400591dnl Check to see if dirent has member d_reclen. On cygwin those d_reclen
592dnl is not decleared.
593AC_MSG_CHECKING(whether d_reclen declared in dirent)
594AC_CACHE_VAL(e2fsprogs_cv_have_d_reclen_dirent,
595 AC_TRY_COMPILE(
596[#include <dirent.h>], [struct dirent de; de.d_reclen = 0; ],
597 [e2fsprogs_cv_have_d_reclen_dirent=yes],
598 [e2fsprogs_cv_have_d_reclen_dirent=no]))
599AC_MSG_RESULT($e2fsprogs_cv_have_d_reclen_dirent)
600if test "$e2fsprogs_cv_have_d_reclen_dirent" = yes; then
601 AC_DEFINE(HAVE_RECLEN_DIRENT)
602fi
603dnl Check to see if ssize_t was decleared
604AC_MSG_CHECKING(whether ssize_t declared)
605AC_CACHE_VAL(e2fsprogs_cv_have_ssize_t,
606 AC_TRY_COMPILE(
607[#include <sys/types.h>], [ssize_t a = 0; ],
608 [e2fsprogs_cv_have_ssize_t=yes],
609 [e2fsprogs_cv_have_ssize_t=no]))
610AC_MSG_RESULT($e2fsprogs_cv_have_ssize_t)
611if test "$e2fsprogs_cv_have_ssize_t" = yes; then
612 AC_DEFINE(HAVE_TYPE_SSIZE_T)
613fi
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000614dnl
Theodore Ts'ob0b9c4d1997-10-20 23:36:30 +0000615dnl Check to see if llseek() is declared in unistd.h. On some libc's
616dnl it is, and on others it isn't..... Thank you glibc developers....
617dnl
618dnl Warning! Use of --enable-gcc-wall may throw off this test.
619dnl
620dnl
621AC_MSG_CHECKING(whether llseek declared in unistd.h)
622AC_CACHE_VAL(e2fsprogs_cv_have_llseek_prototype,
623 AC_TRY_COMPILE(
624[#include <unistd.h>], [extern int llseek(int);],
625 [e2fsprogs_cv_have_llseek_prototype=no],
626 [e2fsprogs_cv_have_llseek_prototype=yes]))
627AC_MSG_RESULT($e2fsprogs_cv_have_llseek_prototype)
628if test "$e2fsprogs_cv_have_llseek_prototype" = yes; then
629 AC_DEFINE(HAVE_LLSEEK_PROTOTYPE)
630fi
631dnl
Theodore Ts'o6928adc2000-05-25 23:28:50 +0000632dnl Check to see if lseek64() is declared in unistd.h. Glibc's header files
633dnl are so convoluted that I can't tell whether it will always be defined,
634dnl and if it isn't defined while lseek64 is defined in the library,
635dnl disaster will strike.
636dnl
637dnl Warning! Use of --enable-gcc-wall may throw off this test.
638dnl
639dnl
640AC_MSG_CHECKING(whether lseek64 declared in unistd.h)
641AC_CACHE_VAL(e2fsprogs_cv_have_lseek64_prototype,
642 AC_TRY_COMPILE(
643[#define _LARGEFILE_SOURCE
644#define _LARGEFILE64_SOURCE
645#include <unistd.h>], [extern int lseek64(int);],
646 [e2fsprogs_cv_have_lseek64_prototype=no],
647 [e2fsprogs_cv_have_lseek64_prototype=yes]))
648AC_MSG_RESULT($e2fsprogs_cv_have_lseek64_prototype)
649if test "$e2fsprogs_cv_have_lseek64_prototype" = yes; then
650 AC_DEFINE(HAVE_LSEEK64_PROTOTYPE)
651fi
652dnl
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000653dnl Word sizes...
654dnl
655if test "$cross_compiling" = yes -a "$ac_cv_sizeof_long" = ""; then
656 # if cross-compiling, with no cached values, just assume something common.
657 ac_cv_sizeof_short=2
658 ac_cv_sizeof_int=4
659 ac_cv_sizeof_long=4
Theodore Ts'o6c133521999-07-03 20:37:03 +0000660 ac_cv_sizeof_long_long=8
661 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 +0000662fi
663AC_CHECK_SIZEOF(short)
664AC_CHECK_SIZEOF(int)
665AC_CHECK_SIZEOF(long)
Theodore Ts'ofc6d9d51997-04-29 14:51:31 +0000666AC_CHECK_SIZEOF(long long)
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000667SIZEOF_SHORT=$ac_cv_sizeof_short
668SIZEOF_INT=$ac_cv_sizeof_int
669SIZEOF_LONG=$ac_cv_sizeof_long
Theodore Ts'ofc6d9d51997-04-29 14:51:31 +0000670SIZEOF_LONG_LONG=$ac_cv_sizeof_long_long
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000671AC_SUBST(SIZEOF_SHORT)
672AC_SUBST(SIZEOF_INT)
673AC_SUBST(SIZEOF_LONG)
Theodore Ts'ofc6d9d51997-04-29 14:51:31 +0000674AC_SUBST(SIZEOF_LONG_LONG)
Theodore Ts'o877eb6d2001-06-11 06:54:13 +0000675AC_C_BIGENDIAN
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000676dnl
Theodore Ts'o0c193f82003-08-01 14:26:23 -0400677dnl See if we have inttypes.h and if intptr_t is defined
678dnl
679AC_CHECK_HEADERS([inttypes.h])
680AC_CHECK_TYPE(intptr_t,long)
681dnl
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000682dnl See if struct stat has a st_flags field, in which case we can get file
683dnl flags somewhat portably. Also check for the analogous setter, chflags().
684dnl
685AC_MSG_CHECKING(whether struct stat has a st_flags field)
686AC_CACHE_VAL(e2fsprogs_cv_struct_st_flags,
687 AC_TRY_COMPILE([#include <sys/stat.h>],
688 [struct stat stat; stat.st_flags = 0;],
689 [e2fsprogs_cv_struct_st_flags=yes],
690 [e2fsprogs_cv_struct_st_flags=no]))
691AC_MSG_RESULT($e2fsprogs_cv_struct_st_flags)
692if test "$e2fsprogs_cv_struct_st_flags" = yes; then
Theodore Ts'oc03bc4e1999-10-20 18:20:36 +0000693 AC_MSG_CHECKING(whether st_flags field is useful)
694 AC_CACHE_VAL(e2fsprogs_cv_struct_st_flags_immut,
695 AC_TRY_COMPILE([#include <sys/stat.h>],
696 [struct stat stat; stat.st_flags |= UF_IMMUTABLE;],
697 [e2fsprogs_cv_struct_st_flags_immut=yes],
698 [e2fsprogs_cv_struct_st_flags_immut=no]))
699 AC_MSG_RESULT($e2fsprogs_cv_struct_st_flags_immut)
700 if test "$e2fsprogs_cv_struct_st_flags_immut" = yes; then
701 AC_DEFINE(HAVE_STAT_FLAGS)
702 fi
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000703fi
Theodore Ts'o84ea6e72004-03-19 19:29:17 -0500704dnl
705dnl Check for the presence of SA_LEN
706dnl
707AC_MSG_CHECKING(whether struct sockaddr contains sa_len)
708AC_CACHE_VAL(e2fsprogs_cv_sockaddr_sa_len,
709[AC_TRY_COMPILE([#include <sys/types.h>
710#include <sys/socket.h>
711],
712[struct sockaddr sa;
713sa.sa_len;],
714e2fsprogs_cv_sockaddr_sa_len=yes,e2fsprogs_cv_sockaddr_sa_len=no)])
715AC_MSG_RESULT([$]e2fsprogs_cv_sockaddr_sa_len)
716if test $e2fsprogs_cv_sockaddr_sa_len = yes; then
717 AC_DEFINE_UNQUOTED(HAVE_SA_LEN,1,[Define if struct sockaddr contains sa_len])
718fi
719dnl
Theodore Ts'o1c29b092003-07-12 16:01:45 -0400720AC_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 +0000721dnl
Theodore Ts'ofc6d9d51997-04-29 14:51:31 +0000722dnl Check to see if -lsocket is required (solaris) to make something
723dnl that uses socket() to compile; this is needed for the UUID library
724dnl
725SOCKET_LIB=''
726AC_CHECK_LIB(socket, socket, [SOCKET_LIB=-lsocket])
727AC_SUBST(SOCKET_LIB)
728dnl
Theodore Ts'o3ae497e2003-03-16 06:26:25 -0500729dnl Check to see if libdl exists for the sake of dlopen
730dnl
731DLOPEN_LIB=''
732AC_CHECK_LIB(dl, dlopen,
733[DLOPEN_LIB=-ldl
734AC_DEFINE(HAVE_DLOPEN)])
735AC_SUBST(DLOPEN_LIB)
736dnl
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000737dnl See if optreset exists
738dnl
739AC_MSG_CHECKING(for optreset)
740AC_CACHE_VAL(ac_cv_have_optreset,
741[AC_EGREP_HEADER(optreset, unistd.h,
742 ac_cv_have_optreset=yes, ac_cv_have_optreset=no)])dnl
743AC_MSG_RESULT($ac_cv_have_optreset)
744if test $ac_cv_have_optreset = yes; then
745 AC_DEFINE(HAVE_OPTRESET)
746fi
747dnl
Theodore Ts'o8f3f29d2000-02-11 05:04:44 +0000748dnl We use the EXT2 ioctls only under Linux
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000749dnl
Theodore Ts'o8f3f29d2000-02-11 05:04:44 +0000750case "$host_os" in
751linux*)
752 AC_DEFINE(HAVE_EXT2_IOCTLS)
753 ;;
754esac
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000755dnl
Theodore Ts'offf45482003-04-13 00:44:19 -0400756dnl OS-specific uncomment control
Theodore Ts'oe6f2bda2002-08-18 03:37:10 -0400757dnl
758LINUX_CMT="#"
Theodore Ts'offf45482003-04-13 00:44:19 -0400759CYGWIN_CMT="#"
760UNIX_CMT=
Theodore Ts'oe6f2bda2002-08-18 03:37:10 -0400761case "$host_os" in
762linux*)
763 LINUX_CMT=
764 ;;
Theodore Ts'offf45482003-04-13 00:44:19 -0400765cygwin)
766 CYGWIN_CMT=
767 UNIX_CMT="#"
Theodore Ts'od21ae6c2003-05-05 09:00:24 -0400768 EVMS_CMT="#"
Theodore Ts'offf45482003-04-13 00:44:19 -0400769 ;;
Theodore Ts'od21ae6c2003-05-05 09:00:24 -0400770*)
771 EVMS_CMT="#"
Theodore Ts'oe6f2bda2002-08-18 03:37:10 -0400772esac
773AC_SUBST(LINUX_CMT)
Theodore Ts'offf45482003-04-13 00:44:19 -0400774AC_SUBST(CYGWIN_CMT)
775AC_SUBST(UNIX_CMT)
Theodore Ts'o5c70a502003-05-20 10:29:29 -0400776AC_SUBST([EVMS_CMT])
Theodore Ts'oe6f2bda2002-08-18 03:37:10 -0400777dnl
Theodore Ts'o6c133521999-07-03 20:37:03 +0000778dnl Linux and Hurd places root files in the / by default
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000779dnl
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000780case "$host_os" in
Theodore Ts'o93636bd2003-07-12 02:45:05 -0400781linux* | gnu* | k*bsd*-gnu)
Theodore Ts'oa4b2d3c1998-04-03 16:12:25 +0000782 if test "$prefix" = NONE -a "$root_prefix" = NONE ; then
783 root_prefix="";
784 echo "On $host_os systems, root_prefix defaults to ''"
Theodore Ts'ofc6d9d51997-04-29 14:51:31 +0000785 fi
786 ;;
787esac
Theodore Ts'ofc6d9d51997-04-29 14:51:31 +0000788dnl
Theodore Ts'oa4b2d3c1998-04-03 16:12:25 +0000789dnl On Linux/hurd, force the prefix to be /usr
Theodore Ts'ofc6d9d51997-04-29 14:51:31 +0000790dnl
791case "$host_os" in
Theodore Ts'o93636bd2003-07-12 02:45:05 -0400792linux* | gnu* | k*bsd*-gnu)
Theodore Ts'ofc6d9d51997-04-29 14:51:31 +0000793 if test "$prefix" = NONE ; then
Theodore Ts'oa4b2d3c1998-04-03 16:12:25 +0000794 prefix="/usr";
795 echo "On $host_os systems, prefix defaults to /usr"
Theodore Ts'obff61a72002-05-21 22:21:38 -0400796 if test "$mandir" = '${prefix}/man' ; then
797 echo "...and mandir defaults to /usr/share/man"
798 mandir=/usr/share/man
799 fi
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000800 fi
801;;
802esac
Theodore Ts'oa4b2d3c1998-04-03 16:12:25 +0000803if test "$root_prefix" = NONE ; then
Theodore Ts'offe19911998-04-08 06:05:49 +0000804 if test "$prefix" = NONE ; then
Theodore Ts'oa4b2d3c1998-04-03 16:12:25 +0000805 root_prefix="$ac_default_prefix"
806 else
807 root_prefix="$prefix"
808 fi
Theodore Ts'ob5ffead2002-05-11 19:17:00 -0400809 root_bindir=$bindir
810 root_sbindir=$sbindir
811 root_libdir=$libdir
812 root_sysconfdir=$sysconfdir
813else
814 root_bindir='${root_prefix}/bin'
815 root_sbindir='${root_prefix}/sbin'
816 root_libdir='${root_prefix}/lib'
817 root_sysconfdir='${root_prefix}/etc'
Theodore Ts'oa4b2d3c1998-04-03 16:12:25 +0000818fi
819AC_SUBST(root_prefix)
Theodore Ts'ob5ffead2002-05-11 19:17:00 -0400820AC_SUBST(root_bindir)
821AC_SUBST(root_sbindir)
822AC_SUBST(root_libdir)
823AC_SUBST(root_sysconfdir)
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000824dnl
825dnl See if -static works.
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000826dnl
Theodore Ts'oae851481997-04-29 18:13:24 +0000827AC_MSG_CHECKING([whether linker accepts -static])
828AC_CACHE_VAL(ac_cv_e2fsprogs_use_static,
829[SAVE_LDFLAGS=$LDFLAGS; LDFLAGS="$LDFLAGS -static"
830AC_TRY_LINK([#include <stdio.h>],[fflush(stdout);],
831 ac_cv_e2fsprogs_use_static=yes, ac_cv_e2fsprogs_use_static=no)
832LDFLAGS=$SAVE_LDFLAGS])
Theodore Ts'odefde781999-01-04 07:39:19 +0000833dnl
834dnl Regardless of how the test turns out, Solaris doesn't handle -static
835dnl This is caused by the socket library requiring the nsl library, which
836dnl requires the -dl library, which only works for dynamically linked
837dnl programs. It basically means you can't have statically linked programs
838dnl which use the network under Solaris.
839dnl
840case "$host_os" in
841solaris2.*)
842 ac_cv_e2fsprogs_use_static=no
843;;
844esac
Theodore Ts'oae851481997-04-29 18:13:24 +0000845AC_MSG_RESULT($ac_cv_e2fsprogs_use_static)
Theodore Ts'o74becf31997-04-26 14:37:06 +0000846LDFLAG_STATIC=
Theodore Ts'oae851481997-04-29 18:13:24 +0000847if test $ac_cv_e2fsprogs_use_static = yes; then
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000848 LDFLAG_STATIC=-static
Theodore Ts'oae851481997-04-29 18:13:24 +0000849fi
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000850AC_SUBST(LDFLAG_STATIC)
851dnl
Theodore Ts'o07a0db12003-07-05 14:50:24 -0400852dnl Work around mysterious Darwin / GNU libintl problem
853dnl (__asm__ redirection doesn't work for some mysterious reason. Looks like
854dnl Apple hacked gcc somehow?)
855dnl
856case "$host_os" in
857darwin*)
858 echo "Using Apple Darwin / GNU libintl workaround"
859 AC_DEFINE(_INTL_REDIRECT_MACROS)
860 ;;
861esac
862dnl
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000863dnl Make the ss and et directories work correctly.
864dnl
865SS_DIR=`cd ${srcdir}/lib/ss; pwd`
866ET_DIR=`cd ${srcdir}/lib/et; pwd`
867AC_SUBST(SS_DIR)
868AC_SUBST(ET_DIR)
869dnl
870dnl Only try to run the test suite if we're not cross compiling.
871dnl
872if test "$cross_compiling" = yes ; then
873 DO_TEST_SUITE=
874else
875 DO_TEST_SUITE=check
876fi
877AC_SUBST(DO_TEST_SUITE)
878dnl
Theodore Ts'oc6f35b82003-05-17 16:29:27 -0400879dnl Only include the intl include files if we're building with them
880dnl
881INTL_FLAGS=
882if test "$USE_INCLUDED_LIBINTL" = "yes" ; then
883 INTL_FLAGS='-I$(top_builddir)/intl -I$(top_srcdir)/intl'
884fi
885AC_SUBST(INTL_FLAGS)
886dnl
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000887dnl Make our output files, being sure that we create the some miscellaneous
888dnl directories
889dnl
890test -d lib || mkdir lib
891test -d include || mkdir include
892test -d include/linux || mkdir include/linux
Theodore Ts'odefde781999-01-04 07:39:19 +0000893test -d include/asm || mkdir include/asm
Theodore Ts'obff0cc92003-03-23 01:37:53 -0500894for i in MCONFIG Makefile e2fsprogs.spec \
895 util/Makefile util/subst.conf util/gen-tarball \
896 lib/et/Makefile lib/ss/Makefile lib/ext2fs/Makefile lib/e2p/Makefile \
Theodore Ts'o94ba8c72003-03-02 02:07:14 -0500897 lib/uuid/Makefile lib/uuid/uuid_types.h \
898 lib/blkid/Makefile lib/blkid/blkid_types.h \
899 lib/evms/Makefile misc/Makefile ext2ed/Makefile e2fsck/Makefile \
900 debugfs/Makefile tests/Makefile tests/progs/Makefile \
901 resize/Makefile doc/Makefile intl/Makefile po/Makefile.in ; do
902 if test -d `dirname ${srcdir}/$i` ; then
903 outlist="$outlist $i"
904 fi
905done
906AC_OUTPUT($outlist)