]>
Commit | Line | Data |
---|---|---|
1227625a SP |
1 | AC_INIT(dump/dump.h) |
2 | ||
3 | MCONFIG=./MCONFIG | |
4 | AC_SUBST_FILE(MCONFIG) | |
5 | ||
6 | AC_CONFIG_HEADER(config.h) | |
7 | ||
8 | dnl | |
9 | dnl Check for programs | |
10 | dnl | |
11 | AC_PROG_MAKE_SET | |
12 | AC_PROG_LN_S | |
13 | AC_PATH_PROG(CP, cp, cp) | |
14 | AC_PATH_PROG(MV, mv, mv) | |
15 | AC_PATH_PROG(RM, rm, rm) | |
16 | AC_CHECK_TOOL(AR, ar, ar) | |
17 | AC_CHECK_TOOL(RANLIB, ranlib, :) | |
18 | AC_CHECK_TOOL(PATCH, patch, :) | |
19 | AC_PROG_CC | |
20 | AC_PROG_INSTALL | |
21 | ||
1227625a SP |
22 | dnl |
23 | dnl Handle --enable-debug | |
24 | dnl | |
25 | AC_ARG_ENABLE([debug], | |
1daf06b9 | 26 | [ --enable-debug include debugging code (default is NO)], |
1227625a SP |
27 | if test "$enableval" = "no" |
28 | then | |
29 | DUMPDEBUG="" | |
30 | RESTOREDEBUG="" | |
1daf06b9 | 31 | echo "Not including debugging code" |
1227625a SP |
32 | else |
33 | DUMPDEBUG="-DFDEBUG -DTDEBUG -DWRITEDEBUG -DDIRDEBUG" | |
34 | RESTOREDEBUG="-DDIRDEBUG" | |
1daf06b9 | 35 | echo "Including debugging code" |
1227625a SP |
36 | fi, |
37 | DUMPDEBUG="" | |
38 | RESTOREDEBUG="" | |
1daf06b9 | 39 | echo "Not including debugging code by default" |
1227625a SP |
40 | ) |
41 | AC_SUBST(DUMPDEBUG) | |
42 | AC_SUBST(RESTOREDEBUG) | |
43 | ||
44 | dnl | |
45 | dnl Handle --enable-static | |
46 | dnl | |
47 | AC_ARG_ENABLE([static], | |
1daf06b9 | 48 | [ --enable-static link dump and restore statically (default is NO)], |
1227625a SP |
49 | if test "$enableval" = "no" |
50 | then | |
51 | STATIC="" | |
1daf06b9 | 52 | echo "Linking dump and restore dynamically" |
1227625a SP |
53 | else |
54 | STATIC="-static" | |
1daf06b9 | 55 | echo "Linking dump and restore statically" |
1227625a SP |
56 | fi |
57 | , | |
58 | STATIC="" | |
59 | echo "Linking dump and restore dynamically by default" | |
60 | ) | |
61 | AC_SUBST(STATIC) | |
62 | ||
63 | dnl | |
64 | dnl Handle --enable-rmt | |
65 | dnl | |
66 | AC_ARG_ENABLE([rmt], | |
1daf06b9 | 67 | [ --enable-rmt compile and install rmt (default is YES)], |
1227625a SP |
68 | if test "$enableval" = "no" |
69 | then | |
70 | RMTDIR="" | |
71 | RMTMAKEFILE="" | |
1daf06b9 | 72 | echo "Not compiling rmt" |
1227625a SP |
73 | else |
74 | RMTDIR="rmt" | |
75 | RMTMAKEFILE="rmt/Makefile" | |
1daf06b9 | 76 | echo "Compiling rmt" |
1227625a SP |
77 | fi |
78 | , | |
1daf06b9 SP |
79 | RMTDIR="rmt" |
80 | RMTMAKEFILE="rmt/Makefile" | |
81 | echo "Compiling rmt by default" | |
1227625a SP |
82 | ) |
83 | AC_SUBST(RMTDIR) | |
84 | ||
2ed89fda SP |
85 | dnl |
86 | dnl Handle --enable-kerberos | |
87 | dnl | |
88 | AC_ARG_ENABLE([kerberos], | |
1daf06b9 | 89 | [ --enable-kerberos compile kerberos extensions (default is NO)], |
2ed89fda SP |
90 | if test "$enableval" = "yes" |
91 | then | |
92 | OPTDEFS="-DKERBEROS" | |
1daf06b9 | 93 | echo "Compiling kerberos extensions" |
2ed89fda SP |
94 | else |
95 | OPTDEFS="" | |
1daf06b9 | 96 | echo "Not compiling kerberos extensions" |
2ed89fda SP |
97 | fi |
98 | , | |
99 | OPTDEFS="" | |
100 | echo "Not compiling kerberos extensions by default" | |
101 | ) | |
102 | AC_SUBST(OPTDEFS) | |
103 | ||
c38e5b6a SP |
104 | dnl |
105 | dnl Handle --enable-readline | |
106 | dnl | |
107 | AC_ARG_ENABLE([readline], | |
1daf06b9 | 108 | [ --enable-readline enable readline support in restore (default is YES)], |
c38e5b6a SP |
109 | if test "$enableval" = "no" |
110 | then | |
111 | READLINE="" | |
1daf06b9 | 112 | echo "Not including readline support" |
c38e5b6a | 113 | else |
5e04cc92 | 114 | READLINE="-lreadline -ltermcap" |
c38e5b6a | 115 | AC_DEFINE(HAVE_READLINE) |
1daf06b9 | 116 | echo "Including readline support" |
c38e5b6a SP |
117 | fi |
118 | , | |
1daf06b9 SP |
119 | READLINE="-lreadline -ltermcap" |
120 | AC_DEFINE(HAVE_READLINE) | |
121 | echo "Including readline support by default" | |
c38e5b6a SP |
122 | ) |
123 | AC_SUBST(READLINE) | |
124 | ||
d8574d45 SP |
125 | dnl |
126 | dnl Handle --enable-oldsylefscript | |
127 | dnl | |
128 | AC_ARG_ENABLE([oldstylefscript], | |
1daf06b9 | 129 | [ --enable-oldstylefscript enable old style F script (no arguments) (default is NO)], |
d8574d45 SP |
130 | if test "$enableval" = "yes" |
131 | then | |
132 | AC_DEFINE(OLD_STYLE_FSCRIPT) | |
1daf06b9 SP |
133 | echo "Using old style F script" |
134 | else | |
135 | echo "Using new style F script" | |
d8574d45 SP |
136 | fi |
137 | , | |
1daf06b9 | 138 | echo "Using new style F script by default" |
d8574d45 SP |
139 | ) |
140 | ||
d6967896 SP |
141 | dnl |
142 | dnl Handle --enable-largefile | |
143 | dnl | |
144 | AC_ARG_ENABLE([largefile], | |
1daf06b9 | 145 | [ --enable-largefile enable Large File System support (default is YES)], |
d6967896 SP |
146 | if test "$enableval" = "yes" |
147 | then | |
95c74f38 | 148 | AC_DEFINE(USE_LFS) |
1daf06b9 SP |
149 | echo "Enabling Large File System support" |
150 | else | |
151 | echo "Not enabling Large File System support" | |
d6967896 SP |
152 | fi |
153 | , | |
1daf06b9 SP |
154 | AC_DEFINE(USE_LFS) |
155 | echo "Enabling Large File System support by default" | |
d6967896 SP |
156 | ) |
157 | ||
35b24fb7 SP |
158 | dnl |
159 | dnl Handle --enable-qfa | |
160 | dnl | |
161 | AC_ARG_ENABLE([qfa], | |
1daf06b9 | 162 | [ --enable-qfa enable Quick File Access support (default is YES)], |
35b24fb7 SP |
163 | if test "$enableval" = "yes" |
164 | then | |
165 | AC_DEFINE(USE_QFA) | |
1daf06b9 SP |
166 | echo "Enabling Quick File Access support" |
167 | else | |
168 | echo "Not enabling Quick File Access support" | |
35b24fb7 SP |
169 | fi |
170 | , | |
1daf06b9 SP |
171 | AC_DEFINE(USE_QFA) |
172 | echo "Enabling Quick File Access support by default" | |
35b24fb7 SP |
173 | ) |
174 | ||
175 | dnl | |
176 | dnl Handle --enable-qfadebug | |
177 | dnl | |
178 | AC_ARG_ENABLE([qfadebug], | |
1daf06b9 | 179 | [ --enable-qfadebug include Quick File Access debugging code (default is NO)], |
35b24fb7 SP |
180 | if test "$enableval" = "yes" |
181 | then | |
182 | AC_DEFINE(DEBUG_QFA) | |
1daf06b9 SP |
183 | echo "Including Quick File Access debugging code" |
184 | else | |
185 | echo "Not including Quick File Access debugging code" | |
35b24fb7 SP |
186 | fi |
187 | , | |
1daf06b9 | 188 | echo "Not including Quick File Access debugging code by default" |
35b24fb7 SP |
189 | ) |
190 | ||
1227625a SP |
191 | dnl |
192 | dnl set $(CC) from --with-cc=value | |
193 | dnl | |
194 | AC_ARG_WITH([cc], | |
d8574d45 | 195 | [ --with-cc=COMPILER select compiler to use], |
1227625a SP |
196 | AC_MSG_RESULT(CC=$withval) |
197 | CC=$withval, | |
198 | if test -z "$CC" ; then CC=cc; fi | |
199 | [AC_MSG_RESULT(CC defaults to $CC)])dnl | |
200 | export CC | |
201 | AC_SUBST([CC]) | |
202 | ||
203 | dnl | |
204 | dnl set $(LD) from --with-linker=value | |
205 | dnl | |
206 | AC_ARG_WITH([linker], | |
d8574d45 | 207 | [ --with-linker=LINKER select linker to use], |
1227625a SP |
208 | AC_MSG_RESULT(LD=$withval) |
209 | LD=$withval, | |
210 | if test -z "$LD" ; then LD=$CC; fi | |
211 | [AC_MSG_RESULT(LD defaults to $LD)])dnl | |
212 | export LD | |
213 | AC_SUBST([LD]) | |
214 | ||
215 | dnl | |
216 | dnl set $(CCOPTS) from --with-ccopts=value | |
217 | dnl | |
218 | AC_ARG_WITH([ccopts], | |
d8574d45 | 219 | [ --with-ccopts=CCOPTS select compiler command line options], |
1227625a SP |
220 | AC_MSG_RESULT(CCOPTS is $withval) |
221 | CCOPTS=$withval | |
222 | CFLAGS="$CFLAGS $withval", | |
223 | CCOPTS=)dnl | |
224 | AC_SUBST(CCOPTS) | |
225 | ||
226 | dnl | |
227 | dnl set $(LDFLAGS) from --with-ldopts=value | |
228 | dnl | |
229 | AC_ARG_WITH([ldopts], | |
d8574d45 | 230 | [ --with-ldopts=LDOPTS select linker command line options], |
1227625a | 231 | AC_MSG_RESULT(LDFLAGS is $withval) |
e95b2aff SP |
232 | LDOPTS=$withval |
233 | LDFLAGS="$LDFLAGS $withval", | |
234 | LDOPTS=)dnl | |
235 | AC_SUBST(LDOPTS) | |
1227625a SP |
236 | |
237 | dnl | |
238 | dnl set $(BINOWNER) from --with-binowner | |
239 | dnl | |
240 | AC_ARG_WITH([binowner], | |
d8574d45 | 241 | [ --with-binowner=USER select owner for binaries], |
1227625a SP |
242 | AC_MSG_RESULT(BINOWNER is $withval) |
243 | BINOWNER=$withval, | |
244 | BINOWNER=root | |
245 | echo "BINOWNER defaults to $BINOWNER" | |
246 | )dnl | |
247 | AC_SUBST(BINOWNER) | |
248 | ||
249 | dnl | |
250 | dnl set $(BINGRP) from --with-bingrp | |
251 | dnl | |
252 | AC_ARG_WITH([bingrp], | |
d8574d45 | 253 | [ --with-bingrp=GROUP select group for binaries], |
1227625a SP |
254 | AC_MSG_RESULT(BINGRP is $withval) |
255 | BINGRP=$withval, | |
256 | BINGRP=tty | |
257 | echo "BINGRP defaults to $BINGRP" | |
258 | )dnl | |
259 | AC_SUBST(BINGRP) | |
260 | ||
261 | dnl | |
262 | dnl set $(BINMODE) from --with-binmode | |
263 | dnl | |
264 | AC_ARG_WITH([binmode], | |
d8574d45 | 265 | [ --with-binmode=MODE select mode for binaries], |
1227625a SP |
266 | AC_MSG_RESULT(BINMODE is $withval) |
267 | BINMODE=$withval, | |
882090d1 | 268 | BINMODE=0755 |
1227625a SP |
269 | echo "BINMODE defaults to $BINMODE" |
270 | )dnl | |
271 | AC_SUBST(BINMODE) | |
272 | ||
273 | dnl | |
274 | dnl set $(MANOWNER) from --with-manowner | |
275 | dnl | |
276 | AC_ARG_WITH([manowner], | |
d8574d45 | 277 | [ --with-manowner=USER select owner for manual pages], |
1227625a SP |
278 | AC_MSG_RESULT(MANOWNER is $withval) |
279 | MANOWNER=$withval, | |
280 | MANOWNER=man | |
281 | echo "MANOWNER defaults to $MANOWNER" | |
282 | )dnl | |
283 | AC_SUBST(MANOWNER) | |
284 | ||
285 | dnl | |
286 | dnl set $(MANGRP) from --with-mangrp | |
287 | dnl | |
288 | AC_ARG_WITH([mangrp], | |
d8574d45 | 289 | [ --with-mangrp=GROUP select group for manual pages], |
1227625a SP |
290 | AC_MSG_RESULT(MANGRP is $withval) |
291 | MANGRP=$withval, | |
292 | MANGRP=tty | |
293 | echo "MANGRP defaults to $MANGRP" | |
294 | )dnl | |
295 | AC_SUBST(MANGRP) | |
296 | ||
297 | dnl | |
298 | dnl set $(MANMODE) from --with-manmode | |
299 | dnl | |
300 | AC_ARG_WITH([manmode], | |
d8574d45 | 301 | [ --with-manmode=MODE select mode for manual pages], |
1227625a SP |
302 | AC_MSG_RESULT(MANMODE is $withval) |
303 | MANMODE=$withval, | |
882090d1 | 304 | MANMODE=0644 |
1227625a SP |
305 | echo "MANMODE defaults to $MANMODE" |
306 | )dnl | |
307 | AC_SUBST(MANMODE) | |
308 | ||
8d4197bb SP |
309 | dnl |
310 | dnl set $(DUMPDATESPATH) from --with-dumpdatespath | |
311 | dnl | |
312 | AC_ARG_WITH([dumpdatespath], | |
d8574d45 | 313 | [ --with-dumpdatespath=PATH select path for dumpdates file], |
8d4197bb SP |
314 | AC_MSG_RESULT(DUMPDATESPATH is $withval) |
315 | DUMPDATESPATH=$withval, | |
60d46c35 | 316 | DUMPDATESPATH="${sysconfdir}/dumpdates" |
8d4197bb SP |
317 | echo "DUMPDATESPATH defaults to $DUMPDATESPATH" |
318 | )dnl | |
319 | AC_SUBST(DUMPDATESPATH) | |
320 | ||
1227625a SP |
321 | dnl |
322 | dnl Check for Ext2fs headers and libraries | |
323 | dnl | |
d3e542e7 | 324 | AC_CHECK_HEADER(ext2fs/ext2fs.h, [ext2fs_h=yes], [ext2fs_h=no], [-]) |
1227625a SP |
325 | AC_CHECK_LIB(ext2fs, ext2fs_open, [ext2fs_lib=yes], [ext2fs_lib=no], [-lcom_err]) |
326 | if test "$ext2fs_h" = no -o "$ext2fs_lib" = no; then | |
d3393043 | 327 | AC_MSG_ERROR(You need to install the Ext2fs libraries from the E2fsprogs distribution first - hint: make install-libs) |
1227625a SP |
328 | fi |
329 | ||
e4a8bde4 SP |
330 | dnl |
331 | dnl Try to use ext2_fs.h header from libext2fs instead of from the kernel | |
332 | dnl | |
d3e542e7 | 333 | AC_CHECK_HEADERS(ext2fs/ext2_fs.h, [], [], [-]) |
e4a8bde4 | 334 | |
a4f547cd SP |
335 | dnl |
336 | dnl Check for ext2_ino_t type | |
337 | dnl | |
7422942f | 338 | AC_MSG_CHECKING(for ext2_ino_t type in libext2fs headers) |
a4f547cd | 339 | AC_TRY_COMPILE([#include <stdio.h> |
e4a8bde4 SP |
340 | #ifdef HAVE_EXT2FS_EXT2_FS_H |
341 | #include <ext2fs/ext2_fs.h> | |
342 | #else | |
a4f547cd | 343 | #include <linux/ext2_fs.h> |
e4a8bde4 SP |
344 | #endif |
345 | #include <ext2fs/ext2fs.h>], | |
a4f547cd | 346 | [ext2_ino_t ino = 0;], |
7422942f | 347 | [AC_DEFINE(HAVE_EXT2_INO_T) AC_MSG_RESULT(yes)], |
a4f547cd SP |
348 | AC_MSG_RESULT(no)) |
349 | ||
350 | dnl | |
351 | dnl Check for s_journal_inum field in ext2_super_block struct | |
352 | dnl | |
353 | AC_MSG_CHECKING(for s_journal_inum field in ext2_super_block struct) | |
354 | AC_TRY_COMPILE([#include <stdio.h> | |
e4a8bde4 SP |
355 | #ifdef HAVE_EXT2FS_EXT2_FS_H |
356 | #include <ext2fs/ext2_fs.h> | |
357 | #else | |
a4f547cd | 358 | #include <linux/ext2_fs.h> |
e4a8bde4 | 359 | #endif |
a4f547cd SP |
360 | #include <ext2fs/ext2fs.h>], |
361 | [struct ext2_super_block es; es.s_journal_inum = 0;], | |
7422942f | 362 | [AC_DEFINE(HAVE_EXT2_JOURNAL_INUM) AC_MSG_RESULT(yes)], |
a4f547cd SP |
363 | AC_MSG_RESULT(no)) |
364 | ||
3e815572 SP |
365 | dnl |
366 | dnl Check for termcap libraries | |
367 | dnl | |
368 | AC_CHECK_LIB(termcap, tgetent, [termcap_lib=yes], [termcap_lib=no]) | |
369 | if test "$termcap_lib" = no; then | |
370 | if test "$READLINE" = "-lreadline -ltermcap"; then | |
e68dc63e | 371 | AC_MSG_ERROR(You need to install the GNU termcap library or configure without --enable-readline) |
3e815572 SP |
372 | fi |
373 | fi | |
374 | ||
c38e5b6a SP |
375 | dnl |
376 | dnl Check for readline headers and libraries | |
377 | dnl | |
d3e542e7 | 378 | AC_CHECK_HEADER(readline/readline.h, [readline_h=yes], [readline_h=no], [-]) |
3e815572 | 379 | AC_CHECK_LIB(readline, readline, [readline_lib=yes], [readline_lib=no], "-ltermcap") |
c38e5b6a | 380 | if test "$readline_h" = no -o "$readline_lib" = no; then |
3e815572 | 381 | if test "$READLINE" = "-lreadline -ltermcap"; then |
e68dc63e | 382 | AC_MSG_ERROR(You need to install the GNU readline library or configure without --enable-readline) |
c38e5b6a SP |
383 | fi |
384 | fi | |
385 | ||
bcecd677 SP |
386 | dnl |
387 | dnl Check for rl_completion_matches | |
388 | dnl | |
389 | AC_CHECK_LIB(readline, rl_completion_matches, [rlcm=yes], [rlcm=no], "-ltermcap") | |
390 | if test "$rlcm" = yes; then | |
391 | AC_DEFINE(HAVE_READLINE_RLCM) | |
392 | fi | |
393 | ||
394 | dnl | |
395 | dnl Check for rl_completion_append_character | |
396 | dnl | |
397 | AC_CHECK_LIB(readline, rl_completion_append_character, [rcac=yes], [rcac=no], "-ltermcap") | |
398 | if test "$rcac" = yes; then | |
399 | AC_DEFINE(HAVE_READLINE_CAC) | |
400 | fi | |
401 | ||
4d5ed2f3 SP |
402 | dnl |
403 | dnl Check for zlib headers and libraries | |
404 | dnl | |
d3e542e7 | 405 | AC_CHECK_HEADER(zlib.h, [zlib_h=yes], [zlib_h=no], [-]) |
4d5ed2f3 SP |
406 | AC_CHECK_LIB(z, compress2, [zlib_lib=yes], [zlib_lib=no]) |
407 | if test "$zlib_h" = yes -a "$zlib_lib" = yes; then | |
408 | ZLIB="-lz" | |
409 | AC_DEFINE(HAVE_ZLIB) | |
410 | else | |
411 | ZLIB="" | |
412 | fi | |
413 | AC_SUBST(ZLIB) | |
414 | ||
88ef261e SP |
415 | dnl |
416 | dnl Check for bzlib headers and libraries | |
417 | dnl | |
d3e542e7 | 418 | AC_CHECK_HEADER(bzlib.h, [bzlib_h=yes], [bzlib_h=no], [-]) |
88ef261e SP |
419 | AC_CHECK_LIB(bz2, BZ2_bzBuffToBuffCompress, [bzlib_lib=yes], [bzlib_lib=no]) |
420 | if test "$bzlib_h" = yes -a "$bzlib_lib" = yes; then | |
421 | BZLIB="-lbz2" | |
422 | AC_DEFINE(HAVE_BZLIB) | |
423 | else | |
424 | BZLIB="" | |
425 | fi | |
426 | AC_SUBST(BZLIB) | |
427 | ||
1227625a SP |
428 | dnl |
429 | dnl Check for library functions | |
430 | dnl | |
5c1faba5 SP |
431 | AC_CHECK_FUNCS(err errx verr verrx vwarn vwarnx warn warnx realpath lchown) |
432 | AC_CHECK_FUNC(glob) | |
433 | ||
434 | dnl | |
435 | dnl Check for GLOB_ALTDIRFUNC | |
436 | dnl | |
a4f547cd | 437 | AC_MSG_CHECKING(for extended glob routines) |
5c1faba5 SP |
438 | if test "$ac_cv_func_glob" = "yes"; then |
439 | AC_EGREP_CPP(yes, | |
440 | [ | |
441 | # include <glob.h> | |
442 | # ifdef GLOB_ALTDIRFUNC | |
443 | yes | |
444 | # endif | |
a4f547cd SP |
445 | ], |
446 | [ | |
447 | AC_DEFINE(HAVE_GLOB) | |
448 | AC_MSG_RESULT(yes) | |
449 | ], | |
450 | [ | |
451 | AC_MSG_RESULT(no) | |
452 | echo "Your system does not support extended glob, will use the internal routines" | |
453 | ]) | |
5c1faba5 | 454 | fi |
1227625a SP |
455 | |
456 | dnl | |
457 | dnl Check for types | |
458 | dnl | |
1a886de8 SP |
459 | AC_CHECK_TYPE(quad_t, int64_t) |
460 | AC_CHECK_TYPE(u_quad_t, uint64_t) | |
1227625a SP |
461 | |
462 | dnl | |
463 | dnl Compute top_buildir | |
464 | dnl | |
465 | top_builddir=`cd .; pwd` | |
466 | AC_SUBST(top_builddir) | |
467 | ||
468 | dnl | |
469 | dnl Create directories | |
470 | dnl | |
471 | test -d compat || mkdir compat | |
472 | test -d compat/lib || mkdir compat/lib | |
473 | ||
474 | dnl | |
475 | dnl Output files | |
476 | dnl | |
8d4197bb | 477 | AC_OUTPUT(MCONFIG Makefile common/Makefile compat/include/Makefile compat/lib/Makefile dump/Makefile restore/Makefile $RMTMAKEFILE) |