]>
Commit | Line | Data |
---|---|---|
1227625a | 1 | AC_INIT(dump/dump.h) |
e7d18957 | 2 | AC_PREREQ(2.57) |
1227625a SP |
3 | |
4 | MCONFIG=./MCONFIG | |
5 | AC_SUBST_FILE(MCONFIG) | |
6 | ||
7 | AC_CONFIG_HEADER(config.h) | |
8 | ||
9 | dnl | |
10 | dnl Check for programs | |
11 | dnl | |
12 | AC_PROG_MAKE_SET | |
13 | AC_PROG_LN_S | |
14 | AC_PATH_PROG(CP, cp, cp) | |
15 | AC_PATH_PROG(MV, mv, mv) | |
16 | AC_PATH_PROG(RM, rm, rm) | |
17 | AC_CHECK_TOOL(AR, ar, ar) | |
18 | AC_CHECK_TOOL(RANLIB, ranlib, :) | |
19 | AC_CHECK_TOOL(PATCH, patch, :) | |
20 | AC_PROG_CC | |
21 | AC_PROG_INSTALL | |
22 | ||
e7d18957 SP |
23 | AC_CHECK_HEADERS([sys/types.h]) |
24 | ||
25 | CPPFLAGS="-D_BSD_SOURCE -D_USE_BSD_SIGNAL ${CPPFLAGS}" | |
26 | ||
1227625a SP |
27 | dnl |
28 | dnl Handle --enable-debug | |
29 | dnl | |
30 | AC_ARG_ENABLE([debug], | |
1daf06b9 | 31 | [ --enable-debug include debugging code (default is NO)], |
1227625a SP |
32 | if test "$enableval" = "no" |
33 | then | |
34 | DUMPDEBUG="" | |
35 | RESTOREDEBUG="" | |
1daf06b9 | 36 | echo "Not including debugging code" |
1227625a SP |
37 | else |
38 | DUMPDEBUG="-DFDEBUG -DTDEBUG -DWRITEDEBUG -DDIRDEBUG" | |
39 | RESTOREDEBUG="-DDIRDEBUG" | |
1daf06b9 | 40 | echo "Including debugging code" |
1227625a SP |
41 | fi, |
42 | DUMPDEBUG="" | |
43 | RESTOREDEBUG="" | |
1daf06b9 | 44 | echo "Not including debugging code by default" |
1227625a SP |
45 | ) |
46 | AC_SUBST(DUMPDEBUG) | |
47 | AC_SUBST(RESTOREDEBUG) | |
48 | ||
49 | dnl | |
50 | dnl Handle --enable-static | |
51 | dnl | |
52 | AC_ARG_ENABLE([static], | |
1daf06b9 | 53 | [ --enable-static link dump and restore statically (default is NO)], |
1227625a SP |
54 | if test "$enableval" = "no" |
55 | then | |
56 | STATIC="" | |
1daf06b9 | 57 | echo "Linking dump and restore dynamically" |
1227625a SP |
58 | else |
59 | STATIC="-static" | |
1daf06b9 | 60 | echo "Linking dump and restore statically" |
1227625a SP |
61 | fi |
62 | , | |
63 | STATIC="" | |
64 | echo "Linking dump and restore dynamically by default" | |
65 | ) | |
66 | AC_SUBST(STATIC) | |
67 | ||
d7783603 SP |
68 | dnl |
69 | dnl Handle --enable-staticz | |
70 | dnl | |
71 | AC_ARG_ENABLE([staticz], | |
72 | [ --enable-staticz link libz and libbz2 statically (default is NO)], | |
73 | if test "$enableval" = "no" | |
74 | then | |
75 | STATICZ="no" | |
76 | echo "Linking libz and libbz2 dynamically" | |
77 | else | |
78 | STATICZ="yes" | |
79 | echo "Linking libz and libbz2 statically" | |
80 | fi | |
81 | , | |
82 | STATICZ="no" | |
83 | echo "Linking libz and libbz2 dynamically by default" | |
84 | ) | |
85 | ||
1227625a SP |
86 | dnl |
87 | dnl Handle --enable-rmt | |
88 | dnl | |
89 | AC_ARG_ENABLE([rmt], | |
1daf06b9 | 90 | [ --enable-rmt compile and install rmt (default is YES)], |
1227625a SP |
91 | if test "$enableval" = "no" |
92 | then | |
93 | RMTDIR="" | |
94 | RMTMAKEFILE="" | |
1daf06b9 | 95 | echo "Not compiling rmt" |
1227625a SP |
96 | else |
97 | RMTDIR="rmt" | |
98 | RMTMAKEFILE="rmt/Makefile" | |
1daf06b9 | 99 | echo "Compiling rmt" |
1227625a SP |
100 | fi |
101 | , | |
1daf06b9 SP |
102 | RMTDIR="rmt" |
103 | RMTMAKEFILE="rmt/Makefile" | |
104 | echo "Compiling rmt by default" | |
1227625a SP |
105 | ) |
106 | AC_SUBST(RMTDIR) | |
107 | ||
cdfe1392 SP |
108 | dnl |
109 | dnl Handle --enable-ermt | |
110 | dnl | |
111 | AC_ARG_ENABLE([ermt], | |
112 | [ --enable-ermt compile ermt, an encrypting version of rmt (default is NO)], | |
113 | if test "$enableval" = "no" | |
114 | then | |
115 | ERMT="" | |
116 | CRYPTO="" | |
117 | echo "Not compiling ermt" | |
118 | else | |
119 | if test "$RMTDIR" = "" | |
120 | then | |
121 | AC_MSG_ERROR(ermt requires --enable-rmt) | |
122 | fi | |
123 | ERMT="ermt" | |
124 | CRYPTO="-lcrypto" | |
125 | echo "Compiling ermt" | |
126 | fi | |
127 | , | |
128 | ERMT="" | |
129 | CRYPTO="" | |
130 | echo "Not compiling ermt by default" | |
131 | ) | |
132 | AC_SUBST(ERMT) | |
133 | AC_SUBST(CRYPTO) | |
134 | ||
2ed89fda SP |
135 | dnl |
136 | dnl Handle --enable-kerberos | |
137 | dnl | |
138 | AC_ARG_ENABLE([kerberos], | |
1daf06b9 | 139 | [ --enable-kerberos compile kerberos extensions (default is NO)], |
2ed89fda SP |
140 | if test "$enableval" = "yes" |
141 | then | |
142 | OPTDEFS="-DKERBEROS" | |
1daf06b9 | 143 | echo "Compiling kerberos extensions" |
2ed89fda SP |
144 | else |
145 | OPTDEFS="" | |
1daf06b9 | 146 | echo "Not compiling kerberos extensions" |
2ed89fda SP |
147 | fi |
148 | , | |
149 | OPTDEFS="" | |
150 | echo "Not compiling kerberos extensions by default" | |
151 | ) | |
152 | AC_SUBST(OPTDEFS) | |
153 | ||
c38e5b6a SP |
154 | dnl |
155 | dnl Handle --enable-readline | |
156 | dnl | |
157 | AC_ARG_ENABLE([readline], | |
1daf06b9 | 158 | [ --enable-readline enable readline support in restore (default is YES)], |
c38e5b6a SP |
159 | if test "$enableval" = "no" |
160 | then | |
161 | READLINE="" | |
1daf06b9 | 162 | echo "Not including readline support" |
c38e5b6a | 163 | else |
0556ca22 | 164 | READLINE="yes" |
e7d18957 | 165 | AC_DEFINE([HAVE_READLINE],1,[Define if you want to include readline support.]) |
1daf06b9 | 166 | echo "Including readline support" |
c38e5b6a SP |
167 | fi |
168 | , | |
0556ca22 | 169 | READLINE="yes" |
e7d18957 | 170 | AC_DEFINE([HAVE_READLINE],1,[Define if you want to include readline support.]) |
1daf06b9 | 171 | echo "Including readline support by default" |
c38e5b6a | 172 | ) |
c38e5b6a | 173 | |
d8574d45 SP |
174 | dnl |
175 | dnl Handle --enable-oldsylefscript | |
176 | dnl | |
177 | AC_ARG_ENABLE([oldstylefscript], | |
1daf06b9 | 178 | [ --enable-oldstylefscript enable old style F script (no arguments) (default is NO)], |
d8574d45 SP |
179 | if test "$enableval" = "yes" |
180 | then | |
e7d18957 | 181 | AC_DEFINE([OLD_STYLE_FSCRIPT],1,[Define this is you want old style F script (no arguments).]) |
1daf06b9 SP |
182 | echo "Using old style F script" |
183 | else | |
184 | echo "Using new style F script" | |
d8574d45 SP |
185 | fi |
186 | , | |
1daf06b9 | 187 | echo "Using new style F script by default" |
d8574d45 SP |
188 | ) |
189 | ||
d6967896 SP |
190 | dnl |
191 | dnl Handle --enable-largefile | |
192 | dnl | |
193 | AC_ARG_ENABLE([largefile], | |
1daf06b9 | 194 | [ --enable-largefile enable Large File System support (default is YES)], |
d6967896 SP |
195 | if test "$enableval" = "yes" |
196 | then | |
e7d18957 | 197 | AC_DEFINE([USE_LFS],1,[Define this if you want Large File System support.]) |
1daf06b9 SP |
198 | echo "Enabling Large File System support" |
199 | else | |
200 | echo "Not enabling Large File System support" | |
d6967896 SP |
201 | fi |
202 | , | |
e7d18957 | 203 | AC_DEFINE([USE_LFS],1,[Define this if you want Large File System support.]) |
1daf06b9 | 204 | echo "Enabling Large File System support by default" |
d6967896 SP |
205 | ) |
206 | ||
35b24fb7 SP |
207 | dnl |
208 | dnl Handle --enable-qfa | |
209 | dnl | |
210 | AC_ARG_ENABLE([qfa], | |
1daf06b9 | 211 | [ --enable-qfa enable Quick File Access support (default is YES)], |
35b24fb7 SP |
212 | if test "$enableval" = "yes" |
213 | then | |
e7d18957 | 214 | AC_DEFINE([USE_QFA],1,[Define this if you want Quick File Access support.]) |
1daf06b9 SP |
215 | echo "Enabling Quick File Access support" |
216 | else | |
217 | echo "Not enabling Quick File Access support" | |
35b24fb7 SP |
218 | fi |
219 | , | |
e7d18957 | 220 | AC_DEFINE([USE_QFA],1,[Define this if you want Quick File Access support.]) |
1daf06b9 | 221 | echo "Enabling Quick File Access support by default" |
35b24fb7 SP |
222 | ) |
223 | ||
224 | dnl | |
225 | dnl Handle --enable-qfadebug | |
226 | dnl | |
227 | AC_ARG_ENABLE([qfadebug], | |
1daf06b9 | 228 | [ --enable-qfadebug include Quick File Access debugging code (default is NO)], |
35b24fb7 SP |
229 | if test "$enableval" = "yes" |
230 | then | |
e7d18957 | 231 | AC_DEFINE([DEBUG_QFA],1,[Define this if you want to include Quick File Access debugging code.]) |
1daf06b9 SP |
232 | echo "Including Quick File Access debugging code" |
233 | else | |
234 | echo "Not including Quick File Access debugging code" | |
35b24fb7 SP |
235 | fi |
236 | , | |
1daf06b9 | 237 | echo "Not including Quick File Access debugging code by default" |
35b24fb7 SP |
238 | ) |
239 | ||
d1925e0c SP |
240 | dnl |
241 | dnl Handle --enable-macosx | |
242 | dnl | |
243 | AC_ARG_ENABLE([macosx], | |
244 | [ --enable-macosx include Mac OSX restore compatibility (default is NO)], | |
245 | if test "$enableval" = "yes" | |
246 | then | |
247 | AC_DEFINE([DUMP_MACOSX],1,[Define this if you want to include Mac OSX restore compatibility.]) | |
248 | echo "Including Mac OSX restore compatibility code" | |
249 | else | |
250 | echo "Not including Mac OSX restore compatibility code" | |
251 | fi | |
252 | , | |
253 | echo "Not including Mac OSX restore compatibility code by default" | |
254 | ) | |
255 | ||
7f7d329e SP |
256 | dnl |
257 | dnl Handle --enable-transselinux | |
258 | dnl | |
259 | AC_ARG_ENABLE([transselinux], | |
260 | [ --enable-transselinux restore can translate SELinux EAs (default is YES)], | |
261 | if test "$enableval" = "yes" | |
262 | then | |
263 | LTRANSSELINUX="-lselinux" | |
264 | CCTRANSSELINUX="-DTRANSSELINUX" | |
265 | echo "restore can translate SELinux EAs" | |
266 | else | |
267 | LTRANSSELINUX="" | |
268 | CCTRANSSELINUX="" | |
269 | echo "restore can not translate SELinux EAs" | |
270 | fi | |
271 | , | |
272 | LTRANSSELINUX="-lselinux" | |
273 | CCTRANSSELINUX="-DTRANSSELINUX" | |
274 | echo "restore can translate SELinux EAs by default" | |
275 | ) | |
276 | AC_SUBST(LTRANSSELINUX) | |
277 | AC_SUBST(CCTRANSSELINUX) | |
278 | ||
d1925e0c | 279 | |
1227625a SP |
280 | dnl |
281 | dnl set $(CC) from --with-cc=value | |
282 | dnl | |
283 | AC_ARG_WITH([cc], | |
d8574d45 | 284 | [ --with-cc=COMPILER select compiler to use], |
1227625a SP |
285 | AC_MSG_RESULT(CC=$withval) |
286 | CC=$withval, | |
287 | if test -z "$CC" ; then CC=cc; fi | |
288 | [AC_MSG_RESULT(CC defaults to $CC)])dnl | |
289 | export CC | |
290 | AC_SUBST([CC]) | |
291 | ||
292 | dnl | |
293 | dnl set $(LD) from --with-linker=value | |
294 | dnl | |
295 | AC_ARG_WITH([linker], | |
d8574d45 | 296 | [ --with-linker=LINKER select linker to use], |
1227625a SP |
297 | AC_MSG_RESULT(LD=$withval) |
298 | LD=$withval, | |
299 | if test -z "$LD" ; then LD=$CC; fi | |
300 | [AC_MSG_RESULT(LD defaults to $LD)])dnl | |
301 | export LD | |
302 | AC_SUBST([LD]) | |
303 | ||
304 | dnl | |
305 | dnl set $(CCOPTS) from --with-ccopts=value | |
306 | dnl | |
307 | AC_ARG_WITH([ccopts], | |
d8574d45 | 308 | [ --with-ccopts=CCOPTS select compiler command line options], |
1227625a SP |
309 | AC_MSG_RESULT(CCOPTS is $withval) |
310 | CCOPTS=$withval | |
311 | CFLAGS="$CFLAGS $withval", | |
312 | CCOPTS=)dnl | |
313 | AC_SUBST(CCOPTS) | |
314 | ||
315 | dnl | |
316 | dnl set $(LDFLAGS) from --with-ldopts=value | |
317 | dnl | |
318 | AC_ARG_WITH([ldopts], | |
d8574d45 | 319 | [ --with-ldopts=LDOPTS select linker command line options], |
1227625a | 320 | AC_MSG_RESULT(LDFLAGS is $withval) |
e95b2aff SP |
321 | LDOPTS=$withval |
322 | LDFLAGS="$LDFLAGS $withval", | |
323 | LDOPTS=)dnl | |
324 | AC_SUBST(LDOPTS) | |
1227625a SP |
325 | |
326 | dnl | |
327 | dnl set $(BINOWNER) from --with-binowner | |
328 | dnl | |
329 | AC_ARG_WITH([binowner], | |
d8574d45 | 330 | [ --with-binowner=USER select owner for binaries], |
1227625a SP |
331 | AC_MSG_RESULT(BINOWNER is $withval) |
332 | BINOWNER=$withval, | |
333 | BINOWNER=root | |
334 | echo "BINOWNER defaults to $BINOWNER" | |
335 | )dnl | |
336 | AC_SUBST(BINOWNER) | |
337 | ||
338 | dnl | |
339 | dnl set $(BINGRP) from --with-bingrp | |
340 | dnl | |
341 | AC_ARG_WITH([bingrp], | |
d8574d45 | 342 | [ --with-bingrp=GROUP select group for binaries], |
1227625a SP |
343 | AC_MSG_RESULT(BINGRP is $withval) |
344 | BINGRP=$withval, | |
345 | BINGRP=tty | |
346 | echo "BINGRP defaults to $BINGRP" | |
347 | )dnl | |
348 | AC_SUBST(BINGRP) | |
349 | ||
350 | dnl | |
351 | dnl set $(BINMODE) from --with-binmode | |
352 | dnl | |
353 | AC_ARG_WITH([binmode], | |
d8574d45 | 354 | [ --with-binmode=MODE select mode for binaries], |
1227625a SP |
355 | AC_MSG_RESULT(BINMODE is $withval) |
356 | BINMODE=$withval, | |
882090d1 | 357 | BINMODE=0755 |
1227625a SP |
358 | echo "BINMODE defaults to $BINMODE" |
359 | )dnl | |
360 | AC_SUBST(BINMODE) | |
361 | ||
362 | dnl | |
363 | dnl set $(MANOWNER) from --with-manowner | |
364 | dnl | |
365 | AC_ARG_WITH([manowner], | |
d8574d45 | 366 | [ --with-manowner=USER select owner for manual pages], |
1227625a SP |
367 | AC_MSG_RESULT(MANOWNER is $withval) |
368 | MANOWNER=$withval, | |
369 | MANOWNER=man | |
370 | echo "MANOWNER defaults to $MANOWNER" | |
371 | )dnl | |
372 | AC_SUBST(MANOWNER) | |
373 | ||
374 | dnl | |
375 | dnl set $(MANGRP) from --with-mangrp | |
376 | dnl | |
377 | AC_ARG_WITH([mangrp], | |
d8574d45 | 378 | [ --with-mangrp=GROUP select group for manual pages], |
1227625a SP |
379 | AC_MSG_RESULT(MANGRP is $withval) |
380 | MANGRP=$withval, | |
381 | MANGRP=tty | |
382 | echo "MANGRP defaults to $MANGRP" | |
383 | )dnl | |
384 | AC_SUBST(MANGRP) | |
385 | ||
386 | dnl | |
387 | dnl set $(MANMODE) from --with-manmode | |
388 | dnl | |
389 | AC_ARG_WITH([manmode], | |
d8574d45 | 390 | [ --with-manmode=MODE select mode for manual pages], |
1227625a SP |
391 | AC_MSG_RESULT(MANMODE is $withval) |
392 | MANMODE=$withval, | |
882090d1 | 393 | MANMODE=0644 |
1227625a SP |
394 | echo "MANMODE defaults to $MANMODE" |
395 | )dnl | |
396 | AC_SUBST(MANMODE) | |
397 | ||
8d4197bb SP |
398 | dnl |
399 | dnl set $(DUMPDATESPATH) from --with-dumpdatespath | |
400 | dnl | |
401 | AC_ARG_WITH([dumpdatespath], | |
d8574d45 | 402 | [ --with-dumpdatespath=PATH select path for dumpdates file], |
8d4197bb SP |
403 | AC_MSG_RESULT(DUMPDATESPATH is $withval) |
404 | DUMPDATESPATH=$withval, | |
60d46c35 | 405 | DUMPDATESPATH="${sysconfdir}/dumpdates" |
8d4197bb SP |
406 | echo "DUMPDATESPATH defaults to $DUMPDATESPATH" |
407 | )dnl | |
408 | AC_SUBST(DUMPDATESPATH) | |
409 | ||
1227625a SP |
410 | dnl |
411 | dnl Check for Ext2fs headers and libraries | |
412 | dnl | |
d3e542e7 | 413 | AC_CHECK_HEADER(ext2fs/ext2fs.h, [ext2fs_h=yes], [ext2fs_h=no], [-]) |
1227625a SP |
414 | AC_CHECK_LIB(ext2fs, ext2fs_open, [ext2fs_lib=yes], [ext2fs_lib=no], [-lcom_err]) |
415 | if test "$ext2fs_h" = no -o "$ext2fs_lib" = no; then | |
d3393043 | 416 | AC_MSG_ERROR(You need to install the Ext2fs libraries from the E2fsprogs distribution first - hint: make install-libs) |
1227625a SP |
417 | fi |
418 | ||
cca7148b SP |
419 | dnl |
420 | dnl Check for ext2fs_read_inode_full | |
421 | dnl | |
422 | AC_CHECK_LIB(ext2fs, ext2fs_read_inode_full, [rif=yes], [rif=no], [-lcom_err]) | |
423 | if test "$rif" = yes; then | |
424 | AC_DEFINE([HAVE_EXT2FS_READ_INODE_FULL],1,[Define this if your ext2fs libs have the ext2fs_read_inode_full function.]) | |
425 | fi | |
426 | ||
e4a8bde4 SP |
427 | dnl |
428 | dnl Try to use ext2_fs.h header from libext2fs instead of from the kernel | |
429 | dnl | |
d3e542e7 | 430 | AC_CHECK_HEADERS(ext2fs/ext2_fs.h, [], [], [-]) |
e4a8bde4 | 431 | |
a4f547cd SP |
432 | dnl |
433 | dnl Check for ext2_ino_t type | |
434 | dnl | |
7422942f | 435 | AC_MSG_CHECKING(for ext2_ino_t type in libext2fs headers) |
a4f547cd | 436 | AC_TRY_COMPILE([#include <stdio.h> |
e4a8bde4 SP |
437 | #ifdef HAVE_EXT2FS_EXT2_FS_H |
438 | #include <ext2fs/ext2_fs.h> | |
439 | #else | |
a4f547cd | 440 | #include <linux/ext2_fs.h> |
e4a8bde4 SP |
441 | #endif |
442 | #include <ext2fs/ext2fs.h>], | |
a4f547cd | 443 | [ext2_ino_t ino = 0;], |
e7d18957 SP |
444 | [AC_DEFINE([HAVE_EXT2_INO_T],1,[Define if we have the ext2_ino_t type (from e2fsprogs 1.20+).]) |
445 | AC_MSG_RESULT(yes)], | |
a4f547cd SP |
446 | AC_MSG_RESULT(no)) |
447 | ||
448 | dnl | |
449 | dnl Check for s_journal_inum field in ext2_super_block struct | |
450 | dnl | |
451 | AC_MSG_CHECKING(for s_journal_inum field in ext2_super_block struct) | |
452 | AC_TRY_COMPILE([#include <stdio.h> | |
e4a8bde4 SP |
453 | #ifdef HAVE_EXT2FS_EXT2_FS_H |
454 | #include <ext2fs/ext2_fs.h> | |
455 | #else | |
a4f547cd | 456 | #include <linux/ext2_fs.h> |
e4a8bde4 | 457 | #endif |
a4f547cd SP |
458 | #include <ext2fs/ext2fs.h>], |
459 | [struct ext2_super_block es; es.s_journal_inum = 0;], | |
e7d18957 SP |
460 | [AC_DEFINE([HAVE_EXT2_JOURNAL_INUM],1,[Define if we have the s_journal_inum field in struct ext2_super_block.]) |
461 | AC_MSG_RESULT(yes)], | |
a4f547cd SP |
462 | AC_MSG_RESULT(no)) |
463 | ||
c9e4e868 SP |
464 | dnl |
465 | dnl Check for blkid headers libraries | |
466 | dnl | |
467 | AC_CHECK_HEADER(blkid/blkid.h, [blkid_h=yes], [blkid_h=no], [-]) | |
468 | AC_CHECK_LIB(blkid, blkid_get_devname, [blkid_lib=yes], [blkid_lib=no], [-luuid]) | |
469 | if test "$blkid_h" = yes -a "$blkid_lib" = yes; then | |
470 | AC_DEFINE([HAVE_BLKID],1,[Define this if you have the blkid library.]) | |
572eed31 | 471 | BLKID="-lblkid -luuid" |
c9e4e868 SP |
472 | fi |
473 | AC_SUBST(BLKID) | |
474 | ||
3e815572 | 475 | dnl |
0556ca22 | 476 | dnl Check for ncurses or termcap libraries |
3e815572 | 477 | dnl |
0556ca22 | 478 | AC_CHECK_LIB(ncurses, tgetent, [ncurses_lib=yes], [ncurses_lib=no]) |
3e815572 | 479 | AC_CHECK_LIB(termcap, tgetent, [termcap_lib=yes], [termcap_lib=no]) |
d2816d4c | 480 | AC_CHECK_LIB(tinfo, tgetent, [tinfo_lib=yes], [tinfo_lib=no]) |
0556ca22 | 481 | |
d2816d4c | 482 | if test "$ncurses_lib" = no -a "$termcap_lib" = no -a "$tinfo_lib" = no; then |
0556ca22 SP |
483 | if test "$READLINE" = "yes"; then |
484 | AC_MSG_ERROR(You need to install the ncurses or termcap library or configure without --enable-readline) | |
3e815572 SP |
485 | fi |
486 | fi | |
d2816d4c SP |
487 | if test "$tinfo_lib" = yes; then |
488 | rdllib="-ltinfo" | |
489 | elif test "$ncurses_lib" = yes; then | |
0556ca22 SP |
490 | rdllib="-lncurses" |
491 | elif test "$termcap_lib" = yes; then | |
492 | rdllib="-ltermcap" | |
493 | fi | |
3e815572 | 494 | |
c38e5b6a SP |
495 | dnl |
496 | dnl Check for readline headers and libraries | |
497 | dnl | |
d3e542e7 | 498 | AC_CHECK_HEADER(readline/readline.h, [readline_h=yes], [readline_h=no], [-]) |
0556ca22 | 499 | AC_CHECK_LIB(readline, readline, [readline_lib=yes], [readline_lib=no], $rdllib) |
c38e5b6a | 500 | if test "$readline_h" = no -o "$readline_lib" = no; then |
0556ca22 | 501 | if test "$READLINE" = "yes"; then |
e68dc63e | 502 | AC_MSG_ERROR(You need to install the GNU readline library or configure without --enable-readline) |
c38e5b6a SP |
503 | fi |
504 | fi | |
0556ca22 SP |
505 | if test "$READLINE" = yes; then |
506 | READLINE="-lreadline $rdllib" | |
507 | fi | |
508 | AC_SUBST(READLINE) | |
c38e5b6a | 509 | |
bcecd677 SP |
510 | dnl |
511 | dnl Check for rl_completion_matches | |
512 | dnl | |
513 | AC_CHECK_LIB(readline, rl_completion_matches, [rlcm=yes], [rlcm=no], "-ltermcap") | |
514 | if test "$rlcm" = yes; then | |
e7d18957 | 515 | AC_DEFINE([HAVE_READLINE_RLCM],1,[Define this if your readline libs have the rl_completion_matches library.]) |
bcecd677 SP |
516 | fi |
517 | ||
518 | dnl | |
519 | dnl Check for rl_completion_append_character | |
520 | dnl | |
521 | AC_CHECK_LIB(readline, rl_completion_append_character, [rcac=yes], [rcac=no], "-ltermcap") | |
522 | if test "$rcac" = yes; then | |
e7d18957 | 523 | AC_DEFINE([HAVE_READLINE_CAC],1,[Define this if your readline libs have the rl_completion_append_character variable.]) |
bcecd677 SP |
524 | fi |
525 | ||
4d5ed2f3 SP |
526 | dnl |
527 | dnl Check for zlib headers and libraries | |
528 | dnl | |
d3e542e7 | 529 | AC_CHECK_HEADER(zlib.h, [zlib_h=yes], [zlib_h=no], [-]) |
4d5ed2f3 SP |
530 | AC_CHECK_LIB(z, compress2, [zlib_lib=yes], [zlib_lib=no]) |
531 | if test "$zlib_h" = yes -a "$zlib_lib" = yes; then | |
d7783603 SP |
532 | if test "$STATICZ" = yes; then |
533 | ZLIB="-Wl,-Bstatic -lz -Wl,-Bdynamic" | |
534 | else | |
535 | ZLIB="-lz" | |
536 | fi | |
e7d18957 | 537 | AC_DEFINE([HAVE_ZLIB],1,[Define this if you have zlib compression library.]) |
4d5ed2f3 SP |
538 | else |
539 | ZLIB="" | |
540 | fi | |
541 | AC_SUBST(ZLIB) | |
542 | ||
88ef261e SP |
543 | dnl |
544 | dnl Check for bzlib headers and libraries | |
545 | dnl | |
d3e542e7 | 546 | AC_CHECK_HEADER(bzlib.h, [bzlib_h=yes], [bzlib_h=no], [-]) |
88ef261e SP |
547 | AC_CHECK_LIB(bz2, BZ2_bzBuffToBuffCompress, [bzlib_lib=yes], [bzlib_lib=no]) |
548 | if test "$bzlib_h" = yes -a "$bzlib_lib" = yes; then | |
d7783603 SP |
549 | if test "$STATICZ" = yes; then |
550 | BZLIB="-Wl,-Bstatic -lbz2 -Wl,-Bdynamic" | |
551 | else | |
552 | BZLIB="-lbz2" | |
553 | fi | |
e7d18957 | 554 | AC_DEFINE([HAVE_BZLIB],1,[Define this if you have bzlib compression library.]) |
88ef261e SP |
555 | else |
556 | BZLIB="" | |
557 | fi | |
558 | AC_SUBST(BZLIB) | |
559 | ||
1227625a SP |
560 | dnl |
561 | dnl Check for library functions | |
562 | dnl | |
5c1faba5 SP |
563 | AC_CHECK_FUNCS(err errx verr verrx vwarn vwarnx warn warnx realpath lchown) |
564 | AC_CHECK_FUNC(glob) | |
565 | ||
566 | dnl | |
567 | dnl Check for GLOB_ALTDIRFUNC | |
568 | dnl | |
a4f547cd | 569 | AC_MSG_CHECKING(for extended glob routines) |
5c1faba5 SP |
570 | if test "$ac_cv_func_glob" = "yes"; then |
571 | AC_EGREP_CPP(yes, | |
572 | [ | |
573 | # include <glob.h> | |
574 | # ifdef GLOB_ALTDIRFUNC | |
575 | yes | |
576 | # endif | |
a4f547cd SP |
577 | ], |
578 | [ | |
e7d18957 | 579 | AC_DEFINE([HAVE_GLOB],1,[Define if you have the glob function.]) |
a4f547cd SP |
580 | AC_MSG_RESULT(yes) |
581 | ], | |
582 | [ | |
583 | AC_MSG_RESULT(no) | |
584 | echo "Your system does not support extended glob, will use the internal routines" | |
585 | ]) | |
5c1faba5 | 586 | fi |
1227625a | 587 | |
18282881 SP |
588 | dnl |
589 | dnl Check for OpenSSL, for ermt | |
590 | dnl | |
591 | if test "$ERMT" != ""; then | |
592 | AC_CHECK_HEADER(openssl/evp.h, [evp_h=yes], [evp_h=no]) | |
593 | AC_CHECK_LIB(crypto, EVP_CIPHER_CTX_set_padding, [crypto_lib=yes], [crypto_lib=no]) | |
594 | if test "$evp_h" = no -o "$crypto_lib" = no; then | |
595 | AC_MSG_ERROR(You need to install the OpenSSL library (version 0.9.7a or later), or configure without --enable-ermt) | |
596 | fi | |
597 | fi | |
598 | ||
1227625a SP |
599 | dnl |
600 | dnl Check for types | |
601 | dnl | |
1a886de8 SP |
602 | AC_CHECK_TYPE(quad_t, int64_t) |
603 | AC_CHECK_TYPE(u_quad_t, uint64_t) | |
1227625a SP |
604 | |
605 | dnl | |
606 | dnl Compute top_buildir | |
607 | dnl | |
608 | top_builddir=`cd .; pwd` | |
609 | AC_SUBST(top_builddir) | |
610 | ||
611 | dnl | |
612 | dnl Create directories | |
613 | dnl | |
614 | test -d compat || mkdir compat | |
615 | test -d compat/lib || mkdir compat/lib | |
616 | ||
617 | dnl | |
618 | dnl Output files | |
619 | dnl | |
8d4197bb | 620 | AC_OUTPUT(MCONFIG Makefile common/Makefile compat/include/Makefile compat/lib/Makefile dump/Makefile restore/Makefile $RMTMAKEFILE) |