]> git.wh0rd.org - dump.git/blame - configure.in
Added readline capabilities to interactive restore.
[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],
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
2ed89fda
SP
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
c38e5b6a
SP
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"
104 AC_DEFINE(HAVE_READLINE)
105fi
106,
107READLINE=""
108echo "Not including readline support by default"
109)
110AC_SUBST(READLINE)
111
1227625a
SP
112dnl
113dnl set $(CC) from --with-cc=value
114dnl
115AC_ARG_WITH([cc],
116[ --with-cc=COMPILER select compiler to use],
117AC_MSG_RESULT(CC=$withval)
118CC=$withval,
119if test -z "$CC" ; then CC=cc; fi
120[AC_MSG_RESULT(CC defaults to $CC)])dnl
121export CC
122AC_SUBST([CC])
123
124dnl
125dnl set $(LD) from --with-linker=value
126dnl
127AC_ARG_WITH([linker],
128[ --with-linker=LINKER select linker to use],
129AC_MSG_RESULT(LD=$withval)
130LD=$withval,
131if test -z "$LD" ; then LD=$CC; fi
132[AC_MSG_RESULT(LD defaults to $LD)])dnl
133export LD
134AC_SUBST([LD])
135
136dnl
137dnl set $(CCOPTS) from --with-ccopts=value
138dnl
139AC_ARG_WITH([ccopts],
140[ --with-ccopts=CCOPTS select compiler command line options],
141AC_MSG_RESULT(CCOPTS is $withval)
142CCOPTS=$withval
143CFLAGS="$CFLAGS $withval",
144CCOPTS=)dnl
145AC_SUBST(CCOPTS)
146
147dnl
148dnl set $(LDFLAGS) from --with-ldopts=value
149dnl
150AC_ARG_WITH([ldopts],
151[ --with-ldopts=LDOPTS select linker command line options],
152AC_MSG_RESULT(LDFLAGS is $withval)
153LDFLAGS=$withval,
154LDFLAGS=)dnl
155AC_SUBST(LDFLAGS)
156
157dnl
158dnl set $(BINOWNER) from --with-binowner
159dnl
160AC_ARG_WITH([binowner],
161[ --with-binowner=USER select owner for binaries],
162AC_MSG_RESULT(BINOWNER is $withval)
163BINOWNER=$withval,
164BINOWNER=root
165echo "BINOWNER defaults to $BINOWNER"
166)dnl
167AC_SUBST(BINOWNER)
168
169dnl
170dnl set $(BINGRP) from --with-bingrp
171dnl
172AC_ARG_WITH([bingrp],
173[ --with-bingrp=GROUP select group for binaries],
174AC_MSG_RESULT(BINGRP is $withval)
175BINGRP=$withval,
176BINGRP=tty
177echo "BINGRP defaults to $BINGRP"
178)dnl
179AC_SUBST(BINGRP)
180
181dnl
182dnl set $(BINMODE) from --with-binmode
183dnl
184AC_ARG_WITH([binmode],
185[ --with-binmode=MODE select mode for binaries],
186AC_MSG_RESULT(BINMODE is $withval)
187BINMODE=$withval,
188BINMODE=6555
189echo "BINMODE defaults to $BINMODE"
190)dnl
191AC_SUBST(BINMODE)
192
193dnl
194dnl set $(MANOWNER) from --with-manowner
195dnl
196AC_ARG_WITH([manowner],
197[ --with-manowner=USER select owner for manual pages],
198AC_MSG_RESULT(MANOWNER is $withval)
199MANOWNER=$withval,
200MANOWNER=man
201echo "MANOWNER defaults to $MANOWNER"
202)dnl
203AC_SUBST(MANOWNER)
204
205dnl
206dnl set $(MANGRP) from --with-mangrp
207dnl
208AC_ARG_WITH([mangrp],
209[ --with-mangrp=group select group for manual pages],
210AC_MSG_RESULT(MANGRP is $withval)
211MANGRP=$withval,
212MANGRP=tty
213echo "MANGRP defaults to $MANGRP"
214)dnl
215AC_SUBST(MANGRP)
216
217dnl
218dnl set $(MANMODE) from --with-manmode
219dnl
220AC_ARG_WITH([manmode],
221[ --with-manmode=MODE select mode for manual pages],
222AC_MSG_RESULT(MANMODE is $withval)
223MANMODE=$withval,
224MANMODE=0444
225echo "MANMODE defaults to $MANMODE"
226)dnl
227AC_SUBST(MANMODE)
228
8d4197bb
SP
229dnl
230dnl set $(DUMPDATESPATH) from --with-dumpdatespath
231dnl
232AC_ARG_WITH([dumpdatespath],
233[ --with-dumpdatespath=path select path for dumpdates file],
234AC_MSG_RESULT(DUMPDATESPATH is $withval)
235DUMPDATESPATH=$withval,
236DUMPDATESPATH="/etc/dumpdates"
237echo "DUMPDATESPATH defaults to $DUMPDATESPATH"
238)dnl
239AC_SUBST(DUMPDATESPATH)
240
1227625a
SP
241dnl
242dnl Check for Ext2fs headers and libraries
243dnl
244AC_CHECK_HEADER(ext2fs/ext2fs.h, [ext2fs_h=yes], [ext2fs_h=no])
245AC_CHECK_LIB(ext2fs, ext2fs_open, [ext2fs_lib=yes], [ext2fs_lib=no], [-lcom_err])
246if test "$ext2fs_h" = no -o "$ext2fs_lib" = no; then
d3393043 247 AC_MSG_ERROR(You need to install the Ext2fs libraries from the E2fsprogs distribution first - hint: make install-libs)
1227625a
SP
248fi
249
c38e5b6a
SP
250dnl
251dnl Check for readline headers and libraries
252dnl
253AC_CHECK_HEADER(readline/readline.h, [readline_h=yes], [readline_h=no])
254AC_CHECK_LIB(readline, readline, [readline_lib=yes], [readline_lib=no])
255if test "$readline_h" = no -o "$readline_lib" = no; then
256 if test "$READLINE" = "-lreadline"; then
257 AC_MSG_ERROR(You need to install the GNU readline libraries first)
258 fi
259fi
260
1227625a
SP
261dnl
262dnl Check for library functions
263dnl
5c1faba5
SP
264AC_CHECK_FUNCS(err errx verr verrx vwarn vwarnx warn warnx realpath lchown)
265AC_CHECK_FUNC(glob)
266
267dnl
268dnl Check for GLOB_ALTDIRFUNC
269dnl
270if test "$ac_cv_func_glob" = "yes"; then
271 AC_EGREP_CPP(yes,
272 [
273# include <glob.h>
274# ifdef GLOB_ALTDIRFUNC
275 yes
276# endif
277 ], AC_DEFINE(HAVE_GLOB), noglob=yes)
278 if test "$noglob" = "yes"; then
279 echo "Your system does not support extended glob, will use the internal routines"
280 fi
281fi
1227625a
SP
282
283dnl
284dnl Check for types
285dnl
286AC_CHECK_TYPE(quad_t, __s64)
287AC_CHECK_TYPE(u_quad_t, __u64)
288
289dnl
290dnl Compute top_buildir
291dnl
292top_builddir=`cd .; pwd`
293AC_SUBST(top_builddir)
294
295dnl
296dnl Create directories
297dnl
298test -d compat || mkdir compat
299test -d compat/lib || mkdir compat/lib
300
301dnl
302dnl Output files
303dnl
8d4197bb 304AC_OUTPUT(MCONFIG Makefile common/Makefile compat/include/Makefile compat/lib/Makefile dump/Makefile restore/Makefile $RMTMAKEFILE)