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