]> git.wh0rd.org - dump.git/blame - configure.in
-z usage info only if ZLIB defined
[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
132 AC_DEFINE(_FILE_OFFSET_BITS,64)
133fi
134,
135echo "Not enabling Large File System support"
136)
137
1227625a
SP
138dnl
139dnl set $(CC) from --with-cc=value
140dnl
141AC_ARG_WITH([cc],
d8574d45 142[ --with-cc=COMPILER select compiler to use],
1227625a
SP
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],
d8574d45 154[ --with-linker=LINKER select linker to use],
1227625a
SP
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],
d8574d45 166[ --with-ccopts=CCOPTS select compiler command line options],
1227625a
SP
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],
d8574d45 177[ --with-ldopts=LDOPTS select linker command line options],
1227625a
SP
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],
d8574d45 187[ --with-binowner=USER select owner for binaries],
1227625a
SP
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],
d8574d45 199[ --with-bingrp=GROUP select group for binaries],
1227625a
SP
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],
d8574d45 211[ --with-binmode=MODE select mode for binaries],
1227625a
SP
212AC_MSG_RESULT(BINMODE is $withval)
213BINMODE=$withval,
882090d1 214BINMODE=0755
1227625a
SP
215echo "BINMODE defaults to $BINMODE"
216)dnl
217AC_SUBST(BINMODE)
218
219dnl
220dnl set $(MANOWNER) from --with-manowner
221dnl
222AC_ARG_WITH([manowner],
d8574d45 223[ --with-manowner=USER select owner for manual pages],
1227625a
SP
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],
d8574d45 235[ --with-mangrp=GROUP select group for manual pages],
1227625a
SP
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],
d8574d45 247[ --with-manmode=MODE select mode for manual pages],
1227625a
SP
248AC_MSG_RESULT(MANMODE is $withval)
249MANMODE=$withval,
882090d1 250MANMODE=0644
1227625a
SP
251echo "MANMODE defaults to $MANMODE"
252)dnl
253AC_SUBST(MANMODE)
254
8d4197bb
SP
255dnl
256dnl set $(DUMPDATESPATH) from --with-dumpdatespath
257dnl
258AC_ARG_WITH([dumpdatespath],
d8574d45 259[ --with-dumpdatespath=PATH select path for dumpdates file],
8d4197bb
SP
260AC_MSG_RESULT(DUMPDATESPATH is $withval)
261DUMPDATESPATH=$withval,
262DUMPDATESPATH="/etc/dumpdates"
263echo "DUMPDATESPATH defaults to $DUMPDATESPATH"
264)dnl
265AC_SUBST(DUMPDATESPATH)
266
1227625a
SP
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
d3393043 273 AC_MSG_ERROR(You need to install the Ext2fs libraries from the E2fsprogs distribution first - hint: make install-libs)
1227625a
SP
274fi
275
3e815572
SP
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
c38e5b6a
SP
286dnl
287dnl Check for readline headers and libraries
288dnl
289AC_CHECK_HEADER(readline/readline.h, [readline_h=yes], [readline_h=no])
3e815572 290AC_CHECK_LIB(readline, readline, [readline_lib=yes], [readline_lib=no], "-ltermcap")
c38e5b6a 291if test "$readline_h" = no -o "$readline_lib" = no; then
3e815572 292 if test "$READLINE" = "-lreadline -ltermcap"; then
c38e5b6a
SP
293 AC_MSG_ERROR(You need to install the GNU readline libraries first)
294 fi
295fi
296
4d5ed2f3
SP
297dnl
298dnl Check for zlib headers and libraries
299dnl
300AC_CHECK_HEADER(zlib.h, [zlib_h=yes], [zlib_h=no])
301AC_CHECK_LIB(z, compress2, [zlib_lib=yes], [zlib_lib=no])
302if test "$zlib_h" = yes -a "$zlib_lib" = yes; then
303 ZLIB="-lz"
304 AC_DEFINE(HAVE_ZLIB)
305else
306 ZLIB=""
307fi
308AC_SUBST(ZLIB)
309
1227625a
SP
310dnl
311dnl Check for library functions
312dnl
5c1faba5
SP
313AC_CHECK_FUNCS(err errx verr verrx vwarn vwarnx warn warnx realpath lchown)
314AC_CHECK_FUNC(glob)
315
316dnl
317dnl Check for GLOB_ALTDIRFUNC
318dnl
319if test "$ac_cv_func_glob" = "yes"; then
320 AC_EGREP_CPP(yes,
321 [
322# include <glob.h>
323# ifdef GLOB_ALTDIRFUNC
324 yes
325# endif
326 ], AC_DEFINE(HAVE_GLOB), noglob=yes)
327 if test "$noglob" = "yes"; then
328 echo "Your system does not support extended glob, will use the internal routines"
329 fi
330fi
1227625a
SP
331
332dnl
333dnl Check for types
334dnl
335AC_CHECK_TYPE(quad_t, __s64)
336AC_CHECK_TYPE(u_quad_t, __u64)
337
338dnl
339dnl Compute top_buildir
340dnl
341top_builddir=`cd .; pwd`
342AC_SUBST(top_builddir)
343
344dnl
345dnl Create directories
346dnl
347test -d compat || mkdir compat
348test -d compat/lib || mkdir compat/lib
349
350dnl
351dnl Output files
352dnl
8d4197bb 353AC_OUTPUT(MCONFIG Makefile common/Makefile compat/include/Makefile compat/lib/Makefile dump/Makefile restore/Makefile $RMTMAKEFILE)