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 set $(CC) from --with-cc=value
98 [ --with-cc=COMPILER select compiler to use],
99 AC_MSG_RESULT(CC=$withval)
101 if test -z "$CC" ; then CC=cc; fi
102 [AC_MSG_RESULT(CC defaults to $CC)])dnl
107 dnl set $(LD) from --with-linker=value
109 AC_ARG_WITH([linker],
110 [ --with-linker=LINKER select linker to use],
111 AC_MSG_RESULT(LD=$withval)
113 if test -z "$LD" ; then LD=$CC; fi
114 [AC_MSG_RESULT(LD defaults to $LD)])dnl
119 dnl set $(CCOPTS) from --with-ccopts=value
121 AC_ARG_WITH([ccopts],
122 [ --with-ccopts=CCOPTS select compiler command line options],
123 AC_MSG_RESULT(CCOPTS is $withval)
125 CFLAGS="$CFLAGS $withval",
130 dnl set $(LDFLAGS) from --with-ldopts=value
132 AC_ARG_WITH([ldopts],
133 [ --with-ldopts=LDOPTS select linker command line options],
134 AC_MSG_RESULT(LDFLAGS is $withval)
140 dnl set $(BINOWNER) from --with-binowner
142 AC_ARG_WITH([binowner],
143 [ --with-binowner=USER select owner for binaries],
144 AC_MSG_RESULT(BINOWNER is $withval)
147 echo "BINOWNER defaults to $BINOWNER"
152 dnl set $(BINGRP) from --with-bingrp
154 AC_ARG_WITH([bingrp],
155 [ --with-bingrp=GROUP select group for binaries],
156 AC_MSG_RESULT(BINGRP is $withval)
159 echo "BINGRP defaults to $BINGRP"
164 dnl set $(BINMODE) from --with-binmode
166 AC_ARG_WITH([binmode],
167 [ --with-binmode=MODE select mode for binaries],
168 AC_MSG_RESULT(BINMODE is $withval)
171 echo "BINMODE defaults to $BINMODE"
176 dnl set $(MANOWNER) from --with-manowner
178 AC_ARG_WITH([manowner],
179 [ --with-manowner=USER select owner for manual pages],
180 AC_MSG_RESULT(MANOWNER is $withval)
183 echo "MANOWNER defaults to $MANOWNER"
188 dnl set $(MANGRP) from --with-mangrp
190 AC_ARG_WITH([mangrp],
191 [ --with-mangrp=group select group for manual pages],
192 AC_MSG_RESULT(MANGRP is $withval)
195 echo "MANGRP defaults to $MANGRP"
200 dnl set $(MANMODE) from --with-manmode
202 AC_ARG_WITH([manmode],
203 [ --with-manmode=MODE select mode for manual pages],
204 AC_MSG_RESULT(MANMODE is $withval)
207 echo "MANMODE defaults to $MANMODE"
212 dnl set $(DUMPDATESPATH) from --with-dumpdatespath
214 AC_ARG_WITH([dumpdatespath],
215 [ --with-dumpdatespath=path select path for dumpdates file],
216 AC_MSG_RESULT(DUMPDATESPATH is $withval)
217 DUMPDATESPATH=$withval,
218 DUMPDATESPATH="/etc/dumpdates"
219 echo "DUMPDATESPATH defaults to $DUMPDATESPATH"
221 AC_SUBST(DUMPDATESPATH)
224 dnl Check for Ext2fs headers and libraries
226 AC_CHECK_HEADER(ext2fs/ext2fs.h, [ext2fs_h=yes], [ext2fs_h=no])
227 AC_CHECK_LIB(ext2fs, ext2fs_open, [ext2fs_lib=yes], [ext2fs_lib=no], [-lcom_err])
228 if test "$ext2fs_h" = no -o "$ext2fs_lib" = no; then
229 AC_MSG_ERROR(You need to install the Ext2fs libraries from the E2fsprogs distribution first)
233 dnl Check for library functions
235 AC_CHECK_FUNCS(err errx verr verrx vwarn vwarnx warn warnx realpath lchown)
239 dnl Check for GLOB_ALTDIRFUNC
241 if test "$ac_cv_func_glob" = "yes"; then
245 # ifdef GLOB_ALTDIRFUNC
248 ], AC_DEFINE(HAVE_GLOB), noglob=yes)
249 if test "$noglob" = "yes"; then
250 echo "Your system does not support extended glob, will use the internal routines"
257 AC_CHECK_TYPE(quad_t, __s64)
258 AC_CHECK_TYPE(u_quad_t, __u64)
261 dnl Compute top_buildir
263 top_builddir=`cd .; pwd`
264 AC_SUBST(top_builddir)
267 dnl Create directories
269 test -d compat || mkdir compat
270 test -d compat/lib || mkdir compat/lib
275 AC_OUTPUT(MCONFIG Makefile common/Makefile compat/include/Makefile compat/lib/Makefile dump/Makefile restore/Makefile $RMTMAKEFILE)