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 Handle --enable-kerberos
80 AC_ARG_ENABLE([kerberos],
81 [ --enable-kerberos compile kerberos extensions],
82 if test "$enableval" = "yes"
90 echo "Not compiling kerberos extensions by default"
95 dnl Handle --enable-readline
97 AC_ARG_ENABLE([readline],
98 [ --enable-readline enable readline support in restore],
99 if test "$enableval" = "no"
103 READLINE="-lreadline"
104 AC_DEFINE(HAVE_READLINE)
108 echo "Not including readline support by default"
113 dnl set $(CC) from --with-cc=value
116 [ --with-cc=COMPILER select compiler to use],
117 AC_MSG_RESULT(CC=$withval)
119 if test -z "$CC" ; then CC=cc; fi
120 [AC_MSG_RESULT(CC defaults to $CC)])dnl
125 dnl set $(LD) from --with-linker=value
127 AC_ARG_WITH([linker],
128 [ --with-linker=LINKER select linker to use],
129 AC_MSG_RESULT(LD=$withval)
131 if test -z "$LD" ; then LD=$CC; fi
132 [AC_MSG_RESULT(LD defaults to $LD)])dnl
137 dnl set $(CCOPTS) from --with-ccopts=value
139 AC_ARG_WITH([ccopts],
140 [ --with-ccopts=CCOPTS select compiler command line options],
141 AC_MSG_RESULT(CCOPTS is $withval)
143 CFLAGS="$CFLAGS $withval",
148 dnl set $(LDFLAGS) from --with-ldopts=value
150 AC_ARG_WITH([ldopts],
151 [ --with-ldopts=LDOPTS select linker command line options],
152 AC_MSG_RESULT(LDFLAGS is $withval)
158 dnl set $(BINOWNER) from --with-binowner
160 AC_ARG_WITH([binowner],
161 [ --with-binowner=USER select owner for binaries],
162 AC_MSG_RESULT(BINOWNER is $withval)
165 echo "BINOWNER defaults to $BINOWNER"
170 dnl set $(BINGRP) from --with-bingrp
172 AC_ARG_WITH([bingrp],
173 [ --with-bingrp=GROUP select group for binaries],
174 AC_MSG_RESULT(BINGRP is $withval)
177 echo "BINGRP defaults to $BINGRP"
182 dnl set $(BINMODE) from --with-binmode
184 AC_ARG_WITH([binmode],
185 [ --with-binmode=MODE select mode for binaries],
186 AC_MSG_RESULT(BINMODE is $withval)
189 echo "BINMODE defaults to $BINMODE"
194 dnl set $(MANOWNER) from --with-manowner
196 AC_ARG_WITH([manowner],
197 [ --with-manowner=USER select owner for manual pages],
198 AC_MSG_RESULT(MANOWNER is $withval)
201 echo "MANOWNER defaults to $MANOWNER"
206 dnl set $(MANGRP) from --with-mangrp
208 AC_ARG_WITH([mangrp],
209 [ --with-mangrp=group select group for manual pages],
210 AC_MSG_RESULT(MANGRP is $withval)
213 echo "MANGRP defaults to $MANGRP"
218 dnl set $(MANMODE) from --with-manmode
220 AC_ARG_WITH([manmode],
221 [ --with-manmode=MODE select mode for manual pages],
222 AC_MSG_RESULT(MANMODE is $withval)
225 echo "MANMODE defaults to $MANMODE"
230 dnl set $(DUMPDATESPATH) from --with-dumpdatespath
232 AC_ARG_WITH([dumpdatespath],
233 [ --with-dumpdatespath=path select path for dumpdates file],
234 AC_MSG_RESULT(DUMPDATESPATH is $withval)
235 DUMPDATESPATH=$withval,
236 DUMPDATESPATH="/etc/dumpdates"
237 echo "DUMPDATESPATH defaults to $DUMPDATESPATH"
239 AC_SUBST(DUMPDATESPATH)
242 dnl Check for Ext2fs headers and libraries
244 AC_CHECK_HEADER(ext2fs/ext2fs.h, [ext2fs_h=yes], [ext2fs_h=no])
245 AC_CHECK_LIB(ext2fs, ext2fs_open, [ext2fs_lib=yes], [ext2fs_lib=no], [-lcom_err])
246 if test "$ext2fs_h" = no -o "$ext2fs_lib" = no; then
247 AC_MSG_ERROR(You need to install the Ext2fs libraries from the E2fsprogs distribution first - hint: make install-libs)
251 dnl Check for readline headers and libraries
253 AC_CHECK_HEADER(readline/readline.h, [readline_h=yes], [readline_h=no])
254 AC_CHECK_LIB(readline, readline, [readline_lib=yes], [readline_lib=no])
255 if test "$readline_h" = no -o "$readline_lib" = no; then
256 if test "$READLINE" = "-lreadline"; then
257 AC_MSG_ERROR(You need to install the GNU readline libraries first)
262 dnl Check for library functions
264 AC_CHECK_FUNCS(err errx verr verrx vwarn vwarnx warn warnx realpath lchown)
268 dnl Check for GLOB_ALTDIRFUNC
270 if test "$ac_cv_func_glob" = "yes"; then
274 # ifdef GLOB_ALTDIRFUNC
277 ], AC_DEFINE(HAVE_GLOB), noglob=yes)
278 if test "$noglob" = "yes"; then
279 echo "Your system does not support extended glob, will use the internal routines"
286 AC_CHECK_TYPE(quad_t, __s64)
287 AC_CHECK_TYPE(u_quad_t, __u64)
290 dnl Compute top_buildir
292 top_builddir=`cd .; pwd`
293 AC_SUBST(top_builddir)
296 dnl Create directories
298 test -d compat || mkdir compat
299 test -d compat/lib || mkdir compat/lib
304 AC_OUTPUT(MCONFIG Makefile common/Makefile compat/include/Makefile compat/lib/Makefile dump/Makefile restore/Makefile $RMTMAKEFILE)