]> git.wh0rd.org - dump.git/blame_incremental - configure.in
Fix dump -w|-W (/etc/mtab does have 0 0 as passno/freq)
[dump.git] / configure.in
... / ...
CommitLineData
1AC_INIT(dump/dump.h)
2
3MCONFIG=./MCONFIG
4AC_SUBST_FILE(MCONFIG)
5
6AC_CONFIG_HEADER(config.h)
7
8dnl
9dnl Check for programs
10dnl
11AC_PROG_MAKE_SET
12AC_PROG_LN_S
13AC_PATH_PROG(CP, cp, cp)
14AC_PATH_PROG(MV, mv, mv)
15AC_PATH_PROG(RM, rm, rm)
16AC_CHECK_TOOL(AR, ar, ar)
17AC_CHECK_TOOL(RANLIB, ranlib, :)
18AC_CHECK_TOOL(PATCH, patch, :)
19AC_PROG_CC
20AC_PROG_INSTALL
21
22dnl
23dnl Handle --enable-debug
24dnl
25AC_ARG_ENABLE([debug],
26[ --enable-debug include debugging code (default is NO)],
27if test "$enableval" = "no"
28then
29 DUMPDEBUG=""
30 RESTOREDEBUG=""
31 echo "Not including debugging code"
32else
33 DUMPDEBUG="-DFDEBUG -DTDEBUG -DWRITEDEBUG -DDIRDEBUG"
34 RESTOREDEBUG="-DDIRDEBUG"
35 echo "Including debugging code"
36fi,
37DUMPDEBUG=""
38RESTOREDEBUG=""
39echo "Not including debugging code by default"
40)
41AC_SUBST(DUMPDEBUG)
42AC_SUBST(RESTOREDEBUG)
43
44dnl
45dnl Handle --enable-static
46dnl
47AC_ARG_ENABLE([static],
48[ --enable-static link dump and restore statically (default is NO)],
49if test "$enableval" = "no"
50then
51 STATIC=""
52 echo "Linking dump and restore dynamically"
53else
54 STATIC="-static"
55 echo "Linking dump and restore statically"
56fi
57,
58STATIC=""
59echo "Linking dump and restore dynamically by default"
60)
61AC_SUBST(STATIC)
62
63dnl
64dnl Handle --enable-rmt
65dnl
66AC_ARG_ENABLE([rmt],
67[ --enable-rmt compile and install rmt (default is YES)],
68if test "$enableval" = "no"
69then
70 RMTDIR=""
71 RMTMAKEFILE=""
72 echo "Not compiling rmt"
73else
74 RMTDIR="rmt"
75 RMTMAKEFILE="rmt/Makefile"
76 echo "Compiling rmt"
77fi
78,
79RMTDIR="rmt"
80RMTMAKEFILE="rmt/Makefile"
81echo "Compiling rmt by default"
82)
83AC_SUBST(RMTDIR)
84
85dnl
86dnl Handle --enable-ermt
87dnl
88AC_ARG_ENABLE([ermt],
89[ --enable-ermt compile ermt, an encrypting version of rmt (default is NO)],
90if test "$enableval" = "no"
91then
92 ERMT=""
93 CRYPTO=""
94 echo "Not compiling ermt"
95else
96 if test "$RMTDIR" = ""
97 then
98 AC_MSG_ERROR(ermt requires --enable-rmt)
99 fi
100 ERMT="ermt"
101 CRYPTO="-lcrypto"
102 echo "Compiling ermt"
103fi
104,
105ERMT=""
106CRYPTO=""
107echo "Not compiling ermt by default"
108)
109AC_SUBST(ERMT)
110AC_SUBST(CRYPTO)
111
112dnl
113dnl Handle --enable-kerberos
114dnl
115AC_ARG_ENABLE([kerberos],
116[ --enable-kerberos compile kerberos extensions (default is NO)],
117if test "$enableval" = "yes"
118then
119 OPTDEFS="-DKERBEROS"
120 echo "Compiling kerberos extensions"
121else
122 OPTDEFS=""
123 echo "Not compiling kerberos extensions"
124fi
125,
126OPTDEFS=""
127echo "Not compiling kerberos extensions by default"
128)
129AC_SUBST(OPTDEFS)
130
131dnl
132dnl Handle --enable-readline
133dnl
134AC_ARG_ENABLE([readline],
135[ --enable-readline enable readline support in restore (default is YES)],
136if test "$enableval" = "no"
137then
138 READLINE=""
139 echo "Not including readline support"
140else
141 READLINE="-lreadline -ltermcap"
142 AC_DEFINE(HAVE_READLINE)
143 echo "Including readline support"
144fi
145,
146READLINE="-lreadline -ltermcap"
147AC_DEFINE(HAVE_READLINE)
148echo "Including readline support by default"
149)
150AC_SUBST(READLINE)
151
152dnl
153dnl Handle --enable-oldsylefscript
154dnl
155AC_ARG_ENABLE([oldstylefscript],
156[ --enable-oldstylefscript enable old style F script (no arguments) (default is NO)],
157if test "$enableval" = "yes"
158then
159 AC_DEFINE(OLD_STYLE_FSCRIPT)
160 echo "Using old style F script"
161else
162 echo "Using new style F script"
163fi
164,
165echo "Using new style F script by default"
166)
167
168dnl
169dnl Handle --enable-largefile
170dnl
171AC_ARG_ENABLE([largefile],
172[ --enable-largefile enable Large File System support (default is YES)],
173if test "$enableval" = "yes"
174then
175 AC_DEFINE(USE_LFS)
176 echo "Enabling Large File System support"
177else
178 echo "Not enabling Large File System support"
179fi
180,
181AC_DEFINE(USE_LFS)
182echo "Enabling Large File System support by default"
183)
184
185dnl
186dnl Handle --enable-qfa
187dnl
188AC_ARG_ENABLE([qfa],
189[ --enable-qfa enable Quick File Access support (default is YES)],
190if test "$enableval" = "yes"
191then
192 AC_DEFINE(USE_QFA)
193 echo "Enabling Quick File Access support"
194else
195 echo "Not enabling Quick File Access support"
196fi
197,
198AC_DEFINE(USE_QFA)
199echo "Enabling Quick File Access support by default"
200)
201
202dnl
203dnl Handle --enable-qfadebug
204dnl
205AC_ARG_ENABLE([qfadebug],
206[ --enable-qfadebug include Quick File Access debugging code (default is NO)],
207if test "$enableval" = "yes"
208then
209 AC_DEFINE(DEBUG_QFA)
210 echo "Including Quick File Access debugging code"
211else
212 echo "Not including Quick File Access debugging code"
213fi
214,
215echo "Not including Quick File Access debugging code by default"
216)
217
218dnl
219dnl set $(CC) from --with-cc=value
220dnl
221AC_ARG_WITH([cc],
222[ --with-cc=COMPILER select compiler to use],
223AC_MSG_RESULT(CC=$withval)
224CC=$withval,
225if test -z "$CC" ; then CC=cc; fi
226[AC_MSG_RESULT(CC defaults to $CC)])dnl
227export CC
228AC_SUBST([CC])
229
230dnl
231dnl set $(LD) from --with-linker=value
232dnl
233AC_ARG_WITH([linker],
234[ --with-linker=LINKER select linker to use],
235AC_MSG_RESULT(LD=$withval)
236LD=$withval,
237if test -z "$LD" ; then LD=$CC; fi
238[AC_MSG_RESULT(LD defaults to $LD)])dnl
239export LD
240AC_SUBST([LD])
241
242dnl
243dnl set $(CCOPTS) from --with-ccopts=value
244dnl
245AC_ARG_WITH([ccopts],
246[ --with-ccopts=CCOPTS select compiler command line options],
247AC_MSG_RESULT(CCOPTS is $withval)
248CCOPTS=$withval
249CFLAGS="$CFLAGS $withval",
250CCOPTS=)dnl
251AC_SUBST(CCOPTS)
252
253dnl
254dnl set $(LDFLAGS) from --with-ldopts=value
255dnl
256AC_ARG_WITH([ldopts],
257[ --with-ldopts=LDOPTS select linker command line options],
258AC_MSG_RESULT(LDFLAGS is $withval)
259LDOPTS=$withval
260LDFLAGS="$LDFLAGS $withval",
261LDOPTS=)dnl
262AC_SUBST(LDOPTS)
263
264dnl
265dnl set $(BINOWNER) from --with-binowner
266dnl
267AC_ARG_WITH([binowner],
268[ --with-binowner=USER select owner for binaries],
269AC_MSG_RESULT(BINOWNER is $withval)
270BINOWNER=$withval,
271BINOWNER=root
272echo "BINOWNER defaults to $BINOWNER"
273)dnl
274AC_SUBST(BINOWNER)
275
276dnl
277dnl set $(BINGRP) from --with-bingrp
278dnl
279AC_ARG_WITH([bingrp],
280[ --with-bingrp=GROUP select group for binaries],
281AC_MSG_RESULT(BINGRP is $withval)
282BINGRP=$withval,
283BINGRP=tty
284echo "BINGRP defaults to $BINGRP"
285)dnl
286AC_SUBST(BINGRP)
287
288dnl
289dnl set $(BINMODE) from --with-binmode
290dnl
291AC_ARG_WITH([binmode],
292[ --with-binmode=MODE select mode for binaries],
293AC_MSG_RESULT(BINMODE is $withval)
294BINMODE=$withval,
295BINMODE=0755
296echo "BINMODE defaults to $BINMODE"
297)dnl
298AC_SUBST(BINMODE)
299
300dnl
301dnl set $(MANOWNER) from --with-manowner
302dnl
303AC_ARG_WITH([manowner],
304[ --with-manowner=USER select owner for manual pages],
305AC_MSG_RESULT(MANOWNER is $withval)
306MANOWNER=$withval,
307MANOWNER=man
308echo "MANOWNER defaults to $MANOWNER"
309)dnl
310AC_SUBST(MANOWNER)
311
312dnl
313dnl set $(MANGRP) from --with-mangrp
314dnl
315AC_ARG_WITH([mangrp],
316[ --with-mangrp=GROUP select group for manual pages],
317AC_MSG_RESULT(MANGRP is $withval)
318MANGRP=$withval,
319MANGRP=tty
320echo "MANGRP defaults to $MANGRP"
321)dnl
322AC_SUBST(MANGRP)
323
324dnl
325dnl set $(MANMODE) from --with-manmode
326dnl
327AC_ARG_WITH([manmode],
328[ --with-manmode=MODE select mode for manual pages],
329AC_MSG_RESULT(MANMODE is $withval)
330MANMODE=$withval,
331MANMODE=0644
332echo "MANMODE defaults to $MANMODE"
333)dnl
334AC_SUBST(MANMODE)
335
336dnl
337dnl set $(DUMPDATESPATH) from --with-dumpdatespath
338dnl
339AC_ARG_WITH([dumpdatespath],
340[ --with-dumpdatespath=PATH select path for dumpdates file],
341AC_MSG_RESULT(DUMPDATESPATH is $withval)
342DUMPDATESPATH=$withval,
343DUMPDATESPATH="${sysconfdir}/dumpdates"
344echo "DUMPDATESPATH defaults to $DUMPDATESPATH"
345)dnl
346AC_SUBST(DUMPDATESPATH)
347
348dnl
349dnl Check for Ext2fs headers and libraries
350dnl
351AC_CHECK_HEADER(ext2fs/ext2fs.h, [ext2fs_h=yes], [ext2fs_h=no], [-])
352AC_CHECK_LIB(ext2fs, ext2fs_open, [ext2fs_lib=yes], [ext2fs_lib=no], [-lcom_err])
353if 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)
355fi
356
357dnl
358dnl Try to use ext2_fs.h header from libext2fs instead of from the kernel
359dnl
360AC_CHECK_HEADERS(ext2fs/ext2_fs.h, [], [], [-])
361
362dnl
363dnl Check for ext2_ino_t type
364dnl
365AC_MSG_CHECKING(for ext2_ino_t type in libext2fs headers)
366AC_TRY_COMPILE([#include <stdio.h>
367#ifdef HAVE_EXT2FS_EXT2_FS_H
368#include <ext2fs/ext2_fs.h>
369#else
370#include <linux/ext2_fs.h>
371#endif
372#include <ext2fs/ext2fs.h>],
373[ext2_ino_t ino = 0;],
374[AC_DEFINE(HAVE_EXT2_INO_T) AC_MSG_RESULT(yes)],
375AC_MSG_RESULT(no))
376
377dnl
378dnl Check for s_journal_inum field in ext2_super_block struct
379dnl
380AC_MSG_CHECKING(for s_journal_inum field in ext2_super_block struct)
381AC_TRY_COMPILE([#include <stdio.h>
382#ifdef HAVE_EXT2FS_EXT2_FS_H
383#include <ext2fs/ext2_fs.h>
384#else
385#include <linux/ext2_fs.h>
386#endif
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)],
390AC_MSG_RESULT(no))
391
392dnl
393dnl Check for termcap libraries
394dnl
395AC_CHECK_LIB(termcap, tgetent, [termcap_lib=yes], [termcap_lib=no])
396if 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)
399 fi
400fi
401
402dnl
403dnl Check for readline headers and libraries
404dnl
405AC_CHECK_HEADER(readline/readline.h, [readline_h=yes], [readline_h=no], [-])
406AC_CHECK_LIB(readline, readline, [readline_lib=yes], [readline_lib=no], "-ltermcap")
407if 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)
410 fi
411fi
412
413dnl
414dnl Check for rl_completion_matches
415dnl
416AC_CHECK_LIB(readline, rl_completion_matches, [rlcm=yes], [rlcm=no], "-ltermcap")
417if test "$rlcm" = yes; then
418 AC_DEFINE(HAVE_READLINE_RLCM)
419fi
420
421dnl
422dnl Check for rl_completion_append_character
423dnl
424AC_CHECK_LIB(readline, rl_completion_append_character, [rcac=yes], [rcac=no], "-ltermcap")
425if test "$rcac" = yes; then
426 AC_DEFINE(HAVE_READLINE_CAC)
427fi
428
429dnl
430dnl Check for zlib headers and libraries
431dnl
432AC_CHECK_HEADER(zlib.h, [zlib_h=yes], [zlib_h=no], [-])
433AC_CHECK_LIB(z, compress2, [zlib_lib=yes], [zlib_lib=no])
434if test "$zlib_h" = yes -a "$zlib_lib" = yes; then
435 ZLIB="-lz"
436 AC_DEFINE(HAVE_ZLIB)
437else
438 ZLIB=""
439fi
440AC_SUBST(ZLIB)
441
442dnl
443dnl Check for bzlib headers and libraries
444dnl
445AC_CHECK_HEADER(bzlib.h, [bzlib_h=yes], [bzlib_h=no], [-])
446AC_CHECK_LIB(bz2, BZ2_bzBuffToBuffCompress, [bzlib_lib=yes], [bzlib_lib=no])
447if test "$bzlib_h" = yes -a "$bzlib_lib" = yes; then
448 BZLIB="-lbz2"
449 AC_DEFINE(HAVE_BZLIB)
450else
451 BZLIB=""
452fi
453AC_SUBST(BZLIB)
454
455dnl
456dnl Check for library functions
457dnl
458AC_CHECK_FUNCS(err errx verr verrx vwarn vwarnx warn warnx realpath lchown)
459AC_CHECK_FUNC(glob)
460
461dnl
462dnl Check for GLOB_ALTDIRFUNC
463dnl
464AC_MSG_CHECKING(for extended glob routines)
465if test "$ac_cv_func_glob" = "yes"; then
466 AC_EGREP_CPP(yes,
467 [
468# include <glob.h>
469# ifdef GLOB_ALTDIRFUNC
470 yes
471# endif
472 ],
473 [
474 AC_DEFINE(HAVE_GLOB)
475 AC_MSG_RESULT(yes)
476 ],
477 [
478 AC_MSG_RESULT(no)
479 echo "Your system does not support extended glob, will use the internal routines"
480 ])
481fi
482
483dnl
484dnl Check for types
485dnl
486AC_CHECK_TYPE(quad_t, int64_t)
487AC_CHECK_TYPE(u_quad_t, uint64_t)
488
489dnl
490dnl Compute top_buildir
491dnl
492top_builddir=`cd .; pwd`
493AC_SUBST(top_builddir)
494
495dnl
496dnl Create directories
497dnl
498test -d compat || mkdir compat
499test -d compat/lib || mkdir compat/lib
500
501dnl
502dnl Output files
503dnl
504AC_OUTPUT(MCONFIG Makefile common/Makefile compat/include/Makefile compat/lib/Makefile dump/Makefile restore/Makefile $RMTMAKEFILE)