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