]> git.wh0rd.org - dump.git/blame_incremental - configure.in
Regenerate configure.
[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-staticz
70dnl
71AC_ARG_ENABLE([staticz],
72[ --enable-staticz link libz and libbz2 statically (default is NO)],
73if test "$enableval" = "no"
74then
75 STATICZ="no"
76 echo "Linking libz and libbz2 dynamically"
77else
78 STATICZ="yes"
79 echo "Linking libz and libbz2 statically"
80fi
81,
82STATICZ="no"
83echo "Linking libz and libbz2 dynamically by default"
84)
85
86dnl
87dnl Handle --enable-rmt
88dnl
89AC_ARG_ENABLE([rmt],
90[ --enable-rmt compile and install rmt (default is YES)],
91if test "$enableval" = "no"
92then
93 RMTDIR=""
94 RMTMAKEFILE=""
95 echo "Not compiling rmt"
96else
97 RMTDIR="rmt"
98 RMTMAKEFILE="rmt/Makefile"
99 echo "Compiling rmt"
100fi
101,
102RMTDIR="rmt"
103RMTMAKEFILE="rmt/Makefile"
104echo "Compiling rmt by default"
105)
106AC_SUBST(RMTDIR)
107
108dnl
109dnl Handle --enable-ermt
110dnl
111AC_ARG_ENABLE([ermt],
112[ --enable-ermt compile ermt, an encrypting version of rmt (default is NO)],
113if test "$enableval" = "no"
114then
115 ERMT=""
116 echo "Not compiling ermt"
117else
118 if test "$RMTDIR" = ""
119 then
120 AC_MSG_ERROR(ermt requires --enable-rmt)
121 fi
122 ERMT="ermt"
123 echo "Compiling ermt"
124fi
125,
126ERMT=""
127echo "Not compiling ermt by default"
128)
129AC_SUBST(ERMT)
130
131dnl
132dnl Handle --enable-kerberos
133dnl
134AC_ARG_ENABLE([kerberos],
135[ --enable-kerberos compile kerberos extensions (default is NO)],
136if test "$enableval" = "yes"
137then
138 OPTDEFS="-DKERBEROS"
139 echo "Compiling kerberos extensions"
140else
141 OPTDEFS=""
142 echo "Not compiling kerberos extensions"
143fi
144,
145OPTDEFS=""
146echo "Not compiling kerberos extensions by default"
147)
148AC_SUBST(OPTDEFS)
149
150dnl
151dnl Handle --enable-readline
152dnl
153AC_ARG_ENABLE([readline],
154[ --enable-readline enable readline support in restore (default is YES)],
155if test "$enableval" = "no"
156then
157 READLINE=""
158 echo "Not including readline support"
159else
160 READLINE="yes"
161 AC_DEFINE([HAVE_READLINE],1,[Define if you want to include readline support.])
162 echo "Including readline support"
163fi
164,
165READLINE="yes"
166AC_DEFINE([HAVE_READLINE],1,[Define if you want to include readline support.])
167echo "Including readline support by default"
168)
169
170dnl
171dnl Handle --enable-oldsylefscript
172dnl
173AC_ARG_ENABLE([oldstylefscript],
174[ --enable-oldstylefscript enable old style F script (no arguments) (default is NO)],
175if test "$enableval" = "yes"
176then
177 AC_DEFINE([OLD_STYLE_FSCRIPT],1,[Define this is you want old style F script (no arguments).])
178 echo "Using old style F script"
179else
180 echo "Using new style F script"
181fi
182,
183echo "Using new style F script by default"
184)
185
186dnl
187dnl Handle --enable-largefile
188dnl
189AC_ARG_ENABLE([largefile],
190[ --enable-largefile enable Large File System support (default is YES)],
191if test "$enableval" = "yes"
192then
193 AC_DEFINE([USE_LFS],1,[Define this if you want Large File System support.])
194 echo "Enabling Large File System support"
195else
196 echo "Not enabling Large File System support"
197fi
198,
199AC_DEFINE([USE_LFS],1,[Define this if you want Large File System support.])
200echo "Enabling Large File System support by default"
201)
202
203dnl
204dnl Handle --enable-qfa
205dnl
206AC_ARG_ENABLE([qfa],
207[ --enable-qfa enable Quick File Access support (default is YES)],
208if test "$enableval" = "yes"
209then
210 AC_DEFINE([USE_QFA],1,[Define this if you want Quick File Access support.])
211 echo "Enabling Quick File Access support"
212else
213 echo "Not enabling Quick File Access support"
214fi
215,
216AC_DEFINE([USE_QFA],1,[Define this if you want Quick File Access support.])
217echo "Enabling Quick File Access support by default"
218)
219
220dnl
221dnl Handle --enable-qfadebug
222dnl
223AC_ARG_ENABLE([qfadebug],
224[ --enable-qfadebug include Quick File Access debugging code (default is NO)],
225if test "$enableval" = "yes"
226then
227 AC_DEFINE([DEBUG_QFA],1,[Define this if you want to include Quick File Access debugging code.])
228 echo "Including Quick File Access debugging code"
229else
230 echo "Not including Quick File Access debugging code"
231fi
232,
233echo "Not including Quick File Access debugging code by default"
234)
235
236dnl
237dnl Handle --enable-macosx
238dnl
239AC_ARG_ENABLE([macosx],
240[ --enable-macosx include Mac OSX restore compatibility (default is NO)],
241if test "$enableval" = "yes"
242then
243 AC_DEFINE([DUMP_MACOSX],1,[Define this if you want to include Mac OSX restore compatibility.])
244 echo "Including Mac OSX restore compatibility code"
245else
246 echo "Not including Mac OSX restore compatibility code"
247fi
248,
249echo "Not including Mac OSX restore compatibility code by default"
250)
251
252dnl
253dnl Handle --enable-transselinux
254dnl
255AC_ARG_ENABLE([transselinux],
256[ --enable-transselinux restore can translate SELinux EAs (default is YES)],
257if test "$enableval" = "yes"
258then
259 LTRANSSELINUX="-lselinux"
260 CCTRANSSELINUX="-DTRANSSELINUX"
261 echo "restore can translate SELinux EAs"
262else
263 LTRANSSELINUX=""
264 CCTRANSSELINUX=""
265 echo "restore can not translate SELinux EAs"
266fi
267,
268LTRANSSELINUX="-lselinux"
269CCTRANSSELINUX="-DTRANSSELINUX"
270echo "restore can translate SELinux EAs by default"
271)
272AC_SUBST(LTRANSSELINUX)
273AC_SUBST(CCTRANSSELINUX)
274
275
276dnl
277dnl set $(CC) from --with-cc=value
278dnl
279AC_ARG_WITH([cc],
280[ --with-cc=COMPILER select compiler to use],
281AC_MSG_RESULT(CC=$withval)
282CC=$withval,
283if test -z "$CC" ; then CC=cc; fi
284[AC_MSG_RESULT(CC defaults to $CC)])dnl
285export CC
286AC_SUBST([CC])
287
288dnl
289dnl set $(LD) from --with-linker=value
290dnl
291AC_ARG_WITH([linker],
292[ --with-linker=LINKER select linker to use],
293AC_MSG_RESULT(LD=$withval)
294LD=$withval,
295if test -z "$LD" ; then LD=$CC; fi
296[AC_MSG_RESULT(LD defaults to $LD)])dnl
297export LD
298AC_SUBST([LD])
299
300dnl
301dnl set $(CCOPTS) from --with-ccopts=value
302dnl
303AC_ARG_WITH([ccopts],
304[ --with-ccopts=CCOPTS select compiler command line options],
305AC_MSG_RESULT(CCOPTS is $withval)
306CCOPTS=$withval
307CFLAGS="$CFLAGS $withval",
308CCOPTS=)dnl
309AC_SUBST(CCOPTS)
310
311dnl
312dnl set $(LDFLAGS) from --with-ldopts=value
313dnl
314AC_ARG_WITH([ldopts],
315[ --with-ldopts=LDOPTS select linker command line options],
316AC_MSG_RESULT(LDFLAGS is $withval)
317LDOPTS=$withval
318LDFLAGS="$LDFLAGS $withval",
319LDOPTS=)dnl
320AC_SUBST(LDOPTS)
321
322dnl
323dnl set $(BINOWNER) from --with-binowner
324dnl
325AC_ARG_WITH([binowner],
326[ --with-binowner=USER select owner for binaries],
327AC_MSG_RESULT(BINOWNER is $withval)
328BINOWNER=$withval,
329BINOWNER=root
330echo "BINOWNER defaults to $BINOWNER"
331)dnl
332AC_SUBST(BINOWNER)
333
334dnl
335dnl set $(BINGRP) from --with-bingrp
336dnl
337AC_ARG_WITH([bingrp],
338[ --with-bingrp=GROUP select group for binaries],
339AC_MSG_RESULT(BINGRP is $withval)
340BINGRP=$withval,
341BINGRP=tty
342echo "BINGRP defaults to $BINGRP"
343)dnl
344AC_SUBST(BINGRP)
345
346dnl
347dnl set $(BINMODE) from --with-binmode
348dnl
349AC_ARG_WITH([binmode],
350[ --with-binmode=MODE select mode for binaries],
351AC_MSG_RESULT(BINMODE is $withval)
352BINMODE=$withval,
353BINMODE=0755
354echo "BINMODE defaults to $BINMODE"
355)dnl
356AC_SUBST(BINMODE)
357
358dnl
359dnl set $(MANOWNER) from --with-manowner
360dnl
361AC_ARG_WITH([manowner],
362[ --with-manowner=USER select owner for manual pages],
363AC_MSG_RESULT(MANOWNER is $withval)
364MANOWNER=$withval,
365MANOWNER=man
366echo "MANOWNER defaults to $MANOWNER"
367)dnl
368AC_SUBST(MANOWNER)
369
370dnl
371dnl set $(MANGRP) from --with-mangrp
372dnl
373AC_ARG_WITH([mangrp],
374[ --with-mangrp=GROUP select group for manual pages],
375AC_MSG_RESULT(MANGRP is $withval)
376MANGRP=$withval,
377MANGRP=tty
378echo "MANGRP defaults to $MANGRP"
379)dnl
380AC_SUBST(MANGRP)
381
382dnl
383dnl set $(MANMODE) from --with-manmode
384dnl
385AC_ARG_WITH([manmode],
386[ --with-manmode=MODE select mode for manual pages],
387AC_MSG_RESULT(MANMODE is $withval)
388MANMODE=$withval,
389MANMODE=0644
390echo "MANMODE defaults to $MANMODE"
391)dnl
392AC_SUBST(MANMODE)
393
394dnl
395dnl set $(DUMPDATESPATH) from --with-dumpdatespath
396dnl
397AC_ARG_WITH([dumpdatespath],
398[ --with-dumpdatespath=PATH select path for dumpdates file],
399AC_MSG_RESULT(DUMPDATESPATH is $withval)
400DUMPDATESPATH=$withval,
401DUMPDATESPATH="${sysconfdir}/dumpdates"
402echo "DUMPDATESPATH defaults to $DUMPDATESPATH"
403)dnl
404AC_SUBST(DUMPDATESPATH)
405
406dnl
407dnl Check for Ext2fs headers and libraries
408dnl
409AC_CHECK_HEADER(ext2fs/ext2fs.h, [ext2fs_h=yes], [ext2fs_h=no], [-])
410PKG_CHECK_MODULES(EXT2FS, [ext2fs])
411if test -n "$STATIC" ; then
412 EXT2FS_LIBS=`$PKG_CONFIG --libs --static ext2fs`
413fi
414if test "$ext2fs_h" = no -o "x$EXT2FS_LIBS" = "x"; then
415 AC_MSG_ERROR(You need to install the Ext2fs libraries from the E2fsprogs distribution first - hint: make install-libs)
416fi
417
418dnl
419dnl Check for ext2fs_read_inode_full
420dnl
421AC_CHECK_LIB(ext2fs, ext2fs_read_inode_full, [rif=yes], [rif=no], [-lcom_err])
422if test "$rif" = yes; then
423 AC_DEFINE([HAVE_EXT2FS_READ_INODE_FULL],1,[Define this if your ext2fs libs have the ext2fs_read_inode_full function.])
424fi
425
426dnl
427dnl Try to use ext2_fs.h header from libext2fs instead of from the kernel
428dnl
429AC_CHECK_HEADERS(ext2fs/ext2_fs.h, [], [], [-])
430
431dnl
432dnl Check for ext2_ino_t type
433dnl
434AC_MSG_CHECKING(for ext2_ino_t type in libext2fs headers)
435AC_TRY_COMPILE([#include <stdio.h>
436#ifdef HAVE_EXT2FS_EXT2_FS_H
437#include <ext2fs/ext2_fs.h>
438#else
439#include <linux/ext2_fs.h>
440#endif
441#include <ext2fs/ext2fs.h>],
442[ext2_ino_t ino = 0;],
443[AC_DEFINE([HAVE_EXT2_INO_T],1,[Define if we have the ext2_ino_t type (from e2fsprogs 1.20+).])
444 AC_MSG_RESULT(yes)],
445AC_MSG_RESULT(no))
446
447dnl
448dnl Check for s_journal_inum field in ext2_super_block struct
449dnl
450AC_MSG_CHECKING(for s_journal_inum field in ext2_super_block struct)
451AC_TRY_COMPILE([#include <stdio.h>
452#ifdef HAVE_EXT2FS_EXT2_FS_H
453#include <ext2fs/ext2_fs.h>
454#else
455#include <linux/ext2_fs.h>
456#endif
457#include <ext2fs/ext2fs.h>],
458[struct ext2_super_block es; es.s_journal_inum = 0;],
459[AC_DEFINE([HAVE_EXT2_JOURNAL_INUM],1,[Define if we have the s_journal_inum field in struct ext2_super_block.])
460 AC_MSG_RESULT(yes)],
461AC_MSG_RESULT(no))
462
463dnl
464dnl Check for blkid headers libraries
465dnl
466AC_CHECK_HEADER(blkid/blkid.h, [blkid_h=yes], [blkid_h=no], [-])
467PKG_CHECK_EXISTS([blkid],
468 [
469 if test -n $STATIC ; then
470 BLKID=`$PKG_CONFIG --libs --static blkid`
471 else
472 BLKID=`$PKG_CONFIG --libs blkid`
473 fi
474 if test "$blkid_h" = yes ; then
475 AC_DEFINE([HAVE_BLKID],1,[Define this if you have the blkid library.])
476 fi
477 ],[BLKID=""])
478AC_SUBST(BLKID)
479
480dnl
481dnl Check for ncurses or termcap libraries
482dnl
483AC_CHECK_LIB(ncurses, tgetent, [ncurses_lib=yes], [ncurses_lib=no])
484AC_CHECK_LIB(termcap, tgetent, [termcap_lib=yes], [termcap_lib=no])
485AC_CHECK_LIB(tinfo, tgetent, [tinfo_lib=yes], [tinfo_lib=no])
486
487if test "$ncurses_lib" = no -a "$termcap_lib" = no -a "$tinfo_lib" = no; then
488 if test "$READLINE" = "yes"; then
489 AC_MSG_ERROR(You need to install the ncurses or termcap library or configure without --enable-readline)
490 fi
491fi
492if test "$tinfo_lib" = yes; then
493 rdllib="-ltinfo"
494elif test "$ncurses_lib" = yes; then
495 rdllib="-lncurses"
496elif test "$termcap_lib" = yes; then
497 rdllib="-ltermcap"
498fi
499
500dnl
501dnl Check for readline headers and libraries
502dnl
503AC_CHECK_HEADER(readline/readline.h, [readline_h=yes], [readline_h=no], [-])
504AC_CHECK_LIB(readline, readline, [readline_lib=yes], [readline_lib=no], $rdllib)
505if test "$readline_h" = no -o "$readline_lib" = no; then
506 if test "$READLINE" = "yes"; then
507 AC_MSG_ERROR(You need to install the GNU readline library or configure without --enable-readline)
508 fi
509fi
510if test "$READLINE" = yes; then
511 READLINE="-lreadline $rdllib"
512fi
513AC_SUBST(READLINE)
514
515dnl
516dnl Check for rl_completion_matches
517dnl
518AC_CHECK_LIB(readline, rl_completion_matches, [rlcm=yes], [rlcm=no], "-ltermcap")
519if test "$rlcm" = yes; then
520 AC_DEFINE([HAVE_READLINE_RLCM],1,[Define this if your readline libs have the rl_completion_matches library.])
521fi
522
523dnl
524dnl Check for rl_completion_append_character
525dnl
526AC_CHECK_LIB(readline, rl_completion_append_character, [rcac=yes], [rcac=no], "-ltermcap")
527if test "$rcac" = yes; then
528 AC_DEFINE([HAVE_READLINE_CAC],1,[Define this if your readline libs have the rl_completion_append_character variable.])
529fi
530
531dnl
532dnl Check for zlib headers and libraries
533dnl
534AC_CHECK_HEADER(zlib.h, [zlib_h=yes], [zlib_h=no], [-])
535AC_CHECK_LIB(z, zlibVersion, [zlib_lib=yes], [zlib_lib=no])
536if test "$zlib_h" = yes -a "$zlib_lib" = yes; then
537 if test "$STATICZ" = yes; then
538 ZLIB="-Wl,-Bstatic -lz -Wl,-Bdynamic"
539 else
540 ZLIB="-lz"
541 fi
542 AC_DEFINE([HAVE_ZLIB],1,[Define this if you have zlib compression library.])
543else
544 ZLIB=""
545fi
546AC_SUBST(ZLIB)
547
548dnl
549dnl Check for bzlib headers and libraries
550dnl
551AC_CHECK_HEADER(bzlib.h, [bzlib_h=yes], [bzlib_h=no], [-])
552AC_CHECK_LIB(bz2, BZ2_bzBuffToBuffCompress, [bzlib_lib=yes], [bzlib_lib=no])
553if test "$bzlib_h" = yes -a "$bzlib_lib" = yes; then
554 if test "$STATICZ" = yes; then
555 BZLIB="-Wl,-Bstatic -lbz2 -Wl,-Bdynamic"
556 else
557 BZLIB="-lbz2"
558 fi
559 AC_DEFINE([HAVE_BZLIB],1,[Define this if you have bzlib compression library.])
560else
561 BZLIB=""
562fi
563AC_SUBST(BZLIB)
564
565dnl
566dnl Check for sqlite3 headers and libraries
567dnl
568AC_CHECK_HEADER(sqlite3.h, [sqlite3_h=yes], [sqlite3_h=no], [-])
569AC_CHECK_LIB(sqlite3, sqlite3_initialize, [sqlite3_lib=yes], [sqlite3_lib=no])
570if test "$sqlite3_h" = yes -a "$sqlite3_lib" = yes; then
571 if test "$STATICZ" = yes; then
572 SQLITE3="-Wl,-Bstatic -lsqlite3 -Wl,-Bdynamic"
573 else
574 SQLITE3="-lsqlite3"
575 fi
576 AC_DEFINE([HAVE_SQLITE3],1,[Define this if you have sqlite3 library.])
577else
578 SQLITE3=""
579fi
580AC_SUBST(SQLITE3)
581
582dnl
583dnl Check for library functions
584dnl
585AC_CHECK_FUNCS(err errx verr verrx vwarn vwarnx warn warnx realpath lchown)
586AC_CHECK_FUNC(glob)
587
588dnl
589dnl Check for GLOB_ALTDIRFUNC
590dnl
591AC_MSG_CHECKING(for extended glob routines)
592if test "$ac_cv_func_glob" = "yes"; then
593 AC_EGREP_CPP(yes,
594 [
595# include <glob.h>
596# ifdef GLOB_ALTDIRFUNC
597 yes
598# endif
599 ],
600 [
601 AC_DEFINE([HAVE_GLOB],1,[Define if you have the glob function.])
602 AC_MSG_RESULT(yes)
603 ],
604 [
605 AC_MSG_RESULT(no)
606 echo "Your system does not support extended glob, will use the internal routines"
607 ])
608fi
609
610dnl
611dnl Check for OpenSSL, for ermt and encryption.
612dnl
613AC_CHECK_HEADER(openssl/evp.h, [evp_h=yes], [evp_h=no])
614AC_CHECK_LIB(crypto, EVP_CIPHER_CTX_set_padding, [crypto_lib=yes], [crypto_lib=no])
615if test "$evp_h" = yes -a "$crypto_lib" = yes; then
616 if test "$STATICZ" = yes; then
617 SSLLIB="-Wl,-Bstatic -lssl -Wl,-Bdynamic"
618 else
619 SSLLIB="-lssl"
620 fi
621 AC_DEFINE([HAVE_OPENSSL],1,[Define this if you have openssl library.])
622else
623 SSLLIB=""
624 if test "$ERMT" != ""; then
625 AC_MSG_ERROR(You need to install the OpenSSL library (version 0.9.7a or later), or configure without --enable-ermt)
626 fi
627fi
628AC_SUBST(SSLLIB)
629
630dnl
631dnl Check for types
632dnl
633AC_CHECK_TYPE(quad_t, int64_t)
634AC_CHECK_TYPE(u_quad_t, uint64_t)
635
636dnl
637dnl Compute top_buildir
638dnl
639top_builddir=`cd .; pwd`
640AC_SUBST(top_builddir)
641
642dnl
643dnl Create directories
644dnl
645test -d compat || mkdir compat
646test -d compat/lib || mkdir compat/lib
647
648dnl
649dnl Output files
650dnl
651AC_OUTPUT(MCONFIG Makefile common/Makefile compat/include/Makefile compat/lib/Makefile dump/Makefile restore/Makefile testing/Makefile $RMTMAKEFILE)