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