Blame SOURCES/dump-buildfix.patch

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