ceaf20
diff --git a/MCONFIG.in b/MCONFIG.in
ceaf20
new file mode 100644
ceaf20
index 0000000..f5d1012
ceaf20
--- /dev/null
ceaf20
+++ b/MCONFIG.in
ceaf20
@@ -0,0 +1,99 @@
ceaf20
+VERSION=	0.4b44
ceaf20
+DATE=		June 10, 2011
ceaf20
+
ceaf20
+AR=		@AR@
ceaf20
+CC=		@CC@
ceaf20
+INSTALL=	@INSTALL@
ceaf20
+LD=		@LD@
ceaf20
+LN_S=		@LN_S@
ceaf20
+MV=		@MV@
ceaf20
+RANLIB=		@RANLIB@
ceaf20
+RM=		@RM@
ceaf20
+
ceaf20
+BINOWNER=	@BINOWNER@
ceaf20
+BINGRP=		@BINGRP@
ceaf20
+BINMODE=	@BINMODE@
ceaf20
+MANOWNER=	@MANOWNER@
ceaf20
+MANGRP=		@MANGRP@
ceaf20
+MANMODE=	@MANMODE@
ceaf20
+
ceaf20
+INSTALLBIN=	$(INSTALL) -o $(BINOWNER) -g $(BINGRP) -m $(BINMODE)
ceaf20
+INSTALLMAN=	$(INSTALL) -o $(MANOWNER) -g $(MANGRP) -m $(MANMODE)
ceaf20
+
ceaf20
+prefix=		@prefix@
ceaf20
+exec_prefix=	@exec_prefix@
ceaf20
+SBINDIR=	@sbindir@
ceaf20
+MANDIR=		@mandir@/man8
ceaf20
+
ceaf20
+DUMPDATESPATH=	@DUMPDATESPATH@
ceaf20
+#
ceaf20
+# Global include directories
ceaf20
+#
ceaf20
+GINC=		-I$(top_builddir) -I$(top_srcdir)/compat/include
ceaf20
+# indicate where the ext2fs library can be found (this is not needed if you
ceaf20
+# have run `make install-libs' in the e2fsprogs source directory).
ceaf20
+GINC+=		@EXT2FS_CFLAGS@
ceaf20
+
ceaf20
+#
ceaf20
+# Global libraries
ceaf20
+#
ceaf20
+# indicate where the ext2fs library can be found (this is not needed if you
ceaf20
+# have run `make install-libs' in the e2fsprogs source directory).
ceaf20
+#GLIBDIR=	-L/usr/src/e2fsprogs-0.5c/lib
ceaf20
+GLIBS=		$(GLIBDIR) -L../compat/lib -lcompat @EXT2FS_LIBS@ @COM_ERR_LIBS@
ceaf20
+
ceaf20
+#
ceaf20
+# Definitions (don't change them unless you know what you are doing)
ceaf20
+#
ceaf20
+DEFS=		-DRDUMP -DRRESTORE -DLINUX_FORK_BUG -DHAVE_LZO -D_PATH_DUMPDATES=\"$(DUMPDATESPATH)\" -D_DUMP_VERSION=\"$(VERSION)\" @OPTDEFS@  
ceaf20
+
ceaf20
+all::
ceaf20
+
ceaf20
+#
ceaf20
+# Autoconf magic
ceaf20
+#
ceaf20
+
ceaf20
+$(top_builddir)/config.status:	$(top_srcdir)/configure
ceaf20
+	(cd $(top_builddir); ./config.status --recheck)
ceaf20
+
ceaf20
+$(top_builddir)/MCONFIG:	$(top_srcdir)/MCONFIG.in \
ceaf20
+				$(top_builddir)/config.status
ceaf20
+	(cd $(top_builddir); ./config.status)
ceaf20
+
ceaf20
+$(top_builddir)/config.h:	$(top_srcdir)/config.h.in \
ceaf20
+				$(top_builddir)/config.status
ceaf20
+	(cd $(top_builddir); ./config.status)
ceaf20
+
ceaf20
+Makefile:			$(srcdir)/Makefile.in $(top_builddir)/MCONFIG \
ceaf20
+				$(top_builddir)/config.status
ceaf20
+	(cd $(top_builddir); ./config.status)
ceaf20
+
ceaf20
+$(top_srcdir)/configure:	$(top_srcdir)/configure.in
ceaf20
+	cd $(top_srcdir) && autoconf
ceaf20
+
ceaf20
+$(top_srcdir)/config.h.in:	$(top_srcdir)/configure.in
ceaf20
+	cd $(top_srcdir) && autoheader
ceaf20
+
ceaf20
+#
ceaf20
+# Make depend magic
ceaf20
+#
ceaf20
+
ceaf20
+.depend:			Makefile $(SRCS) $(top_srcdir)/depfix.sed
ceaf20
+	if test -n "$(SRCS)" ; then \
ceaf20
+		$(CC) -M $(CFLAGS) $(SRCS) | \
ceaf20
+			sed -f $(top_srcdir)/depfix.sed \
ceaf20
+			    -e 's; $(srcdir)/; $$(srcdir)/;g' \
ceaf20
+			    -e 's; $(top_srcdir)/; $$(top_srcdir)/;g' \
ceaf20
+			    -e 's; $(top_builddir)/; $$(top_builddir)/;g' \
ceaf20
+			    -e 's; \./; ;g' \
ceaf20
+			    -e '/^ *\\$$/d' > .depend; \
ceaf20
+	else :; fi
ceaf20
+
ceaf20
+depend::			.depend
ceaf20
+	if test -n "$(SRCS)" ; then \
ceaf20
+		sed -e '/^# +++ Dependency line eater +++/,$$d' \
ceaf20
+			< Makefile | cat - .depend \
ceaf20
+			> Makefile.new; \
ceaf20
+		$(MV) Makefile Makefile.old; \
ceaf20
+		$(MV) Makefile.new Makefile; \
ceaf20
+	else :; fi
ceaf20
diff --git a/configure.in b/configure.in
ceaf20
new file mode 100644
ceaf20
index 0000000..e40e01b
ceaf20
--- /dev/null
ceaf20
+++ b/configure.in
ceaf20
@@ -0,0 +1,639 @@
ceaf20
+AC_INIT(dump/dump.h)
ceaf20
+AC_PREREQ(2.57)
ceaf20
+
ceaf20
+MCONFIG=./MCONFIG
ceaf20
+AC_SUBST_FILE(MCONFIG)
ceaf20
+
ceaf20
+AC_CONFIG_HEADER(config.h)
ceaf20
+
ceaf20
+dnl
ceaf20
+dnl Check for programs
ceaf20
+dnl
ceaf20
+AC_PROG_MAKE_SET
ceaf20
+AC_PROG_LN_S
ceaf20
+AC_PATH_PROG(CP, cp, cp)
ceaf20
+AC_PATH_PROG(MV, mv, mv)
ceaf20
+AC_PATH_PROG(RM, rm, rm)
ceaf20
+AC_CHECK_TOOL(AR, ar, ar)
ceaf20
+AC_CHECK_TOOL(RANLIB, ranlib, :)
ceaf20
+AC_CHECK_TOOL(PATCH, patch, :)
ceaf20
+AC_PROG_CC
ceaf20
+AC_PROG_INSTALL
ceaf20
+
ceaf20
+AC_CHECK_HEADERS([sys/types.h])
ceaf20
+
ceaf20
+CPPFLAGS="-D_BSD_SOURCE -D_USE_BSD_SIGNAL ${CPPFLAGS}"
ceaf20
+
ceaf20
+dnl
ceaf20
+dnl Handle --enable-debug
ceaf20
+dnl
ceaf20
+AC_ARG_ENABLE([debug],
ceaf20
+[  --enable-debug             include debugging code (default is NO)],
ceaf20
+if test "$enableval" = "no"
ceaf20
+then
ceaf20
+	DUMPDEBUG=""
ceaf20
+	RESTOREDEBUG=""
ceaf20
+	echo "Not including debugging code"
ceaf20
+else
ceaf20
+	DUMPDEBUG="-DFDEBUG -DTDEBUG -DWRITEDEBUG -DDIRDEBUG"
ceaf20
+	RESTOREDEBUG="-DDIRDEBUG"
ceaf20
+	echo "Including debugging code"
ceaf20
+fi,
ceaf20
+DUMPDEBUG=""
ceaf20
+RESTOREDEBUG=""
ceaf20
+echo "Not including debugging code by default"
ceaf20
+)
ceaf20
+AC_SUBST(DUMPDEBUG)
ceaf20
+AC_SUBST(RESTOREDEBUG)
ceaf20
+
ceaf20
+dnl
ceaf20
+dnl Handle --enable-static
ceaf20
+dnl
ceaf20
+AC_ARG_ENABLE([static],
ceaf20
+[  --enable-static            link dump and restore statically (default is NO)],
ceaf20
+if test "$enableval" = "no"
ceaf20
+then
ceaf20
+	STATIC=""
ceaf20
+	echo "Linking dump and restore dynamically"
ceaf20
+else
ceaf20
+	STATIC="-static"
ceaf20
+	echo "Linking dump and restore statically"
ceaf20
+fi
ceaf20
+,
ceaf20
+STATIC=""
ceaf20
+echo "Linking dump and restore dynamically by default"
ceaf20
+)
ceaf20
+AC_SUBST(STATIC)
ceaf20
+
ceaf20
+dnl
ceaf20
+dnl Handle --enable-staticz
ceaf20
+dnl
ceaf20
+AC_ARG_ENABLE([staticz],
ceaf20
+[  --enable-staticz           link libz and libbz2 statically (default is NO)],
ceaf20
+if test "$enableval" = "no"
ceaf20
+then
ceaf20
+	STATICZ="no"
ceaf20
+	echo "Linking libz and libbz2 dynamically"
ceaf20
+else
ceaf20
+	STATICZ="yes"
ceaf20
+	echo "Linking libz and libbz2 statically"
ceaf20
+fi
ceaf20
+,
ceaf20
+STATICZ="no"
ceaf20
+echo "Linking libz and libbz2 dynamically by default"
ceaf20
+)
ceaf20
+
ceaf20
+dnl
ceaf20
+dnl Handle --enable-rmt
ceaf20
+dnl
ceaf20
+AC_ARG_ENABLE([rmt],
ceaf20
+[  --enable-rmt               compile and install rmt (default is YES)],
ceaf20
+if test "$enableval" = "no"
ceaf20
+then
ceaf20
+	RMTDIR=""
ceaf20
+	RMTMAKEFILE=""
ceaf20
+	echo "Not compiling rmt"
ceaf20
+else
ceaf20
+	RMTDIR="rmt"
ceaf20
+	RMTMAKEFILE="rmt/Makefile"
ceaf20
+	echo "Compiling rmt"
ceaf20
+fi
ceaf20
+,
ceaf20
+RMTDIR="rmt"
ceaf20
+RMTMAKEFILE="rmt/Makefile"
ceaf20
+echo "Compiling rmt by default"
ceaf20
+)
ceaf20
+AC_SUBST(RMTDIR)
ceaf20
+
ceaf20
+dnl
ceaf20
+dnl Handle --enable-ermt
ceaf20
+dnl
ceaf20
+AC_ARG_ENABLE([ermt],
ceaf20
+[  --enable-ermt              compile ermt, an encrypting version of rmt (default is NO)],
ceaf20
+if test "$enableval" = "no"
ceaf20
+then
ceaf20
+	ERMT=""
ceaf20
+	echo "Not compiling ermt"
ceaf20
+else
ceaf20
+	if test "$RMTDIR" = ""
ceaf20
+	then
ceaf20
+		AC_MSG_ERROR(ermt requires --enable-rmt)
ceaf20
+	fi
ceaf20
+	ERMT="ermt"
ceaf20
+	echo "Compiling ermt"
ceaf20
+fi
ceaf20
+,
ceaf20
+ERMT=""
ceaf20
+echo "Not compiling ermt by default"
ceaf20
+)
ceaf20
+AC_SUBST(ERMT)
ceaf20
+
ceaf20
+dnl
ceaf20
+dnl Handle --enable-kerberos
ceaf20
+dnl
ceaf20
+AC_ARG_ENABLE([kerberos],
ceaf20
+[  --enable-kerberos          compile kerberos extensions (default is NO)],
ceaf20
+if test "$enableval" = "yes"
ceaf20
+then
ceaf20
+	OPTDEFS="-DKERBEROS"
ceaf20
+	echo "Compiling kerberos extensions"
ceaf20
+else
ceaf20
+	OPTDEFS=""
ceaf20
+	echo "Not compiling kerberos extensions"
ceaf20
+fi
ceaf20
+,
ceaf20
+OPTDEFS=""
ceaf20
+echo "Not compiling kerberos extensions by default"
ceaf20
+)
ceaf20
+AC_SUBST(OPTDEFS)
ceaf20
+
ceaf20
+dnl
ceaf20
+dnl Handle --enable-readline
ceaf20
+dnl
ceaf20
+AC_ARG_ENABLE([readline],
ceaf20
+[  --enable-readline          enable readline support in restore (default is YES)],
ceaf20
+if test "$enableval" = "no"
ceaf20
+then
ceaf20
+	READLINE=""
ceaf20
+	echo "Not including readline support"
ceaf20
+else
ceaf20
+	READLINE="yes"
ceaf20
+	AC_DEFINE([HAVE_READLINE],1,[Define if you want to include readline support.])
ceaf20
+	echo "Including readline support"
ceaf20
+fi
ceaf20
+,
ceaf20
+READLINE="yes"
ceaf20
+AC_DEFINE([HAVE_READLINE],1,[Define if you want to include readline support.])
ceaf20
+echo "Including readline support by default"
ceaf20
+)
ceaf20
+
ceaf20
+dnl
ceaf20
+dnl Handle --enable-oldsylefscript
ceaf20
+dnl
ceaf20
+AC_ARG_ENABLE([oldstylefscript],
ceaf20
+[  --enable-oldstylefscript   enable old style F script (no arguments) (default is NO)],
ceaf20
+if test "$enableval" = "yes"
ceaf20
+then
ceaf20
+	AC_DEFINE([OLD_STYLE_FSCRIPT],1,[Define this is you want old style F script (no arguments).])
ceaf20
+	echo "Using old style F script"
ceaf20
+else
ceaf20
+	echo "Using new style F script"
ceaf20
+fi
ceaf20
+,
ceaf20
+echo "Using new style F script by default"
ceaf20
+)
ceaf20
+
ceaf20
+dnl
ceaf20
+dnl Handle --enable-largefile
ceaf20
+dnl
ceaf20
+AC_ARG_ENABLE([largefile],
ceaf20
+[  --enable-largefile         enable Large File System support (default is YES)],
ceaf20
+if test "$enableval" = "yes"
ceaf20
+then
ceaf20
+	AC_DEFINE([USE_LFS],1,[Define this if you want Large File System support.])
ceaf20
+	echo "Enabling Large File System support"
ceaf20
+else
ceaf20
+	echo "Not enabling Large File System support"
ceaf20
+fi
ceaf20
+,
ceaf20
+AC_DEFINE([USE_LFS],1,[Define this if you want Large File System support.])
ceaf20
+echo "Enabling Large File System support by default"
ceaf20
+)
ceaf20
+
ceaf20
+dnl
ceaf20
+dnl Handle --enable-qfa
ceaf20
+dnl
ceaf20
+AC_ARG_ENABLE([qfa],
ceaf20
+[  --enable-qfa               enable Quick File Access support (default is YES)],
ceaf20
+if test "$enableval" = "yes"
ceaf20
+then
ceaf20
+	AC_DEFINE([USE_QFA],1,[Define this if you want Quick File Access support.])
ceaf20
+	echo "Enabling Quick File Access support"
ceaf20
+else
ceaf20
+	echo "Not enabling Quick File Access support"
ceaf20
+fi
ceaf20
+,
ceaf20
+AC_DEFINE([USE_QFA],1,[Define this if you want Quick File Access support.])
ceaf20
+echo "Enabling Quick File Access support by default"
ceaf20
+)
ceaf20
+
ceaf20
+dnl
ceaf20
+dnl Handle --enable-qfadebug
ceaf20
+dnl
ceaf20
+AC_ARG_ENABLE([qfadebug],
ceaf20
+[  --enable-qfadebug          include Quick File Access debugging code (default is NO)],
ceaf20
+if test "$enableval" = "yes"
ceaf20
+then
ceaf20
+	AC_DEFINE([DEBUG_QFA],1,[Define this if you want to include Quick File Access debugging code.])
ceaf20
+	echo "Including Quick File Access debugging code"
ceaf20
+else
ceaf20
+	echo "Not including Quick File Access debugging code"
ceaf20
+fi
ceaf20
+,
ceaf20
+echo "Not including Quick File Access debugging code by default"
ceaf20
+)
ceaf20
+
ceaf20
+dnl
ceaf20
+dnl Handle --enable-macosx
ceaf20
+dnl
ceaf20
+AC_ARG_ENABLE([macosx],
ceaf20
+[  --enable-macosx            include Mac OSX restore compatibility (default is NO)],
ceaf20
+if test "$enableval" = "yes"
ceaf20
+then
ceaf20
+	AC_DEFINE([DUMP_MACOSX],1,[Define this if you want to include Mac OSX restore compatibility.])
ceaf20
+	echo "Including Mac OSX restore compatibility code"
ceaf20
+else
ceaf20
+	echo "Not including Mac OSX restore compatibility code"
ceaf20
+fi
ceaf20
+,
ceaf20
+echo "Not including Mac OSX restore compatibility code by default"
ceaf20
+)
ceaf20
+
ceaf20
+dnl
ceaf20
+dnl Handle --enable-transselinux
ceaf20
+dnl
ceaf20
+AC_ARG_ENABLE([transselinux],
ceaf20
+[  --enable-transselinux      restore can translate SELinux EAs (default is YES)],
ceaf20
+if test "$enableval" = "yes"
ceaf20
+then
ceaf20
+	LTRANSSELINUX="-lselinux"
ceaf20
+	CCTRANSSELINUX="-DTRANSSELINUX"
ceaf20
+	echo "restore can translate SELinux EAs"
ceaf20
+else
ceaf20
+	LTRANSSELINUX=""
ceaf20
+	CCTRANSSELINUX=""
ceaf20
+	echo "restore can not translate SELinux EAs"
ceaf20
+fi
ceaf20
+,
ceaf20
+LTRANSSELINUX="-lselinux"
ceaf20
+CCTRANSSELINUX="-DTRANSSELINUX"
ceaf20
+echo "restore can translate SELinux EAs by default"
ceaf20
+)
ceaf20
+AC_SUBST(LTRANSSELINUX)
ceaf20
+AC_SUBST(CCTRANSSELINUX)
ceaf20
+
ceaf20
+
ceaf20
+dnl
ceaf20
+dnl set $(CC) from --with-cc=value
ceaf20
+dnl
ceaf20
+AC_ARG_WITH([cc],
ceaf20
+[  --with-cc=COMPILER         select compiler to use],
ceaf20
+AC_MSG_RESULT(CC=$withval)
ceaf20
+CC=$withval,
ceaf20
+if test -z "$CC" ; then CC=cc; fi
ceaf20
+[AC_MSG_RESULT(CC defaults to $CC)])dnl
ceaf20
+export CC
ceaf20
+AC_SUBST([CC])
ceaf20
+
ceaf20
+dnl
ceaf20
+dnl set $(LD) from --with-linker=value
ceaf20
+dnl
ceaf20
+AC_ARG_WITH([linker],
ceaf20
+[  --with-linker=LINKER       select linker to use],
ceaf20
+AC_MSG_RESULT(LD=$withval)
ceaf20
+LD=$withval,
ceaf20
+if test -z "$LD" ; then LD=$CC; fi
ceaf20
+[AC_MSG_RESULT(LD defaults to $LD)])dnl
ceaf20
+export LD
ceaf20
+AC_SUBST([LD])
ceaf20
+
ceaf20
+dnl
ceaf20
+dnl set $(CCOPTS) from --with-ccopts=value
ceaf20
+dnl
ceaf20
+AC_ARG_WITH([ccopts],
ceaf20
+[  --with-ccopts=CCOPTS       select compiler command line options],
ceaf20
+AC_MSG_RESULT(CCOPTS is $withval)
ceaf20
+CCOPTS=$withval
ceaf20
+CFLAGS="$CFLAGS $withval",
ceaf20
+CCOPTS=)dnl
ceaf20
+AC_SUBST(CCOPTS)
ceaf20
+
ceaf20
+dnl
ceaf20
+dnl set $(LDFLAGS) from --with-ldopts=value
ceaf20
+dnl
ceaf20
+AC_ARG_WITH([ldopts],
ceaf20
+[  --with-ldopts=LDOPTS       select linker command line options],
ceaf20
+AC_MSG_RESULT(LDFLAGS is $withval)
ceaf20
+LDOPTS=$withval
ceaf20
+LDFLAGS="$LDFLAGS $withval",
ceaf20
+LDOPTS=)dnl
ceaf20
+AC_SUBST(LDOPTS)
ceaf20
+
ceaf20
+dnl
ceaf20
+dnl set $(BINOWNER) from --with-binowner
ceaf20
+dnl
ceaf20
+AC_ARG_WITH([binowner],
ceaf20
+[  --with-binowner=USER       select owner for binaries],
ceaf20
+AC_MSG_RESULT(BINOWNER is $withval)
ceaf20
+BINOWNER=$withval,
ceaf20
+BINOWNER=root
ceaf20
+echo "BINOWNER defaults to $BINOWNER"
ceaf20
+)dnl
ceaf20
+AC_SUBST(BINOWNER)
ceaf20
+
ceaf20
+dnl
ceaf20
+dnl set $(BINGRP) from --with-bingrp
ceaf20
+dnl
ceaf20
+AC_ARG_WITH([bingrp],
ceaf20
+[  --with-bingrp=GROUP        select group for binaries],
ceaf20
+AC_MSG_RESULT(BINGRP is $withval)
ceaf20
+BINGRP=$withval,
ceaf20
+BINGRP=tty
ceaf20
+echo "BINGRP defaults to $BINGRP"
ceaf20
+)dnl
ceaf20
+AC_SUBST(BINGRP)
ceaf20
+
ceaf20
+dnl
ceaf20
+dnl set $(BINMODE) from --with-binmode
ceaf20
+dnl
ceaf20
+AC_ARG_WITH([binmode],
ceaf20
+[  --with-binmode=MODE        select mode for binaries],
ceaf20
+AC_MSG_RESULT(BINMODE is $withval)
ceaf20
+BINMODE=$withval,
ceaf20
+BINMODE=0755
ceaf20
+echo "BINMODE defaults to $BINMODE"
ceaf20
+)dnl
ceaf20
+AC_SUBST(BINMODE)
ceaf20
+
ceaf20
+dnl
ceaf20
+dnl set $(MANOWNER) from --with-manowner
ceaf20
+dnl
ceaf20
+AC_ARG_WITH([manowner],
ceaf20
+[  --with-manowner=USER       select owner for manual pages],
ceaf20
+AC_MSG_RESULT(MANOWNER is $withval)
ceaf20
+MANOWNER=$withval,
ceaf20
+MANOWNER=man
ceaf20
+echo "MANOWNER defaults to $MANOWNER"
ceaf20
+)dnl
ceaf20
+AC_SUBST(MANOWNER)
ceaf20
+
ceaf20
+dnl
ceaf20
+dnl set $(MANGRP) from --with-mangrp
ceaf20
+dnl
ceaf20
+AC_ARG_WITH([mangrp],
ceaf20
+[  --with-mangrp=GROUP        select group for manual pages],
ceaf20
+AC_MSG_RESULT(MANGRP is $withval)
ceaf20
+MANGRP=$withval,
ceaf20
+MANGRP=tty
ceaf20
+echo "MANGRP defaults to $MANGRP"
ceaf20
+)dnl
ceaf20
+AC_SUBST(MANGRP)
ceaf20
+
ceaf20
+dnl
ceaf20
+dnl set $(MANMODE) from --with-manmode
ceaf20
+dnl
ceaf20
+AC_ARG_WITH([manmode],
ceaf20
+[  --with-manmode=MODE        select mode for manual pages],
ceaf20
+AC_MSG_RESULT(MANMODE is $withval)
ceaf20
+MANMODE=$withval,
ceaf20
+MANMODE=0644
ceaf20
+echo "MANMODE defaults to $MANMODE"
ceaf20
+)dnl
ceaf20
+AC_SUBST(MANMODE)
ceaf20
+
ceaf20
+dnl
ceaf20
+dnl set $(DUMPDATESPATH) from --with-dumpdatespath
ceaf20
+dnl
ceaf20
+AC_ARG_WITH([dumpdatespath],
ceaf20
+[  --with-dumpdatespath=PATH  select path for dumpdates file],
ceaf20
+AC_MSG_RESULT(DUMPDATESPATH is $withval)
ceaf20
+DUMPDATESPATH=$withval,
ceaf20
+DUMPDATESPATH="${sysconfdir}/dumpdates"
ceaf20
+echo "DUMPDATESPATH defaults to $DUMPDATESPATH"
ceaf20
+)dnl
ceaf20
+AC_SUBST(DUMPDATESPATH)
ceaf20
+
ceaf20
+dnl
ceaf20
+dnl Check for Ext2fs headers and libraries
ceaf20
+dnl
ceaf20
+AC_CHECK_HEADER(ext2fs/ext2fs.h, [ext2fs_h=yes], [ext2fs_h=no], [-])
ceaf20
+PKG_CHECK_MODULES(EXT2FS, [ext2fs])
ceaf20
+if test -n "$STATIC" ; then
ceaf20
+	EXT2FS_LIBS=`$PKG_CONFIG --libs --static ext2fs`
ceaf20
+fi
ceaf20
+if test "$ext2fs_h" = no -o "x$EXT2FS_LIBS" = "x"; then
ceaf20
+	AC_MSG_ERROR(You need to install the Ext2fs libraries from the E2fsprogs distribution first - hint: make install-libs)
ceaf20
+fi
ceaf20
+
ceaf20
+PKG_CHECK_MODULES(COM_ERR, [com_err])
ceaf20
+if test -n "$STATIC" ; then
ceaf20
+	COM_ERR_LIBS=`$PKG_CONFIG --libs --static com_err`
ceaf20
+fi
ceaf20
+
ceaf20
+dnl
ceaf20
+dnl Check for ext2fs_read_inode_full
ceaf20
+dnl
ceaf20
+AC_CHECK_LIB(ext2fs, ext2fs_read_inode_full, [rif=yes], [rif=no], [-lcom_err])
ceaf20
+if test "$rif" = yes; then
ceaf20
+	AC_DEFINE([HAVE_EXT2FS_READ_INODE_FULL],1,[Define this if your ext2fs libs have the ext2fs_read_inode_full function.])
ceaf20
+fi
ceaf20
+
ceaf20
+dnl
ceaf20
+dnl Try to use ext2_fs.h header from libext2fs instead of from the kernel
ceaf20
+dnl
ceaf20
+AC_CHECK_HEADERS(ext2fs/ext2_fs.h, [], [], [-])
ceaf20
+
ceaf20
+dnl
ceaf20
+dnl Check for ext2_ino_t type
ceaf20
+dnl
ceaf20
+AC_MSG_CHECKING(for ext2_ino_t type in libext2fs headers)
ceaf20
+AC_TRY_COMPILE([#include <stdio.h>
ceaf20
+#ifdef HAVE_EXT2FS_EXT2_FS_H
ceaf20
+#include <ext2fs/ext2_fs.h>
ceaf20
+#else
ceaf20
+#include <linux/ext2_fs.h>
ceaf20
+#endif
ceaf20
+#include <ext2fs/ext2fs.h>],
ceaf20
+[ext2_ino_t ino = 0;], 
ceaf20
+[AC_DEFINE([HAVE_EXT2_INO_T],1,[Define if we have the ext2_ino_t type (from e2fsprogs 1.20+).])
ceaf20
+ AC_MSG_RESULT(yes)],
ceaf20
+AC_MSG_RESULT(no))
ceaf20
+
ceaf20
+dnl
ceaf20
+dnl Check for s_journal_inum field in ext2_super_block struct
ceaf20
+dnl
ceaf20
+AC_MSG_CHECKING(for s_journal_inum field in ext2_super_block struct)
ceaf20
+AC_TRY_COMPILE([#include <stdio.h>
ceaf20
+#ifdef HAVE_EXT2FS_EXT2_FS_H
ceaf20
+#include <ext2fs/ext2_fs.h>
ceaf20
+#else
ceaf20
+#include <linux/ext2_fs.h>
ceaf20
+#endif
ceaf20
+#include <ext2fs/ext2fs.h>],
ceaf20
+[struct ext2_super_block es; es.s_journal_inum = 0;],
ceaf20
+[AC_DEFINE([HAVE_EXT2_JOURNAL_INUM],1,[Define if we have the s_journal_inum field in struct ext2_super_block.])
ceaf20
+ AC_MSG_RESULT(yes)],
ceaf20
+AC_MSG_RESULT(no))
ceaf20
+
ceaf20
+dnl
ceaf20
+dnl Check for blkid headers libraries
ceaf20
+dnl
ceaf20
+AC_CHECK_HEADER(blkid/blkid.h, [blkid_h=yes], [blkid_h=no], [-])
ceaf20
+PKG_CHECK_EXISTS([blkid],
ceaf20
+	[
ceaf20
+	if test -n $STATIC ; then
ceaf20
+		BLKID=`$PKG_CONFIG --libs --static blkid`
ceaf20
+	else
ceaf20
+		BLKID=`$PKG_CONFIG --libs blkid`
ceaf20
+	fi
ceaf20
+	if test "$blkid_h" = yes ; then
ceaf20
+		AC_DEFINE([HAVE_BLKID],1,[Define this if you have the blkid library.])
ceaf20
+	fi
ceaf20
+	],[BLKID=""])
ceaf20
+AC_SUBST(BLKID)
ceaf20
+
ceaf20
+dnl
ceaf20
+dnl Check for ncurses or termcap libraries
ceaf20
+dnl
ceaf20
+AC_CHECK_LIB(ncurses, tgetent, [ncurses_lib=yes], [ncurses_lib=no])
ceaf20
+AC_CHECK_LIB(termcap, tgetent, [termcap_lib=yes], [termcap_lib=no])
ceaf20
+AC_CHECK_LIB(tinfo, tgetent, [tinfo_lib=yes], [tinfo_lib=no])
ceaf20
+
ceaf20
+if test "$ncurses_lib" = no -a "$termcap_lib" = no -a "$tinfo_lib" = no; then
ceaf20
+	if test "$READLINE" = "yes"; then
ceaf20
+		AC_MSG_ERROR(You need to install the ncurses or termcap library or configure without --enable-readline)
ceaf20
+	fi
ceaf20
+fi
ceaf20
+if test "$tinfo_lib" = yes; then
ceaf20
+	rdllib="-ltinfo"
ceaf20
+elif test "$ncurses_lib" = yes; then
ceaf20
+	rdllib="-lncurses"
ceaf20
+elif test "$termcap_lib" = yes; then
ceaf20
+	rdllib="-ltermcap"
ceaf20
+fi
ceaf20
+
ceaf20
+dnl
ceaf20
+dnl Check for readline headers and libraries
ceaf20
+dnl
ceaf20
+AC_CHECK_HEADER(readline/readline.h, [readline_h=yes], [readline_h=no], [-])
ceaf20
+AC_CHECK_LIB(readline, readline, [readline_lib=yes], [readline_lib=no], $rdllib)
ceaf20
+if test "$readline_h" = no -o "$readline_lib" = no; then
ceaf20
+	if test "$READLINE" = "yes"; then
ceaf20
+		AC_MSG_ERROR(You need to install the GNU readline library or configure without --enable-readline)
ceaf20
+	fi
ceaf20
+fi
ceaf20
+if test "$READLINE" = yes; then
ceaf20
+	READLINE="-lreadline $rdllib"
ceaf20
+fi
ceaf20
+AC_SUBST(READLINE)
ceaf20
+
ceaf20
+dnl
ceaf20
+dnl Check for rl_completion_matches
ceaf20
+dnl
ceaf20
+AC_CHECK_LIB(readline, rl_completion_matches, [rlcm=yes], [rlcm=no], "-ltermcap")
ceaf20
+if test "$rlcm" = yes; then
ceaf20
+	AC_DEFINE([HAVE_READLINE_RLCM],1,[Define this if your readline libs have the rl_completion_matches library.])
ceaf20
+fi
ceaf20
+
ceaf20
+dnl
ceaf20
+dnl Check for rl_completion_append_character
ceaf20
+dnl
ceaf20
+AC_CHECK_LIB(readline, rl_completion_append_character, [rcac=yes], [rcac=no], "-ltermcap")
ceaf20
+if test "$rcac" = yes; then
ceaf20
+	AC_DEFINE([HAVE_READLINE_CAC],1,[Define this if your readline libs have the rl_completion_append_character variable.])
ceaf20
+fi
ceaf20
+
ceaf20
+dnl
ceaf20
+dnl Check for zlib headers and libraries
ceaf20
+dnl
ceaf20
+AC_CHECK_HEADER(zlib.h, [zlib_h=yes], [zlib_h=no], [-])
ceaf20
+AC_CHECK_LIB(z, zlibVersion, [zlib_lib=yes], [zlib_lib=no])
ceaf20
+if test "$zlib_h" = yes -a "$zlib_lib" = yes; then
ceaf20
+	if test "$STATICZ" = yes; then
ceaf20
+		ZLIB="-Wl,-Bstatic -lz -Wl,-Bdynamic"
ceaf20
+	else
ceaf20
+		ZLIB="-lz"
ceaf20
+	fi
ceaf20
+	AC_DEFINE([HAVE_ZLIB],1,[Define this if you have zlib compression library.])
ceaf20
+else
ceaf20
+	ZLIB=""
ceaf20
+fi
ceaf20
+AC_SUBST(ZLIB)
ceaf20
+
ceaf20
+dnl
ceaf20
+dnl Check for bzlib headers and libraries
ceaf20
+dnl
ceaf20
+AC_CHECK_HEADER(bzlib.h, [bzlib_h=yes], [bzlib_h=no], [-])
ceaf20
+AC_CHECK_LIB(bz2, BZ2_bzBuffToBuffCompress, [bzlib_lib=yes], [bzlib_lib=no])
ceaf20
+if test "$bzlib_h" = yes -a "$bzlib_lib" = yes; then
ceaf20
+	if test "$STATICZ" = yes; then
ceaf20
+		BZLIB="-Wl,-Bstatic -lbz2 -Wl,-Bdynamic"
ceaf20
+	else
ceaf20
+		BZLIB="-lbz2"
ceaf20
+	fi
ceaf20
+	AC_DEFINE([HAVE_BZLIB],1,[Define this if you have bzlib compression library.])
ceaf20
+else
ceaf20
+	BZLIB=""
ceaf20
+fi
ceaf20
+AC_SUBST(BZLIB)
ceaf20
+
ceaf20
+dnl
ceaf20
+dnl Check for library functions
ceaf20
+dnl
ceaf20
+AC_CHECK_FUNCS(err errx verr verrx vwarn vwarnx warn warnx realpath lchown)
ceaf20
+AC_CHECK_FUNC(glob)
ceaf20
+
ceaf20
+dnl
ceaf20
+dnl Check for GLOB_ALTDIRFUNC
ceaf20
+dnl
ceaf20
+AC_MSG_CHECKING(for extended glob routines)
ceaf20
+if test "$ac_cv_func_glob" = "yes"; then
ceaf20
+	AC_EGREP_CPP(yes, 
ceaf20
+	[
ceaf20
+#	include <glob.h>
ceaf20
+#	ifdef GLOB_ALTDIRFUNC
ceaf20
+	yes
ceaf20
+#	endif
ceaf20
+	], 
ceaf20
+	[
ceaf20
+	AC_DEFINE([HAVE_GLOB],1,[Define if you have the glob function.])
ceaf20
+	AC_MSG_RESULT(yes)
ceaf20
+	],
ceaf20
+	[
ceaf20
+	AC_MSG_RESULT(no)
ceaf20
+	echo "Your system does not support extended glob, will use the internal routines"
ceaf20
+	])
ceaf20
+fi
ceaf20
+
ceaf20
+dnl
ceaf20
+dnl Check for OpenSSL, for ermt
ceaf20
+dnl
ceaf20
+if test "$ERMT" != ""; then
ceaf20
+	AC_CHECK_HEADER(openssl/evp.h, [evp_h=yes], [evp_h=no])
ceaf20
+	AC_CHECK_LIB(crypto, EVP_CIPHER_CTX_set_padding, [crypto_lib=yes], [crypto_lib=no])
ceaf20
+	PKG_CHECK_EXISTS([libcrypto],
ceaf20
+		[
ceaf20
+		if test -n $STATIC ; then
ceaf20
+			CRYPTO=`$PKG_CONFIG --libs --static libcrypto`
ceaf20
+		else
ceaf20
+			CRYPTO=`$PKG_CONFIG --libs libcrypto`
ceaf20
+		fi
ceaf20
+		],[CRYPTO=""])
ceaf20
+	if test "$evp_h" = no -o "x$CRYPTO" = "x"; then
ceaf20
+		AC_MSG_ERROR(You need to install the OpenSSL library (version 0.9.7a or later), or configure without --enable-ermt)
ceaf20
+	fi
ceaf20
+fi
ceaf20
+AC_SUBST(CRYPTO)
ceaf20
+
ceaf20
+dnl
ceaf20
+dnl Check for types
ceaf20
+dnl
ceaf20
+AC_CHECK_TYPE(quad_t, int64_t)
ceaf20
+AC_CHECK_TYPE(u_quad_t, uint64_t)
ceaf20
+
ceaf20
+dnl
ceaf20
+dnl Compute top_buildir
ceaf20
+dnl
ceaf20
+top_builddir=`cd .; pwd`
ceaf20
+AC_SUBST(top_builddir)
ceaf20
+
ceaf20
+dnl
ceaf20
+dnl Create directories
ceaf20
+dnl
ceaf20
+test -d compat || mkdir compat
ceaf20
+test -d compat/lib || mkdir compat/lib
ceaf20
+
ceaf20
+dnl
ceaf20
+dnl Output files
ceaf20
+dnl
ceaf20
+AC_OUTPUT(MCONFIG Makefile common/Makefile compat/include/Makefile compat/lib/Makefile dump/Makefile restore/Makefile $RMTMAKEFILE)