6 AC_CONFIG_HEADER(config.h)
13 AC_PATH_PROG(CP, cp, cp)
14 AC_PATH_PROG(MV, mv, mv)
15 AC_PATH_PROG(RM, rm, rm)
16 AC_CHECK_TOOL(AR, ar, ar)
17 AC_CHECK_TOOL(RANLIB, ranlib, :)
18 AC_CHECK_TOOL(PATCH, patch, :)
23 dnl Handle --enable-dumpdates-patch
25 AC_ARG_ENABLE([dumpdates-patch],
26 [ --enable-dumpdates-patch apply the dumpdates patch from Debian],
27 if test "$enableval" = "yes"
29 if test "$PATCH" = ":"
31 AC_MSG_ERROR(The patch program was not found on your system)
33 (cd $srcdir; $PATCH -p < debian-patch)
39 dnl Handle --enable-debug
41 AC_ARG_ENABLE([debug],
42 [ --enable-debug include debugging code],
43 if test "$enableval" = "no"
48 DUMPDEBUG="-DFDEBUG -DTDEBUG -DWRITEDEBUG -DDIRDEBUG"
49 RESTOREDEBUG="-DDIRDEBUG"
55 AC_SUBST(RESTOREDEBUG)
58 dnl Handle --enable-static
60 AC_ARG_ENABLE([static],
61 [ --enable-static link dump and restore statically],
62 if test "$enableval" = "no"
70 echo "Linking dump and restore dynamically by default"
75 dnl Handle --enable-rmt
78 [ --enable-rmt compile and install rmt],
79 if test "$enableval" = "no"
85 RMTMAKEFILE="rmt/Makefile"
89 echo "Not compiling rmt by default"
94 dnl set $(CC) from --with-cc=value
97 [ --with-cc=COMPILER select compiler to use],
98 AC_MSG_RESULT(CC=$withval)
100 if test -z "$CC" ; then CC=cc; fi
101 [AC_MSG_RESULT(CC defaults to $CC)])dnl
106 dnl set $(LD) from --with-linker=value
108 AC_ARG_WITH([linker],
109 [ --with-linker=LINKER select linker to use],
110 AC_MSG_RESULT(LD=$withval)
112 if test -z "$LD" ; then LD=$CC; fi
113 [AC_MSG_RESULT(LD defaults to $LD)])dnl
118 dnl set $(CCOPTS) from --with-ccopts=value
120 AC_ARG_WITH([ccopts],
121 [ --with-ccopts=CCOPTS select compiler command line options],
122 AC_MSG_RESULT(CCOPTS is $withval)
124 CFLAGS="$CFLAGS $withval",
129 dnl set $(LDFLAGS) from --with-ldopts=value
131 AC_ARG_WITH([ldopts],
132 [ --with-ldopts=LDOPTS select linker command line options],
133 AC_MSG_RESULT(LDFLAGS is $withval)
139 dnl set $(BINOWNER) from --with-binowner
141 AC_ARG_WITH([binowner],
142 [ --with-binowner=USER select owner for binaries],
143 AC_MSG_RESULT(BINOWNER is $withval)
146 echo "BINOWNER defaults to $BINOWNER"
151 dnl set $(BINGRP) from --with-bingrp
153 AC_ARG_WITH([bingrp],
154 [ --with-bingrp=GROUP select group for binaries],
155 AC_MSG_RESULT(BINGRP is $withval)
158 echo "BINGRP defaults to $BINGRP"
163 dnl set $(BINMODE) from --with-binmode
165 AC_ARG_WITH([binmode],
166 [ --with-binmode=MODE select mode for binaries],
167 AC_MSG_RESULT(BINMODE is $withval)
170 echo "BINMODE defaults to $BINMODE"
175 dnl set $(MANOWNER) from --with-manowner
177 AC_ARG_WITH([manowner],
178 [ --with-manowner=USER select owner for manual pages],
179 AC_MSG_RESULT(MANOWNER is $withval)
182 echo "MANOWNER defaults to $MANOWNER"
187 dnl set $(MANGRP) from --with-mangrp
189 AC_ARG_WITH([mangrp],
190 [ --with-mangrp=group select group for manual pages],
191 AC_MSG_RESULT(MANGRP is $withval)
194 echo "MANGRP defaults to $MANGRP"
199 dnl set $(MANMODE) from --with-manmode
201 AC_ARG_WITH([manmode],
202 [ --with-manmode=MODE select mode for manual pages],
203 AC_MSG_RESULT(MANMODE is $withval)
206 echo "MANMODE defaults to $MANMODE"
211 dnl Check for Ext2fs headers and libraries
213 AC_CHECK_HEADER(ext2fs/ext2fs.h, [ext2fs_h=yes], [ext2fs_h=no])
214 AC_CHECK_LIB(ext2fs, ext2fs_open, [ext2fs_lib=yes], [ext2fs_lib=no], [-lcom_err])
215 if test "$ext2fs_h" = no -o "$ext2fs_lib" = no; then
216 AC_MSG_ERROR(You need to install the Ext2fs libraries from the E2fsprogs distribution first)
220 dnl Check for library functions
222 AC_CHECK_FUNCS(err errx verr verrx vwarn vwarnx warn warnx realpath)
227 AC_CHECK_TYPE(quad_t, __s64)
228 AC_CHECK_TYPE(u_quad_t, __u64)
231 dnl Compute top_buildir
233 top_builddir=`cd .; pwd`
234 AC_SUBST(top_builddir)
237 dnl Create directories
239 test -d compat || mkdir compat
240 test -d compat/lib || mkdir compat/lib
245 AC_OUTPUT(MCONFIG Makefile common/Makefile compat/lib/Makefile dump/Makefile restore/Makefile $RMTMAKEFILE)