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 -ltermcap"
104 AC_DEFINE(HAVE_READLINE)
108 echo "Not including readline support by default"
113 dnl Handle --enable-oldsylefscript
115 AC_ARG_ENABLE([oldstylefscript],
116 [ --enable-oldstylefscript enable old style F script (no arguments)],
117 if test "$enableval" = "yes"
119 AC_DEFINE(OLD_STYLE_FSCRIPT)
122 echo "Using new style F script"
126 dnl Handle --enable-largefile
128 AC_ARG_ENABLE([largefile],
129 [ --enable-largefile enable Large File System support (your glibc needs to support it)],
130 if test "$enableval" = "yes"
132 AC_DEFINE(_FILE_OFFSET_BITS,64)
135 echo "Not enabling Large File System support"
139 dnl set $(CC) from --with-cc=value
142 [ --with-cc=COMPILER select compiler to use],
143 AC_MSG_RESULT(CC=$withval)
145 if test -z "$CC" ; then CC=cc; fi
146 [AC_MSG_RESULT(CC defaults to $CC)])dnl
151 dnl set $(LD) from --with-linker=value
153 AC_ARG_WITH([linker],
154 [ --with-linker=LINKER select linker to use],
155 AC_MSG_RESULT(LD=$withval)
157 if test -z "$LD" ; then LD=$CC; fi
158 [AC_MSG_RESULT(LD defaults to $LD)])dnl
163 dnl set $(CCOPTS) from --with-ccopts=value
165 AC_ARG_WITH([ccopts],
166 [ --with-ccopts=CCOPTS select compiler command line options],
167 AC_MSG_RESULT(CCOPTS is $withval)
169 CFLAGS="$CFLAGS $withval",
174 dnl set $(LDFLAGS) from --with-ldopts=value
176 AC_ARG_WITH([ldopts],
177 [ --with-ldopts=LDOPTS select linker command line options],
178 AC_MSG_RESULT(LDFLAGS is $withval)
184 dnl set $(BINOWNER) from --with-binowner
186 AC_ARG_WITH([binowner],
187 [ --with-binowner=USER select owner for binaries],
188 AC_MSG_RESULT(BINOWNER is $withval)
191 echo "BINOWNER defaults to $BINOWNER"
196 dnl set $(BINGRP) from --with-bingrp
198 AC_ARG_WITH([bingrp],
199 [ --with-bingrp=GROUP select group for binaries],
200 AC_MSG_RESULT(BINGRP is $withval)
203 echo "BINGRP defaults to $BINGRP"
208 dnl set $(BINMODE) from --with-binmode
210 AC_ARG_WITH([binmode],
211 [ --with-binmode=MODE select mode for binaries],
212 AC_MSG_RESULT(BINMODE is $withval)
215 echo "BINMODE defaults to $BINMODE"
220 dnl set $(MANOWNER) from --with-manowner
222 AC_ARG_WITH([manowner],
223 [ --with-manowner=USER select owner for manual pages],
224 AC_MSG_RESULT(MANOWNER is $withval)
227 echo "MANOWNER defaults to $MANOWNER"
232 dnl set $(MANGRP) from --with-mangrp
234 AC_ARG_WITH([mangrp],
235 [ --with-mangrp=GROUP select group for manual pages],
236 AC_MSG_RESULT(MANGRP is $withval)
239 echo "MANGRP defaults to $MANGRP"
244 dnl set $(MANMODE) from --with-manmode
246 AC_ARG_WITH([manmode],
247 [ --with-manmode=MODE select mode for manual pages],
248 AC_MSG_RESULT(MANMODE is $withval)
251 echo "MANMODE defaults to $MANMODE"
256 dnl set $(DUMPDATESPATH) from --with-dumpdatespath
258 AC_ARG_WITH([dumpdatespath],
259 [ --with-dumpdatespath=PATH select path for dumpdates file],
260 AC_MSG_RESULT(DUMPDATESPATH is $withval)
261 DUMPDATESPATH=$withval,
262 DUMPDATESPATH="/etc/dumpdates"
263 echo "DUMPDATESPATH defaults to $DUMPDATESPATH"
265 AC_SUBST(DUMPDATESPATH)
268 dnl Check for Ext2fs headers and libraries
270 AC_CHECK_HEADER(ext2fs/ext2fs.h, [ext2fs_h=yes], [ext2fs_h=no])
271 AC_CHECK_LIB(ext2fs, ext2fs_open, [ext2fs_lib=yes], [ext2fs_lib=no], [-lcom_err])
272 if test "$ext2fs_h" = no -o "$ext2fs_lib" = no; then
273 AC_MSG_ERROR(You need to install the Ext2fs libraries from the E2fsprogs distribution first - hint: make install-libs)
277 dnl Check for ext2_ino_t type
279 AC_MSG_CHECKING(for ext2_ino_t type in ext2 headers)
280 AC_TRY_COMPILE([#include <stdio.h>
281 #include <linux/ext2_fs.h>
282 #include <ext2fs/ext2fs.h>],
283 [ext2_ino_t ino = 0;],
284 [AC_DEFINE(HAVE_EXT2_INO_T), AC_MSG_RESULT(yes)],
288 dnl Check for s_journal_inum field in ext2_super_block struct
290 AC_MSG_CHECKING(for s_journal_inum field in ext2_super_block struct)
291 AC_TRY_COMPILE([#include <stdio.h>
292 #include <linux/ext2_fs.h>
293 #include <ext2fs/ext2fs.h>],
294 [struct ext2_super_block es; es.s_journal_inum = 0;],
295 [AC_DEFINE(HAVE_EXT2_JOURNAL_INUM), AC_MSG_RESULT(yes)],
299 dnl Check for termcap libraries
301 AC_CHECK_LIB(termcap, tgetent, [termcap_lib=yes], [termcap_lib=no])
302 if test "$termcap_lib" = no; then
303 if test "$READLINE" = "-lreadline -ltermcap"; then
304 AC_MSG_ERROR(You need to install the GNU termcap libraries first)
309 dnl Check for readline headers and libraries
311 AC_CHECK_HEADER(readline/readline.h, [readline_h=yes], [readline_h=no])
312 AC_CHECK_LIB(readline, readline, [readline_lib=yes], [readline_lib=no], "-ltermcap")
313 if test "$readline_h" = no -o "$readline_lib" = no; then
314 if test "$READLINE" = "-lreadline -ltermcap"; then
315 AC_MSG_ERROR(You need to install the GNU readline libraries first)
320 dnl Check for zlib headers and libraries
322 AC_CHECK_HEADER(zlib.h, [zlib_h=yes], [zlib_h=no])
323 AC_CHECK_LIB(z, compress2, [zlib_lib=yes], [zlib_lib=no])
324 if test "$zlib_h" = yes -a "$zlib_lib" = yes; then
333 dnl Check for library functions
335 AC_CHECK_FUNCS(err errx verr verrx vwarn vwarnx warn warnx realpath lchown)
339 dnl Check for GLOB_ALTDIRFUNC
341 AC_MSG_CHECKING(for extended glob routines)
342 if test "$ac_cv_func_glob" = "yes"; then
346 # ifdef GLOB_ALTDIRFUNC
356 echo "Your system does not support extended glob, will use the internal routines"
363 AC_CHECK_TYPE(quad_t, __s64)
364 AC_CHECK_TYPE(u_quad_t, __u64)
367 dnl Compute top_buildir
369 top_builddir=`cd .; pwd`
370 AC_SUBST(top_builddir)
373 dnl Create directories
375 test -d compat || mkdir compat
376 test -d compat/lib || mkdir compat/lib
381 AC_OUTPUT(MCONFIG Makefile common/Makefile compat/include/Makefile compat/lib/Makefile dump/Makefile restore/Makefile $RMTMAKEFILE)