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 *) echo "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 pre_vers=`echo $base_ver 0.01 - p | dc`
50 E2FSPROGS_PKGVER="$pre_vers+${base_ver}_WIP_$date_spec"
53 E2FSPROGS_PKGVER="$base_ver"
57 unset DATE MONTH YEAR base_ver pre_vers date_spec
58 echo "Generating configuration file for e2fsprogs version $E2FSPROGS_VERSION"
59 echo "Release date is ${E2FSPROGS_MONTH}, ${E2FSPROGS_YEAR}"
60 AC_SUBST(E2FSPROGS_YEAR)
61 AC_SUBST(E2FSPROGS_MONTH)
62 AC_SUBST(E2FSPROGS_DAY)
63 AC_SUBST(E2FSPROGS_VERSION)
64 AC_SUBST(E2FSPROGS_PKGVER)
69 AC_ARG_WITH([diet-libc],
70 [ --with-diet-libc use diet libc],
71 CC="diet cc -nostdinc"
72 AC_MSG_RESULT(CC=$CC))dnl
74 dnl set $(CC) from --with-cc=value
77 [ --with-cc=COMPILER select compiler to use],
78 AC_MSG_RESULT(CC=$withval)
80 if test -z "$CC" ; then CC=cc; fi
81 [AC_MSG_RESULT(CC defaults to $CC)])dnl
87 dnl set $(LD) from --with-linker=value
90 [ --with-linker=LINKER select linker to use],
91 AC_MSG_RESULT(LD=$withval)
93 if test -z "$LD" ; then LD=$CC; fi
94 [AC_MSG_RESULT(LD defaults to $LD)])dnl
98 dnl set $(CCOPTS) from --with-ccopts=value
100 AC_ARG_WITH([ccopts],
101 [ --with-ccopts=CCOPTS select compiler command line options],
102 AC_MSG_RESULT(CCOPTS is $withval)
106 dnl On systems without linux header files, we add an extra include directory
107 dnl that holds enough to fake it (hopefully). Note that the $(top_srcdir) here
108 dnl is quoted so that it gets expanded by make, not by configure.
110 AC_CHECK_HEADER(linux/fs.h, [linux_headers=yes], [linux_headers=no])
111 if test "$linux_headers" != yes; then
112 LINUX_INCLUDE='-I$(top_builddir)/include'
114 AC_SUBST(LINUX_INCLUDE)
116 dnl Alpha computers use fast and imprecise floating point code that may
117 dnl miss exceptions by default. Force sane options if we're using GCC.
118 AC_MSG_CHECKING(for additional special compiler flags)
122 alpha) addcflags="-mieee" ;;
125 if test "x$addcflags" != x
127 AC_MSG_RESULT($addcflags)
128 CFLAGS="$addcflags $CFLAGS"
130 AC_MSG_RESULT([[(none)]])
133 dnl Set default values for library extentions. Will be dealt with after
134 dnl parsing configuration opions, which may modify these
140 dnl set $(LDFLAGS) from --with-ldopts=value
142 AC_ARG_WITH([ldopts],
143 [ --with-ldopts=LDOPTS select linker command line options],
144 AC_MSG_RESULT(LDFLAGS is $withval)
149 dnl Allow separate `root_prefix' to be specified
151 AC_ARG_WITH([root-prefix],
152 [ --with-root-prefix=PREFIX override prefix variable for files to be placed in the root],
153 root_prefix=$withval,
156 dnl handle --enable-maintainer-mode
158 AC_ARG_ENABLE([maintainer-mode],
159 [ --enable-maintainer-mode enable makefile rules useful for maintainers],
160 if test "$enableval" = "no"
163 echo "Disabling maintainer mode"
166 echo "Enabling maintainer mode"
170 echo "Disabling maintainer mode by default"
172 AC_SUBST(MAINTAINER_CMT)
174 dnl handle --enable-compression
176 AC_ARG_ENABLE([compression],
177 [ --enable-compression enable EXPERIMENTAL compression support],
178 if test "$enableval" = "no"
180 echo "Disabling compression support"
182 AC_DEFINE(ENABLE_COMPRESSION)
183 echo "Enabling compression support"
184 echo "WARNING: Compression support is experimental"
187 echo "Disabling compression support by default"
190 dnl handle --enable-htree
192 AC_ARG_ENABLE([htree],
193 [ --enable-htree enable EXPERIMENTAL htree directory support],
194 if test "$enableval" = "no"
197 echo "Disabling htree directory support"
200 AC_DEFINE(ENABLE_HTREE)
201 echo "Enabling htree directory support"
205 AC_DEFINE(ENABLE_HTREE)
206 echo "Enabling htree directory support by default"
210 dnl This needs to be before all of the --enable-*-shlibs options
212 E2_PKG_CONFIG_STATIC=--static
214 dnl handle --enable-elf-shlibs
216 AC_ARG_ENABLE([elf-shlibs],
217 [ --enable-elf-shlibs select ELF shared libraries],
218 if test "$enableval" = "no"
221 MAKEFILE_ELF=/dev/null
222 echo "Disabling ELF shared libraries"
224 E2_PKG_CONFIG_STATIC=
226 MAKEFILE_ELF=$srcdir/lib/Makefile.elf-lib
229 MAKEFILE_ELF=$srcdir/lib/Makefile.solaris-lib
234 echo "Enabling ELF shared libraries"
237 MAKEFILE_ELF=/dev/null
239 echo "Disabling ELF shared libraries by default"
242 AC_SUBST_FILE(MAKEFILE_ELF)
244 dnl handle --enable-bsd-shlibs
246 AC_ARG_ENABLE([bsd-shlibs],
247 [ --enable-bsd-shlibs select BSD shared libraries],
248 if test "$enableval" = "no"
251 MAKEFILE_BSDLIB=/dev/null
252 echo "Disabling BSD shared libraries"
254 E2_PKG_CONFIG_STATIC=
256 MAKEFILE_BSDLIB=$srcdir/lib/Makefile.bsd-lib
260 MAKEFILE_BSDLIB=$srcdir/lib/Makefile.darwin-lib
264 echo "Enabling BSD shared libraries"
267 MAKEFILE_BSDLIB=/dev/null
269 echo "Disabling BSD shared libraries by default"
272 AC_SUBST_FILE(MAKEFILE_BSDLIB)
274 dnl handle --enable-profile
276 AC_ARG_ENABLE([profile],
277 [ --enable-profile build profiling libraries],
278 if test "$enableval" = "no"
281 MAKEFILE_PROFILE=/dev/null
282 echo "Disabling profiling libraries"
285 MAKEFILE_PROFILE=$srcdir/lib/Makefile.profile
286 PROFILED_LIB_EXT=_p.a
287 echo "Building profiling libraries"
291 MAKEFILE_PROFILE=/dev/null
292 echo "Disabling profiling libraries by default"
294 AC_SUBST(PROFILE_CMT)
295 AC_SUBST_FILE(MAKEFILE_PROFILE)
297 dnl handle --enable-checker
299 AC_ARG_ENABLE([checker],
300 [ --enable-checker build checker libraries],
301 if test "$enableval" = "no"
304 MAKEFILE_CHECKER=/dev/null
305 echo "Disabling checker libraries"
308 MAKEFILE_CHECKER=$srcdir/lib/Makefile.checker
309 echo "Building checker libraries"
313 MAKEFILE_CHECKER=/dev/null
314 echo "Disabling checker libraries by default"
316 AC_SUBST(CHECKER_CMT)
317 AC_SUBST_FILE(MAKEFILE_CHECKER)
319 dnl Substitute library extensions
322 AC_SUBST(STATIC_LIB_EXT)
323 AC_SUBST(PROFILED_LIB_EXT)
325 dnl handle --enable-jbd-debug
327 AC_ARG_ENABLE([jbd-debug],
328 [ --enable-jbd-debug enable journal debugging],
329 if test "$enableval" = "no"
331 echo "Disabling journal debugging"
333 AC_DEFINE(CONFIG_JBD_DEBUG)
334 echo "Enabling journal debugging"
337 echo "Disabling journal debugging by default"
340 dnl handle --enable-blkid-debug
342 AC_ARG_ENABLE([blkid-debug],
343 [ --enable-blkid-debug enable blkid debugging],
344 if test "$enableval" = "no"
346 echo "Disabling blkid debugging"
348 AC_DEFINE(CONFIG_BLKID_DEBUG)
349 echo "Enabling blkid debugging"
352 echo "Disabling blkid debugging by default"
355 dnl handle --enable-testio-debug
357 AC_ARG_ENABLE([testio-debug],
358 [ --enable-testio-debug enable the use of the test I/O manager for debugging],
359 if test "$enableval" = "no"
361 echo "Disabling testio debugging"
363 AC_DEFINE(CONFIG_TESTIO_DEBUG)
364 echo "Enabling testio debugging"
367 echo "Disabling testio debugging by default"
370 dnl handle --enable-swapfs
372 AC_ARG_ENABLE([swapfs],
373 [ --disable-swapfs disable support of legacy byte-swapped filesystems],
374 if test "$enableval" = "no"
377 echo "Disabling swapfs support"
380 AC_DEFINE(ENABLE_SWAPFS)
381 echo "Enabling swapfs support"
385 echo "Enabling swapfs support by default"
386 AC_DEFINE(ENABLE_SWAPFS)
390 dnl handle --enable-debugfs
392 AC_ARG_ENABLE([debugfs],
393 [ --disable-debugfs disable support of debugfs program],
394 if test "$enableval" = "no"
396 echo "Disabling debugfs support"
400 echo "Enabling debugfs support"
403 echo "Enabling debugfs support by default"
406 AC_SUBST(DEBUGFS_CMT)
408 dnl handle --enable-imager
410 AC_ARG_ENABLE([imager],
411 [ --disable-imager disable support of e2image program],
412 if test "$enableval" = "no"
414 echo "Disabling e2image support"
418 echo "Enabling e2image support"
421 echo "Enabling e2image support by default"
426 dnl handle --enable-resizer
428 AC_ARG_ENABLE([resizer],
429 [ --disable-resizer disable support of e2resize program],
430 if test "$enableval" = "no"
432 echo "Disabling e2resize support"
436 echo "Enabling e2resize support"
439 echo "Enabling e2resize support by default"
442 AC_SUBST(RESIZER_CMT)
444 dnl See whether to install the `fsck' wrapper program (that calls e2fsck)
446 AC_ARG_ENABLE([fsck],
447 [ --enable-fsck build fsck wrapper program],
448 [if test "$enableval" = "no"
450 FSCK_PROG='' FSCK_MAN=''
451 echo "Not building fsck wrapper"
453 FSCK_PROG=fsck FSCK_MAN=fsck.8
454 echo "Building fsck wrapper"
459 FSCK_PROG='' FSCK_MAN=''
460 echo "Not building fsck wrapper by default"
463 FSCK_PROG=fsck FSCK_MAN=fsck.8
464 echo "Building fsck wrapper by default"
470 dnl See whether to install the `e2initrd-helper' program
472 AC_ARG_ENABLE([e2initrd-helper],
473 [ --enable-e2initrd-helper build e2initrd-helper program],
474 [if test "$enableval" = "no"
476 E2INITRD_PROG='' E2INITRD_MAN=''
477 echo "Not building e2initrd helper"
479 E2INITRD_PROG=e2initrd_helper E2INITRD_MAN=e2initrd_helper.8
480 echo "Building e2initrd helper"
483 E2INITRD_PROG=e2initrd_helper E2INITRD_MAN=e2initrd_helper.8
484 echo "Building e2initrd helper by default"
486 AC_SUBST(E2INITRD_PROG)
487 AC_SUBST(E2INITRD_MAN)
488 dnl handle --enable-blkid-devmapper
490 STATIC_BLKID_DEVMAPPER_LIBS=''
491 AC_ARG_ENABLE([blkid-devmapper],
492 [ --enable-blkid-devmapper build with device-mapper support],
493 [if test "$enableval" = "no"
495 echo "Disabling device-mapper support"
498 STATIC_DEVMAPPER_LIBS=''
500 AC_DEFINE(HAVE_DEVMAPPER)
501 echo "Enabling device-mapper support"
503 PKG_PROG_PKG_CONFIG()
505 if test -z "$PKG_CONFIG"; then
506 echo "pkg-config not installed; please install it."
510 AC_CHECK_LIB(devmapper, dm_tree_create,
511 [DEVMAPPER_LIBS=`$PKG_CONFIG --libs devmapper`;
512 STATIC_DEVMAPPER_LIBS=`$PKG_CONFIG --static --libs devmapper`;
513 DEVMAPPER_REQ="devmapper";
514 DEVMAPPER_PC_LIBS="-ldevmapper"],
515 [AC_MSG_ERROR([device-mapper library not found])],
517 # work around stupid devmapper.pc bug in Debian
518 case "$STATIC_DEVMAPPER_LIBS" in
522 echo "Working around Debian bug #390243..."
523 STATIC_DEVMAPPER_LIBS="-pthread $STATIC_DEVMAPPER_LIBS"
526 if test "$E2_PKG_CONFIG_STATIC" = "--static"; then
527 DEVMAPPER_LIBS="$STATIC_DEVMAPPER_LIBS"
528 STATIC_BLKID_DEVMAPPER_LIBS="$STATIC_DEVMAPPER_LIBS"
532 echo "Disabling device-mapper support by default"
534 AC_SUBST(DEVMAPPER_REQ)
535 AC_SUBST(DEVMAPPER_PC_LIBS)
536 AC_SUBST(DEVMAPPER_LIBS)
537 AC_SUBST(STATIC_DEVMAPPER_LIBS)
538 AC_SUBST(STATIC_BLKID_DEVMAPPER_LIBS)
543 [ --disable-tls disable use of thread local support],
544 [if test "$enableval" = "no"
547 echo "Disabling thread local support"
550 echo "Enabling thread local support"
554 echo "Try using thread local support by default"
556 if test "$try_tls" = "yes"
563 AC_ARG_ENABLE([uuidd],
564 [ --disable-uuidd disable building the uuid daemon],
565 [if test "$enableval" = "no"
567 echo "Not building uuidd"
572 echo "Building uuidd"
577 echo "Building uuidd by default"
583 MAKEFILE_LIBRARY=$srcdir/lib/Makefile.library
584 AC_SUBST_FILE(MAKEFILE_LIBRARY)
586 dnl Add internationalization support, using gettext.
588 GETTEXT_PACKAGE=e2fsprogs
590 VERSION="$E2FSPROGS_VERSION"
592 AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE")
593 AC_DEFINE_UNQUOTED(VERSION, "$VERSION")
594 AC_SUBST(GETTEXT_PACKAGE)
600 dnl End of configuration options
602 AC_SUBST(BINARY_TYPE)
604 AC_PATH_PROG(LN, ln, ln)
606 AC_PATH_PROG(MV, mv, mv)
607 AC_PATH_PROG(CP, cp, cp)
608 AC_PATH_PROG(RM, rm, rm)
609 AC_PATH_PROG(CHMOD, chmod, :)
612 AC_PATH_PROG(SED, sed, sed)
613 AC_PATH_PROG(PERL, perl, perl)
614 AC_PATH_PROG(LDCONFIG, ldconfig, :)
615 AC_CHECK_TOOL(AR, ar, ar)
616 AC_CHECK_TOOL(RANLIB, ranlib, :)
617 AC_CHECK_TOOL(STRIP, strip, :)
618 AC_CHECK_PROG(MAKEINFO, makeinfo, makeinfo, )
619 if test "_$MAKEINFO" = "_"; then
620 MAKEINFO="@echo Makeinfo is missing. Info documentation will not be built.;true"
625 *** Makeinfo is missing. Info documentation will not be built.])
633 # See if we need a separate native compiler.
634 if test $cross_compiling = no; then
638 AC_CHECK_PROGS(BUILD_CC, gcc cc)
640 AC_CHECK_HEADERS(dirent.h errno.h getopt.h malloc.h mntent.h paths.h setjmp.h signal.h stdarg.h stdint.h stdlib.h termios.h unistd.h utime.h linux/fd.h linux/major.h net/if_dl.h netinet/in.h sys/disklabel.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)
641 AC_CHECK_HEADERS(sys/disk.h sys/mount.h,,,
644 #include <sys/queue.h>
647 AC_CHECK_HEADERS(net/if.h,,,
650 #include <sys/types.h>
653 #include <sys/socket.h>
657 dnl Check to see if dirent has member d_reclen. On cygwin those d_reclen
658 dnl is not decleared.
659 AC_CHECK_MEMBER(struct dirent.d_reclen,[AC_DEFINE(HAVE_RECLEN_DIRENT)],,
660 [#include <dirent.h>])
661 dnl Check to see if ssize_t was decleared
662 AC_CHECK_TYPE(ssize_t,[AC_DEFINE(HAVE_TYPE_SSIZE_T)],,
663 [#include <sys/types.h>])
665 dnl Check to see if llseek() is declared in unistd.h. On some libc's
666 dnl it is, and on others it isn't..... Thank you glibc developers....
668 AC_CHECK_DECL(llseek,[AC_DEFINE(HAVE_LLSEEK_PROTOTYPE)],,
669 [#include <unistd.h>])
671 dnl Check to see if lseek64() is declared in unistd.h. Glibc's header files
672 dnl are so convoluted that I can't tell whether it will always be defined,
673 dnl and if it isn't defined while lseek64 is defined in the library,
674 dnl disaster will strike.
676 dnl Warning! Use of --enable-gcc-wall may throw off this test.
679 AC_CHECK_DECL(lseek64,[AC_DEFINE(HAVE_LSEEK64_PROTOTYPE)],,
680 [#define _LARGEFILE_SOURCE
681 #define _LARGEFILE64_SOURCE
682 #include <unistd.h>])
686 if test "$cross_compiling" = yes -a "$ac_cv_sizeof_long" = ""; then
687 # if cross-compiling, with no cached values, just assume something common.
691 ac_cv_sizeof_long_long=8
692 AC_MSG_WARN([Cross-compiling, so cannot check type sizes; assuming short=2, int=4, long=4, long long=8])
694 AC_CHECK_SIZEOF(short)
696 AC_CHECK_SIZEOF(long)
697 AC_CHECK_SIZEOF(long long)
698 SIZEOF_SHORT=$ac_cv_sizeof_short
699 SIZEOF_INT=$ac_cv_sizeof_int
700 SIZEOF_LONG=$ac_cv_sizeof_long
701 SIZEOF_LONG_LONG=$ac_cv_sizeof_long_long
702 AC_SUBST(SIZEOF_SHORT)
704 AC_SUBST(SIZEOF_LONG)
705 AC_SUBST(SIZEOF_LONG_LONG)
707 BUILD_CC="$BUILD_CC" CPP="$CPP" /bin/sh $ac_aux_dir/parse-types.sh
708 ASM_TYPES_HEADER=./asm_types.h
709 AC_SUBST_FILE(ASM_TYPES_HEADER)
711 dnl See if we have inttypes.h and if intptr_t is defined
713 AC_CHECK_HEADERS([inttypes.h])
714 AC_CHECK_TYPES(intptr_t)
716 dnl See if struct stat has a st_flags field, in which case we can get file
717 dnl flags somewhat portably. Also check for the analogous setter, chflags().
719 AC_MSG_CHECKING(whether struct stat has a st_flags field)
720 AC_CACHE_VAL(e2fsprogs_cv_struct_st_flags,
721 AC_TRY_COMPILE([#include <sys/stat.h>],
722 [struct stat stat; stat.st_flags = 0;],
723 [e2fsprogs_cv_struct_st_flags=yes],
724 [e2fsprogs_cv_struct_st_flags=no]))
725 AC_MSG_RESULT($e2fsprogs_cv_struct_st_flags)
726 if test "$e2fsprogs_cv_struct_st_flags" = yes; then
727 AC_MSG_CHECKING(whether st_flags field is useful)
728 AC_CACHE_VAL(e2fsprogs_cv_struct_st_flags_immut,
729 AC_TRY_COMPILE([#include <sys/stat.h>],
730 [struct stat stat; stat.st_flags |= UF_IMMUTABLE;],
731 [e2fsprogs_cv_struct_st_flags_immut=yes],
732 [e2fsprogs_cv_struct_st_flags_immut=no]))
733 AC_MSG_RESULT($e2fsprogs_cv_struct_st_flags_immut)
734 if test "$e2fsprogs_cv_struct_st_flags_immut" = yes; then
735 AC_DEFINE(HAVE_STAT_FLAGS)
739 dnl Check for the presence of SA_LEN
741 AC_CHECK_MEMBER(struct sockaddr.sa_len,
742 AC_DEFINE_UNQUOTED(HAVE_SA_LEN,1,[Define if struct sockaddr contains sa_len]),,
743 [#include <sys/types.h>
744 #include <sys/socket.h>])
746 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)
748 dnl Check to see if -lsocket is required (solaris) to make something
749 dnl that uses socket() to compile; this is needed for the UUID library
752 AC_CHECK_LIB(socket, socket, [SOCKET_LIB=-lsocket])
755 dnl Check to see if libdl exists for the sake of dlopen
758 AC_CHECK_LIB(dl, dlopen,
760 AC_DEFINE(HAVE_DLOPEN)])
763 dnl See if optreset exists
765 AC_MSG_CHECKING(for optreset)
766 AC_CACHE_VAL(ac_cv_have_optreset,
767 [AC_EGREP_HEADER(optreset, unistd.h,
768 ac_cv_have_optreset=yes, ac_cv_have_optreset=no)])dnl
769 AC_MSG_RESULT($ac_cv_have_optreset)
770 if test $ac_cv_have_optreset = yes; then
771 AC_DEFINE(HAVE_OPTRESET)
774 dnl Check for unified diff
776 AC_MSG_CHECKING(for unified diff option)
777 if diff -u $0 $0 > /dev/null 2>&1 ; then
782 AC_MSG_RESULT($UNI_DIFF_OPTS)
783 AC_SUBST(UNI_DIFF_OPTS)
785 dnl We use the EXT2 ioctls only under Linux
789 AC_DEFINE(HAVE_EXT2_IOCTLS)
793 dnl OS-specific uncomment control
811 dnl Linux and Hurd places root files in the / by default
814 linux* | gnu* | k*bsd*-gnu)
815 if test "$prefix" = NONE -a "$root_prefix" = NONE ; then
817 echo "On $host_os systems, root_prefix defaults to ''"
822 dnl On Linux/hurd, force the prefix to be /usr
825 linux* | gnu* | k*bsd*-gnu)
826 if test "$prefix" = NONE ; then
828 echo "On $host_os systems, prefix defaults to /usr"
829 if test "$mandir" = '${prefix}/man' ; then
830 echo "...and mandir defaults to /usr/share/man"
831 mandir=/usr/share/man
836 if test "$root_prefix" = NONE ; then
837 if test "$prefix" = NONE ; then
838 root_prefix="$ac_default_prefix"
840 root_prefix="$prefix"
843 root_sbindir=$sbindir
845 root_sysconfdir=$sysconfdir
847 root_bindir='${root_prefix}/bin'
848 root_sbindir='${root_prefix}/sbin'
849 root_libdir='${root_prefix}/lib'
850 root_sysconfdir='${root_prefix}/etc'
852 if test "$bindir" != '${exec_prefix}/bin'; then
854 echo "Setting root_bindir to $root_bindir"
856 if test "$sbindir" != '${exec_prefix}/sbin'; then
857 root_sbindir=$sbindir
858 echo "Setting root_sbindir to $root_sbindir"
860 if test "$libdir" != '${exec_prefix}/lib'; then
862 echo "Setting root_libdir to $root_libdir"
864 if test "$sysconfdir" != '${prefix}/etc'; then
865 root_sysconfdir=$sysconfdir
866 echo "Setting root_sysconfdir to $root_sysconfdir"
868 AC_SUBST(root_prefix)
869 AC_SUBST(root_bindir)
870 AC_SUBST(root_sbindir)
871 AC_SUBST(root_libdir)
872 AC_SUBST(root_sysconfdir)
874 dnl See if -static works.
876 AC_MSG_CHECKING([whether linker accepts -static])
877 AC_CACHE_VAL(ac_cv_e2fsprogs_use_static,
878 [SAVE_LDFLAGS=$LDFLAGS; LDFLAGS="$LDFLAGS -static"
879 AC_TRY_LINK([#include <stdio.h>],[fflush(stdout);],
880 ac_cv_e2fsprogs_use_static=yes, ac_cv_e2fsprogs_use_static=no)
881 LDFLAGS=$SAVE_LDFLAGS])
883 dnl Regardless of how the test turns out, Solaris doesn't handle -static
884 dnl This is caused by the socket library requiring the nsl library, which
885 dnl requires the -dl library, which only works for dynamically linked
886 dnl programs. It basically means you can't have statically linked programs
887 dnl which use the network under Solaris.
891 ac_cv_e2fsprogs_use_static=no
894 AC_MSG_RESULT($ac_cv_e2fsprogs_use_static)
896 if test $ac_cv_e2fsprogs_use_static = yes; then
897 LDFLAG_STATIC=-static
899 AC_SUBST(LDFLAG_STATIC)
901 dnl Work around mysterious Darwin / GNU libintl problem
902 dnl (__asm__ redirection doesn't work for some mysterious reason. Looks like
903 dnl Apple hacked gcc somehow?)
907 echo "Using Apple Darwin / GNU libintl workaround"
908 AC_DEFINE(_INTL_REDIRECT_MACROS)
912 dnl Make the ss and et directories work correctly.
914 SS_DIR=`cd ${srcdir}/lib/ss; pwd`
915 ET_DIR=`cd ${srcdir}/lib/et; pwd`
919 dnl Only try to run the test suite if we're not cross compiling.
921 if test "$cross_compiling" = yes ; then
926 AC_SUBST(DO_TEST_SUITE)
928 dnl Only include the intl include files if we're building with them
931 if test "$USE_INCLUDED_LIBINTL" = "yes" ; then
932 INTL_FLAGS='-I$(top_builddir)/intl -I$(top_srcdir)/intl'
938 if test $cross_compiling = no; then
939 BUILD_CFLAGS="$CFLAGS"
940 BUILD_LDFLAGS="$LDFLAGS"
945 AC_SUBST(BUILD_CFLAGS)
946 AC_SUBST(BUILD_LDFLAGS)
948 dnl Make our output files, being sure that we create the some miscellaneous
951 test -d lib || mkdir lib
952 test -d include || mkdir include
953 test -d include/linux || mkdir include/linux
954 test -d include/asm || mkdir include/asm
955 for i in MCONFIG Makefile e2fsprogs.spec \
956 util/Makefile util/subst.conf util/gen-tarball \
957 lib/et/Makefile lib/ss/Makefile lib/e2p/Makefile \
958 lib/ext2fs/Makefile lib/ext2fs/ext2_types.h \
959 lib/uuid/Makefile lib/uuid/uuid_types.h \
960 lib/blkid/Makefile lib/blkid/blkid_types.h \
961 lib/ss/ss.pc lib/uuid/uuid.pc lib/et/com_err.pc \
962 lib/e2p/e2p.pc lib/blkid/blkid.pc lib/ext2fs/ext2fs.pc \
963 misc/Makefile ext2ed/Makefile e2fsck/Makefile \
964 debugfs/Makefile tests/Makefile tests/progs/Makefile \
965 resize/Makefile doc/Makefile intl/Makefile po/Makefile.in ; do
966 if test -d `dirname ${srcdir}/$i` ; then
967 outlist="$outlist $i"
971 if test -f util/gen-tarball; then chmod +x util/gen-tarball; fi