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