]> git.wh0rd.org - dump.git/blame - configure.in
a debug message removed
[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],
d8574d45 26[ --enable-debug include debugging code],
1227625a
SP
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],
d8574d45 45[ --enable-static link dump and restore statically],
1227625a
SP
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],
d8574d45 62[ --enable-rmt compile and install rmt],
1227625a
SP
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
2ed89fda
SP
77dnl
78dnl Handle --enable-kerberos
79dnl
80AC_ARG_ENABLE([kerberos],
d8574d45 81[ --enable-kerberos compile kerberos extensions],
2ed89fda
SP
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
c38e5b6a
SP
94dnl
95dnl Handle --enable-readline
96dnl
97AC_ARG_ENABLE([readline],
d8574d45 98[ --enable-readline enable readline support in restore],
c38e5b6a
SP
99if test "$enableval" = "no"
100then
101 READLINE=""
102else
5e04cc92 103 READLINE="-lreadline -ltermcap"
c38e5b6a
SP
104 AC_DEFINE(HAVE_READLINE)
105fi
106,
107READLINE=""
108echo "Not including readline support by default"
109)
110AC_SUBST(READLINE)
111
d8574d45
SP
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
d6967896
SP
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
95c74f38 132 AC_DEFINE(USE_LFS)
d6967896
SP
133fi
134,
135echo "Not enabling Large File System support"
136)
137
35b24fb7
SP
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
1227625a
SP
164dnl
165dnl set $(CC) from --with-cc=value
166dnl
167AC_ARG_WITH([cc],
d8574d45 168[ --with-cc=COMPILER select compiler to use],
1227625a
SP
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],
d8574d45 180[ --with-linker=LINKER select linker to use],
1227625a
SP
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],
d8574d45 192[ --with-ccopts=CCOPTS select compiler command line options],
1227625a
SP
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],
d8574d45 203[ --with-ldopts=LDOPTS select linker command line options],
1227625a
SP
204AC_MSG_RESULT(LDFLAGS is $withval)
205LDFLAGS=$withval,
206LDFLAGS=)dnl
207AC_SUBST(LDFLAGS)
208
209dnl
210dnl set $(BINOWNER) from --with-binowner
211dnl
212AC_ARG_WITH([binowner],
d8574d45 213[ --with-binowner=USER select owner for binaries],
1227625a
SP
214AC_MSG_RESULT(BINOWNER is $withval)
215BINOWNER=$withval,
216BINOWNER=root
217echo "BINOWNER defaults to $BINOWNER"
218)dnl
219AC_SUBST(BINOWNER)
220
221dnl
222dnl set $(BINGRP) from --with-bingrp
223dnl
224AC_ARG_WITH([bingrp],
d8574d45 225[ --with-bingrp=GROUP select group for binaries],
1227625a
SP
226AC_MSG_RESULT(BINGRP is $withval)
227BINGRP=$withval,
228BINGRP=tty
229echo "BINGRP defaults to $BINGRP"
230)dnl
231AC_SUBST(BINGRP)
232
233dnl
234dnl set $(BINMODE) from --with-binmode
235dnl
236AC_ARG_WITH([binmode],
d8574d45 237[ --with-binmode=MODE select mode for binaries],
1227625a
SP
238AC_MSG_RESULT(BINMODE is $withval)
239BINMODE=$withval,
882090d1 240BINMODE=0755
1227625a
SP
241echo "BINMODE defaults to $BINMODE"
242)dnl
243AC_SUBST(BINMODE)
244
245dnl
246dnl set $(MANOWNER) from --with-manowner
247dnl
248AC_ARG_WITH([manowner],
d8574d45 249[ --with-manowner=USER select owner for manual pages],
1227625a
SP
250AC_MSG_RESULT(MANOWNER is $withval)
251MANOWNER=$withval,
252MANOWNER=man
253echo "MANOWNER defaults to $MANOWNER"
254)dnl
255AC_SUBST(MANOWNER)
256
257dnl
258dnl set $(MANGRP) from --with-mangrp
259dnl
260AC_ARG_WITH([mangrp],
d8574d45 261[ --with-mangrp=GROUP select group for manual pages],
1227625a
SP
262AC_MSG_RESULT(MANGRP is $withval)
263MANGRP=$withval,
264MANGRP=tty
265echo "MANGRP defaults to $MANGRP"
266)dnl
267AC_SUBST(MANGRP)
268
269dnl
270dnl set $(MANMODE) from --with-manmode
271dnl
272AC_ARG_WITH([manmode],
d8574d45 273[ --with-manmode=MODE select mode for manual pages],
1227625a
SP
274AC_MSG_RESULT(MANMODE is $withval)
275MANMODE=$withval,
882090d1 276MANMODE=0644
1227625a
SP
277echo "MANMODE defaults to $MANMODE"
278)dnl
279AC_SUBST(MANMODE)
280
8d4197bb
SP
281dnl
282dnl set $(DUMPDATESPATH) from --with-dumpdatespath
283dnl
284AC_ARG_WITH([dumpdatespath],
d8574d45 285[ --with-dumpdatespath=PATH select path for dumpdates file],
8d4197bb
SP
286AC_MSG_RESULT(DUMPDATESPATH is $withval)
287DUMPDATESPATH=$withval,
60d46c35 288DUMPDATESPATH="${sysconfdir}/dumpdates"
8d4197bb
SP
289echo "DUMPDATESPATH defaults to $DUMPDATESPATH"
290)dnl
291AC_SUBST(DUMPDATESPATH)
292
1227625a
SP
293dnl
294dnl Check for Ext2fs headers and libraries
295dnl
296AC_CHECK_HEADER(ext2fs/ext2fs.h, [ext2fs_h=yes], [ext2fs_h=no])
297AC_CHECK_LIB(ext2fs, ext2fs_open, [ext2fs_lib=yes], [ext2fs_lib=no], [-lcom_err])
298if test "$ext2fs_h" = no -o "$ext2fs_lib" = no; then
d3393043 299 AC_MSG_ERROR(You need to install the Ext2fs libraries from the E2fsprogs distribution first - hint: make install-libs)
1227625a
SP
300fi
301
e4a8bde4
SP
302dnl
303dnl Try to use ext2_fs.h header from libext2fs instead of from the kernel
304dnl
305AC_CHECK_HEADERS(ext2fs/ext2_fs.h)
306
a4f547cd
SP
307dnl
308dnl Check for ext2_ino_t type
309dnl
7422942f 310AC_MSG_CHECKING(for ext2_ino_t type in libext2fs headers)
a4f547cd 311AC_TRY_COMPILE([#include <stdio.h>
e4a8bde4
SP
312#ifdef HAVE_EXT2FS_EXT2_FS_H
313#include <ext2fs/ext2_fs.h>
314#else
a4f547cd 315#include <linux/ext2_fs.h>
e4a8bde4
SP
316#endif
317#include <ext2fs/ext2fs.h>],
a4f547cd 318[ext2_ino_t ino = 0;],
7422942f 319[AC_DEFINE(HAVE_EXT2_INO_T) AC_MSG_RESULT(yes)],
a4f547cd
SP
320AC_MSG_RESULT(no))
321
322dnl
323dnl Check for s_journal_inum field in ext2_super_block struct
324dnl
325AC_MSG_CHECKING(for s_journal_inum field in ext2_super_block struct)
326AC_TRY_COMPILE([#include <stdio.h>
e4a8bde4
SP
327#ifdef HAVE_EXT2FS_EXT2_FS_H
328#include <ext2fs/ext2_fs.h>
329#else
a4f547cd 330#include <linux/ext2_fs.h>
e4a8bde4 331#endif
a4f547cd
SP
332#include <ext2fs/ext2fs.h>],
333[struct ext2_super_block es; es.s_journal_inum = 0;],
7422942f 334[AC_DEFINE(HAVE_EXT2_JOURNAL_INUM) AC_MSG_RESULT(yes)],
a4f547cd
SP
335AC_MSG_RESULT(no))
336
3e815572
SP
337dnl
338dnl Check for termcap libraries
339dnl
340AC_CHECK_LIB(termcap, tgetent, [termcap_lib=yes], [termcap_lib=no])
341if test "$termcap_lib" = no; then
342 if test "$READLINE" = "-lreadline -ltermcap"; then
e68dc63e 343 AC_MSG_ERROR(You need to install the GNU termcap library or configure without --enable-readline)
3e815572
SP
344 fi
345fi
346
c38e5b6a
SP
347dnl
348dnl Check for readline headers and libraries
349dnl
350AC_CHECK_HEADER(readline/readline.h, [readline_h=yes], [readline_h=no])
3e815572 351AC_CHECK_LIB(readline, readline, [readline_lib=yes], [readline_lib=no], "-ltermcap")
c38e5b6a 352if test "$readline_h" = no -o "$readline_lib" = no; then
3e815572 353 if test "$READLINE" = "-lreadline -ltermcap"; then
e68dc63e 354 AC_MSG_ERROR(You need to install the GNU readline library or configure without --enable-readline)
c38e5b6a
SP
355 fi
356fi
357
4d5ed2f3
SP
358dnl
359dnl Check for zlib headers and libraries
360dnl
361AC_CHECK_HEADER(zlib.h, [zlib_h=yes], [zlib_h=no])
362AC_CHECK_LIB(z, compress2, [zlib_lib=yes], [zlib_lib=no])
363if test "$zlib_h" = yes -a "$zlib_lib" = yes; then
364 ZLIB="-lz"
365 AC_DEFINE(HAVE_ZLIB)
366else
367 ZLIB=""
368fi
369AC_SUBST(ZLIB)
370
88ef261e
SP
371dnl
372dnl Check for bzlib headers and libraries
373dnl
374AC_CHECK_HEADER(bzlib.h, [bzlib_h=yes], [bzlib_h=no])
375AC_CHECK_LIB(bz2, BZ2_bzBuffToBuffCompress, [bzlib_lib=yes], [bzlib_lib=no])
376if test "$bzlib_h" = yes -a "$bzlib_lib" = yes; then
377 BZLIB="-lbz2"
378 AC_DEFINE(HAVE_BZLIB)
379else
380 BZLIB=""
381fi
382AC_SUBST(BZLIB)
383
1227625a
SP
384dnl
385dnl Check for library functions
386dnl
5c1faba5
SP
387AC_CHECK_FUNCS(err errx verr verrx vwarn vwarnx warn warnx realpath lchown)
388AC_CHECK_FUNC(glob)
389
390dnl
391dnl Check for GLOB_ALTDIRFUNC
392dnl
a4f547cd 393AC_MSG_CHECKING(for extended glob routines)
5c1faba5
SP
394if test "$ac_cv_func_glob" = "yes"; then
395 AC_EGREP_CPP(yes,
396 [
397# include <glob.h>
398# ifdef GLOB_ALTDIRFUNC
399 yes
400# endif
a4f547cd
SP
401 ],
402 [
403 AC_DEFINE(HAVE_GLOB)
404 AC_MSG_RESULT(yes)
405 ],
406 [
407 AC_MSG_RESULT(no)
408 echo "Your system does not support extended glob, will use the internal routines"
409 ])
5c1faba5 410fi
1227625a
SP
411
412dnl
413dnl Check for types
414dnl
415AC_CHECK_TYPE(quad_t, __s64)
416AC_CHECK_TYPE(u_quad_t, __u64)
417
418dnl
419dnl Compute top_buildir
420dnl
421top_builddir=`cd .; pwd`
422AC_SUBST(top_builddir)
423
424dnl
425dnl Create directories
426dnl
427test -d compat || mkdir compat
428test -d compat/lib || mkdir compat/lib
429
430dnl
431dnl Output files
432dnl
8d4197bb 433AC_OUTPUT(MCONFIG Makefile common/Makefile compat/include/Makefile compat/lib/Makefile dump/Makefile restore/Makefile $RMTMAKEFILE)