]> git.wh0rd.org - dump.git/blame_incremental - configure.in
Added some items from my mailbox.
[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(_FILE_OFFSET_BITS,64)
133fi
134,
135echo "Not enabling Large File System support"
136)
137
138dnl
139dnl set $(CC) from --with-cc=value
140dnl
141AC_ARG_WITH([cc],
142[ --with-cc=COMPILER select compiler to use],
143AC_MSG_RESULT(CC=$withval)
144CC=$withval,
145if test -z "$CC" ; then CC=cc; fi
146[AC_MSG_RESULT(CC defaults to $CC)])dnl
147export CC
148AC_SUBST([CC])
149
150dnl
151dnl set $(LD) from --with-linker=value
152dnl
153AC_ARG_WITH([linker],
154[ --with-linker=LINKER select linker to use],
155AC_MSG_RESULT(LD=$withval)
156LD=$withval,
157if test -z "$LD" ; then LD=$CC; fi
158[AC_MSG_RESULT(LD defaults to $LD)])dnl
159export LD
160AC_SUBST([LD])
161
162dnl
163dnl set $(CCOPTS) from --with-ccopts=value
164dnl
165AC_ARG_WITH([ccopts],
166[ --with-ccopts=CCOPTS select compiler command line options],
167AC_MSG_RESULT(CCOPTS is $withval)
168CCOPTS=$withval
169CFLAGS="$CFLAGS $withval",
170CCOPTS=)dnl
171AC_SUBST(CCOPTS)
172
173dnl
174dnl set $(LDFLAGS) from --with-ldopts=value
175dnl
176AC_ARG_WITH([ldopts],
177[ --with-ldopts=LDOPTS select linker command line options],
178AC_MSG_RESULT(LDFLAGS is $withval)
179LDFLAGS=$withval,
180LDFLAGS=)dnl
181AC_SUBST(LDFLAGS)
182
183dnl
184dnl set $(BINOWNER) from --with-binowner
185dnl
186AC_ARG_WITH([binowner],
187[ --with-binowner=USER select owner for binaries],
188AC_MSG_RESULT(BINOWNER is $withval)
189BINOWNER=$withval,
190BINOWNER=root
191echo "BINOWNER defaults to $BINOWNER"
192)dnl
193AC_SUBST(BINOWNER)
194
195dnl
196dnl set $(BINGRP) from --with-bingrp
197dnl
198AC_ARG_WITH([bingrp],
199[ --with-bingrp=GROUP select group for binaries],
200AC_MSG_RESULT(BINGRP is $withval)
201BINGRP=$withval,
202BINGRP=tty
203echo "BINGRP defaults to $BINGRP"
204)dnl
205AC_SUBST(BINGRP)
206
207dnl
208dnl set $(BINMODE) from --with-binmode
209dnl
210AC_ARG_WITH([binmode],
211[ --with-binmode=MODE select mode for binaries],
212AC_MSG_RESULT(BINMODE is $withval)
213BINMODE=$withval,
214BINMODE=0755
215echo "BINMODE defaults to $BINMODE"
216)dnl
217AC_SUBST(BINMODE)
218
219dnl
220dnl set $(MANOWNER) from --with-manowner
221dnl
222AC_ARG_WITH([manowner],
223[ --with-manowner=USER select owner for manual pages],
224AC_MSG_RESULT(MANOWNER is $withval)
225MANOWNER=$withval,
226MANOWNER=man
227echo "MANOWNER defaults to $MANOWNER"
228)dnl
229AC_SUBST(MANOWNER)
230
231dnl
232dnl set $(MANGRP) from --with-mangrp
233dnl
234AC_ARG_WITH([mangrp],
235[ --with-mangrp=GROUP select group for manual pages],
236AC_MSG_RESULT(MANGRP is $withval)
237MANGRP=$withval,
238MANGRP=tty
239echo "MANGRP defaults to $MANGRP"
240)dnl
241AC_SUBST(MANGRP)
242
243dnl
244dnl set $(MANMODE) from --with-manmode
245dnl
246AC_ARG_WITH([manmode],
247[ --with-manmode=MODE select mode for manual pages],
248AC_MSG_RESULT(MANMODE is $withval)
249MANMODE=$withval,
250MANMODE=0644
251echo "MANMODE defaults to $MANMODE"
252)dnl
253AC_SUBST(MANMODE)
254
255dnl
256dnl set $(DUMPDATESPATH) from --with-dumpdatespath
257dnl
258AC_ARG_WITH([dumpdatespath],
259[ --with-dumpdatespath=PATH select path for dumpdates file],
260AC_MSG_RESULT(DUMPDATESPATH is $withval)
261DUMPDATESPATH=$withval,
262DUMPDATESPATH="/etc/dumpdates"
263echo "DUMPDATESPATH defaults to $DUMPDATESPATH"
264)dnl
265AC_SUBST(DUMPDATESPATH)
266
267dnl
268dnl Check for Ext2fs headers and libraries
269dnl
270AC_CHECK_HEADER(ext2fs/ext2fs.h, [ext2fs_h=yes], [ext2fs_h=no])
271AC_CHECK_LIB(ext2fs, ext2fs_open, [ext2fs_lib=yes], [ext2fs_lib=no], [-lcom_err])
272if test "$ext2fs_h" = no -o "$ext2fs_lib" = no; then
273 AC_MSG_ERROR(You need to install the Ext2fs libraries from the E2fsprogs distribution first - hint: make install-libs)
274fi
275
276dnl
277dnl Check for termcap libraries
278dnl
279AC_CHECK_LIB(termcap, tgetent, [termcap_lib=yes], [termcap_lib=no])
280if test "$termcap_lib" = no; then
281 if test "$READLINE" = "-lreadline -ltermcap"; then
282 AC_MSG_ERROR(You need to install the GNU termcap libraries first)
283 fi
284fi
285
286dnl
287dnl Check for readline headers and libraries
288dnl
289AC_CHECK_HEADER(readline/readline.h, [readline_h=yes], [readline_h=no])
290AC_CHECK_LIB(readline, readline, [readline_lib=yes], [readline_lib=no], "-ltermcap")
291if test "$readline_h" = no -o "$readline_lib" = no; then
292 if test "$READLINE" = "-lreadline -ltermcap"; then
293 AC_MSG_ERROR(You need to install the GNU readline libraries first)
294 fi
295fi
296
297dnl
298dnl Check for library functions
299dnl
300AC_CHECK_FUNCS(err errx verr verrx vwarn vwarnx warn warnx realpath lchown)
301AC_CHECK_FUNC(glob)
302
303dnl
304dnl Check for GLOB_ALTDIRFUNC
305dnl
306if test "$ac_cv_func_glob" = "yes"; then
307 AC_EGREP_CPP(yes,
308 [
309# include <glob.h>
310# ifdef GLOB_ALTDIRFUNC
311 yes
312# endif
313 ], AC_DEFINE(HAVE_GLOB), noglob=yes)
314 if test "$noglob" = "yes"; then
315 echo "Your system does not support extended glob, will use the internal routines"
316 fi
317fi
318
319dnl
320dnl Check for types
321dnl
322AC_CHECK_TYPE(quad_t, __s64)
323AC_CHECK_TYPE(u_quad_t, __u64)
324
325dnl
326dnl Compute top_buildir
327dnl
328top_builddir=`cd .; pwd`
329AC_SUBST(top_builddir)
330
331dnl
332dnl Create directories
333dnl
334test -d compat || mkdir compat
335test -d compat/lib || mkdir compat/lib
336
337dnl
338dnl Output files
339dnl
340AC_OUTPUT(MCONFIG Makefile common/Makefile compat/include/Makefile compat/lib/Makefile dump/Makefile restore/Makefile $RMTMAKEFILE)