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