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-ermt
89 [ --enable-ermt compile ermt, an encrypting version of rmt (default is NO)],
90 if test "$enableval" = "no"
94 echo "Not compiling ermt"
96 if test "$RMTDIR" = ""
98 AC_MSG_ERROR(ermt requires --enable-rmt)
102 echo "Compiling ermt"
107 echo "Not compiling ermt by default"
113 dnl Handle --enable-kerberos
115 AC_ARG_ENABLE([kerberos],
116 [ --enable-kerberos compile kerberos extensions (default is NO)],
117 if test "$enableval" = "yes"
120 echo "Compiling kerberos extensions"
123 echo "Not compiling kerberos extensions"
127 echo "Not compiling kerberos extensions by default"
132 dnl Handle --enable-readline
134 AC_ARG_ENABLE([readline],
135 [ --enable-readline enable readline support in restore (default is YES)],
136 if test "$enableval" = "no"
139 echo "Not including readline support"
141 READLINE="-lreadline -ltermcap"
142 AC_DEFINE(HAVE_READLINE)
143 echo "Including readline support"
146 READLINE="-lreadline -ltermcap"
147 AC_DEFINE(HAVE_READLINE)
148 echo "Including readline support by default"
153 dnl Handle --enable-oldsylefscript
155 AC_ARG_ENABLE([oldstylefscript],
156 [ --enable-oldstylefscript enable old style F script (no arguments) (default is NO)],
157 if test "$enableval" = "yes"
159 AC_DEFINE(OLD_STYLE_FSCRIPT)
160 echo "Using old style F script"
162 echo "Using new style F script"
165 echo "Using new style F script by default"
169 dnl Handle --enable-largefile
171 AC_ARG_ENABLE([largefile],
172 [ --enable-largefile enable Large File System support (default is YES)],
173 if test "$enableval" = "yes"
176 echo "Enabling Large File System support"
178 echo "Not enabling Large File System support"
182 echo "Enabling Large File System support by default"
186 dnl Handle --enable-qfa
189 [ --enable-qfa enable Quick File Access support (default is YES)],
190 if test "$enableval" = "yes"
193 echo "Enabling Quick File Access support"
195 echo "Not enabling Quick File Access support"
199 echo "Enabling Quick File Access support by default"
203 dnl Handle --enable-qfadebug
205 AC_ARG_ENABLE([qfadebug],
206 [ --enable-qfadebug include Quick File Access debugging code (default is NO)],
207 if test "$enableval" = "yes"
210 echo "Including Quick File Access debugging code"
212 echo "Not including Quick File Access debugging code"
215 echo "Not including Quick File Access debugging code by default"
219 dnl set $(CC) from --with-cc=value
222 [ --with-cc=COMPILER select compiler to use],
223 AC_MSG_RESULT(CC=$withval)
225 if test -z "$CC" ; then CC=cc; fi
226 [AC_MSG_RESULT(CC defaults to $CC)])dnl
231 dnl set $(LD) from --with-linker=value
233 AC_ARG_WITH([linker],
234 [ --with-linker=LINKER select linker to use],
235 AC_MSG_RESULT(LD=$withval)
237 if test -z "$LD" ; then LD=$CC; fi
238 [AC_MSG_RESULT(LD defaults to $LD)])dnl
243 dnl set $(CCOPTS) from --with-ccopts=value
245 AC_ARG_WITH([ccopts],
246 [ --with-ccopts=CCOPTS select compiler command line options],
247 AC_MSG_RESULT(CCOPTS is $withval)
249 CFLAGS="$CFLAGS $withval",
254 dnl set $(LDFLAGS) from --with-ldopts=value
256 AC_ARG_WITH([ldopts],
257 [ --with-ldopts=LDOPTS select linker command line options],
258 AC_MSG_RESULT(LDFLAGS is $withval)
260 LDFLAGS="$LDFLAGS $withval",
265 dnl set $(BINOWNER) from --with-binowner
267 AC_ARG_WITH([binowner],
268 [ --with-binowner=USER select owner for binaries],
269 AC_MSG_RESULT(BINOWNER is $withval)
272 echo "BINOWNER defaults to $BINOWNER"
277 dnl set $(BINGRP) from --with-bingrp
279 AC_ARG_WITH([bingrp],
280 [ --with-bingrp=GROUP select group for binaries],
281 AC_MSG_RESULT(BINGRP is $withval)
284 echo "BINGRP defaults to $BINGRP"
289 dnl set $(BINMODE) from --with-binmode
291 AC_ARG_WITH([binmode],
292 [ --with-binmode=MODE select mode for binaries],
293 AC_MSG_RESULT(BINMODE is $withval)
296 echo "BINMODE defaults to $BINMODE"
301 dnl set $(MANOWNER) from --with-manowner
303 AC_ARG_WITH([manowner],
304 [ --with-manowner=USER select owner for manual pages],
305 AC_MSG_RESULT(MANOWNER is $withval)
308 echo "MANOWNER defaults to $MANOWNER"
313 dnl set $(MANGRP) from --with-mangrp
315 AC_ARG_WITH([mangrp],
316 [ --with-mangrp=GROUP select group for manual pages],
317 AC_MSG_RESULT(MANGRP is $withval)
320 echo "MANGRP defaults to $MANGRP"
325 dnl set $(MANMODE) from --with-manmode
327 AC_ARG_WITH([manmode],
328 [ --with-manmode=MODE select mode for manual pages],
329 AC_MSG_RESULT(MANMODE is $withval)
332 echo "MANMODE defaults to $MANMODE"
337 dnl set $(DUMPDATESPATH) from --with-dumpdatespath
339 AC_ARG_WITH([dumpdatespath],
340 [ --with-dumpdatespath=PATH select path for dumpdates file],
341 AC_MSG_RESULT(DUMPDATESPATH is $withval)
342 DUMPDATESPATH=$withval,
343 DUMPDATESPATH="${sysconfdir}/dumpdates"
344 echo "DUMPDATESPATH defaults to $DUMPDATESPATH"
346 AC_SUBST(DUMPDATESPATH)
349 dnl Check for Ext2fs headers and libraries
351 AC_CHECK_HEADER(ext2fs/ext2fs.h, [ext2fs_h=yes], [ext2fs_h=no], [-])
352 AC_CHECK_LIB(ext2fs, ext2fs_open, [ext2fs_lib=yes], [ext2fs_lib=no], [-lcom_err])
353 if test "$ext2fs_h" = no -o "$ext2fs_lib" = no; then
354 AC_MSG_ERROR(You need to install the Ext2fs libraries from the E2fsprogs distribution first - hint: make install-libs)
358 dnl Try to use ext2_fs.h header from libext2fs instead of from the kernel
360 AC_CHECK_HEADERS(ext2fs/ext2_fs.h, [], [], [-])
363 dnl Check for ext2_ino_t type
365 AC_MSG_CHECKING(for ext2_ino_t type in libext2fs headers)
366 AC_TRY_COMPILE([#include <stdio.h>
367 #ifdef HAVE_EXT2FS_EXT2_FS_H
368 #include <ext2fs/ext2_fs.h>
370 #include <linux/ext2_fs.h>
372 #include <ext2fs/ext2fs.h>],
373 [ext2_ino_t ino = 0;],
374 [AC_DEFINE(HAVE_EXT2_INO_T) AC_MSG_RESULT(yes)],
378 dnl Check for s_journal_inum field in ext2_super_block struct
380 AC_MSG_CHECKING(for s_journal_inum field in ext2_super_block struct)
381 AC_TRY_COMPILE([#include <stdio.h>
382 #ifdef HAVE_EXT2FS_EXT2_FS_H
383 #include <ext2fs/ext2_fs.h>
385 #include <linux/ext2_fs.h>
387 #include <ext2fs/ext2fs.h>],
388 [struct ext2_super_block es; es.s_journal_inum = 0;],
389 [AC_DEFINE(HAVE_EXT2_JOURNAL_INUM) AC_MSG_RESULT(yes)],
393 dnl Check for termcap libraries
395 AC_CHECK_LIB(termcap, tgetent, [termcap_lib=yes], [termcap_lib=no])
396 if test "$termcap_lib" = no; then
397 if test "$READLINE" = "-lreadline -ltermcap"; then
398 AC_MSG_ERROR(You need to install the GNU termcap library or configure without --enable-readline)
403 dnl Check for readline headers and libraries
405 AC_CHECK_HEADER(readline/readline.h, [readline_h=yes], [readline_h=no], [-])
406 AC_CHECK_LIB(readline, readline, [readline_lib=yes], [readline_lib=no], "-ltermcap")
407 if test "$readline_h" = no -o "$readline_lib" = no; then
408 if test "$READLINE" = "-lreadline -ltermcap"; then
409 AC_MSG_ERROR(You need to install the GNU readline library or configure without --enable-readline)
414 dnl Check for rl_completion_matches
416 AC_CHECK_LIB(readline, rl_completion_matches, [rlcm=yes], [rlcm=no], "-ltermcap")
417 if test "$rlcm" = yes; then
418 AC_DEFINE(HAVE_READLINE_RLCM)
422 dnl Check for rl_completion_append_character
424 AC_CHECK_LIB(readline, rl_completion_append_character, [rcac=yes], [rcac=no], "-ltermcap")
425 if test "$rcac" = yes; then
426 AC_DEFINE(HAVE_READLINE_CAC)
430 dnl Check for zlib headers and libraries
432 AC_CHECK_HEADER(zlib.h, [zlib_h=yes], [zlib_h=no], [-])
433 AC_CHECK_LIB(z, compress2, [zlib_lib=yes], [zlib_lib=no])
434 if test "$zlib_h" = yes -a "$zlib_lib" = yes; then
443 dnl Check for bzlib headers and libraries
445 AC_CHECK_HEADER(bzlib.h, [bzlib_h=yes], [bzlib_h=no], [-])
446 AC_CHECK_LIB(bz2, BZ2_bzBuffToBuffCompress, [bzlib_lib=yes], [bzlib_lib=no])
447 if test "$bzlib_h" = yes -a "$bzlib_lib" = yes; then
449 AC_DEFINE(HAVE_BZLIB)
456 dnl Check for library functions
458 AC_CHECK_FUNCS(err errx verr verrx vwarn vwarnx warn warnx realpath lchown)
462 dnl Check for GLOB_ALTDIRFUNC
464 AC_MSG_CHECKING(for extended glob routines)
465 if test "$ac_cv_func_glob" = "yes"; then
469 # ifdef GLOB_ALTDIRFUNC
479 echo "Your system does not support extended glob, will use the internal routines"
484 dnl Check for OpenSSL, for ermt
486 if test "$ERMT" != ""; then
487 AC_CHECK_HEADER(openssl/evp.h, [evp_h=yes], [evp_h=no])
488 AC_CHECK_LIB(crypto, EVP_CIPHER_CTX_set_padding, [crypto_lib=yes], [crypto_lib=no])
489 if test "$evp_h" = no -o "$crypto_lib" = no; then
490 AC_MSG_ERROR(You need to install the OpenSSL library (version 0.9.7a or later), or configure without --enable-ermt)
497 AC_CHECK_TYPE(quad_t, int64_t)
498 AC_CHECK_TYPE(u_quad_t, uint64_t)
501 dnl Compute top_buildir
503 top_builddir=`cd .; pwd`
504 AC_SUBST(top_builddir)
507 dnl Create directories
509 test -d compat || mkdir compat
510 test -d compat/lib || mkdir compat/lib
515 AC_OUTPUT(MCONFIG Makefile common/Makefile compat/include/Makefile compat/lib/Makefile dump/Makefile restore/Makefile $RMTMAKEFILE)