]> git.wh0rd.org - dump.git/blame - configure.in
Fix dump -w|-W (/etc/mtab does have 0 0 as passno/freq)
[dump.git] / configure.in
CommitLineData
1227625a
SP
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
1227625a
SP
22dnl
23dnl Handle --enable-debug
24dnl
25AC_ARG_ENABLE([debug],
1daf06b9 26[ --enable-debug include debugging code (default is NO)],
1227625a
SP
27if test "$enableval" = "no"
28then
29 DUMPDEBUG=""
30 RESTOREDEBUG=""
1daf06b9 31 echo "Not including debugging code"
1227625a
SP
32else
33 DUMPDEBUG="-DFDEBUG -DTDEBUG -DWRITEDEBUG -DDIRDEBUG"
34 RESTOREDEBUG="-DDIRDEBUG"
1daf06b9 35 echo "Including debugging code"
1227625a
SP
36fi,
37DUMPDEBUG=""
38RESTOREDEBUG=""
1daf06b9 39echo "Not including debugging code by default"
1227625a
SP
40)
41AC_SUBST(DUMPDEBUG)
42AC_SUBST(RESTOREDEBUG)
43
44dnl
45dnl Handle --enable-static
46dnl
47AC_ARG_ENABLE([static],
1daf06b9 48[ --enable-static link dump and restore statically (default is NO)],
1227625a
SP
49if test "$enableval" = "no"
50then
51 STATIC=""
1daf06b9 52 echo "Linking dump and restore dynamically"
1227625a
SP
53else
54 STATIC="-static"
1daf06b9 55 echo "Linking dump and restore statically"
1227625a
SP
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],
1daf06b9 67[ --enable-rmt compile and install rmt (default is YES)],
1227625a
SP
68if test "$enableval" = "no"
69then
70 RMTDIR=""
71 RMTMAKEFILE=""
1daf06b9 72 echo "Not compiling rmt"
1227625a
SP
73else
74 RMTDIR="rmt"
75 RMTMAKEFILE="rmt/Makefile"
1daf06b9 76 echo "Compiling rmt"
1227625a
SP
77fi
78,
1daf06b9
SP
79RMTDIR="rmt"
80RMTMAKEFILE="rmt/Makefile"
81echo "Compiling rmt by default"
1227625a
SP
82)
83AC_SUBST(RMTDIR)
84
cdfe1392
SP
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
2ed89fda
SP
112dnl
113dnl Handle --enable-kerberos
114dnl
115AC_ARG_ENABLE([kerberos],
1daf06b9 116[ --enable-kerberos compile kerberos extensions (default is NO)],
2ed89fda
SP
117if test "$enableval" = "yes"
118then
119 OPTDEFS="-DKERBEROS"
1daf06b9 120 echo "Compiling kerberos extensions"
2ed89fda
SP
121else
122 OPTDEFS=""
1daf06b9 123 echo "Not compiling kerberos extensions"
2ed89fda
SP
124fi
125,
126OPTDEFS=""
127echo "Not compiling kerberos extensions by default"
128)
129AC_SUBST(OPTDEFS)
130
c38e5b6a
SP
131dnl
132dnl Handle --enable-readline
133dnl
134AC_ARG_ENABLE([readline],
1daf06b9 135[ --enable-readline enable readline support in restore (default is YES)],
c38e5b6a
SP
136if test "$enableval" = "no"
137then
138 READLINE=""
1daf06b9 139 echo "Not including readline support"
c38e5b6a 140else
5e04cc92 141 READLINE="-lreadline -ltermcap"
c38e5b6a 142 AC_DEFINE(HAVE_READLINE)
1daf06b9 143 echo "Including readline support"
c38e5b6a
SP
144fi
145,
1daf06b9
SP
146READLINE="-lreadline -ltermcap"
147AC_DEFINE(HAVE_READLINE)
148echo "Including readline support by default"
c38e5b6a
SP
149)
150AC_SUBST(READLINE)
151
d8574d45
SP
152dnl
153dnl Handle --enable-oldsylefscript
154dnl
155AC_ARG_ENABLE([oldstylefscript],
1daf06b9 156[ --enable-oldstylefscript enable old style F script (no arguments) (default is NO)],
d8574d45
SP
157if test "$enableval" = "yes"
158then
159 AC_DEFINE(OLD_STYLE_FSCRIPT)
1daf06b9
SP
160 echo "Using old style F script"
161else
162 echo "Using new style F script"
d8574d45
SP
163fi
164,
1daf06b9 165echo "Using new style F script by default"
d8574d45
SP
166)
167
d6967896
SP
168dnl
169dnl Handle --enable-largefile
170dnl
171AC_ARG_ENABLE([largefile],
1daf06b9 172[ --enable-largefile enable Large File System support (default is YES)],
d6967896
SP
173if test "$enableval" = "yes"
174then
95c74f38 175 AC_DEFINE(USE_LFS)
1daf06b9
SP
176 echo "Enabling Large File System support"
177else
178 echo "Not enabling Large File System support"
d6967896
SP
179fi
180,
1daf06b9
SP
181AC_DEFINE(USE_LFS)
182echo "Enabling Large File System support by default"
d6967896
SP
183)
184
35b24fb7
SP
185dnl
186dnl Handle --enable-qfa
187dnl
188AC_ARG_ENABLE([qfa],
1daf06b9 189[ --enable-qfa enable Quick File Access support (default is YES)],
35b24fb7
SP
190if test "$enableval" = "yes"
191then
192 AC_DEFINE(USE_QFA)
1daf06b9
SP
193 echo "Enabling Quick File Access support"
194else
195 echo "Not enabling Quick File Access support"
35b24fb7
SP
196fi
197,
1daf06b9
SP
198AC_DEFINE(USE_QFA)
199echo "Enabling Quick File Access support by default"
35b24fb7
SP
200)
201
202dnl
203dnl Handle --enable-qfadebug
204dnl
205AC_ARG_ENABLE([qfadebug],
1daf06b9 206[ --enable-qfadebug include Quick File Access debugging code (default is NO)],
35b24fb7
SP
207if test "$enableval" = "yes"
208then
209 AC_DEFINE(DEBUG_QFA)
1daf06b9
SP
210 echo "Including Quick File Access debugging code"
211else
212 echo "Not including Quick File Access debugging code"
35b24fb7
SP
213fi
214,
1daf06b9 215echo "Not including Quick File Access debugging code by default"
35b24fb7
SP
216)
217
1227625a
SP
218dnl
219dnl set $(CC) from --with-cc=value
220dnl
221AC_ARG_WITH([cc],
d8574d45 222[ --with-cc=COMPILER select compiler to use],
1227625a
SP
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],
d8574d45 234[ --with-linker=LINKER select linker to use],
1227625a
SP
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],
d8574d45 246[ --with-ccopts=CCOPTS select compiler command line options],
1227625a
SP
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],
d8574d45 257[ --with-ldopts=LDOPTS select linker command line options],
1227625a 258AC_MSG_RESULT(LDFLAGS is $withval)
e95b2aff
SP
259LDOPTS=$withval
260LDFLAGS="$LDFLAGS $withval",
261LDOPTS=)dnl
262AC_SUBST(LDOPTS)
1227625a
SP
263
264dnl
265dnl set $(BINOWNER) from --with-binowner
266dnl
267AC_ARG_WITH([binowner],
d8574d45 268[ --with-binowner=USER select owner for binaries],
1227625a
SP
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],
d8574d45 280[ --with-bingrp=GROUP select group for binaries],
1227625a
SP
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],
d8574d45 292[ --with-binmode=MODE select mode for binaries],
1227625a
SP
293AC_MSG_RESULT(BINMODE is $withval)
294BINMODE=$withval,
882090d1 295BINMODE=0755
1227625a
SP
296echo "BINMODE defaults to $BINMODE"
297)dnl
298AC_SUBST(BINMODE)
299
300dnl
301dnl set $(MANOWNER) from --with-manowner
302dnl
303AC_ARG_WITH([manowner],
d8574d45 304[ --with-manowner=USER select owner for manual pages],
1227625a
SP
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],
d8574d45 316[ --with-mangrp=GROUP select group for manual pages],
1227625a
SP
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],
d8574d45 328[ --with-manmode=MODE select mode for manual pages],
1227625a
SP
329AC_MSG_RESULT(MANMODE is $withval)
330MANMODE=$withval,
882090d1 331MANMODE=0644
1227625a
SP
332echo "MANMODE defaults to $MANMODE"
333)dnl
334AC_SUBST(MANMODE)
335
8d4197bb
SP
336dnl
337dnl set $(DUMPDATESPATH) from --with-dumpdatespath
338dnl
339AC_ARG_WITH([dumpdatespath],
d8574d45 340[ --with-dumpdatespath=PATH select path for dumpdates file],
8d4197bb
SP
341AC_MSG_RESULT(DUMPDATESPATH is $withval)
342DUMPDATESPATH=$withval,
60d46c35 343DUMPDATESPATH="${sysconfdir}/dumpdates"
8d4197bb
SP
344echo "DUMPDATESPATH defaults to $DUMPDATESPATH"
345)dnl
346AC_SUBST(DUMPDATESPATH)
347
1227625a
SP
348dnl
349dnl Check for Ext2fs headers and libraries
350dnl
d3e542e7 351AC_CHECK_HEADER(ext2fs/ext2fs.h, [ext2fs_h=yes], [ext2fs_h=no], [-])
1227625a
SP
352AC_CHECK_LIB(ext2fs, ext2fs_open, [ext2fs_lib=yes], [ext2fs_lib=no], [-lcom_err])
353if test "$ext2fs_h" = no -o "$ext2fs_lib" = no; then
d3393043 354 AC_MSG_ERROR(You need to install the Ext2fs libraries from the E2fsprogs distribution first - hint: make install-libs)
1227625a
SP
355fi
356
e4a8bde4
SP
357dnl
358dnl Try to use ext2_fs.h header from libext2fs instead of from the kernel
359dnl
d3e542e7 360AC_CHECK_HEADERS(ext2fs/ext2_fs.h, [], [], [-])
e4a8bde4 361
a4f547cd
SP
362dnl
363dnl Check for ext2_ino_t type
364dnl
7422942f 365AC_MSG_CHECKING(for ext2_ino_t type in libext2fs headers)
a4f547cd 366AC_TRY_COMPILE([#include <stdio.h>
e4a8bde4
SP
367#ifdef HAVE_EXT2FS_EXT2_FS_H
368#include <ext2fs/ext2_fs.h>
369#else
a4f547cd 370#include <linux/ext2_fs.h>
e4a8bde4
SP
371#endif
372#include <ext2fs/ext2fs.h>],
a4f547cd 373[ext2_ino_t ino = 0;],
7422942f 374[AC_DEFINE(HAVE_EXT2_INO_T) AC_MSG_RESULT(yes)],
a4f547cd
SP
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>
e4a8bde4
SP
382#ifdef HAVE_EXT2FS_EXT2_FS_H
383#include <ext2fs/ext2_fs.h>
384#else
a4f547cd 385#include <linux/ext2_fs.h>
e4a8bde4 386#endif
a4f547cd
SP
387#include <ext2fs/ext2fs.h>],
388[struct ext2_super_block es; es.s_journal_inum = 0;],
7422942f 389[AC_DEFINE(HAVE_EXT2_JOURNAL_INUM) AC_MSG_RESULT(yes)],
a4f547cd
SP
390AC_MSG_RESULT(no))
391
3e815572
SP
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
e68dc63e 398 AC_MSG_ERROR(You need to install the GNU termcap library or configure without --enable-readline)
3e815572
SP
399 fi
400fi
401
c38e5b6a
SP
402dnl
403dnl Check for readline headers and libraries
404dnl
d3e542e7 405AC_CHECK_HEADER(readline/readline.h, [readline_h=yes], [readline_h=no], [-])
3e815572 406AC_CHECK_LIB(readline, readline, [readline_lib=yes], [readline_lib=no], "-ltermcap")
c38e5b6a 407if test "$readline_h" = no -o "$readline_lib" = no; then
3e815572 408 if test "$READLINE" = "-lreadline -ltermcap"; then
e68dc63e 409 AC_MSG_ERROR(You need to install the GNU readline library or configure without --enable-readline)
c38e5b6a
SP
410 fi
411fi
412
bcecd677
SP
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
4d5ed2f3
SP
429dnl
430dnl Check for zlib headers and libraries
431dnl
d3e542e7 432AC_CHECK_HEADER(zlib.h, [zlib_h=yes], [zlib_h=no], [-])
4d5ed2f3
SP
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
88ef261e
SP
442dnl
443dnl Check for bzlib headers and libraries
444dnl
d3e542e7 445AC_CHECK_HEADER(bzlib.h, [bzlib_h=yes], [bzlib_h=no], [-])
88ef261e
SP
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
1227625a
SP
455dnl
456dnl Check for library functions
457dnl
5c1faba5
SP
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
a4f547cd 464AC_MSG_CHECKING(for extended glob routines)
5c1faba5
SP
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
a4f547cd
SP
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 ])
5c1faba5 481fi
1227625a
SP
482
483dnl
484dnl Check for types
485dnl
1a886de8
SP
486AC_CHECK_TYPE(quad_t, int64_t)
487AC_CHECK_TYPE(u_quad_t, uint64_t)
1227625a
SP
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
8d4197bb 504AC_OUTPUT(MCONFIG Makefile common/Makefile compat/include/Makefile compat/lib/Makefile dump/Makefile restore/Makefile $RMTMAKEFILE)