+BINARY_TYPE=bin
+dnl
+dnl This is to figure out the version number and the date....
+dnl
+E2FSPROGS_VERSION=`grep E2FSPROGS_VERSION ${srcdir}/version.h \
+ | awk '{print $3}' | tr \" " " | awk '{print $1}'`
+DATE=`grep E2FSPROGS_DATE ${srcdir}/version.h | awk '{print $3}' \
+ | tr \" " "`
+MONTH=`echo $DATE | awk -F- '{print $2}'`
+YEAR=`echo $DATE | awk -F- '{print $3}'`
+
+if expr $YEAR ">" 1900 > /dev/null ; then
+ E2FSPROGS_YEAR=$YEAR
+elif expr $YEAR ">" 90 >/dev/null ; then
+ E2FSPROGS_YEAR=19$YEAR
+else
+ E2FSPROGS_YEAR=20$YEAR
+fi
+
+case $MONTH in
+Jan) E2FSPROGS_MONTH="January" ;;
+Feb) E2FSPROGS_MONTH="February" ;;
+Mar) E2FSPROGS_MONTH="March" ;;
+Apr) E2FSPROGS_MONTH="April" ;;
+May) E2FSPROGS_MONTH="May" ;;
+Jun) E2FSPROGS_MONTH="June" ;;
+Jul) E2FSPROGS_MONTH="July" ;;
+Aug) E2FSPROGS_MONTH="August" ;;
+Sep) E2FSPROGS_MONTH="September" ;;
+Oct) E2FSPROGS_MONTH="October" ;;
+Nov) E2FSPROGS_MONTH="November" ;;
+Dec) E2FSPROGS_MONTH="December" ;;
+*) echo "Unknown month $MONTH??" ;;
+esac
+
+unset DATE MONTH YEAR
+echo "Generating configuration file for e2fsprogs version $E2FSPROGS_VERSION"
+echo "Release date is ${E2FSPROGS_MONTH}, ${E2FSPROGS_YEAR}"
+AC_SUBST(E2FSPROGS_YEAR)
+AC_SUBST(E2FSPROGS_MONTH)
+AC_SUBST(E2FSPROGS_VERSION)
+AC_REQUIRE([AC_CANONICAL_HOST])
+dnl
+dnl set $(CC) from --with-cc=value
+dnl
+AC_ARG_WITH([cc],
+[ --with-cc=COMPILER select compiler to use],
+AC_MSG_RESULT(CC=$withval)
+CC=$withval,
+if test -z "$CC" ; then CC=cc; fi
+[AC_MSG_RESULT(CC defaults to $CC)])dnl
+export CC
+AC_SUBST([CC])
+AC_PROG_CC
+dnl
+dnl set $(LD) from --with-linker=value
+dnl
+AC_ARG_WITH([linker],
+[ --with-linker=LINKER select linker to use],
+AC_MSG_RESULT(LD=$withval)
+LD=$withval,
+if test -z "$LD" ; then LD=$CC; fi
+[AC_MSG_RESULT(LD defaults to $LD)])dnl
+export LD
+AC_SUBST([LD])
+dnl
+dnl set $(CCOPTS) from --with-ccopts=value
+dnl
+AC_ARG_WITH([ccopts],
+[ --with-ccopts=CCOPTS select compiler command line options],
+AC_MSG_RESULT(CCOPTS is $withval)
+CCOPTS=$withval
+CFLAGS="$CFLAGS $withval",
+CCOPTS=)dnl
+AC_SUBST(CCOPTS)
+dnl
+dnl On systems without linux header files, we add an extra include directory
+dnl that holds enough to fake it (hopefully). Note that the $(top_srcdir) here
+dnl is quoted so that it gets expanded by make, not by configure.
+dnl
+AC_CHECK_HEADER(linux/fs.h, [linux_headers=yes], [linux_headers=no])
+if test "$linux_headers" != yes; then
+ LINUX_INCLUDE='-I$(top_builddir)/include'
+fi
+AC_SUBST(LINUX_INCLUDE)
+dnl
+dnl Set default values for library extentions. Will be dealt with after
+dnl parsing configuration opions, which may modify these
+dnl
+LIB_EXT=.a
+STATIC_LIB_EXT=.a
+PROFILE_LIB_EXT=.a
+dnl
+dnl set $(LDFLAGS) from --with-ldopts=value
+dnl
+AC_ARG_WITH([ldopts],
+[ --with-ldopts=LDOPTS select linker command line options],
+AC_MSG_RESULT(LDFLAGS is $withval)
+LDFLAGS=$withval,
+LDFLAGS=)dnl
+AC_SUBST(LDFLAGS)
+dnl
+dnl Allow separate `root_prefix' to be specified
+dnl
+AC_ARG_WITH([root-prefix],
+[ --with-root-prefix=PREFIX override prefix variable for files to be placed in the root],
+root_prefix=$withval,
+root_prefix=NONE)dnl
+dnl
+dnl handle --enable-compression
+dnl
+AC_ARG_ENABLE([compression],
+[ --enable-compression enable EXPERIMENTAL compression support],
+if test "$enableval" = "no"
+then
+ echo "Disabling compression support"
+else
+ AC_DEFINE(ENABLE_COMPRESSION)
+ echo "Enabling compression support"
+ echo "WARNING: Compression support is experimental"
+fi
+,
+echo "Disabling compression support by default"
+)