blob: 5055ba38200f47f4cefe16149b5fa26d1f2c1845 [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'o19178752000-02-11 15:55:07 +0000139dnl handle --enable-compression
140dnl
141AC_ARG_ENABLE([compression],
142[ --enable-compression enable EXPERIMENTAL compression support],
143if test "$enableval" = "no"
144then
145 echo "Disabling compression support"
146else
147 AC_DEFINE(ENABLE_COMPRESSION)
148 echo "Enabling compression support"
149 echo "WARNING: Compression support is experimental"
150fi
151,
152echo "Disabling compression support by default"
153)
154dnl
Theodore Ts'o8fdc9982002-06-25 23:26:34 -0400155dnl handle --enable-htree
156dnl
157AC_ARG_ENABLE([htree],
158[ --enable-htree enable EXPERIMENTAL htree directory support],
159if test "$enableval" = "no"
160then
161 HTREE_CMT=#
162 echo "Disabling htree directory support"
163else
164 HTREE_CMT=
165 AC_DEFINE(ENABLE_HTREE)
166 echo "Enabling htree directory support"
Theodore Ts'o8fdc9982002-06-25 23:26:34 -0400167fi
168,
Theodore Ts'o559ca6c2002-08-18 03:48:55 -0400169HTREE_CMT=
170AC_DEFINE(ENABLE_HTREE)
171echo "Enabling htree directory support by default"
Theodore Ts'o8fdc9982002-06-25 23:26:34 -0400172)
173AC_SUBST(HTREE_CMT)
174dnl
175dnl handle --enable-clear-htree
176dnl
177AC_ARG_ENABLE([htree-clear],
178[ --enable-htree-clear clear htree because we don't trust e2fsck],
179if test "$enableval" = "no"
180then
181 HTREE_CLR_CMT=#
182 echo "Disabling htree clearing"
183else
184 HTREE_CLR_CMT=
185 AC_DEFINE(ENABLE_HTREE_CLEAR)
186 echo "Enabling htree clearing"
187fi
188,
189HTREE_CLR_CMT=#
190echo "Disabling htree clearing by default"
191)
192AC_SUBST(HTREE_CLR_CMT)
193dnl
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000194dnl handle --enable-elf-shlibs
195dnl
196AC_ARG_ENABLE([elf-shlibs],
Theodore Ts'oa4d09611997-04-29 14:28:00 +0000197[ --enable-elf-shlibs select ELF shared libraries],
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000198if test "$enableval" = "no"
199then
200 ELF_CMT=#
201 MAKEFILE_ELF=/dev/null
202 echo "Disabling ELF shared libraries"
203else
204 ELF_CMT=
205 MAKEFILE_ELF=$srcdir/lib/Makefile.elf-lib
Theodore Ts'of5955dd2000-10-25 02:38:39 +0000206 [case "$host_os" in
207 solaris2.*)
208 MAKEFILE_ELF=$srcdir/lib/Makefile.solaris-lib
209 ;;
210 esac]
Theodore Ts'o74becf31997-04-26 14:37:06 +0000211 BINARY_TYPE=elfbin
Theodore Ts'oa4d09611997-04-29 14:28:00 +0000212 LIB_EXT=.so
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000213 echo "Enabling ELF shared libraries"
214fi
215,
216MAKEFILE_ELF=/dev/null
217ELF_CMT=#
218echo "Disabling ELF shared libraries by default"
219)
220AC_SUBST(ELF_CMT)
221AC_SUBST_FILE(MAKEFILE_ELF)
222dnl
223dnl handle --enable-bsd-shlibs
224dnl
225AC_ARG_ENABLE([bsd-shlibs],
Theodore Ts'oa4d09611997-04-29 14:28:00 +0000226[ --enable-bsd-shlibs select BSD shared libraries],
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000227if test "$enableval" = "no"
228then
229 BSDLIB_CMT=#
230 MAKEFILE_BSDLIB=/dev/null
231 echo "Disabling BSD shared libraries"
232else
233 BSDLIB_CMT=
234 MAKEFILE_BSDLIB=$srcdir/lib/Makefile.bsd-lib
Theodore Ts'oa4d09611997-04-29 14:28:00 +0000235 LIB_EXT=.so
Theodore Ts'oe71d8732003-03-14 02:13:48 -0500236 [case "$host_os" in
Theodore Ts'oaa75ecc2003-03-17 10:01:22 -0500237 darwin*)
Theodore Ts'oe71d8732003-03-14 02:13:48 -0500238 MAKEFILE_BSDLIB=$srcdir/lib/Makefile.darwin-lib
239 LIB_EXT=.dylib
240 ;;
241 esac]
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000242 echo "Enabling BSD shared libraries"
243fi
244,
245MAKEFILE_BSDLIB=/dev/null
246BSDLIB_CMT=#
247echo "Disabling BSD shared libraries by default"
248)
249AC_SUBST(BSDLIB_CMT)
250AC_SUBST_FILE(MAKEFILE_BSDLIB)
251dnl
252dnl handle --enable-profile
253dnl
254AC_ARG_ENABLE([profile],
Theodore Ts'oa4d09611997-04-29 14:28:00 +0000255[ --enable-profile build profiling libraries],
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000256if test "$enableval" = "no"
257then
258 PROFILE_CMT=#
259 MAKEFILE_PROFILE=/dev/null
260 echo "Disabling profiling libraries"
261else
262 PROFILE_CMT=
263 MAKEFILE_PROFILE=$srcdir/lib/Makefile.profile
Theodore Ts'oa4d09611997-04-29 14:28:00 +0000264 PROFILED_LIB_EXT=_p.a
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000265 echo "Building profiling libraries"
266fi
267,
268PROFILE_CMT=#
269MAKEFILE_PROFILE=/dev/null
270echo "Disabling profiling libraries by default"
271)
272AC_SUBST(PROFILE_CMT)
273AC_SUBST_FILE(MAKEFILE_PROFILE)
274dnl
275dnl handle --enable-checker
276dnl
277AC_ARG_ENABLE([checker],
Theodore Ts'oa4d09611997-04-29 14:28:00 +0000278[ --enable-checker build checker libraries],
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000279if test "$enableval" = "no"
280then
281 CHECKER_CMT=#
282 MAKEFILE_CHECKER=/dev/null
283 echo "Disabling checker libraries"
284else
285 CHECKER_CMT=
286 MAKEFILE_CHECKER=$srcdir/lib/Makefile.checker
287 echo "Building checker libraries"
288fi
289,
290CHECKER_CMT=#
291MAKEFILE_CHECKER=/dev/null
292echo "Disabling checker libraries by default"
293)
294AC_SUBST(CHECKER_CMT)
295AC_SUBST_FILE(MAKEFILE_CHECKER)
296dnl
Theodore Ts'oa4d09611997-04-29 14:28:00 +0000297dnl Substitute library extensions
298dnl
299AC_SUBST(LIB_EXT)
300AC_SUBST(STATIC_LIB_EXT)
301AC_SUBST(PROFILED_LIB_EXT)
302dnl
Theodore Ts'o782bebf2002-11-08 18:46:45 -0500303dnl handle --enable-jbd-debug
Theodore Ts'ocdf186e2001-06-13 22:16:47 +0000304dnl
Theodore Ts'o782bebf2002-11-08 18:46:45 -0500305AC_ARG_ENABLE([jbd-debug],
306[ --enable-jbd-debug enable journal debugging],
Theodore Ts'ocdf186e2001-06-13 22:16:47 +0000307if test "$enableval" = "no"
308then
309 echo "Disabling journal debugging"
310else
Theodore Ts'o8cf93332001-12-16 02:23:36 -0500311 AC_DEFINE(CONFIG_JBD_DEBUG)
Theodore Ts'ocdf186e2001-06-13 22:16:47 +0000312 echo "Enabling journal debugging"
313fi
314,
315echo "Disabling journal debugging by default"
316)
317dnl
Theodore Ts'of0a22d02003-02-22 13:19:53 -0500318dnl handle --enable-blkid-debug
319dnl
320AC_ARG_ENABLE([blkid-debug],
Theodore Ts'od21ae6c2003-05-05 09:00:24 -0400321[ --enable-blkid-debug enable blkid debugging],
Theodore Ts'of0a22d02003-02-22 13:19:53 -0500322if test "$enableval" = "no"
323then
324 echo "Disabling blkid debugging"
325else
326 AC_DEFINE(CONFIG_BLKID_DEBUG)
327 echo "Enabling blkid debugging"
328fi
329,
330echo "Disabling blkid debugging by default"
331)
332dnl
Theodore Ts'o2a29f132003-05-05 12:08:47 -0400333dnl handle --enable-testio-debug
334dnl
335AC_ARG_ENABLE([testio-debug],
336[ --enable-testio-debug enable the use of the test I/O manager for debugging],
337if test "$enableval" = "no"
338then
339 echo "Disabling testio debugging"
340else
341 AC_DEFINE(CONFIG_TESTIO_DEBUG)
342 echo "Enabling testio debugging"
343fi
344,
345echo "Disabling testio debugging by default"
346)
347dnl
Theodore Ts'ocdf186e2001-06-13 22:16:47 +0000348dnl handle --enable-swapfs
349dnl
350AC_ARG_ENABLE([swapfs],
351[ --disable-swapfs disable support of legacy byte-swapped filesystems],
352if test "$enableval" = "no"
353then
Theodore Ts'ofeb44c62002-11-08 14:55:38 -0500354 SWAPFS_CMT=#
Theodore Ts'ocdf186e2001-06-13 22:16:47 +0000355 echo "Disabling swapfs support"
356else
Theodore Ts'ofeb44c62002-11-08 14:55:38 -0500357 SWAPFS_CMT=
Theodore Ts'ocdf186e2001-06-13 22:16:47 +0000358 AC_DEFINE(ENABLE_SWAPFS)
359 echo "Enabling swapfs support"
360fi
361,
Theodore Ts'ofeb44c62002-11-08 14:55:38 -0500362SWAPFS_CMT=
Theodore Ts'ocdf186e2001-06-13 22:16:47 +0000363echo "Enabling swapfs support by default"
364AC_DEFINE(ENABLE_SWAPFS)
365)
Theodore Ts'ofeb44c62002-11-08 14:55:38 -0500366AC_SUBST(SWAPFS_CMT)
Theodore Ts'ocdf186e2001-06-13 22:16:47 +0000367dnl
368dnl handle --enable-debugfs
369dnl
370AC_ARG_ENABLE([debugfs],
371[ --disable-debugfs disable support of debugfs program],
372if test "$enableval" = "no"
373then
374 echo "Disabling debugfs support"
375 DEBUGFS_CMT="#"
376else
377 DEBUGFS_CMT=
378 echo "Enabling debugfs support"
379fi
380,
381echo "Enabling debugfs support by default"
382DEBUGFS_CMT=
383)
384AC_SUBST(DEBUGFS_CMT)
385dnl
386dnl handle --enable-imager
387dnl
388AC_ARG_ENABLE([imager],
389[ --disable-imager disable support of e2image program],
390if test "$enableval" = "no"
391then
392 echo "Disabling e2image support"
393 IMAGER_CMT="#"
394else
395 IMAGER_CMT=
396 echo "Enabling e2image support"
397fi
398,
399echo "Enabling e2image support by default"
400IMAGER_CMT=
401)
402AC_SUBST(IMAGER_CMT)
403dnl
404dnl handle --enable-resizer
405dnl
406AC_ARG_ENABLE([resizer],
407[ --disable-resizer disable support of e2resize program],
408if test "$enableval" = "no"
409then
410 echo "Disabling e2resize support"
411 RESIZER_CMT="#"
412else
413 RESIZER_CMT=
414 echo "Enabling e2resize support"
415fi
416,
417echo "Enabling e2resize support by default"
418RESIZER_CMT=
419)
420AC_SUBST(RESIZER_CMT)
421dnl
Theodore Ts'o4d0f3e12001-01-11 15:48:50 +0000422dnl handle --enable-dynamic-e2fsck
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000423dnl
Theodore Ts'oa4d09611997-04-29 14:28:00 +0000424AC_ARG_ENABLE([dynamic-e2fsck],
425[ --enable-dynamic-e2fsck build e2fsck dynamically],
426if test "$enableval" = "no"
427then
428 E2FSCK_TYPE=static
429 echo "Building e2fsck statically"
430else
431 E2FSCK_TYPE=shared
432 echo "Building e2fsck dynamically"
433fi
434,
435E2FSCK_TYPE=static
436echo "Building e2fsck statically by default"
437)
438AC_SUBST(E2FSCK_TYPE)
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000439dnl
Theodore Ts'ofc6d9d51997-04-29 14:51:31 +0000440dnl See whether to install the `fsck' wrapper program (that calls e2fsck)
441dnl
442AC_ARG_ENABLE([fsck],
443[ --enable-fsck build fsck wrapper program],
444[if test "$enableval" = "no"
445then
446 FSCK_PROG='' FSCK_MAN=''
447 echo "Not building fsck wrapper"
448else
449 FSCK_PROG=fsck FSCK_MAN=fsck.8
450 echo "Building fsck wrapper"
451fi]
452,
453[case "$host_os" in
Theodore Ts'oe3632402004-05-04 19:39:54 -0400454 gnu*)
Theodore Ts'ofc6d9d51997-04-29 14:51:31 +0000455 FSCK_PROG='' FSCK_MAN=''
456 echo "Not building fsck wrapper by default"
457 ;;
458 *)
459 FSCK_PROG=fsck FSCK_MAN=fsck.8
460 echo "Building fsck wrapper by default"
461esac]
462)
463AC_SUBST(FSCK_PROG)
464AC_SUBST(FSCK_MAN)
465dnl
Theodore Ts'o5d407732004-09-18 14:53:14 -0400466dnl See whether to install the `e2initrd-helper' program
467dnl
468AC_ARG_ENABLE([e2initrd-helper],
469[ --enable-e2initrd-helper build e2initrd-helper program],
470[if test "$enableval" = "no"
471then
472 E2INITRD_PROG='' E2INITRD_MAN=''
473 echo "Not building e2initrd helper"
474else
475 E2INITRD_PROG=e2initrd_helper E2INITRD_MAN=e2initrd_helper.8
476 echo "Building e2initrd helper"
477fi]
478,
479E2INITRD_PROG=e2initrd_helper E2INITRD_MAN=e2initrd_helper.8
480echo "Building e2initrd helper by default"
481)
482AC_SUBST(E2INITRD_PROG)
483AC_SUBST(E2INITRD_MAN)
484dnl
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000485dnl
486MAKEFILE_LIBRARY=$srcdir/lib/Makefile.library
487AC_SUBST_FILE(MAKEFILE_LIBRARY)
488dnl
Theodore Ts'ofc6d9d51997-04-29 14:51:31 +0000489dnl
490AC_ARG_ENABLE([old-bitops],
491[ --enable-old-bitops Use old (non-standard but native) bitmask operations],
492if test "$enableval" = "no"
493then
494 echo "Using new (standard) bitmask operations"
495else
496 AC_DEFINE(EXT2_OLD_BITOPS)
497 echo "Using old (native) bitmask operations"
498
499fi
500,
501echo "Using standard bitmask operations by default"
502)
503dnl
Theodore Ts'ocdf186e2001-06-13 22:16:47 +0000504dnl Add internationalization support, using gettext.
505dnl
Theodore Ts'ob0cacab2004-11-30 19:00:19 -0500506GETTEXT_PACKAGE=e2fsprogs
Theodore Ts'ocdf186e2001-06-13 22:16:47 +0000507PACKAGE=e2fsprogs
508VERSION="$E2FSPROGS_VERSION"
Theodore Ts'ob0cacab2004-11-30 19:00:19 -0500509VERSION=0.14.1
Theodore Ts'ocdf186e2001-06-13 22:16:47 +0000510AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE")
511AC_DEFINE_UNQUOTED(VERSION, "$VERSION")
Theodore Ts'ob0cacab2004-11-30 19:00:19 -0500512AC_SUBST(GETTEXT_PACKAGE)
Theodore Ts'ocdf186e2001-06-13 22:16:47 +0000513AC_SUBST(PACKAGE)
514AC_SUBST(VERSION)
515
Theodore Ts'ocdf186e2001-06-13 22:16:47 +0000516AM_GNU_GETTEXT
517dnl
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000518dnl End of configuration options
519dnl
Theodore Ts'o74becf31997-04-26 14:37:06 +0000520AC_SUBST(BINARY_TYPE)
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000521AC_PROG_MAKE_SET
522AC_PATH_PROG(LN, ln, ln)
Theodore Ts'ofc6d9d51997-04-29 14:51:31 +0000523AC_PROG_LN_S
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000524AC_PATH_PROG(MV, mv, mv)
525AC_PATH_PROG(CP, cp, cp)
526AC_PATH_PROG(RM, rm, rm)
527AC_PATH_PROG(CHMOD, chmod, :)
Theodore Ts'o32237012005-01-17 19:13:39 -0500528AC_PROG_AWK
529AC_PROG_EGREP
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000530AC_PATH_PROG(SED, sed, sed)
Theodore Ts'o9d564f71999-07-03 20:25:58 +0000531AC_PATH_PROG(PERL, perl, perl)
Theodore Ts'o250f79f2001-05-19 22:02:22 +0000532AC_PATH_PROG(LDCONFIG, ldconfig, :)
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000533AC_CHECK_TOOL(AR, ar, ar)
534AC_CHECK_TOOL(RANLIB, ranlib, :)
535AC_CHECK_TOOL(STRIP, strip, :)
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000536AC_PROG_INSTALL
Theodore Ts'o6c133521999-07-03 20:37:03 +0000537# See if we need a separate native compiler.
538if test $cross_compiling = no; then
539 BUILD_CC="$CC"
540 AC_SUBST(BUILD_CC)
541else
542 AC_CHECK_PROGS(BUILD_CC, gcc cc)
543fi
Theodore Ts'oda76d6b2005-01-18 23:29:01 -0500544AC_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/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)
545AC_CHECK_HEADERS(sys/disk.h sys/mount.h,,,
546[[
547#if HAVE_SYS_QUEUE_H
548#include <sys/queue.h>
549#endif
550]])
551AC_CHECK_HEADERS(net/if.h,,,
552[[
553#if HAVE_SYS_TYPES_H
554#include <sys/types.h>
555#endif
556#if HAVE_SYS_SOCKET
557#include <sys/socket.h>
558#endif
559]])
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000560AC_FUNC_VPRINTF
Theodore Ts'offf45482003-04-13 00:44:19 -0400561dnl Check to see if dirent has member d_reclen. On cygwin those d_reclen
562dnl is not decleared.
563AC_MSG_CHECKING(whether d_reclen declared in dirent)
564AC_CACHE_VAL(e2fsprogs_cv_have_d_reclen_dirent,
565 AC_TRY_COMPILE(
566[#include <dirent.h>], [struct dirent de; de.d_reclen = 0; ],
567 [e2fsprogs_cv_have_d_reclen_dirent=yes],
568 [e2fsprogs_cv_have_d_reclen_dirent=no]))
569AC_MSG_RESULT($e2fsprogs_cv_have_d_reclen_dirent)
570if test "$e2fsprogs_cv_have_d_reclen_dirent" = yes; then
571 AC_DEFINE(HAVE_RECLEN_DIRENT)
572fi
573dnl Check to see if ssize_t was decleared
574AC_MSG_CHECKING(whether ssize_t declared)
575AC_CACHE_VAL(e2fsprogs_cv_have_ssize_t,
576 AC_TRY_COMPILE(
577[#include <sys/types.h>], [ssize_t a = 0; ],
578 [e2fsprogs_cv_have_ssize_t=yes],
579 [e2fsprogs_cv_have_ssize_t=no]))
580AC_MSG_RESULT($e2fsprogs_cv_have_ssize_t)
581if test "$e2fsprogs_cv_have_ssize_t" = yes; then
582 AC_DEFINE(HAVE_TYPE_SSIZE_T)
583fi
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000584dnl
Theodore Ts'ob0b9c4d1997-10-20 23:36:30 +0000585dnl Check to see if llseek() is declared in unistd.h. On some libc's
586dnl it is, and on others it isn't..... Thank you glibc developers....
587dnl
588dnl Warning! Use of --enable-gcc-wall may throw off this test.
589dnl
590dnl
591AC_MSG_CHECKING(whether llseek declared in unistd.h)
592AC_CACHE_VAL(e2fsprogs_cv_have_llseek_prototype,
593 AC_TRY_COMPILE(
594[#include <unistd.h>], [extern int llseek(int);],
595 [e2fsprogs_cv_have_llseek_prototype=no],
596 [e2fsprogs_cv_have_llseek_prototype=yes]))
597AC_MSG_RESULT($e2fsprogs_cv_have_llseek_prototype)
598if test "$e2fsprogs_cv_have_llseek_prototype" = yes; then
599 AC_DEFINE(HAVE_LLSEEK_PROTOTYPE)
600fi
601dnl
Theodore Ts'o6928adc2000-05-25 23:28:50 +0000602dnl Check to see if lseek64() is declared in unistd.h. Glibc's header files
603dnl are so convoluted that I can't tell whether it will always be defined,
604dnl and if it isn't defined while lseek64 is defined in the library,
605dnl disaster will strike.
606dnl
607dnl Warning! Use of --enable-gcc-wall may throw off this test.
608dnl
609dnl
610AC_MSG_CHECKING(whether lseek64 declared in unistd.h)
611AC_CACHE_VAL(e2fsprogs_cv_have_lseek64_prototype,
612 AC_TRY_COMPILE(
613[#define _LARGEFILE_SOURCE
614#define _LARGEFILE64_SOURCE
615#include <unistd.h>], [extern int lseek64(int);],
616 [e2fsprogs_cv_have_lseek64_prototype=no],
617 [e2fsprogs_cv_have_lseek64_prototype=yes]))
618AC_MSG_RESULT($e2fsprogs_cv_have_lseek64_prototype)
619if test "$e2fsprogs_cv_have_lseek64_prototype" = yes; then
620 AC_DEFINE(HAVE_LSEEK64_PROTOTYPE)
621fi
622dnl
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000623dnl Word sizes...
624dnl
625if test "$cross_compiling" = yes -a "$ac_cv_sizeof_long" = ""; then
626 # if cross-compiling, with no cached values, just assume something common.
627 ac_cv_sizeof_short=2
628 ac_cv_sizeof_int=4
629 ac_cv_sizeof_long=4
Theodore Ts'o6c133521999-07-03 20:37:03 +0000630 ac_cv_sizeof_long_long=8
631 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 +0000632fi
633AC_CHECK_SIZEOF(short)
634AC_CHECK_SIZEOF(int)
635AC_CHECK_SIZEOF(long)
Theodore Ts'ofc6d9d51997-04-29 14:51:31 +0000636AC_CHECK_SIZEOF(long long)
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000637SIZEOF_SHORT=$ac_cv_sizeof_short
638SIZEOF_INT=$ac_cv_sizeof_int
639SIZEOF_LONG=$ac_cv_sizeof_long
Theodore Ts'ofc6d9d51997-04-29 14:51:31 +0000640SIZEOF_LONG_LONG=$ac_cv_sizeof_long_long
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000641AC_SUBST(SIZEOF_SHORT)
642AC_SUBST(SIZEOF_INT)
643AC_SUBST(SIZEOF_LONG)
Theodore Ts'ofc6d9d51997-04-29 14:51:31 +0000644AC_SUBST(SIZEOF_LONG_LONG)
Theodore Ts'o877eb6d2001-06-11 06:54:13 +0000645AC_C_BIGENDIAN
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000646dnl
Theodore Ts'o0c193f82003-08-01 14:26:23 -0400647dnl See if we have inttypes.h and if intptr_t is defined
648dnl
649AC_CHECK_HEADERS([inttypes.h])
Theodore Ts'od2ee56d2005-01-09 00:57:45 -0500650AC_CHECK_TYPES(intptr_t)
Theodore Ts'o0c193f82003-08-01 14:26:23 -0400651dnl
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000652dnl See if struct stat has a st_flags field, in which case we can get file
653dnl flags somewhat portably. Also check for the analogous setter, chflags().
654dnl
655AC_MSG_CHECKING(whether struct stat has a st_flags field)
656AC_CACHE_VAL(e2fsprogs_cv_struct_st_flags,
657 AC_TRY_COMPILE([#include <sys/stat.h>],
658 [struct stat stat; stat.st_flags = 0;],
659 [e2fsprogs_cv_struct_st_flags=yes],
660 [e2fsprogs_cv_struct_st_flags=no]))
661AC_MSG_RESULT($e2fsprogs_cv_struct_st_flags)
662if test "$e2fsprogs_cv_struct_st_flags" = yes; then
Theodore Ts'oc03bc4e1999-10-20 18:20:36 +0000663 AC_MSG_CHECKING(whether st_flags field is useful)
664 AC_CACHE_VAL(e2fsprogs_cv_struct_st_flags_immut,
665 AC_TRY_COMPILE([#include <sys/stat.h>],
666 [struct stat stat; stat.st_flags |= UF_IMMUTABLE;],
667 [e2fsprogs_cv_struct_st_flags_immut=yes],
668 [e2fsprogs_cv_struct_st_flags_immut=no]))
669 AC_MSG_RESULT($e2fsprogs_cv_struct_st_flags_immut)
670 if test "$e2fsprogs_cv_struct_st_flags_immut" = yes; then
671 AC_DEFINE(HAVE_STAT_FLAGS)
672 fi
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000673fi
Theodore Ts'o84ea6e72004-03-19 19:29:17 -0500674dnl
675dnl Check for the presence of SA_LEN
676dnl
677AC_MSG_CHECKING(whether struct sockaddr contains sa_len)
678AC_CACHE_VAL(e2fsprogs_cv_sockaddr_sa_len,
679[AC_TRY_COMPILE([#include <sys/types.h>
680#include <sys/socket.h>
681],
682[struct sockaddr sa;
683sa.sa_len;],
684e2fsprogs_cv_sockaddr_sa_len=yes,e2fsprogs_cv_sockaddr_sa_len=no)])
685AC_MSG_RESULT([$]e2fsprogs_cv_sockaddr_sa_len)
686if test $e2fsprogs_cv_sockaddr_sa_len = yes; then
687 AC_DEFINE_UNQUOTED(HAVE_SA_LEN,1,[Define if struct sockaddr contains sa_len])
688fi
689dnl
Theodore Ts'o1c29b092003-07-12 16:01:45 -0400690AC_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 +0000691dnl
Theodore Ts'ofc6d9d51997-04-29 14:51:31 +0000692dnl Check to see if -lsocket is required (solaris) to make something
693dnl that uses socket() to compile; this is needed for the UUID library
694dnl
695SOCKET_LIB=''
696AC_CHECK_LIB(socket, socket, [SOCKET_LIB=-lsocket])
697AC_SUBST(SOCKET_LIB)
698dnl
Theodore Ts'o3ae497e2003-03-16 06:26:25 -0500699dnl Check to see if libdl exists for the sake of dlopen
700dnl
701DLOPEN_LIB=''
702AC_CHECK_LIB(dl, dlopen,
703[DLOPEN_LIB=-ldl
704AC_DEFINE(HAVE_DLOPEN)])
705AC_SUBST(DLOPEN_LIB)
706dnl
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000707dnl See if optreset exists
708dnl
709AC_MSG_CHECKING(for optreset)
710AC_CACHE_VAL(ac_cv_have_optreset,
711[AC_EGREP_HEADER(optreset, unistd.h,
712 ac_cv_have_optreset=yes, ac_cv_have_optreset=no)])dnl
713AC_MSG_RESULT($ac_cv_have_optreset)
714if test $ac_cv_have_optreset = yes; then
715 AC_DEFINE(HAVE_OPTRESET)
716fi
717dnl
Theodore Ts'o8f3f29d2000-02-11 05:04:44 +0000718dnl We use the EXT2 ioctls only under Linux
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000719dnl
Theodore Ts'o8f3f29d2000-02-11 05:04:44 +0000720case "$host_os" in
721linux*)
722 AC_DEFINE(HAVE_EXT2_IOCTLS)
723 ;;
724esac
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000725dnl
Theodore Ts'offf45482003-04-13 00:44:19 -0400726dnl OS-specific uncomment control
Theodore Ts'oe6f2bda2002-08-18 03:37:10 -0400727dnl
728LINUX_CMT="#"
Theodore Ts'offf45482003-04-13 00:44:19 -0400729CYGWIN_CMT="#"
730UNIX_CMT=
Theodore Ts'oe6f2bda2002-08-18 03:37:10 -0400731case "$host_os" in
732linux*)
733 LINUX_CMT=
734 ;;
Theodore Ts'offf45482003-04-13 00:44:19 -0400735cygwin)
736 CYGWIN_CMT=
737 UNIX_CMT="#"
Theodore Ts'offf45482003-04-13 00:44:19 -0400738 ;;
Theodore Ts'oe6f2bda2002-08-18 03:37:10 -0400739esac
740AC_SUBST(LINUX_CMT)
Theodore Ts'offf45482003-04-13 00:44:19 -0400741AC_SUBST(CYGWIN_CMT)
742AC_SUBST(UNIX_CMT)
Theodore Ts'oe6f2bda2002-08-18 03:37:10 -0400743dnl
Theodore Ts'o6c133521999-07-03 20:37:03 +0000744dnl Linux and Hurd places root files in the / by default
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000745dnl
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000746case "$host_os" in
Theodore Ts'o93636bd2003-07-12 02:45:05 -0400747linux* | gnu* | k*bsd*-gnu)
Theodore Ts'oa4b2d3c1998-04-03 16:12:25 +0000748 if test "$prefix" = NONE -a "$root_prefix" = NONE ; then
749 root_prefix="";
750 echo "On $host_os systems, root_prefix defaults to ''"
Theodore Ts'ofc6d9d51997-04-29 14:51:31 +0000751 fi
752 ;;
753esac
Theodore Ts'ofc6d9d51997-04-29 14:51:31 +0000754dnl
Theodore Ts'oa4b2d3c1998-04-03 16:12:25 +0000755dnl On Linux/hurd, force the prefix to be /usr
Theodore Ts'ofc6d9d51997-04-29 14:51:31 +0000756dnl
757case "$host_os" in
Theodore Ts'o93636bd2003-07-12 02:45:05 -0400758linux* | gnu* | k*bsd*-gnu)
Theodore Ts'ofc6d9d51997-04-29 14:51:31 +0000759 if test "$prefix" = NONE ; then
Theodore Ts'oa4b2d3c1998-04-03 16:12:25 +0000760 prefix="/usr";
761 echo "On $host_os systems, prefix defaults to /usr"
Theodore Ts'obff61a72002-05-21 22:21:38 -0400762 if test "$mandir" = '${prefix}/man' ; then
763 echo "...and mandir defaults to /usr/share/man"
764 mandir=/usr/share/man
765 fi
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000766 fi
767;;
768esac
Theodore Ts'oa4b2d3c1998-04-03 16:12:25 +0000769if test "$root_prefix" = NONE ; then
Theodore Ts'offe19911998-04-08 06:05:49 +0000770 if test "$prefix" = NONE ; then
Theodore Ts'oa4b2d3c1998-04-03 16:12:25 +0000771 root_prefix="$ac_default_prefix"
772 else
773 root_prefix="$prefix"
774 fi
Theodore Ts'ob5ffead2002-05-11 19:17:00 -0400775 root_bindir=$bindir
776 root_sbindir=$sbindir
777 root_libdir=$libdir
778 root_sysconfdir=$sysconfdir
779else
780 root_bindir='${root_prefix}/bin'
781 root_sbindir='${root_prefix}/sbin'
782 root_libdir='${root_prefix}/lib'
783 root_sysconfdir='${root_prefix}/etc'
Theodore Ts'oa4b2d3c1998-04-03 16:12:25 +0000784fi
785AC_SUBST(root_prefix)
Theodore Ts'ob5ffead2002-05-11 19:17:00 -0400786AC_SUBST(root_bindir)
787AC_SUBST(root_sbindir)
788AC_SUBST(root_libdir)
789AC_SUBST(root_sysconfdir)
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000790dnl
791dnl See if -static works.
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000792dnl
Theodore Ts'oae851481997-04-29 18:13:24 +0000793AC_MSG_CHECKING([whether linker accepts -static])
794AC_CACHE_VAL(ac_cv_e2fsprogs_use_static,
795[SAVE_LDFLAGS=$LDFLAGS; LDFLAGS="$LDFLAGS -static"
796AC_TRY_LINK([#include <stdio.h>],[fflush(stdout);],
797 ac_cv_e2fsprogs_use_static=yes, ac_cv_e2fsprogs_use_static=no)
798LDFLAGS=$SAVE_LDFLAGS])
Theodore Ts'odefde781999-01-04 07:39:19 +0000799dnl
800dnl Regardless of how the test turns out, Solaris doesn't handle -static
801dnl This is caused by the socket library requiring the nsl library, which
802dnl requires the -dl library, which only works for dynamically linked
803dnl programs. It basically means you can't have statically linked programs
804dnl which use the network under Solaris.
805dnl
806case "$host_os" in
807solaris2.*)
808 ac_cv_e2fsprogs_use_static=no
809;;
810esac
Theodore Ts'oae851481997-04-29 18:13:24 +0000811AC_MSG_RESULT($ac_cv_e2fsprogs_use_static)
Theodore Ts'o74becf31997-04-26 14:37:06 +0000812LDFLAG_STATIC=
Theodore Ts'oae851481997-04-29 18:13:24 +0000813if test $ac_cv_e2fsprogs_use_static = yes; then
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000814 LDFLAG_STATIC=-static
Theodore Ts'oae851481997-04-29 18:13:24 +0000815fi
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000816AC_SUBST(LDFLAG_STATIC)
817dnl
Theodore Ts'o07a0db12003-07-05 14:50:24 -0400818dnl Work around mysterious Darwin / GNU libintl problem
819dnl (__asm__ redirection doesn't work for some mysterious reason. Looks like
820dnl Apple hacked gcc somehow?)
821dnl
822case "$host_os" in
823darwin*)
824 echo "Using Apple Darwin / GNU libintl workaround"
825 AC_DEFINE(_INTL_REDIRECT_MACROS)
826 ;;
827esac
828dnl
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000829dnl Make the ss and et directories work correctly.
830dnl
831SS_DIR=`cd ${srcdir}/lib/ss; pwd`
832ET_DIR=`cd ${srcdir}/lib/et; pwd`
833AC_SUBST(SS_DIR)
834AC_SUBST(ET_DIR)
835dnl
836dnl Only try to run the test suite if we're not cross compiling.
837dnl
838if test "$cross_compiling" = yes ; then
839 DO_TEST_SUITE=
840else
841 DO_TEST_SUITE=check
842fi
843AC_SUBST(DO_TEST_SUITE)
844dnl
Theodore Ts'oc6f35b82003-05-17 16:29:27 -0400845dnl Only include the intl include files if we're building with them
846dnl
847INTL_FLAGS=
848if test "$USE_INCLUDED_LIBINTL" = "yes" ; then
849 INTL_FLAGS='-I$(top_builddir)/intl -I$(top_srcdir)/intl'
850fi
851AC_SUBST(INTL_FLAGS)
852dnl
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000853dnl Make our output files, being sure that we create the some miscellaneous
854dnl directories
855dnl
856test -d lib || mkdir lib
857test -d include || mkdir include
858test -d include/linux || mkdir include/linux
Theodore Ts'odefde781999-01-04 07:39:19 +0000859test -d include/asm || mkdir include/asm
Theodore Ts'obff0cc92003-03-23 01:37:53 -0500860for i in MCONFIG Makefile e2fsprogs.spec \
861 util/Makefile util/subst.conf util/gen-tarball \
862 lib/et/Makefile lib/ss/Makefile lib/ext2fs/Makefile lib/e2p/Makefile \
Theodore Ts'o94ba8c72003-03-02 02:07:14 -0500863 lib/uuid/Makefile lib/uuid/uuid_types.h \
864 lib/blkid/Makefile lib/blkid/blkid_types.h \
Theodore Ts'o921f4ad2004-11-19 17:25:27 -0500865 misc/Makefile ext2ed/Makefile e2fsck/Makefile \
Theodore Ts'o94ba8c72003-03-02 02:07:14 -0500866 debugfs/Makefile tests/Makefile tests/progs/Makefile \
867 resize/Makefile doc/Makefile intl/Makefile po/Makefile.in ; do
868 if test -d `dirname ${srcdir}/$i` ; then
869 outlist="$outlist $i"
870 fi
871done
872AC_OUTPUT($outlist)