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-debug
25 AC_ARG_ENABLE([debug],
26 [ --enable-debug include debugging code],
27 if test "$enableval" = "no"
32 DUMPDEBUG="-DFDEBUG -DTDEBUG -DWRITEDEBUG -DDIRDEBUG"
33 RESTOREDEBUG="-DDIRDEBUG"
39 AC_SUBST(RESTOREDEBUG)
42 dnl Handle --enable-static
44 AC_ARG_ENABLE([static],
45 [ --enable-static link dump and restore statically],
46 if test "$enableval" = "no"
54 echo "Linking dump and restore dynamically by default"
59 dnl Handle --enable-rmt
62 [ --enable-rmt compile and install rmt],
63 if test "$enableval" = "no"
69 RMTMAKEFILE="rmt/Makefile"
73 echo "Not compiling rmt by default"
78 dnl set $(CC) from --with-cc=value
81 [ --with-cc=COMPILER select compiler to use],
82 AC_MSG_RESULT(CC=$withval)
84 if test -z "$CC" ; then CC=cc; fi
85 [AC_MSG_RESULT(CC defaults to $CC)])dnl
90 dnl set $(LD) from --with-linker=value
93 [ --with-linker=LINKER select linker to use],
94 AC_MSG_RESULT(LD=$withval)
96 if test -z "$LD" ; then LD=$CC; fi
97 [AC_MSG_RESULT(LD defaults to $LD)])dnl
102 dnl set $(CCOPTS) from --with-ccopts=value
104 AC_ARG_WITH([ccopts],
105 [ --with-ccopts=CCOPTS select compiler command line options],
106 AC_MSG_RESULT(CCOPTS is $withval)
108 CFLAGS="$CFLAGS $withval",
113 dnl set $(LDFLAGS) from --with-ldopts=value
115 AC_ARG_WITH([ldopts],
116 [ --with-ldopts=LDOPTS select linker command line options],
117 AC_MSG_RESULT(LDFLAGS is $withval)
123 dnl set $(BINOWNER) from --with-binowner
125 AC_ARG_WITH([binowner],
126 [ --with-binowner=USER select owner for binaries],
127 AC_MSG_RESULT(BINOWNER is $withval)
130 echo "BINOWNER defaults to $BINOWNER"
135 dnl set $(BINGRP) from --with-bingrp
137 AC_ARG_WITH([bingrp],
138 [ --with-bingrp=GROUP select group for binaries],
139 AC_MSG_RESULT(BINGRP is $withval)
142 echo "BINGRP defaults to $BINGRP"
147 dnl set $(BINMODE) from --with-binmode
149 AC_ARG_WITH([binmode],
150 [ --with-binmode=MODE select mode for binaries],
151 AC_MSG_RESULT(BINMODE is $withval)
154 echo "BINMODE defaults to $BINMODE"
159 dnl set $(MANOWNER) from --with-manowner
161 AC_ARG_WITH([manowner],
162 [ --with-manowner=USER select owner for manual pages],
163 AC_MSG_RESULT(MANOWNER is $withval)
166 echo "MANOWNER defaults to $MANOWNER"
171 dnl set $(MANGRP) from --with-mangrp
173 AC_ARG_WITH([mangrp],
174 [ --with-mangrp=group select group for manual pages],
175 AC_MSG_RESULT(MANGRP is $withval)
178 echo "MANGRP defaults to $MANGRP"
183 dnl set $(MANMODE) from --with-manmode
185 AC_ARG_WITH([manmode],
186 [ --with-manmode=MODE select mode for manual pages],
187 AC_MSG_RESULT(MANMODE is $withval)
190 echo "MANMODE defaults to $MANMODE"
195 dnl set $(DUMPDATESPATH) from --with-dumpdatespath
197 AC_ARG_WITH([dumpdatespath],
198 [ --with-dumpdatespath=path select path for dumpdates file],
199 AC_MSG_RESULT(DUMPDATESPATH is $withval)
200 DUMPDATESPATH=$withval,
201 DUMPDATESPATH="/etc/dumpdates"
202 echo "DUMPDATESPATH defaults to $DUMPDATESPATH"
204 AC_SUBST(DUMPDATESPATH)
207 dnl Check for Ext2fs headers and libraries
209 AC_CHECK_HEADER(ext2fs/ext2fs.h, [ext2fs_h=yes], [ext2fs_h=no])
210 AC_CHECK_LIB(ext2fs, ext2fs_open, [ext2fs_lib=yes], [ext2fs_lib=no], [-lcom_err])
211 if test "$ext2fs_h" = no -o "$ext2fs_lib" = no; then
212 AC_MSG_ERROR(You need to install the Ext2fs libraries from the E2fsprogs distribution first)
216 dnl Check for library functions
218 AC_CHECK_FUNCS(err errx verr verrx vwarn vwarnx warn warnx realpath glob)
223 AC_CHECK_TYPE(quad_t, __s64)
224 AC_CHECK_TYPE(u_quad_t, __u64)
227 dnl Compute top_buildir
229 top_builddir=`cd .; pwd`
230 AC_SUBST(top_builddir)
233 dnl Create directories
235 test -d compat || mkdir compat
236 test -d compat/lib || mkdir compat/lib
241 AC_OUTPUT(MCONFIG Makefile common/Makefile compat/include/Makefile compat/lib/Makefile dump/Makefile restore/Makefile $RMTMAKEFILE)