Blame SOURCES/dump-buildfix.patch

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