3 AC_CONFIG_AUX_DIR(config)
8 dnl This is to figure out the version number and the date....
10 E2FSPROGS_VERSION=`grep E2FSPROGS_VERSION ${srcdir}/version.h \
11 | awk '{print $3}' | tr \" " " | awk '{print $1}'`
12 DATE=`grep E2FSPROGS_DATE ${srcdir}/version.h | awk '{print $3}' \
14 E2FSPROGS_DAY=`echo $DATE | awk -F- '{print $1}'`
15 MONTH=`echo $DATE | awk -F- '{print $2}'`
16 YEAR=`echo $DATE | awk -F- '{print $3}'`
18 if expr $YEAR ">" 1900 > /dev/null ; then
20 elif expr $YEAR ">" 90 >/dev/null ; then
21 E2FSPROGS_YEAR=19$YEAR
23 E2FSPROGS_YEAR=20$YEAR
27 Jan) MONTH_NUM=01; E2FSPROGS_MONTH="January" ;;
28 Feb) MONTH_NUM=02; E2FSPROGS_MONTH="February" ;;
29 Mar) MONTH_NUM=03; E2FSPROGS_MONTH="March" ;;
30 Apr) MONTH_NUM=04; E2FSPROGS_MONTH="April" ;;
31 May) MONTH_NUM=05; E2FSPROGS_MONTH="May" ;;
32 Jun) MONTH_NUM=06; E2FSPROGS_MONTH="June" ;;
33 Jul) MONTH_NUM=07; E2FSPROGS_MONTH="July" ;;
34 Aug) MONTH_NUM=08; E2FSPROGS_MONTH="August" ;;
35 Sep) MONTH_NUM=09; E2FSPROGS_MONTH="September" ;;
36 Oct) MONTH_NUM=10; E2FSPROGS_MONTH="October" ;;
37 Nov) MONTH_NUM=11; E2FSPROGS_MONTH="November" ;;
38 Dec) MONTH_NUM=12; E2FSPROGS_MONTH="December" ;;
39 *) AC_MSG_WARN([Unknown month $MONTH??]) ;;
42 base_ver=`echo $E2FSPROGS_VERSION | \
43 sed -e 's/-WIP//' -e 's/pre-//' -e 's/-PLUS//'`
45 date_spec=${E2FSPROGS_YEAR}.${MONTH_NUM}.${E2FSPROGS_DAY}
47 case $E2FSPROGS_VERSION in
49 E2FSPROGS_PKGVER="$base_ver~WIP-$E2FSPROGS_YEAR-$MONTH_NUM-$E2FSPROGS_DAY"
52 E2FSPROGS_PKGVER="$base_ver"
56 unset DATE MONTH YEAR base_ver pre_vers date_spec
57 AC_MSG_RESULT([Generating configuration file for e2fsprogs version $E2FSPROGS_VERSION])
58 AC_MSG_RESULT([Release date is ${E2FSPROGS_MONTH}, ${E2FSPROGS_YEAR}])
59 AC_SUBST(E2FSPROGS_YEAR)
60 AC_SUBST(E2FSPROGS_MONTH)
61 AC_SUBST(E2FSPROGS_DAY)
62 AC_SUBST(E2FSPROGS_VERSION)
63 AC_SUBST(E2FSPROGS_PKGVER)
66 dnl Check to see if libdl exists for the sake of dlopen
69 AC_CHECK_LIB(dl, dlopen,
71 AC_DEFINE(HAVE_DLOPEN)])
77 AC_ARG_WITH([diet-libc],
78 [ --with-diet-libc use diet libc],
79 CC="diet cc -nostdinc"
81 AC_MSG_RESULT(CC=$CC))dnl
84 AC_HELP_STRING([--with-cc],[no longer supported, use CC= instead]),
85 AC_MSG_ERROR([--with-cc no longer supported; use CC= instead]))
88 AC_HELP_STRING([--with-ccopts],[no longer supported, use CFLAGS= instead]),
89 AC_MSG_ERROR([--with-ccopts no longer supported; use CFLAGS= instead]))
92 AC_HELP_STRING([--with-ldopts],[no longer supported, use LDFLAGS= instead]),
93 AC_MSG_ERROR([--with-ldopts no longer supported; use LDFLAGS= instead]))
96 if test "$GCC" = yes; then
102 dnl On systems without linux header files, we add an extra include directory
103 dnl that holds enough to fake it (hopefully). Note that the $(top_srcdir) here
104 dnl is quoted so that it gets expanded by make, not by configure.
106 AC_CHECK_HEADER(linux/fs.h, [linux_headers=yes], [linux_headers=no])
107 if test "$linux_headers" != yes; then
108 LINUX_INCLUDE='-I$(top_builddir)/include'
110 AC_SUBST(LINUX_INCLUDE)
112 dnl Alpha computers use fast and imprecise floating point code that may
113 dnl miss exceptions by default. Force sane options if we're using GCC.
114 AC_MSG_CHECKING(for additional special compiler flags)
118 alpha) addcflags="-mieee" ;;
121 if test "x$addcflags" != x
123 AC_MSG_RESULT($addcflags)
124 CFLAGS="$addcflags $CFLAGS"
126 AC_MSG_RESULT([[(none)]])
129 dnl Set default values for library extentions. Will be dealt with after
130 dnl parsing configuration opions, which may modify these
136 dnl Allow separate `root_prefix' to be specified
138 AC_ARG_WITH([root-prefix],
139 [ --with-root-prefix=PREFIX override prefix variable for files to be placed in the root],
140 root_prefix=$withval,
143 dnl handle --enable-maintainer-mode
145 AC_ARG_ENABLE([maintainer-mode],
146 [ --enable-maintainer-mode enable makefile rules useful for maintainers],
147 if test "$enableval" = "no"
150 AC_MSG_RESULT([Disabling maintainer mode])
153 AC_MSG_RESULT([Enabling maintainer mode])
157 AC_MSG_RESULT([Disabling maintainer mode by default])
159 AC_SUBST(MAINTAINER_CMT)
161 dnl handle --enable-symlink-install
163 AC_ARG_ENABLE([symlink-install],
164 [ --enable-symlink-install use symlinks when installing instead of hard links],
165 if test "$enableval" = "no"
167 LINK_INSTALL_FLAGS=-f
168 AC_MSG_RESULT([Disabling symlinks for install])
170 LINK_INSTALL_FLAGS=-sf
171 AC_MSG_RESULT([Enabling symlinks for install])
174 LINK_INSTALL_FLAGS=-f
175 AC_MSG_RESULT([Disabling symlinks for install])
177 AC_SUBST(LINK_INSTALL_FLAGS)
179 dnl handle --enable-symlink-build
181 AC_ARG_ENABLE([symlink-build],
182 [ --enable-symlink-build use symlinks while building instead of hard links],
183 if test "$enableval" = "no"
186 AC_MSG_RESULT([Disabling symlinks for build])
189 AC_MSG_RESULT([Enabling symlinks for build])
193 AC_MSG_RESULT([Disabling symlinks for build])
195 AC_SUBST(LINK_BUILD_FLAGS)
197 dnl handle --enable-verbose-makecmds
199 AC_ARG_ENABLE([verbose-makecmds],
200 [ --enable-verbose-makecmds enable verbose make command output],
201 if test "$enableval" = "no"
203 AC_MSG_RESULT([Disabling verbose make commands])
207 AC_MSG_RESULT([Enabling verbose make commands])
212 AC_MSG_RESULT([Disabling verbose make commands])
219 dnl handle --enable-compression
221 AC_ARG_ENABLE([compression],
222 [ --enable-compression enable EXPERIMENTAL compression support],
223 if test "$enableval" = "no"
225 AC_MSG_RESULT([Disabling compression support])
227 AC_DEFINE(ENABLE_COMPRESSION)
228 AC_MSG_RESULT([Enabling compression support])
229 AC_MSG_WARN([Compression support is experimental])
232 AC_MSG_RESULT([Disabling compression support by default])
235 dnl handle --enable-htree
237 AC_ARG_ENABLE([htree],
238 [ --enable-htree enable EXPERIMENTAL htree directory support],
239 if test "$enableval" = "no"
242 AC_MSG_RESULT([Disabling htree directory support])
245 AC_DEFINE(ENABLE_HTREE)
246 AC_MSG_RESULT([Enabling htree directory support])
250 AC_DEFINE(ENABLE_HTREE)
251 AC_MSG_RESULT([Enabling htree directory support by default])
255 dnl This needs to be before all of the --enable-*-shlibs options
257 E2_PKG_CONFIG_STATIC=--static
261 dnl handle --enable-elf-shlibs
263 AC_ARG_ENABLE([elf-shlibs],
264 [ --enable-elf-shlibs select ELF shared libraries],
265 if test "$enableval" = "no"
268 MAKEFILE_ELF=/dev/null
269 AC_MSG_RESULT([Disabling ELF shared libraries])
271 E2_PKG_CONFIG_STATIC=
273 MAKEFILE_ELF=$srcdir/lib/Makefile.elf-lib
276 MAKEFILE_ELF=$srcdir/lib/Makefile.solaris-lib
282 LDFLAG_DYNAMIC=['-Wl,-rpath-link,$(top_builddir)/lib']
283 AC_MSG_RESULT([Enabling ELF shared libraries])
286 MAKEFILE_ELF=/dev/null
288 AC_MSG_RESULT([Disabling ELF shared libraries by default])
291 AC_SUBST_FILE(MAKEFILE_ELF)
293 dnl handle --enable-bsd-shlibs
295 AC_ARG_ENABLE([bsd-shlibs],
296 [ --enable-bsd-shlibs select BSD shared libraries],
297 if test "$enableval" = "no"
300 MAKEFILE_BSDLIB=/dev/null
301 AC_MSG_RESULT([Disabling BSD shared libraries])
303 E2_PKG_CONFIG_STATIC=
305 MAKEFILE_BSDLIB=$srcdir/lib/Makefile.bsd-lib
309 MAKEFILE_BSDLIB=$srcdir/lib/Makefile.darwin-lib
313 AC_MSG_RESULT([Enabling BSD shared libraries])
316 MAKEFILE_BSDLIB=/dev/null
318 AC_MSG_RESULT([Disabling BSD shared libraries by default])
321 AC_SUBST_FILE(MAKEFILE_BSDLIB)
323 dnl handle --enable-profile
325 AC_ARG_ENABLE([profile],
326 [ --enable-profile build profiling libraries],
327 if test "$enableval" = "no"
330 MAKEFILE_PROFILE=/dev/null
331 AC_MSG_RESULT([Disabling profiling libraries])
334 MAKEFILE_PROFILE=$srcdir/lib/Makefile.profile
335 PROFILED_LIB_EXT=_p.a
336 AC_MSG_RESULT([Building profiling libraries])
340 MAKEFILE_PROFILE=/dev/null
341 AC_MSG_RESULT([Disabling profiling libraries by default])
343 AC_SUBST(PROFILE_CMT)
344 AC_SUBST_FILE(MAKEFILE_PROFILE)
346 dnl handle --enable-checker
348 AC_ARG_ENABLE([checker],
349 [ --enable-checker build checker libraries],
350 if test "$enableval" = "no"
353 MAKEFILE_CHECKER=/dev/null
354 AC_MSG_RESULT([Disabling checker libraries])
357 MAKEFILE_CHECKER=$srcdir/lib/Makefile.checker
358 AC_MSG_RESULT([Building checker libraries])
362 MAKEFILE_CHECKER=/dev/null
363 AC_MSG_RESULT([Disabling checker libraries by default])
365 AC_SUBST(CHECKER_CMT)
366 AC_SUBST_FILE(MAKEFILE_CHECKER)
368 dnl Substitute library extensions
371 AC_SUBST(STATIC_LIB_EXT)
372 AC_SUBST(PROFILED_LIB_EXT)
373 AC_SUBST(LDFLAG_DYNAMIC)
374 AC_SUBST(PRIVATE_LIBS_CMT)
376 dnl handle --enable-jbd-debug
378 AC_ARG_ENABLE([jbd-debug],
379 [ --enable-jbd-debug enable journal debugging],
380 if test "$enableval" = "no"
382 AC_MSG_RESULT([Disabling journal debugging])
384 AC_DEFINE(CONFIG_JBD_DEBUG)
385 AC_MSG_RESULT([Enabling journal debugging])
388 AC_MSG_RESULT([Disabling journal debugging by default])
391 dnl handle --enable-blkid-debug
393 AC_ARG_ENABLE([blkid-debug],
394 [ --enable-blkid-debug enable blkid debugging],
395 if test "$enableval" = "no"
397 AC_MSG_RESULT([Disabling blkid debugging])
399 AC_DEFINE(CONFIG_BLKID_DEBUG)
400 AC_MSG_RESULT([Enabling blkid debugging])
403 AC_MSG_RESULT([Disabling blkid debugging by default])
406 dnl handle --enable-testio-debug
408 AC_ARG_ENABLE([testio-debug],
409 [ --disable-testio-debug disable the use of the test I/O manager for debugging],
410 if test "$enableval" = "no"
412 AC_MSG_RESULT([Disabling testio debugging])
416 AC_DEFINE(CONFIG_TESTIO_DEBUG)
417 AC_MSG_RESULT([Enabling testio debugging])
420 AC_MSG_RESULT([Enabling testio debugging by default])
421 AC_DEFINE(CONFIG_TESTIO_DEBUG)
424 AC_SUBST(TEST_IO_CMT)
426 dnl handle --disable-libuuid
436 AC_ARG_ENABLE([libuuid],
437 [ --disable-libuuid do not build private uuid library],
438 if test "$enableval" = "no"
440 if test -z "$PKG_CONFIG"; then
441 AC_MSG_ERROR([pkg-config not installed; please install it.])
444 AC_CHECK_LIB(uuid, uuid_generate,
445 [LIBUUID=`$PKG_CONFIG --libs uuid`;
446 STATIC_LIBUUID=`$PKG_CONFIG --static --libs uuid`],
447 [AC_MSG_ERROR([external uuid library not found])],
450 AC_MSG_RESULT([Disabling private uuid library])
452 LIBUUID='$(LIB)/libuuid'$LIB_EXT
454 STATIC_LIBUUID='$(LIB)/libuuid'$STATIC_LIB_EXT
455 DEPSTATIC_LIBUUID=$STATIC_LIBUUID
456 PROFILED_LIBUUID='$(LIB)/libuuid'$PROFILED_LIB_EXT
457 DEPPROFILED_LIBUUID=$PROFILED_LIBUUID
458 AC_MSG_RESULT([Enabling private uuid library])
461 LIBUUID='$(LIB)/libuuid'$LIB_EXT
463 STATIC_LIBUUID='$(LIB)/libuuid'$STATIC_LIB_EXT
464 DEPSTATIC_LIBUUID=$STATIC_LIBUUID
465 PROFILED_LIBUUID='$(LIB)/libuuid'$PROFILED_LIB_EXT
466 DEPPROFILED_LIBUUID=$PROFILED_LIBUUID
467 AC_MSG_RESULT([Enabling private uuid library by default])
471 AC_SUBST(STATIC_LIBUUID)
472 AC_SUBST(DEPSTATIC_LIBUUID)
473 AC_SUBST(PROFILED_LIBUUID)
474 AC_SUBST(DEPPROFILED_LIBUUID)
477 dnl handle --disable-libblkid
485 DEPPROFILED_LIBBLKID=
487 AC_ARG_ENABLE([libblkid],
488 [ --disable-libblkid do not build private blkid library],
489 if test "$enableval" = "no"
491 if test -z "$PKG_CONFIG"; then
492 AC_MSG_ERROR([pkg-config not installed; please install it.])
495 AC_CHECK_LIB(blkid, blkid_get_cache,
496 [LIBBLKID=`$PKG_CONFIG --libs blkid`;
497 STATIC_LIBBLKID=`$PKG_CONFIG --static --libs blkid`],
498 [AC_MSG_ERROR([external blkid library not found])],
501 AC_MSG_RESULT([Disabling private blkid library])
503 LIBBLKID='$(LIB)/libblkid'$LIB_EXT
504 DEPLIBBLKID=$LIBBLKID
505 STATIC_LIBBLKID='$(LIB)/libblkid'$STATIC_LIB_EXT
506 DEPSTATIC_LIBBLKID=$STATIC_LIBBLKID
507 PROFILED_LIBBLKID='$(LIB)/libblkid'$PROFILED_LIB_EXT
508 DEPPROFILED_LIBBLKID=$PROFILED_LIBBLKID
509 AC_DEFINE(CONFIG_BUILD_FINDFS)
510 AC_MSG_RESULT([Enabling private blkid library])
513 LIBBLKID='$(LIB)/libblkid'$LIB_EXT
514 DEPLIBBLKID=$LIBBLKID
515 STATIC_LIBBLKID='$(LIB)/libblkid'$STATIC_LIB_EXT
516 DEPSTATIC_LIBBLKID=$STATIC_LIBBLKID
517 PROFILED_LIBBLKID='$(LIB)/libblkid'$PROFILED_LIB_EXT
518 DEPPROFILED_LIBBLKID=$PROFILED_LIBBLKID
519 AC_DEFINE(CONFIG_BUILD_FINDFS)
520 AC_MSG_RESULT([Enabling private blkid library by default])
523 AC_SUBST(DEPLIBBLKID)
524 AC_SUBST(STATIC_LIBBLKID)
525 AC_SUBST(DEPSTATIC_LIBBLKID)
526 AC_SUBST(PROFILED_LIBBLKID)
527 AC_SUBST(DEPPROFILED_LIBBLKID)
530 dnl handle --disable-libquota
538 DEPPROFILED_LIBQUOTA=
540 AC_ARG_ENABLE([libquota],
541 [ --disable-libquota do not build private quota library],
542 if test "$enableval" = "no"
544 if test -z "$PKG_CONFIG"; then
545 AC_MSG_ERROR([pkg-config not installed; please install it.])
549 [LIBQUOTA=`$PKG_CONFIG --libs quota`;
550 STATIC_LIBQUOTA=`$PKG_CONFIG --static --libs quota`],
551 [AC_MSG_ERROR([external quota library not found])],
554 AC_MSG_RESULT([Disabling private quota library])
556 LIBQUOTA='$(LIB)/libquota'$LIB_EXT
557 DEPLIBQUOTA=$LIBQUOTA
558 STATIC_LIBQUOTA='$(LIB)/libquota'$STATIC_LIB_EXT
559 DEPSTATIC_LIBQUOTA=$STATIC_LIBQUOTA
560 PROFILED_LIBQUOTA='$(LIB)/libquota'$PROFILED_LIB_EXT
561 DEPPROFILED_LIBQUOTA=$PROFILED_LIBQUOTA
562 AC_MSG_RESULT([Enabling private quota library])
565 LIBQUOTA='$(LIB)/libquota'$LIB_EXT
566 DEPLIBQUOTA=$LIBQUOTA
567 STATIC_LIBQUOTA='$(LIB)/libquota'$STATIC_LIB_EXT
568 DEPSTATIC_LIBQUOTA=$STATIC_LIBQUOTA
569 PROFILED_LIBQUOTA='$(LIB)/libquota'$PROFILED_LIB_EXT
570 DEPPROFILED_LIBQUOTA=$PROFILED_LIBQUOTA
571 AC_MSG_RESULT([Enabling private quota library by default])
574 AC_SUBST(DEPLIBQUOTA)
575 AC_SUBST(STATIC_LIBQUOTA)
576 AC_SUBST(DEPSTATIC_LIBQUOTA)
577 AC_SUBST(PROFILED_LIBQUOTA)
578 AC_SUBST(DEPPROFILED_LIBQUOTA)
581 dnl handle --enable-debugfs
583 AC_ARG_ENABLE([debugfs],
584 [ --disable-debugfs disable support of debugfs program],
585 if test "$enableval" = "no"
587 AC_MSG_RESULT([Disabling debugfs support])
591 AC_MSG_RESULT([Enabling debugfs support])
594 AC_MSG_RESULT([Enabling debugfs support by default])
597 AC_SUBST(DEBUGFS_CMT)
599 dnl handle --enable-imager
601 AC_ARG_ENABLE([imager],
602 [ --disable-imager disable support of e2image program],
603 if test "$enableval" = "no"
605 AC_MSG_RESULT([Disabling e2image support])
609 AC_MSG_RESULT([Enabling e2image support])
612 AC_MSG_RESULT([Enabling e2image support by default])
617 dnl handle --enable-resizer
619 AC_ARG_ENABLE([resizer],
620 [ --disable-resizer disable support of e2resize program],
621 if test "$enableval" = "no"
623 AC_MSG_RESULT([Disabling e2resize support])
627 AC_MSG_RESULT([Enabling e2resize support])
630 AC_MSG_RESULT([Enabling e2resize support by default])
633 AC_SUBST(RESIZER_CMT)
635 dnl handle --enable-defrag
637 AC_ARG_ENABLE([defrag],
638 [ --disable-defrag disable support of e4defrag program],
639 if test "$enableval" = "no"
641 AC_MSG_RESULT([Disabling e4defrag support])
645 AC_MSG_RESULT([Enabling e4defrag support])
648 AC_MSG_RESULT([Enabling e4defrag support by default])
653 dnl See whether to install the `fsck' wrapper program (that calls e2fsck)
655 AC_ARG_ENABLE([fsck],
656 [ --enable-fsck build fsck wrapper program],
657 [if test "$enableval" = "no"
659 FSCK_PROG='' FSCK_MAN=''
660 AC_MSG_RESULT([Not building fsck wrapper])
662 FSCK_PROG=fsck FSCK_MAN=fsck.8
663 AC_MSG_RESULT([Building fsck wrapper])
668 FSCK_PROG='' FSCK_MAN=''
669 AC_MSG_RESULT([Not building fsck wrapper by default])
672 FSCK_PROG=fsck FSCK_MAN=fsck.8
673 AC_MSG_RESULT([Building fsck wrapper by default])
679 dnl See whether to install the `e2initrd-helper' program
681 AC_ARG_ENABLE([e2initrd-helper],
682 [ --enable-e2initrd-helper build e2initrd-helper program],
683 [if test "$enableval" = "no"
685 E2INITRD_PROG='' E2INITRD_MAN=''
686 AC_MSG_RESULT([Not building e2initrd helper])
688 E2INITRD_PROG=e2initrd_helper E2INITRD_MAN=e2initrd_helper.8
689 AC_MSG_RESULT([Building e2initrd helper])
692 E2INITRD_PROG=e2initrd_helper E2INITRD_MAN=e2initrd_helper.8
693 AC_MSG_RESULT([Building e2initrd helper by default])
695 AC_SUBST(E2INITRD_PROG)
696 AC_SUBST(E2INITRD_MAN)
701 [ --disable-tls disable use of thread local support],
702 [if test "$enableval" = "no"
705 AC_MSG_RESULT([Disabling thread local support])
708 AC_MSG_RESULT([Enabling thread local support])
711 if test -n "$WITH_DIET_LIBC"
714 AC_MSG_RESULT([Diet libc does not support thread local support])
717 AC_MSG_RESULT([Try using thread local support by default])
720 if test "$try_tls" = "yes"
727 AC_ARG_ENABLE([uuidd],
728 [ --disable-uuidd disable building the uuid daemon],
729 [if test "$enableval" = "no"
731 AC_MSG_RESULT([Not building uuidd])
736 AC_MSG_RESULT([Building uuidd])
741 AC_MSG_RESULT([Building uuidd by default])
747 MAKEFILE_LIBRARY=$srcdir/lib/Makefile.library
748 AC_SUBST_FILE(MAKEFILE_LIBRARY)
750 dnl Add internationalization support, using gettext.
752 GETTEXT_PACKAGE=e2fsprogs
754 VERSION="$E2FSPROGS_VERSION"
756 AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE")
757 AC_DEFINE_UNQUOTED(VERSION, "$VERSION")
758 AC_SUBST(GETTEXT_PACKAGE)
764 dnl End of configuration options
766 AC_SUBST(BINARY_TYPE)
769 AC_PATH_PROG(LN, ln, ln)
771 AC_PATH_PROG(MV, mv, mv)
772 AC_PATH_PROG(CP, cp, cp)
773 AC_PATH_PROG(RM, rm, rm)
774 AC_PATH_PROG(CHMOD, chmod, :)
777 AC_PATH_PROG(SED, sed, sed)
778 AC_PATH_PROG(PERL, perl, perl)
779 AC_PATH_PROG(LDCONFIG, ldconfig, :)
780 AC_CHECK_TOOL(AR, ar, ar)
781 AC_CHECK_TOOL(RANLIB, ranlib, :)
782 AC_CHECK_TOOL(STRIP, strip, :)
783 AC_CHECK_PROG(MAKEINFO, makeinfo, makeinfo, )
784 if test "_$MAKEINFO" = "_"; then
785 MAKEINFO="@echo Makeinfo is missing. Info documentation will not be built.;true"
790 *** Makeinfo is missing. Info documentation will not be built.])
798 # See if we need a separate native compiler.
799 if test $cross_compiling = no; then
803 AC_CHECK_PROGS(BUILD_CC, gcc cc)
805 AC_CHECK_HEADERS(dirent.h errno.h execinfo.h getopt.h malloc.h mntent.h paths.h semaphore.h setjmp.h signal.h stdarg.h stdint.h stdlib.h termios.h termio.h unistd.h utime.h linux/falloc.h linux/fd.h linux/major.h net/if_dl.h netinet/in.h sys/disklabel.h sys/file.h sys/ioctl.h sys/mkdev.h sys/mman.h sys/prctl.h sys/queue.h sys/resource.h sys/select.h sys/socket.h sys/sockio.h sys/stat.h sys/syscall.h sys/sysmacros.h sys/time.h sys/types.h sys/un.h sys/wait.h)
806 AC_CHECK_HEADERS(sys/disk.h sys/mount.h,,,
809 #include <sys/queue.h>
812 AC_CHECK_HEADERS(net/if.h,,,
815 #include <sys/types.h>
818 #include <sys/socket.h>
822 dnl Check to see if dirent has member d_reclen. On cygwin those d_reclen
823 dnl is not decleared.
824 AC_CHECK_MEMBER(struct dirent.d_reclen,[AC_DEFINE(HAVE_RECLEN_DIRENT)],,
825 [#include <dirent.h>])
826 dnl Check to see if ssize_t was decleared
827 AC_CHECK_TYPE(ssize_t,[AC_DEFINE(HAVE_TYPE_SSIZE_T)],,
828 [#include <sys/types.h>])
830 dnl Check to see if llseek() is declared in unistd.h. On some libc's
831 dnl it is, and on others it isn't..... Thank you glibc developers....
833 AC_CHECK_DECL(llseek,[AC_DEFINE(HAVE_LLSEEK_PROTOTYPE)],,
834 [#include <unistd.h>])
836 dnl Check to see if lseek64() is declared in unistd.h. Glibc's header files
837 dnl are so convoluted that I can't tell whether it will always be defined,
838 dnl and if it isn't defined while lseek64 is defined in the library,
839 dnl disaster will strike.
841 dnl Warning! Use of --enable-gcc-wall may throw off this test.
844 AC_CHECK_DECL(lseek64,[AC_DEFINE(HAVE_LSEEK64_PROTOTYPE)],,
845 [#define _LARGEFILE_SOURCE
846 #define _LARGEFILE64_SOURCE
847 #include <unistd.h>])
851 AC_CHECK_SIZEOF(short)
853 AC_CHECK_SIZEOF(long)
854 AC_CHECK_SIZEOF(long long)
855 SIZEOF_SHORT=$ac_cv_sizeof_short
856 SIZEOF_INT=$ac_cv_sizeof_int
857 SIZEOF_LONG=$ac_cv_sizeof_long
858 SIZEOF_LONG_LONG=$ac_cv_sizeof_long_long
859 AC_SUBST(SIZEOF_SHORT)
861 AC_SUBST(SIZEOF_LONG)
862 AC_SUBST(SIZEOF_LONG_LONG)
864 BUILD_CC="$BUILD_CC" CPP="$CPP" /bin/sh $ac_aux_dir/parse-types.sh
865 ASM_TYPES_HEADER=./asm_types.h
866 AC_SUBST_FILE(ASM_TYPES_HEADER)
868 dnl Save the configuration #defines needed for the public ext2fs.h
871 echo "/* These defines are needed for the public ext2fs.h header file */" \
873 if grep HAVE_SYS_TYPES_H confdefs.h > tmp_config.$$; then
874 uniq tmp_config.$$ >> public_config.h
876 echo "#undef HAVE_SYS_TYPES_H" >> public_config.h
878 if grep WORDS_BIGENDIAN confdefs.h > tmp_config.$$; then
879 uniq tmp_config.$$ >> public_config.h
881 echo "#undef WORDS_BIGENDIAN" >> public_config.h
884 PUBLIC_CONFIG_HEADER=./public_config.h
885 AC_SUBST_FILE(PUBLIC_CONFIG_HEADER)
887 dnl See if we have inttypes.h and if intptr_t is defined
889 AC_CHECK_HEADERS([inttypes.h])
890 AC_CHECK_TYPES(intptr_t)
892 dnl See if struct stat has a st_flags field, in which case we can get file
893 dnl flags somewhat portably. Also check for the analogous setter, chflags().
895 AC_MSG_CHECKING(whether struct stat has a st_flags field)
896 AC_CACHE_VAL(e2fsprogs_cv_struct_st_flags,
897 AC_TRY_COMPILE([#include <sys/stat.h>],
898 [struct stat stat; stat.st_flags = 0;],
899 [e2fsprogs_cv_struct_st_flags=yes],
900 [e2fsprogs_cv_struct_st_flags=no]))
901 AC_MSG_RESULT($e2fsprogs_cv_struct_st_flags)
902 if test "$e2fsprogs_cv_struct_st_flags" = yes; then
903 AC_MSG_CHECKING(whether st_flags field is useful)
904 AC_CACHE_VAL(e2fsprogs_cv_struct_st_flags_immut,
905 AC_TRY_COMPILE([#include <sys/stat.h>],
906 [struct stat stat; stat.st_flags |= UF_IMMUTABLE;],
907 [e2fsprogs_cv_struct_st_flags_immut=yes],
908 [e2fsprogs_cv_struct_st_flags_immut=no]))
909 AC_MSG_RESULT($e2fsprogs_cv_struct_st_flags_immut)
910 if test "$e2fsprogs_cv_struct_st_flags_immut" = yes; then
911 AC_DEFINE(HAVE_STAT_FLAGS)
915 dnl Check for the presence of SA_LEN
917 AC_CHECK_MEMBER(struct sockaddr.sa_len,
918 AC_DEFINE_UNQUOTED(HAVE_SA_LEN,1,[Define if struct sockaddr contains sa_len]),,
919 [#include <sys/types.h>
920 #include <sys/socket.h>])
922 dnl This will add -lblkid to the AC_CHECK_FUNCS search if we are using
923 dnl the system-provided blkid library
925 if test -n "$BLKID_CMT"; then
926 AC_SEARCH_LIBS([blkid_probe_all], [blkid])
929 AC_CHECK_FUNCS(chflags getrusage llseek lseek64 open64 fstat64 ftruncate64 getmntinfo strtoull strcasecmp srandom jrand48 fchown mallinfo fdatasync strnlen strptime strdup sysconf pathconf posix_memalign memalign valloc __secure_getenv prctl mmap utime setresuid setresgid usleep nanosleep getdtablesize getrlimit sync_file_range posix_fadvise fallocate fallocate64 blkid_probe_get_topology mbstowcs backtrace)
931 dnl Check to see if -lsocket is required (solaris) to make something
932 dnl that uses socket() to compile; this is needed for the UUID library
935 AC_CHECK_LIB(socket, socket, [SOCKET_LIB=-lsocket])
938 dnl See if optreset exists
940 AC_MSG_CHECKING(for optreset)
941 AC_CACHE_VAL(ac_cv_have_optreset,
942 [AC_EGREP_HEADER(optreset, unistd.h,
943 ac_cv_have_optreset=yes, ac_cv_have_optreset=no)])dnl
944 AC_MSG_RESULT($ac_cv_have_optreset)
945 if test $ac_cv_have_optreset = yes; then
946 AC_DEFINE(HAVE_OPTRESET)
949 dnl Test for sem_init, and which library it might require:
952 AC_CHECK_FUNC(sem_init, ,
953 AC_CHECK_LIB(pthread, sem_init,
954 AC_DEFINE(HAVE_SEM_INIT)
955 SEM_INIT_LIB=-lpthread,
956 AC_CHECK_LIB(rt, sem_init,
957 AC_DEFINE(HAVE_SEM_INIT)
959 AC_CHECK_LIB(posix4, sem_init,
960 AC_DEFINE(HAVE_SEM_INIT)
961 SEM_INIT_LIB=-lposix4))))dnl
962 AC_SUBST(SEM_INIT_LIB)
964 dnl Check for unified diff
966 AC_MSG_CHECKING(for unified diff option)
967 if diff -u $0 $0 > /dev/null 2>&1 ; then
972 AC_MSG_RESULT($UNI_DIFF_OPTS)
973 AC_SUBST(UNI_DIFF_OPTS)
975 dnl We use the EXT2 ioctls only under Linux
979 AC_DEFINE(HAVE_EXT2_IOCTLS)
983 dnl OS-specific uncomment control
1001 dnl Linux and Hurd places root files in the / by default
1004 linux* | gnu* | k*bsd*-gnu)
1005 if test "$prefix" = NONE -a "$root_prefix" = NONE ; then
1007 AC_MSG_RESULT([On $host_os systems, root_prefix defaults to ''])
1012 dnl On Linux/hurd, force the prefix to be /usr
1015 linux* | gnu* | k*bsd*-gnu)
1016 if test "$prefix" = NONE ; then
1018 AC_MSG_RESULT([On $host_os systems, prefix defaults to /usr])
1019 if test "$mandir" = '${prefix}/man' ; then
1020 AC_MSG_RESULT([...and mandir defaults to /usr/share/man])
1021 mandir=/usr/share/man
1026 if test "$root_prefix" = NONE ; then
1027 if test "$prefix" = NONE ; then
1028 root_prefix="$ac_default_prefix"
1030 root_prefix="$prefix"
1033 root_sbindir=$sbindir
1035 root_sysconfdir=$sysconfdir
1037 root_bindir='${root_prefix}/bin'
1038 root_sbindir='${root_prefix}/sbin'
1039 root_libdir='${root_prefix}/lib'
1040 root_sysconfdir='${root_prefix}/etc'
1042 if test "$bindir" != '${exec_prefix}/bin'; then
1044 AC_MSG_RESULT([Setting root_bindir to $root_bindir])
1046 if test "$sbindir" != '${exec_prefix}/sbin'; then
1047 root_sbindir=$sbindir
1048 AC_MSG_RESULT([Setting root_sbindir to $root_sbindir])
1050 if test "$libdir" != '${exec_prefix}/lib'; then
1052 AC_MSG_RESULT([Setting root_libdir to $root_libdir])
1054 if test "$sysconfdir" != '${prefix}/etc'; then
1055 root_sysconfdir=$sysconfdir
1056 AC_MSG_RESULT([Setting root_sysconfdir to $root_sysconfdir])
1058 AC_SUBST(root_prefix)
1059 AC_SUBST(root_bindir)
1060 AC_SUBST(root_sbindir)
1061 AC_SUBST(root_libdir)
1062 AC_SUBST(root_sysconfdir)
1064 dnl See if -static works.
1066 AC_MSG_CHECKING([whether linker accepts -static])
1067 AC_CACHE_VAL(ac_cv_e2fsprogs_use_static,
1068 [SAVE_LDFLAGS=$LDFLAGS; LDFLAGS="$LDFLAGS -static"
1069 AC_TRY_LINK([#include <stdio.h>],[fflush(stdout);],
1070 ac_cv_e2fsprogs_use_static=yes, ac_cv_e2fsprogs_use_static=no)
1071 LDFLAGS=$SAVE_LDFLAGS])
1073 dnl Regardless of how the test turns out, Solaris doesn't handle -static
1074 dnl This is caused by the socket library requiring the nsl library, which
1075 dnl requires the -dl library, which only works for dynamically linked
1076 dnl programs. It basically means you can't have statically linked programs
1077 dnl which use the network under Solaris.
1081 ac_cv_e2fsprogs_use_static=no
1084 AC_MSG_RESULT($ac_cv_e2fsprogs_use_static)
1086 if test $ac_cv_e2fsprogs_use_static = yes; then
1087 LDFLAG_STATIC=-static
1089 AC_SUBST(LDFLAG_STATIC)
1091 dnl Work around mysterious Darwin / GNU libintl problem
1092 dnl (__asm__ redirection doesn't work for some mysterious reason. Looks like
1093 dnl Apple hacked gcc somehow?)
1097 AC_MSG_RESULT([Using Apple Darwin / GNU libintl workaround])
1098 AC_DEFINE(_INTL_REDIRECT_MACROS)
1102 dnl Make the ss and et directories work correctly.
1104 SS_DIR=`cd ${srcdir}/lib/ss; pwd`
1105 ET_DIR=`cd ${srcdir}/lib/et; pwd`
1109 dnl Only try to run the test suite if we're not cross compiling.
1111 if test "$cross_compiling" = yes ; then
1116 AC_SUBST(DO_TEST_SUITE)
1118 dnl Only include the intl include files if we're building with them
1121 if test "$USE_INCLUDED_LIBINTL" = "yes" ; then
1122 INTL_FLAGS='-I$(top_builddir)/intl -I$(top_srcdir)/intl'
1124 AC_SUBST(INTL_FLAGS)
1128 if test $cross_compiling = no; then
1129 BUILD_CFLAGS="$CFLAGS"
1130 BUILD_LDFLAGS="$LDFLAGS"
1135 AC_SUBST(BUILD_CFLAGS)
1136 AC_SUBST(BUILD_LDFLAGS)
1138 dnl Make our output files, being sure that we create the some miscellaneous
1141 test -d lib || mkdir lib
1142 test -d include || mkdir include
1143 test -d include/linux || mkdir include/linux
1144 test -d include/asm || mkdir include/asm
1145 for i in MCONFIG Makefile e2fsprogs.spec \
1146 util/Makefile util/subst.conf util/gen-tarball \
1147 lib/et/Makefile lib/ss/Makefile lib/e2p/Makefile \
1148 lib/ext2fs/Makefile lib/ext2fs/ext2_types.h \
1149 lib/uuid/Makefile lib/uuid/uuid_types.h \
1150 lib/blkid/Makefile lib/blkid/blkid_types.h lib/quota/Makefile \
1151 lib/ss/ss.pc lib/uuid/uuid.pc lib/et/com_err.pc \
1152 lib/e2p/e2p.pc lib/blkid/blkid.pc lib/ext2fs/ext2fs.pc \
1153 misc/Makefile ext2ed/Makefile e2fsck/Makefile \
1154 debugfs/Makefile tests/Makefile tests/progs/Makefile \
1155 resize/Makefile doc/Makefile intl/Makefile \
1156 intl/libgnuintl.h po/Makefile.in ; do
1157 if test -d `dirname ${srcdir}/$i` ; then
1158 outlist="$outlist $i"
1162 if test -f util/gen-tarball; then chmod +x util/gen-tarball; fi