blob: ece81dd806e4c2cb9d952ba29de8dadeaffb3e15 [file] [log] [blame]
Theodore Ts'o50e1e101997-04-26 13:58:21 +00001AC_INIT(version.h)
Theodore Ts'ob0cacab2004-11-30 19:00:19 -05002AC_PREREQ(2.50)
3AC_CONFIG_AUX_DIR(config)
Theodore Ts'o50e1e101997-04-26 13:58:21 +00004MCONFIG=./MCONFIG
5AC_SUBST_FILE(MCONFIG)
Theodore Ts'o74becf31997-04-26 14:37:06 +00006BINARY_TYPE=bin
7dnl
8dnl This is to figure out the version number and the date....
9dnl
10E2FSPROGS_VERSION=`grep E2FSPROGS_VERSION ${srcdir}/version.h \
11 | awk '{print $3}' | tr \" " " | awk '{print $1}'`
12DATE=`grep E2FSPROGS_DATE ${srcdir}/version.h | awk '{print $3}' \
13 | tr \" " "`
Theodore Ts'obff0cc92003-03-23 01:37:53 -050014E2FSPROGS_DAY=`echo $DATE | awk -F- '{print $1}'`
Theodore Ts'o74becf31997-04-26 14:37:06 +000015MONTH=`echo $DATE | awk -F- '{print $2}'`
16YEAR=`echo $DATE | awk -F- '{print $3}'`
17
Theodore Ts'o40fa8cc1999-01-09 05:06:02 +000018if expr $YEAR ">" 1900 > /dev/null ; then
19 E2FSPROGS_YEAR=$YEAR
20elif expr $YEAR ">" 90 >/dev/null ; then
Theodore Ts'o74becf31997-04-26 14:37:06 +000021 E2FSPROGS_YEAR=19$YEAR
22else
23 E2FSPROGS_YEAR=20$YEAR
24fi
25
26case $MONTH in
27Jan) E2FSPROGS_MONTH="January" ;;
28Feb) E2FSPROGS_MONTH="February" ;;
29Mar) E2FSPROGS_MONTH="March" ;;
30Apr) E2FSPROGS_MONTH="April" ;;
31May) E2FSPROGS_MONTH="May" ;;
32Jun) E2FSPROGS_MONTH="June" ;;
33Jul) E2FSPROGS_MONTH="July" ;;
34Aug) E2FSPROGS_MONTH="August" ;;
35Sep) E2FSPROGS_MONTH="September" ;;
36Oct) E2FSPROGS_MONTH="October" ;;
37Nov) E2FSPROGS_MONTH="November" ;;
38Dec) E2FSPROGS_MONTH="December" ;;
39*) echo "Unknown month $MONTH??" ;;
40esac
41
42unset DATE MONTH YEAR
43echo "Generating configuration file for e2fsprogs version $E2FSPROGS_VERSION"
44echo "Release date is ${E2FSPROGS_MONTH}, ${E2FSPROGS_YEAR}"
45AC_SUBST(E2FSPROGS_YEAR)
46AC_SUBST(E2FSPROGS_MONTH)
Theodore Ts'obff0cc92003-03-23 01:37:53 -050047AC_SUBST(E2FSPROGS_DAY)
Theodore Ts'o74becf31997-04-26 14:37:06 +000048AC_SUBST(E2FSPROGS_VERSION)
Theodore Ts'oea97be52001-09-19 15:20:12 -040049AC_CANONICAL_HOST
Theodore Ts'o74becf31997-04-26 14:37:06 +000050dnl
Theodore Ts'od21ae6c2003-05-05 09:00:24 -040051dnl Use diet libc
52dnl
53AC_ARG_WITH([diet-libc],
54[ --with-diet-libc Use diet libc],
55CC="diet cc -nostdinc"
Theodore Ts'od21ae6c2003-05-05 09:00:24 -040056AC_MSG_RESULT(CC=$CC))dnl
57dnl
Theodore Ts'o74becf31997-04-26 14:37:06 +000058dnl set $(CC) from --with-cc=value
59dnl
60AC_ARG_WITH([cc],
61[ --with-cc=COMPILER select compiler to use],
62AC_MSG_RESULT(CC=$withval)
63CC=$withval,
64if test -z "$CC" ; then CC=cc; fi
65[AC_MSG_RESULT(CC defaults to $CC)])dnl
66export CC
67AC_SUBST([CC])
Theodore Ts'o73ae2d42000-02-02 16:13:14 +000068AC_PROG_CC
Theodore Ts'o74becf31997-04-26 14:37:06 +000069dnl
70dnl set $(LD) from --with-linker=value
71dnl
72AC_ARG_WITH([linker],
73[ --with-linker=LINKER select linker to use],
74AC_MSG_RESULT(LD=$withval)
75LD=$withval,
76if test -z "$LD" ; then LD=$CC; fi
77[AC_MSG_RESULT(LD defaults to $LD)])dnl
78export LD
79AC_SUBST([LD])
80dnl
81dnl set $(CCOPTS) from --with-ccopts=value
82dnl
83AC_ARG_WITH([ccopts],
84[ --with-ccopts=CCOPTS select compiler command line options],
85AC_MSG_RESULT(CCOPTS is $withval)
Theodore Ts'o877eb6d2001-06-11 06:54:13 +000086CFLAGS=$withval,
87)dnl
Theodore Ts'o74becf31997-04-26 14:37:06 +000088dnl
Theodore Ts'of8bd9801999-10-26 04:19:45 +000089dnl On systems without linux header files, we add an extra include directory
90dnl that holds enough to fake it (hopefully). Note that the $(top_srcdir) here
91dnl is quoted so that it gets expanded by make, not by configure.
92dnl
93AC_CHECK_HEADER(linux/fs.h, [linux_headers=yes], [linux_headers=no])
Theodore Ts'o73ae2d42000-02-02 16:13:14 +000094if test "$linux_headers" != yes; then
95 LINUX_INCLUDE='-I$(top_builddir)/include'
Theodore Ts'of8bd9801999-10-26 04:19:45 +000096fi
97AC_SUBST(LINUX_INCLUDE)
98dnl
Matthias Andreeb1c92f92004-02-23 21:30:11 +010099dnl Alpha computers use fast and imprecise floating point code that may
100dnl miss exceptions by default. Force sane options if we're using GCC.
101AC_MSG_CHECKING(for additional special compiler flags)
102if test "$GCC" = yes
103then
104 case "$host_cpu" in
105 alpha) addcflags="-mieee" ;;
106 esac
107fi
108if test "x$addcflags" != x
109then
110 AC_MSG_RESULT($addcflags)
111 CFLAGS="$addcflags $CFLAGS"
112else
113 AC_MSG_RESULT([[(none)]])
114fi
115dnl
Theodore Ts'oa4d09611997-04-29 14:28:00 +0000116dnl Set default values for library extentions. Will be dealt with after
117dnl parsing configuration opions, which may modify these
118dnl
119LIB_EXT=.a
120STATIC_LIB_EXT=.a
121PROFILE_LIB_EXT=.a
122dnl
Theodore Ts'o74becf31997-04-26 14:37:06 +0000123dnl set $(LDFLAGS) from --with-ldopts=value
124dnl
125AC_ARG_WITH([ldopts],
126[ --with-ldopts=LDOPTS select linker command line options],
127AC_MSG_RESULT(LDFLAGS is $withval)
128LDFLAGS=$withval,
129LDFLAGS=)dnl
130AC_SUBST(LDFLAGS)
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000131dnl
Theodore Ts'oa4b2d3c1998-04-03 16:12:25 +0000132dnl Allow separate `root_prefix' to be specified
Theodore Ts'ofc6d9d51997-04-29 14:51:31 +0000133dnl
Theodore Ts'oa4b2d3c1998-04-03 16:12:25 +0000134AC_ARG_WITH([root-prefix],
135[ --with-root-prefix=PREFIX override prefix variable for files to be placed in the root],
136root_prefix=$withval,
137root_prefix=NONE)dnl
Theodore Ts'ofc6d9d51997-04-29 14:51:31 +0000138dnl
Theodore Ts'o98919bd2005-02-04 10:43:58 -0500139dnl handle --enable-maintainer-mode
140dnl
141AC_ARG_ENABLE([maintainer-mode],
142[ --enable-maintainer-mode enable makefile rules useful for maintainers],
143if test "$enableval" = "no"
144then
145 MAINTAINER_CMT=#
146 echo "Disabling maintainer mode"
147else
148 MAINTAINER_CMT=
149 echo "Enabling maintainer mode"
150fi
151,
152MAINTAINER_CMT=#
153echo "Disabling maintainer mode by default"
154)
155AC_SUBST(MAINTAINER_CMT)
156dnl
Theodore Ts'o19178752000-02-11 15:55:07 +0000157dnl handle --enable-compression
158dnl
159AC_ARG_ENABLE([compression],
160[ --enable-compression enable EXPERIMENTAL compression support],
161if test "$enableval" = "no"
162then
163 echo "Disabling compression support"
164else
165 AC_DEFINE(ENABLE_COMPRESSION)
166 echo "Enabling compression support"
167 echo "WARNING: Compression support is experimental"
168fi
169,
170echo "Disabling compression support by default"
171)
172dnl
Theodore Ts'o8fdc9982002-06-25 23:26:34 -0400173dnl handle --enable-htree
174dnl
175AC_ARG_ENABLE([htree],
176[ --enable-htree enable EXPERIMENTAL htree directory support],
177if test "$enableval" = "no"
178then
179 HTREE_CMT=#
180 echo "Disabling htree directory support"
181else
182 HTREE_CMT=
183 AC_DEFINE(ENABLE_HTREE)
184 echo "Enabling htree directory support"
Theodore Ts'o8fdc9982002-06-25 23:26:34 -0400185fi
186,
Theodore Ts'o559ca6c2002-08-18 03:48:55 -0400187HTREE_CMT=
188AC_DEFINE(ENABLE_HTREE)
189echo "Enabling htree directory support by default"
Theodore Ts'o8fdc9982002-06-25 23:26:34 -0400190)
191AC_SUBST(HTREE_CMT)
192dnl
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000193dnl handle --enable-elf-shlibs
194dnl
195AC_ARG_ENABLE([elf-shlibs],
Theodore Ts'oa4d09611997-04-29 14:28:00 +0000196[ --enable-elf-shlibs select ELF shared libraries],
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000197if test "$enableval" = "no"
198then
199 ELF_CMT=#
200 MAKEFILE_ELF=/dev/null
201 echo "Disabling ELF shared libraries"
202else
203 ELF_CMT=
204 MAKEFILE_ELF=$srcdir/lib/Makefile.elf-lib
Theodore Ts'of5955dd2000-10-25 02:38:39 +0000205 [case "$host_os" in
206 solaris2.*)
207 MAKEFILE_ELF=$srcdir/lib/Makefile.solaris-lib
208 ;;
209 esac]
Theodore Ts'o74becf31997-04-26 14:37:06 +0000210 BINARY_TYPE=elfbin
Theodore Ts'oa4d09611997-04-29 14:28:00 +0000211 LIB_EXT=.so
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000212 echo "Enabling ELF shared libraries"
213fi
214,
215MAKEFILE_ELF=/dev/null
216ELF_CMT=#
217echo "Disabling ELF shared libraries by default"
218)
219AC_SUBST(ELF_CMT)
220AC_SUBST_FILE(MAKEFILE_ELF)
221dnl
222dnl handle --enable-bsd-shlibs
223dnl
224AC_ARG_ENABLE([bsd-shlibs],
Theodore Ts'oa4d09611997-04-29 14:28:00 +0000225[ --enable-bsd-shlibs select BSD shared libraries],
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000226if test "$enableval" = "no"
227then
228 BSDLIB_CMT=#
229 MAKEFILE_BSDLIB=/dev/null
230 echo "Disabling BSD shared libraries"
231else
232 BSDLIB_CMT=
233 MAKEFILE_BSDLIB=$srcdir/lib/Makefile.bsd-lib
Theodore Ts'oa4d09611997-04-29 14:28:00 +0000234 LIB_EXT=.so
Theodore Ts'oe71d8732003-03-14 02:13:48 -0500235 [case "$host_os" in
Theodore Ts'oaa75ecc2003-03-17 10:01:22 -0500236 darwin*)
Theodore Ts'oe71d8732003-03-14 02:13:48 -0500237 MAKEFILE_BSDLIB=$srcdir/lib/Makefile.darwin-lib
238 LIB_EXT=.dylib
239 ;;
240 esac]
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000241 echo "Enabling BSD shared libraries"
242fi
243,
244MAKEFILE_BSDLIB=/dev/null
245BSDLIB_CMT=#
246echo "Disabling BSD shared libraries by default"
247)
248AC_SUBST(BSDLIB_CMT)
249AC_SUBST_FILE(MAKEFILE_BSDLIB)
250dnl
251dnl handle --enable-profile
252dnl
253AC_ARG_ENABLE([profile],
Theodore Ts'oa4d09611997-04-29 14:28:00 +0000254[ --enable-profile build profiling libraries],
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000255if test "$enableval" = "no"
256then
257 PROFILE_CMT=#
258 MAKEFILE_PROFILE=/dev/null
259 echo "Disabling profiling libraries"
260else
261 PROFILE_CMT=
262 MAKEFILE_PROFILE=$srcdir/lib/Makefile.profile
Theodore Ts'oa4d09611997-04-29 14:28:00 +0000263 PROFILED_LIB_EXT=_p.a
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000264 echo "Building profiling libraries"
265fi
266,
267PROFILE_CMT=#
268MAKEFILE_PROFILE=/dev/null
269echo "Disabling profiling libraries by default"
270)
271AC_SUBST(PROFILE_CMT)
272AC_SUBST_FILE(MAKEFILE_PROFILE)
273dnl
274dnl handle --enable-checker
275dnl
276AC_ARG_ENABLE([checker],
Theodore Ts'oa4d09611997-04-29 14:28:00 +0000277[ --enable-checker build checker libraries],
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000278if test "$enableval" = "no"
279then
280 CHECKER_CMT=#
281 MAKEFILE_CHECKER=/dev/null
282 echo "Disabling checker libraries"
283else
284 CHECKER_CMT=
285 MAKEFILE_CHECKER=$srcdir/lib/Makefile.checker
286 echo "Building checker libraries"
287fi
288,
289CHECKER_CMT=#
290MAKEFILE_CHECKER=/dev/null
291echo "Disabling checker libraries by default"
292)
293AC_SUBST(CHECKER_CMT)
294AC_SUBST_FILE(MAKEFILE_CHECKER)
295dnl
Theodore Ts'oa4d09611997-04-29 14:28:00 +0000296dnl Substitute library extensions
297dnl
298AC_SUBST(LIB_EXT)
299AC_SUBST(STATIC_LIB_EXT)
300AC_SUBST(PROFILED_LIB_EXT)
301dnl
Theodore Ts'o782bebf2002-11-08 18:46:45 -0500302dnl handle --enable-jbd-debug
Theodore Ts'ocdf186e2001-06-13 22:16:47 +0000303dnl
Theodore Ts'o782bebf2002-11-08 18:46:45 -0500304AC_ARG_ENABLE([jbd-debug],
305[ --enable-jbd-debug enable journal debugging],
Theodore Ts'ocdf186e2001-06-13 22:16:47 +0000306if test "$enableval" = "no"
307then
308 echo "Disabling journal debugging"
309else
Theodore Ts'o8cf93332001-12-16 02:23:36 -0500310 AC_DEFINE(CONFIG_JBD_DEBUG)
Theodore Ts'ocdf186e2001-06-13 22:16:47 +0000311 echo "Enabling journal debugging"
312fi
313,
314echo "Disabling journal debugging by default"
315)
316dnl
Theodore Ts'of0a22d02003-02-22 13:19:53 -0500317dnl handle --enable-blkid-debug
318dnl
319AC_ARG_ENABLE([blkid-debug],
Theodore Ts'od21ae6c2003-05-05 09:00:24 -0400320[ --enable-blkid-debug enable blkid debugging],
Theodore Ts'of0a22d02003-02-22 13:19:53 -0500321if test "$enableval" = "no"
322then
323 echo "Disabling blkid debugging"
324else
325 AC_DEFINE(CONFIG_BLKID_DEBUG)
326 echo "Enabling blkid debugging"
327fi
328,
329echo "Disabling blkid debugging by default"
330)
331dnl
Theodore Ts'o2a29f132003-05-05 12:08:47 -0400332dnl handle --enable-testio-debug
333dnl
334AC_ARG_ENABLE([testio-debug],
335[ --enable-testio-debug enable the use of the test I/O manager for debugging],
336if test "$enableval" = "no"
337then
338 echo "Disabling testio debugging"
339else
340 AC_DEFINE(CONFIG_TESTIO_DEBUG)
341 echo "Enabling testio debugging"
342fi
343,
344echo "Disabling testio debugging by default"
345)
346dnl
Theodore Ts'ocdf186e2001-06-13 22:16:47 +0000347dnl handle --enable-swapfs
348dnl
349AC_ARG_ENABLE([swapfs],
350[ --disable-swapfs disable support of legacy byte-swapped filesystems],
351if test "$enableval" = "no"
352then
Theodore Ts'ofeb44c62002-11-08 14:55:38 -0500353 SWAPFS_CMT=#
Theodore Ts'ocdf186e2001-06-13 22:16:47 +0000354 echo "Disabling swapfs support"
355else
Theodore Ts'ofeb44c62002-11-08 14:55:38 -0500356 SWAPFS_CMT=
Theodore Ts'ocdf186e2001-06-13 22:16:47 +0000357 AC_DEFINE(ENABLE_SWAPFS)
358 echo "Enabling swapfs support"
359fi
360,
Theodore Ts'ofeb44c62002-11-08 14:55:38 -0500361SWAPFS_CMT=
Theodore Ts'ocdf186e2001-06-13 22:16:47 +0000362echo "Enabling swapfs support by default"
363AC_DEFINE(ENABLE_SWAPFS)
364)
Theodore Ts'ofeb44c62002-11-08 14:55:38 -0500365AC_SUBST(SWAPFS_CMT)
Theodore Ts'ocdf186e2001-06-13 22:16:47 +0000366dnl
367dnl handle --enable-debugfs
368dnl
369AC_ARG_ENABLE([debugfs],
370[ --disable-debugfs disable support of debugfs program],
371if test "$enableval" = "no"
372then
373 echo "Disabling debugfs support"
374 DEBUGFS_CMT="#"
375else
376 DEBUGFS_CMT=
377 echo "Enabling debugfs support"
378fi
379,
380echo "Enabling debugfs support by default"
381DEBUGFS_CMT=
382)
383AC_SUBST(DEBUGFS_CMT)
384dnl
385dnl handle --enable-imager
386dnl
387AC_ARG_ENABLE([imager],
388[ --disable-imager disable support of e2image program],
389if test "$enableval" = "no"
390then
391 echo "Disabling e2image support"
392 IMAGER_CMT="#"
393else
394 IMAGER_CMT=
395 echo "Enabling e2image support"
396fi
397,
398echo "Enabling e2image support by default"
399IMAGER_CMT=
400)
401AC_SUBST(IMAGER_CMT)
402dnl
403dnl handle --enable-resizer
404dnl
405AC_ARG_ENABLE([resizer],
406[ --disable-resizer disable support of e2resize program],
407if test "$enableval" = "no"
408then
409 echo "Disabling e2resize support"
410 RESIZER_CMT="#"
411else
412 RESIZER_CMT=
413 echo "Enabling e2resize support"
414fi
415,
416echo "Enabling e2resize support by default"
417RESIZER_CMT=
418)
419AC_SUBST(RESIZER_CMT)
420dnl
Theodore Ts'o4d0f3e12001-01-11 15:48:50 +0000421dnl handle --enable-dynamic-e2fsck
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000422dnl
Theodore Ts'oa4d09611997-04-29 14:28:00 +0000423AC_ARG_ENABLE([dynamic-e2fsck],
424[ --enable-dynamic-e2fsck build e2fsck dynamically],
425if test "$enableval" = "no"
426then
427 E2FSCK_TYPE=static
428 echo "Building e2fsck statically"
429else
430 E2FSCK_TYPE=shared
431 echo "Building e2fsck dynamically"
432fi
433,
434E2FSCK_TYPE=static
435echo "Building e2fsck statically by default"
436)
437AC_SUBST(E2FSCK_TYPE)
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000438dnl
Theodore Ts'ofc6d9d51997-04-29 14:51:31 +0000439dnl See whether to install the `fsck' wrapper program (that calls e2fsck)
440dnl
441AC_ARG_ENABLE([fsck],
442[ --enable-fsck build fsck wrapper program],
443[if test "$enableval" = "no"
444then
445 FSCK_PROG='' FSCK_MAN=''
446 echo "Not building fsck wrapper"
447else
448 FSCK_PROG=fsck FSCK_MAN=fsck.8
449 echo "Building fsck wrapper"
450fi]
451,
452[case "$host_os" in
Theodore Ts'oe3632402004-05-04 19:39:54 -0400453 gnu*)
Theodore Ts'ofc6d9d51997-04-29 14:51:31 +0000454 FSCK_PROG='' FSCK_MAN=''
455 echo "Not building fsck wrapper by default"
456 ;;
457 *)
458 FSCK_PROG=fsck FSCK_MAN=fsck.8
459 echo "Building fsck wrapper by default"
460esac]
461)
462AC_SUBST(FSCK_PROG)
463AC_SUBST(FSCK_MAN)
464dnl
Theodore Ts'o5d407732004-09-18 14:53:14 -0400465dnl See whether to install the `e2initrd-helper' program
466dnl
467AC_ARG_ENABLE([e2initrd-helper],
468[ --enable-e2initrd-helper build e2initrd-helper program],
469[if test "$enableval" = "no"
470then
471 E2INITRD_PROG='' E2INITRD_MAN=''
472 echo "Not building e2initrd helper"
473else
474 E2INITRD_PROG=e2initrd_helper E2INITRD_MAN=e2initrd_helper.8
475 echo "Building e2initrd helper"
476fi]
477,
478E2INITRD_PROG=e2initrd_helper E2INITRD_MAN=e2initrd_helper.8
479echo "Building e2initrd helper by default"
480)
481AC_SUBST(E2INITRD_PROG)
482AC_SUBST(E2INITRD_MAN)
Karel Zak4db2f592006-03-08 14:17:28 -0500483dnl handle --enable-blkid-devmapper
484dnl
485AC_ARG_ENABLE([blkid-devmapper],
486[ --enable-blkid-devmapper build with device-mapper support],
487[if test "$enableval" = "no"
488then
489 echo "Disabling device-mapper support"
490 DEVMAPPER_REQ=''
491 DEVMAPPER_LIBS=''
492 STATIC_DEVMAPPER_LIBS=''
493else
494 AC_DEFINE(HAVE_DEVMAPPER)
495 echo "Enabling device-mapper support"
496
497 DEVMAPPER_REQ='libselinux libsepol'
498 DEVMAPPER_PC_LIBS='-ldevmapper'
499 DEVMAPPER_LIBS='-ldevmapper -lselinux -lsepol'
500 STATIC_DEVMAPPER_LIBS='/usr/lib/libdevmapper.a /usr/lib/libselinux.a /usr/lib/libsepol.a'
501
502fi]
503,
504echo "Disabling device-mapper support by default"
505)
506AC_SUBST(DEVMAPPER_REQ)
507AC_SUBST(DEVMAPPER_PC_LIBS)
508AC_SUBST(DEVMAPPER_LIBS)
509AC_SUBST(STATIC_DEVMAPPER_LIBS)
510dnl
Theodore Ts'o5d407732004-09-18 14:53:14 -0400511dnl
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000512dnl
513MAKEFILE_LIBRARY=$srcdir/lib/Makefile.library
514AC_SUBST_FILE(MAKEFILE_LIBRARY)
515dnl
Theodore Ts'ocdf186e2001-06-13 22:16:47 +0000516dnl Add internationalization support, using gettext.
517dnl
Theodore Ts'ob0cacab2004-11-30 19:00:19 -0500518GETTEXT_PACKAGE=e2fsprogs
Theodore Ts'ocdf186e2001-06-13 22:16:47 +0000519PACKAGE=e2fsprogs
520VERSION="$E2FSPROGS_VERSION"
Theodore Ts'ob0cacab2004-11-30 19:00:19 -0500521VERSION=0.14.1
Theodore Ts'ocdf186e2001-06-13 22:16:47 +0000522AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE")
523AC_DEFINE_UNQUOTED(VERSION, "$VERSION")
Theodore Ts'ob0cacab2004-11-30 19:00:19 -0500524AC_SUBST(GETTEXT_PACKAGE)
Theodore Ts'ocdf186e2001-06-13 22:16:47 +0000525AC_SUBST(PACKAGE)
526AC_SUBST(VERSION)
527
Theodore Ts'ocdf186e2001-06-13 22:16:47 +0000528AM_GNU_GETTEXT
529dnl
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000530dnl End of configuration options
531dnl
Theodore Ts'o74becf31997-04-26 14:37:06 +0000532AC_SUBST(BINARY_TYPE)
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000533AC_PROG_MAKE_SET
534AC_PATH_PROG(LN, ln, ln)
Theodore Ts'ofc6d9d51997-04-29 14:51:31 +0000535AC_PROG_LN_S
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000536AC_PATH_PROG(MV, mv, mv)
537AC_PATH_PROG(CP, cp, cp)
538AC_PATH_PROG(RM, rm, rm)
539AC_PATH_PROG(CHMOD, chmod, :)
Theodore Ts'o32237012005-01-17 19:13:39 -0500540AC_PROG_AWK
541AC_PROG_EGREP
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000542AC_PATH_PROG(SED, sed, sed)
Theodore Ts'o9d564f71999-07-03 20:25:58 +0000543AC_PATH_PROG(PERL, perl, perl)
Theodore Ts'o250f79f2001-05-19 22:02:22 +0000544AC_PATH_PROG(LDCONFIG, ldconfig, :)
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000545AC_CHECK_TOOL(AR, ar, ar)
546AC_CHECK_TOOL(RANLIB, ranlib, :)
547AC_CHECK_TOOL(STRIP, strip, :)
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000548AC_PROG_INSTALL
Theodore Ts'o6c133521999-07-03 20:37:03 +0000549# See if we need a separate native compiler.
550if test $cross_compiling = no; then
551 BUILD_CC="$CC"
552 AC_SUBST(BUILD_CC)
553else
554 AC_CHECK_PROGS(BUILD_CC, gcc cc)
555fi
Theodore Ts'o762c7c62005-04-06 14:44:16 -0400556AC_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/disklabel.h sys/ioctl.h sys/mkdev.h sys/prctl.h sys/queue.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_dl.h netinet/in.h)
Theodore Ts'oda76d6b2005-01-18 23:29:01 -0500557AC_CHECK_HEADERS(sys/disk.h sys/mount.h,,,
558[[
559#if HAVE_SYS_QUEUE_H
560#include <sys/queue.h>
561#endif
562]])
563AC_CHECK_HEADERS(net/if.h,,,
564[[
565#if HAVE_SYS_TYPES_H
566#include <sys/types.h>
567#endif
568#if HAVE_SYS_SOCKET
569#include <sys/socket.h>
570#endif
571]])
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000572AC_FUNC_VPRINTF
Theodore Ts'offf45482003-04-13 00:44:19 -0400573dnl Check to see if dirent has member d_reclen. On cygwin those d_reclen
574dnl is not decleared.
Theodore Ts'o6c65d252005-01-19 12:59:48 -0500575AC_CHECK_MEMBER(struct dirent.d_reclen,[AC_DEFINE(HAVE_RECLEN_DIRENT)],,
576 [#include <dirent.h>])
Theodore Ts'offf45482003-04-13 00:44:19 -0400577dnl Check to see if ssize_t was decleared
Theodore Ts'o6c65d252005-01-19 12:59:48 -0500578AC_CHECK_TYPE(ssize_t,[AC_DEFINE(HAVE_TYPE_SSIZE_T)],,
579 [#include <sys/types.h>])
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000580dnl
Theodore Ts'ob0b9c4d1997-10-20 23:36:30 +0000581dnl Check to see if llseek() is declared in unistd.h. On some libc's
582dnl it is, and on others it isn't..... Thank you glibc developers....
583dnl
Theodore Ts'o6c65d252005-01-19 12:59:48 -0500584AC_CHECK_DECL(llseek,[AC_DEFINE(HAVE_LLSEEK_PROTOTYPE)],,
585 [#include <unistd.h>])
Theodore Ts'ob0b9c4d1997-10-20 23:36:30 +0000586dnl
Theodore Ts'o6928adc2000-05-25 23:28:50 +0000587dnl Check to see if lseek64() is declared in unistd.h. Glibc's header files
588dnl are so convoluted that I can't tell whether it will always be defined,
589dnl and if it isn't defined while lseek64 is defined in the library,
590dnl disaster will strike.
591dnl
592dnl Warning! Use of --enable-gcc-wall may throw off this test.
593dnl
594dnl
Theodore Ts'o6c65d252005-01-19 12:59:48 -0500595AC_CHECK_DECL(lseek64,[AC_DEFINE(HAVE_LSEEK64_PROTOTYPE)],,
596 [#define _LARGEFILE_SOURCE
597 #define _LARGEFILE64_SOURCE
598 #include <unistd.h>])
Theodore Ts'o6928adc2000-05-25 23:28:50 +0000599dnl
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000600dnl Word sizes...
601dnl
602if test "$cross_compiling" = yes -a "$ac_cv_sizeof_long" = ""; then
603 # if cross-compiling, with no cached values, just assume something common.
604 ac_cv_sizeof_short=2
605 ac_cv_sizeof_int=4
606 ac_cv_sizeof_long=4
Theodore Ts'o6c133521999-07-03 20:37:03 +0000607 ac_cv_sizeof_long_long=8
608 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 +0000609fi
610AC_CHECK_SIZEOF(short)
611AC_CHECK_SIZEOF(int)
612AC_CHECK_SIZEOF(long)
Theodore Ts'ofc6d9d51997-04-29 14:51:31 +0000613AC_CHECK_SIZEOF(long long)
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000614SIZEOF_SHORT=$ac_cv_sizeof_short
615SIZEOF_INT=$ac_cv_sizeof_int
616SIZEOF_LONG=$ac_cv_sizeof_long
Theodore Ts'ofc6d9d51997-04-29 14:51:31 +0000617SIZEOF_LONG_LONG=$ac_cv_sizeof_long_long
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000618AC_SUBST(SIZEOF_SHORT)
619AC_SUBST(SIZEOF_INT)
620AC_SUBST(SIZEOF_LONG)
Theodore Ts'ofc6d9d51997-04-29 14:51:31 +0000621AC_SUBST(SIZEOF_LONG_LONG)
Theodore Ts'o877eb6d2001-06-11 06:54:13 +0000622AC_C_BIGENDIAN
Theodore Ts'o4ea7ea02006-04-09 08:41:55 -0400623/bin/sh $ac_aux_dir/parse-types.sh
624ASM_TYPES_HEADER=./asm_types.h
625AC_SUBST_FILE(ASM_TYPES_HEADER)
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000626dnl
Theodore Ts'o0c193f82003-08-01 14:26:23 -0400627dnl See if we have inttypes.h and if intptr_t is defined
628dnl
629AC_CHECK_HEADERS([inttypes.h])
Theodore Ts'od2ee56d2005-01-09 00:57:45 -0500630AC_CHECK_TYPES(intptr_t)
Theodore Ts'o0c193f82003-08-01 14:26:23 -0400631dnl
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000632dnl See if struct stat has a st_flags field, in which case we can get file
633dnl flags somewhat portably. Also check for the analogous setter, chflags().
634dnl
635AC_MSG_CHECKING(whether struct stat has a st_flags field)
636AC_CACHE_VAL(e2fsprogs_cv_struct_st_flags,
637 AC_TRY_COMPILE([#include <sys/stat.h>],
638 [struct stat stat; stat.st_flags = 0;],
639 [e2fsprogs_cv_struct_st_flags=yes],
640 [e2fsprogs_cv_struct_st_flags=no]))
641AC_MSG_RESULT($e2fsprogs_cv_struct_st_flags)
642if test "$e2fsprogs_cv_struct_st_flags" = yes; then
Theodore Ts'oc03bc4e1999-10-20 18:20:36 +0000643 AC_MSG_CHECKING(whether st_flags field is useful)
644 AC_CACHE_VAL(e2fsprogs_cv_struct_st_flags_immut,
645 AC_TRY_COMPILE([#include <sys/stat.h>],
646 [struct stat stat; stat.st_flags |= UF_IMMUTABLE;],
647 [e2fsprogs_cv_struct_st_flags_immut=yes],
648 [e2fsprogs_cv_struct_st_flags_immut=no]))
649 AC_MSG_RESULT($e2fsprogs_cv_struct_st_flags_immut)
650 if test "$e2fsprogs_cv_struct_st_flags_immut" = yes; then
651 AC_DEFINE(HAVE_STAT_FLAGS)
652 fi
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000653fi
Theodore Ts'o84ea6e72004-03-19 19:29:17 -0500654dnl
655dnl Check for the presence of SA_LEN
656dnl
Theodore Ts'o6c65d252005-01-19 12:59:48 -0500657AC_CHECK_MEMBER(struct sockaddr.sa_len,
658 AC_DEFINE_UNQUOTED(HAVE_SA_LEN,1,[Define if struct sockaddr contains sa_len]),,
659 [#include <sys/types.h>
660 #include <sys/socket.h>])
Theodore Ts'o84ea6e72004-03-19 19:29:17 -0500661dnl
Andreas Dilger9b7d8112005-07-09 22:06:59 -0500662AC_CHECK_FUNCS(chflags getrusage llseek lseek64 open64 fstat64 getmntinfo strtoull strcasecmp srandom fchown mallinfo fdatasync strnlen strptime sysconf pathconf posix_memalign memalign valloc __secure_getenv prctl)
Theodore Ts'ofc6d9d51997-04-29 14:51:31 +0000663dnl
Theodore Ts'ofc6d9d51997-04-29 14:51:31 +0000664dnl Check to see if -lsocket is required (solaris) to make something
665dnl that uses socket() to compile; this is needed for the UUID library
666dnl
667SOCKET_LIB=''
668AC_CHECK_LIB(socket, socket, [SOCKET_LIB=-lsocket])
669AC_SUBST(SOCKET_LIB)
670dnl
Theodore Ts'o3ae497e2003-03-16 06:26:25 -0500671dnl Check to see if libdl exists for the sake of dlopen
672dnl
673DLOPEN_LIB=''
674AC_CHECK_LIB(dl, dlopen,
675[DLOPEN_LIB=-ldl
676AC_DEFINE(HAVE_DLOPEN)])
677AC_SUBST(DLOPEN_LIB)
678dnl
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000679dnl See if optreset exists
680dnl
681AC_MSG_CHECKING(for optreset)
682AC_CACHE_VAL(ac_cv_have_optreset,
683[AC_EGREP_HEADER(optreset, unistd.h,
684 ac_cv_have_optreset=yes, ac_cv_have_optreset=no)])dnl
685AC_MSG_RESULT($ac_cv_have_optreset)
686if test $ac_cv_have_optreset = yes; then
687 AC_DEFINE(HAVE_OPTRESET)
688fi
689dnl
Theodore Ts'oe54635d2006-08-06 14:33:13 -0400690dnl Check for unified diff
691dnl
692AC_MSG_CHECKING(for unified diff option)
693if diff -u $0 $0 >& /dev/null ; then
694 UNI_DIFF_OPTS=-u
695else
696 UNI_DIFF_OPTS=-c
697fi
698AC_MSG_RESULT($UNI_DIFF_OPTS)
699AC_SUBST(UNI_DIFF_OPTS)
700dnl
Theodore Ts'o8f3f29d2000-02-11 05:04:44 +0000701dnl We use the EXT2 ioctls only under Linux
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000702dnl
Theodore Ts'o8f3f29d2000-02-11 05:04:44 +0000703case "$host_os" in
704linux*)
705 AC_DEFINE(HAVE_EXT2_IOCTLS)
706 ;;
707esac
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000708dnl
Theodore Ts'offf45482003-04-13 00:44:19 -0400709dnl OS-specific uncomment control
Theodore Ts'oe6f2bda2002-08-18 03:37:10 -0400710dnl
711LINUX_CMT="#"
Theodore Ts'offf45482003-04-13 00:44:19 -0400712CYGWIN_CMT="#"
713UNIX_CMT=
Theodore Ts'oe6f2bda2002-08-18 03:37:10 -0400714case "$host_os" in
715linux*)
716 LINUX_CMT=
717 ;;
Theodore Ts'offf45482003-04-13 00:44:19 -0400718cygwin)
719 CYGWIN_CMT=
720 UNIX_CMT="#"
Theodore Ts'offf45482003-04-13 00:44:19 -0400721 ;;
Theodore Ts'oe6f2bda2002-08-18 03:37:10 -0400722esac
723AC_SUBST(LINUX_CMT)
Theodore Ts'offf45482003-04-13 00:44:19 -0400724AC_SUBST(CYGWIN_CMT)
725AC_SUBST(UNIX_CMT)
Theodore Ts'oe6f2bda2002-08-18 03:37:10 -0400726dnl
Theodore Ts'o6c133521999-07-03 20:37:03 +0000727dnl Linux and Hurd places root files in the / by default
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000728dnl
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000729case "$host_os" in
Theodore Ts'o93636bd2003-07-12 02:45:05 -0400730linux* | gnu* | k*bsd*-gnu)
Theodore Ts'oa4b2d3c1998-04-03 16:12:25 +0000731 if test "$prefix" = NONE -a "$root_prefix" = NONE ; then
732 root_prefix="";
733 echo "On $host_os systems, root_prefix defaults to ''"
Theodore Ts'ofc6d9d51997-04-29 14:51:31 +0000734 fi
735 ;;
736esac
Theodore Ts'ofc6d9d51997-04-29 14:51:31 +0000737dnl
Theodore Ts'oa4b2d3c1998-04-03 16:12:25 +0000738dnl On Linux/hurd, force the prefix to be /usr
Theodore Ts'ofc6d9d51997-04-29 14:51:31 +0000739dnl
740case "$host_os" in
Theodore Ts'o93636bd2003-07-12 02:45:05 -0400741linux* | gnu* | k*bsd*-gnu)
Theodore Ts'ofc6d9d51997-04-29 14:51:31 +0000742 if test "$prefix" = NONE ; then
Theodore Ts'oa4b2d3c1998-04-03 16:12:25 +0000743 prefix="/usr";
744 echo "On $host_os systems, prefix defaults to /usr"
Theodore Ts'obff61a72002-05-21 22:21:38 -0400745 if test "$mandir" = '${prefix}/man' ; then
746 echo "...and mandir defaults to /usr/share/man"
747 mandir=/usr/share/man
748 fi
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000749 fi
750;;
751esac
Theodore Ts'oa4b2d3c1998-04-03 16:12:25 +0000752if test "$root_prefix" = NONE ; then
Theodore Ts'offe19911998-04-08 06:05:49 +0000753 if test "$prefix" = NONE ; then
Theodore Ts'oa4b2d3c1998-04-03 16:12:25 +0000754 root_prefix="$ac_default_prefix"
755 else
756 root_prefix="$prefix"
757 fi
Theodore Ts'ob5ffead2002-05-11 19:17:00 -0400758 root_bindir=$bindir
759 root_sbindir=$sbindir
760 root_libdir=$libdir
761 root_sysconfdir=$sysconfdir
762else
763 root_bindir='${root_prefix}/bin'
764 root_sbindir='${root_prefix}/sbin'
765 root_libdir='${root_prefix}/lib'
766 root_sysconfdir='${root_prefix}/etc'
Theodore Ts'oa4b2d3c1998-04-03 16:12:25 +0000767fi
768AC_SUBST(root_prefix)
Theodore Ts'ob5ffead2002-05-11 19:17:00 -0400769AC_SUBST(root_bindir)
770AC_SUBST(root_sbindir)
771AC_SUBST(root_libdir)
772AC_SUBST(root_sysconfdir)
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000773dnl
774dnl See if -static works.
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000775dnl
Theodore Ts'oae851481997-04-29 18:13:24 +0000776AC_MSG_CHECKING([whether linker accepts -static])
777AC_CACHE_VAL(ac_cv_e2fsprogs_use_static,
778[SAVE_LDFLAGS=$LDFLAGS; LDFLAGS="$LDFLAGS -static"
779AC_TRY_LINK([#include <stdio.h>],[fflush(stdout);],
780 ac_cv_e2fsprogs_use_static=yes, ac_cv_e2fsprogs_use_static=no)
781LDFLAGS=$SAVE_LDFLAGS])
Theodore Ts'odefde781999-01-04 07:39:19 +0000782dnl
783dnl Regardless of how the test turns out, Solaris doesn't handle -static
784dnl This is caused by the socket library requiring the nsl library, which
785dnl requires the -dl library, which only works for dynamically linked
786dnl programs. It basically means you can't have statically linked programs
787dnl which use the network under Solaris.
788dnl
789case "$host_os" in
790solaris2.*)
791 ac_cv_e2fsprogs_use_static=no
792;;
793esac
Theodore Ts'oae851481997-04-29 18:13:24 +0000794AC_MSG_RESULT($ac_cv_e2fsprogs_use_static)
Theodore Ts'o74becf31997-04-26 14:37:06 +0000795LDFLAG_STATIC=
Theodore Ts'oae851481997-04-29 18:13:24 +0000796if test $ac_cv_e2fsprogs_use_static = yes; then
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000797 LDFLAG_STATIC=-static
Theodore Ts'oae851481997-04-29 18:13:24 +0000798fi
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000799AC_SUBST(LDFLAG_STATIC)
800dnl
Theodore Ts'o07a0db12003-07-05 14:50:24 -0400801dnl Work around mysterious Darwin / GNU libintl problem
802dnl (__asm__ redirection doesn't work for some mysterious reason. Looks like
803dnl Apple hacked gcc somehow?)
804dnl
805case "$host_os" in
806darwin*)
807 echo "Using Apple Darwin / GNU libintl workaround"
808 AC_DEFINE(_INTL_REDIRECT_MACROS)
809 ;;
810esac
811dnl
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000812dnl Make the ss and et directories work correctly.
813dnl
814SS_DIR=`cd ${srcdir}/lib/ss; pwd`
815ET_DIR=`cd ${srcdir}/lib/et; pwd`
816AC_SUBST(SS_DIR)
817AC_SUBST(ET_DIR)
818dnl
819dnl Only try to run the test suite if we're not cross compiling.
820dnl
821if test "$cross_compiling" = yes ; then
822 DO_TEST_SUITE=
823else
824 DO_TEST_SUITE=check
825fi
826AC_SUBST(DO_TEST_SUITE)
827dnl
Theodore Ts'oc6f35b82003-05-17 16:29:27 -0400828dnl Only include the intl include files if we're building with them
829dnl
830INTL_FLAGS=
831if test "$USE_INCLUDED_LIBINTL" = "yes" ; then
832 INTL_FLAGS='-I$(top_builddir)/intl -I$(top_srcdir)/intl'
833fi
834AC_SUBST(INTL_FLAGS)
835dnl
Theodore Ts'odd947da2005-11-09 18:37:07 -0400836dnl Build CFLAGS
837dnl
838if test $cross_compiling = no; then
839 BUILD_CFLAGS="$CFLAGS"
840 BUILD_LDFLAGS="$LDFLAGS"
841else
842 BUILD_CFLAGS=
843 BUILD_LDFLAGS=
844fi
845AC_SUBST(BUILD_CFLAGS)
846AC_SUBST(BUILD_LDFLAGS)
847dnl
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000848dnl Make our output files, being sure that we create the some miscellaneous
849dnl directories
850dnl
851test -d lib || mkdir lib
852test -d include || mkdir include
853test -d include/linux || mkdir include/linux
Theodore Ts'odefde781999-01-04 07:39:19 +0000854test -d include/asm || mkdir include/asm
Theodore Ts'obff0cc92003-03-23 01:37:53 -0500855for i in MCONFIG Makefile e2fsprogs.spec \
856 util/Makefile util/subst.conf util/gen-tarball \
Theodore Ts'o4ea7ea02006-04-09 08:41:55 -0400857 lib/et/Makefile lib/ss/Makefile lib/e2p/Makefile \
858 lib/ext2fs/Makefile lib/ext2fs/ext2_types.h \
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 \
Theodore Ts'oe6441862005-01-26 12:59:25 -0500861 lib/ss/ss.pc lib/uuid/uuid.pc lib/et/com_err.pc \
862 lib/e2p/e2p.pc lib/blkid/blkid.pc lib/ext2fs/ext2fs.pc \
Theodore Ts'o921f4ad2004-11-19 17:25:27 -0500863 misc/Makefile ext2ed/Makefile e2fsck/Makefile \
Theodore Ts'o94ba8c72003-03-02 02:07:14 -0500864 debugfs/Makefile tests/Makefile tests/progs/Makefile \
865 resize/Makefile doc/Makefile intl/Makefile po/Makefile.in ; do
866 if test -d `dirname ${srcdir}/$i` ; then
867 outlist="$outlist $i"
868 fi
869done
870AC_OUTPUT($outlist)
Theodore Ts'oee683a12005-02-05 15:53:56 -0500871if test -f util/gen-tarball; then chmod +x util/gen-tarball; fi
872