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 (default is NO)],
27 if test "$enableval" = "no"
31 echo "Not including debugging code"
33 DUMPDEBUG="-DFDEBUG -DTDEBUG -DWRITEDEBUG -DDIRDEBUG"
34 RESTOREDEBUG="-DDIRDEBUG"
35 echo "Including debugging code"
39 echo "Not including debugging code by default"
42 AC_SUBST(RESTOREDEBUG)
45 dnl Handle --enable-static
47 AC_ARG_ENABLE([static],
48 [ --enable-static link dump and restore statically (default is NO)],
49 if test "$enableval" = "no"
52 echo "Linking dump and restore dynamically"
55 echo "Linking dump and restore statically"
59 echo "Linking dump and restore dynamically by default"
64 dnl Handle --enable-rmt
67 [ --enable-rmt compile and install rmt (default is YES)],
68 if test "$enableval" = "no"
72 echo "Not compiling rmt"
75 RMTMAKEFILE="rmt/Makefile"
80 RMTMAKEFILE="rmt/Makefile"
81 echo "Compiling rmt by default"
86 dnl Handle --enable-kerberos
88 AC_ARG_ENABLE([kerberos],
89 [ --enable-kerberos compile kerberos extensions (default is NO)],
90 if test "$enableval" = "yes"
93 echo "Compiling kerberos extensions"
96 echo "Not compiling kerberos extensions"
100 echo "Not compiling kerberos extensions by default"
105 dnl Handle --enable-readline
107 AC_ARG_ENABLE([readline],
108 [ --enable-readline enable readline support in restore (default is YES)],
109 if test "$enableval" = "no"
112 echo "Not including readline support"
114 READLINE="-lreadline -ltermcap"
115 AC_DEFINE(HAVE_READLINE)
116 echo "Including readline support"
119 READLINE="-lreadline -ltermcap"
120 AC_DEFINE(HAVE_READLINE)
121 echo "Including readline support by default"
126 dnl Handle --enable-oldsylefscript
128 AC_ARG_ENABLE([oldstylefscript],
129 [ --enable-oldstylefscript enable old style F script (no arguments) (default is NO)],
130 if test "$enableval" = "yes"
132 AC_DEFINE(OLD_STYLE_FSCRIPT)
133 echo "Using old style F script"
135 echo "Using new style F script"
138 echo "Using new style F script by default"
142 dnl Handle --enable-largefile
144 AC_ARG_ENABLE([largefile],
145 [ --enable-largefile enable Large File System support (default is YES)],
146 if test "$enableval" = "yes"
149 echo "Enabling Large File System support"
151 echo "Not enabling Large File System support"
155 echo "Enabling Large File System support by default"
159 dnl Handle --enable-qfa
162 [ --enable-qfa enable Quick File Access support (default is YES)],
163 if test "$enableval" = "yes"
166 echo "Enabling Quick File Access support"
168 echo "Not enabling Quick File Access support"
172 echo "Enabling Quick File Access support by default"
176 dnl Handle --enable-qfadebug
178 AC_ARG_ENABLE([qfadebug],
179 [ --enable-qfadebug include Quick File Access debugging code (default is NO)],
180 if test "$enableval" = "yes"
183 echo "Including Quick File Access debugging code"
185 echo "Not including Quick File Access debugging code"
188 echo "Not including Quick File Access debugging code by default"
192 dnl set $(CC) from --with-cc=value
195 [ --with-cc=COMPILER select compiler to use],
196 AC_MSG_RESULT(CC=$withval)
198 if test -z "$CC" ; then CC=cc; fi
199 [AC_MSG_RESULT(CC defaults to $CC)])dnl
204 dnl set $(LD) from --with-linker=value
206 AC_ARG_WITH([linker],
207 [ --with-linker=LINKER select linker to use],
208 AC_MSG_RESULT(LD=$withval)
210 if test -z "$LD" ; then LD=$CC; fi
211 [AC_MSG_RESULT(LD defaults to $LD)])dnl
216 dnl set $(CCOPTS) from --with-ccopts=value
218 AC_ARG_WITH([ccopts],
219 [ --with-ccopts=CCOPTS select compiler command line options],
220 AC_MSG_RESULT(CCOPTS is $withval)
222 CFLAGS="$CFLAGS $withval",
227 dnl set $(LDFLAGS) from --with-ldopts=value
229 AC_ARG_WITH([ldopts],
230 [ --with-ldopts=LDOPTS select linker command line options],
231 AC_MSG_RESULT(LDFLAGS is $withval)
233 LDFLAGS="$LDFLAGS $withval",
238 dnl set $(BINOWNER) from --with-binowner
240 AC_ARG_WITH([binowner],
241 [ --with-binowner=USER select owner for binaries],
242 AC_MSG_RESULT(BINOWNER is $withval)
245 echo "BINOWNER defaults to $BINOWNER"
250 dnl set $(BINGRP) from --with-bingrp
252 AC_ARG_WITH([bingrp],
253 [ --with-bingrp=GROUP select group for binaries],
254 AC_MSG_RESULT(BINGRP is $withval)
257 echo "BINGRP defaults to $BINGRP"
262 dnl set $(BINMODE) from --with-binmode
264 AC_ARG_WITH([binmode],
265 [ --with-binmode=MODE select mode for binaries],
266 AC_MSG_RESULT(BINMODE is $withval)
269 echo "BINMODE defaults to $BINMODE"
274 dnl set $(MANOWNER) from --with-manowner
276 AC_ARG_WITH([manowner],
277 [ --with-manowner=USER select owner for manual pages],
278 AC_MSG_RESULT(MANOWNER is $withval)
281 echo "MANOWNER defaults to $MANOWNER"
286 dnl set $(MANGRP) from --with-mangrp
288 AC_ARG_WITH([mangrp],
289 [ --with-mangrp=GROUP select group for manual pages],
290 AC_MSG_RESULT(MANGRP is $withval)
293 echo "MANGRP defaults to $MANGRP"
298 dnl set $(MANMODE) from --with-manmode
300 AC_ARG_WITH([manmode],
301 [ --with-manmode=MODE select mode for manual pages],
302 AC_MSG_RESULT(MANMODE is $withval)
305 echo "MANMODE defaults to $MANMODE"
310 dnl set $(DUMPDATESPATH) from --with-dumpdatespath
312 AC_ARG_WITH([dumpdatespath],
313 [ --with-dumpdatespath=PATH select path for dumpdates file],
314 AC_MSG_RESULT(DUMPDATESPATH is $withval)
315 DUMPDATESPATH=$withval,
316 DUMPDATESPATH="${sysconfdir}/dumpdates"
317 echo "DUMPDATESPATH defaults to $DUMPDATESPATH"
319 AC_SUBST(DUMPDATESPATH)
322 dnl Check for Ext2fs headers and libraries
324 AC_CHECK_HEADER(ext2fs/ext2fs.h, [ext2fs_h=yes], [ext2fs_h=no])
325 AC_CHECK_LIB(ext2fs, ext2fs_open, [ext2fs_lib=yes], [ext2fs_lib=no], [-lcom_err])
326 if test "$ext2fs_h" = no -o "$ext2fs_lib" = no; then
327 AC_MSG_ERROR(You need to install the Ext2fs libraries from the E2fsprogs distribution first - hint: make install-libs)
331 dnl Try to use ext2_fs.h header from libext2fs instead of from the kernel
333 AC_CHECK_HEADERS(ext2fs/ext2_fs.h)
336 dnl Check for ext2_ino_t type
338 AC_MSG_CHECKING(for ext2_ino_t type in libext2fs headers)
339 AC_TRY_COMPILE([#include <stdio.h>
340 #ifdef HAVE_EXT2FS_EXT2_FS_H
341 #include <ext2fs/ext2_fs.h>
343 #include <linux/ext2_fs.h>
345 #include <ext2fs/ext2fs.h>],
346 [ext2_ino_t ino = 0;],
347 [AC_DEFINE(HAVE_EXT2_INO_T) AC_MSG_RESULT(yes)],
351 dnl Check for s_journal_inum field in ext2_super_block struct
353 AC_MSG_CHECKING(for s_journal_inum field in ext2_super_block struct)
354 AC_TRY_COMPILE([#include <stdio.h>
355 #ifdef HAVE_EXT2FS_EXT2_FS_H
356 #include <ext2fs/ext2_fs.h>
358 #include <linux/ext2_fs.h>
360 #include <ext2fs/ext2fs.h>],
361 [struct ext2_super_block es; es.s_journal_inum = 0;],
362 [AC_DEFINE(HAVE_EXT2_JOURNAL_INUM) AC_MSG_RESULT(yes)],
366 dnl Check for termcap libraries
368 AC_CHECK_LIB(termcap, tgetent, [termcap_lib=yes], [termcap_lib=no])
369 if test "$termcap_lib" = no; then
370 if test "$READLINE" = "-lreadline -ltermcap"; then
371 AC_MSG_ERROR(You need to install the GNU termcap library or configure without --enable-readline)
376 dnl Check for readline headers and libraries
378 AC_CHECK_HEADER(readline/readline.h, [readline_h=yes], [readline_h=no])
379 AC_CHECK_LIB(readline, readline, [readline_lib=yes], [readline_lib=no], "-ltermcap")
380 if test "$readline_h" = no -o "$readline_lib" = no; then
381 if test "$READLINE" = "-lreadline -ltermcap"; then
382 AC_MSG_ERROR(You need to install the GNU readline library or configure without --enable-readline)
387 dnl Check for rl_completion_matches
389 AC_CHECK_LIB(readline, rl_completion_matches, [rlcm=yes], [rlcm=no], "-ltermcap")
390 if test "$rlcm" = yes; then
391 AC_DEFINE(HAVE_READLINE_RLCM)
395 dnl Check for rl_completion_append_character
397 AC_CHECK_LIB(readline, rl_completion_append_character, [rcac=yes], [rcac=no], "-ltermcap")
398 if test "$rcac" = yes; then
399 AC_DEFINE(HAVE_READLINE_CAC)
403 dnl Check for zlib headers and libraries
405 AC_CHECK_HEADER(zlib.h, [zlib_h=yes], [zlib_h=no])
406 AC_CHECK_LIB(z, compress2, [zlib_lib=yes], [zlib_lib=no])
407 if test "$zlib_h" = yes -a "$zlib_lib" = yes; then
416 dnl Check for bzlib headers and libraries
418 AC_CHECK_HEADER(bzlib.h, [bzlib_h=yes], [bzlib_h=no])
419 AC_CHECK_LIB(bz2, BZ2_bzBuffToBuffCompress, [bzlib_lib=yes], [bzlib_lib=no])
420 if test "$bzlib_h" = yes -a "$bzlib_lib" = yes; then
422 AC_DEFINE(HAVE_BZLIB)
429 dnl Check for library functions
431 AC_CHECK_FUNCS(err errx verr verrx vwarn vwarnx warn warnx realpath lchown)
435 dnl Check for GLOB_ALTDIRFUNC
437 AC_MSG_CHECKING(for extended glob routines)
438 if test "$ac_cv_func_glob" = "yes"; then
442 # ifdef GLOB_ALTDIRFUNC
452 echo "Your system does not support extended glob, will use the internal routines"
459 AC_CHECK_TYPE(quad_t, int64_t)
460 AC_CHECK_TYPE(u_quad_t, uint64_t)
463 dnl Compute top_buildir
465 top_builddir=`cd .; pwd`
466 AC_SUBST(top_builddir)
469 dnl Create directories
471 test -d compat || mkdir compat
472 test -d compat/lib || mkdir compat/lib
477 AC_OUTPUT(MCONFIG Makefile common/Makefile compat/include/Makefile compat/lib/Makefile dump/Makefile restore/Makefile $RMTMAKEFILE)