]>
Commit | Line | Data |
---|---|---|
b3cfa26b TK |
1 | dnl Process this file with autoconf to produce a configure script. |
2 | ||
3 | dnl First, define all of the version numbers up front. | |
4 | dnl In particular, this allows the version macro to be used in AC_INIT | |
5 | ||
6 | dnl These first two version numbers are updated automatically on each release. | |
858fa8ea MM |
7 | m4_define([LIBARCHIVE_VERSION_S],[3.5.2dev]) |
8 | m4_define([LIBARCHIVE_VERSION_N],[3005002]) | |
b3cfa26b | 9 | |
80bdb4b4 | 10 | dnl bsdtar and bsdcpio versioning tracks libarchive |
b3cfa26b | 11 | m4_define([BSDTAR_VERSION_S],LIBARCHIVE_VERSION_S()) |
80bdb4b4 | 12 | m4_define([BSDCPIO_VERSION_S],LIBARCHIVE_VERSION_S()) |
5d3f56d2 | 13 | m4_define([BSDCAT_VERSION_S],LIBARCHIVE_VERSION_S()) |
b3cfa26b | 14 | |
4c6269cb | 15 | AC_PREREQ([2.69]) |
77cfbb98 | 16 | |
b3cfa26b TK |
17 | # |
18 | # Now starts the "real" configure script. | |
19 | # | |
20 | ||
a580c98e | 21 | AC_INIT([libarchive],[LIBARCHIVE_VERSION_S()],[libarchive-discuss@googlegroups.com]) |
b3cfa26b TK |
22 | # Make sure the srcdir contains "libarchive" directory |
23 | AC_CONFIG_SRCDIR([libarchive]) | |
24 | # Use auxiliary subscripts from this subdirectory (cleans up root) | |
4c9c2bcd | 25 | AC_CONFIG_AUX_DIR([build/autoconf]) |
79cb8e5b | 26 | # M4 scripts |
80b5f20f | 27 | AC_CONFIG_MACRO_DIR([build/autoconf]) |
b3cfa26b | 28 | # Must follow AC_CONFIG macros above... |
dc064872 | 29 | AM_INIT_AUTOMAKE([1.11 dist-xz dist-zip]) |
3bf4a20e | 30 | AM_MAINTAINER_MODE([enable]) |
fcfe9113 | 31 | m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])]) |
b3cfa26b | 32 | |
f2488cf6 TK |
33 | # Libtool's "interface version" can be computed from the libarchive version. |
34 | ||
35 | # Libtool interface version bumps on any API change, so increments | |
36 | # whenever libarchive minor version does. | |
b3cfa26b | 37 | ARCHIVE_MINOR=$(( (LIBARCHIVE_VERSION_N() / 1000) % 1000 )) |
f2488cf6 TK |
38 | # Libarchive 2.7 == libtool interface 9 = 2 + 7 |
39 | # Libarchive 2.8 == libtool interface 10 = 2 + 8 | |
7eeddea4 TK |
40 | # Libarchive 2.9 == libtool interface 11 = 2 + 8 |
41 | # Libarchive 3.0 == libtool interface 12 | |
bdf2c171 AM |
42 | # Libarchive 3.1 == libtool interface 13 |
43 | ARCHIVE_INTERFACE=`echo $((13 + ${ARCHIVE_MINOR}))` | |
f2488cf6 | 44 | # Libarchive revision is bumped on any source change === libtool revision |
b3cfa26b | 45 | ARCHIVE_REVISION=$(( LIBARCHIVE_VERSION_N() % 1000 )) |
f2488cf6 | 46 | # Libarchive minor is bumped on any interface addition === libtool age |
7f6d230a | 47 | ARCHIVE_LIBTOOL_VERSION=$ARCHIVE_INTERFACE:$ARCHIVE_REVISION:$ARCHIVE_MINOR |
b3cfa26b TK |
48 | |
49 | # Stick the version numbers into config.h | |
0d8b61ea AR |
50 | AC_DEFINE([__LIBARCHIVE_CONFIG_H_INCLUDED], [1], |
51 | [Internal macro for sanity checks]) | |
b3cfa26b TK |
52 | AC_DEFINE([LIBARCHIVE_VERSION_STRING],"LIBARCHIVE_VERSION_S()", |
53 | [Version number of libarchive]) | |
54 | AC_DEFINE_UNQUOTED([LIBARCHIVE_VERSION_NUMBER],"LIBARCHIVE_VERSION_N()", | |
55 | [Version number of libarchive as a single integer]) | |
56 | AC_DEFINE([BSDCPIO_VERSION_STRING],"BSDCPIO_VERSION_S()", | |
57 | [Version number of bsdcpio]) | |
58 | AC_DEFINE([BSDTAR_VERSION_STRING],"BSDTAR_VERSION_S()", | |
59 | [Version number of bsdtar]) | |
5d3f56d2 MK |
60 | AC_DEFINE([BSDCAT_VERSION_STRING],"BSDTAR_VERSION_S()", |
61 | [Version number of bsdcat]) | |
b3cfa26b TK |
62 | |
63 | # The shell variables here must be the same as the AC_SUBST() variables | |
64 | # below, but the shell variable names apparently cannot be the same as | |
65 | # the m4 macro names above. Why? Ask autoconf. | |
66 | BSDCPIO_VERSION_STRING=BSDCPIO_VERSION_S() | |
67 | BSDTAR_VERSION_STRING=BSDTAR_VERSION_S() | |
5d3f56d2 | 68 | BSDCAT_VERSION_STRING=BSDCAT_VERSION_S() |
b3cfa26b TK |
69 | LIBARCHIVE_VERSION_STRING=LIBARCHIVE_VERSION_S() |
70 | LIBARCHIVE_VERSION_NUMBER=LIBARCHIVE_VERSION_N() | |
71 | ||
72 | # Substitute the above version numbers into the various files below. | |
73 | # Yes, I believe this is the fourth time we define what are essentially | |
74 | # the same symbols. Why? Ask autoconf. | |
75 | AC_SUBST(ARCHIVE_LIBTOOL_VERSION) | |
76 | AC_SUBST(BSDCPIO_VERSION_STRING) | |
77 | AC_SUBST(BSDTAR_VERSION_STRING) | |
5d3f56d2 | 78 | AC_SUBST(BSDCAT_VERSION_STRING) |
b3cfa26b TK |
79 | AC_SUBST(LIBARCHIVE_VERSION_STRING) |
80 | AC_SUBST(LIBARCHIVE_VERSION_NUMBER) | |
81 | ||
82 | AC_CONFIG_HEADERS([config.h]) | |
83 | AC_CONFIG_FILES([Makefile]) | |
bafc3c6b | 84 | AC_CONFIG_FILES([build/pkgconfig/libarchive.pc]) |
b3cfa26b | 85 | |
79cb8e5b CW |
86 | # Check for host type |
87 | AC_CANONICAL_HOST | |
88 | ||
89 | dnl Compilation on mingw and Cygwin needs special Makefile rules | |
90 | inc_windows_files=no | |
91 | inc_cygwin_files=no | |
92 | case "$host_os" in | |
93 | *mingw* ) inc_windows_files=yes ;; | |
1e2b6c98 | 94 | *cygwin* | *msys*) inc_cygwin_files=yes ;; |
79cb8e5b CW |
95 | esac |
96 | AM_CONDITIONAL([INC_WINDOWS_FILES], [test $inc_windows_files = yes]) | |
97 | AM_CONDITIONAL([INC_CYGWIN_FILES], [test $inc_cygwin_files = yes]) | |
98 | ||
c31d1bc4 CW |
99 | dnl Defines that are required for specific platforms (e.g. -D_POSIX_SOURCE, etc) |
100 | PLATFORMCPPFLAGS= | |
101 | case "$host_os" in | |
102 | *mingw* ) PLATFORMCPPFLAGS=-D__USE_MINGW_ANSI_STDIO ;; | |
103 | esac | |
104 | AC_SUBST(PLATFORMCPPFLAGS) | |
105 | ||
b3cfa26b TK |
106 | # Checks for programs. |
107 | AC_PROG_CC | |
4394d8b2 | 108 | AC_PROG_CC_C99 |
b3cfa26b | 109 | AM_PROG_CC_C_O |
b4c5bf51 | 110 | AC_PROG_CPP |
6ca9835b | 111 | AC_USE_SYSTEM_EXTENSIONS |
01a4df54 | 112 | AC_LIBTOOL_WIN32_DLL |
b3cfa26b TK |
113 | AC_PROG_LIBTOOL |
114 | AC_CHECK_TOOL([STRIP],[strip]) | |
1c6adda3 | 115 | AC_PROG_MKDIR_P |
b3cfa26b TK |
116 | |
117 | # | |
118 | # Options for building bsdtar. | |
119 | # | |
120 | # Default is to build bsdtar, but allow people to override that. | |
121 | # | |
122 | AC_ARG_ENABLE([bsdtar], | |
123 | [AS_HELP_STRING([--enable-bsdtar], [enable build of bsdtar (default)]) | |
124 | AS_HELP_STRING([--enable-bsdtar=static], [force static build of bsdtar]) | |
125 | AS_HELP_STRING([--enable-bsdtar=shared], [force dynamic build of bsdtar]) | |
126 | AS_HELP_STRING([--disable-bsdtar], [disable build of bsdtar])], | |
127 | [], [enable_bsdtar=yes]) | |
128 | ||
129 | case "$enable_bsdtar" in | |
130 | yes) | |
131 | if test "$enable_static" = "no"; then | |
132 | static_bsdtar=no | |
133 | else | |
134 | static_bsdtar=yes | |
135 | fi | |
136 | build_bsdtar=yes | |
137 | ;; | |
138 | dynamic|shared) | |
139 | if test "$enable_shared" = "no"; then | |
140 | AC_MSG_FAILURE([Shared linking of bsdtar requires shared libarchive]) | |
141 | fi | |
142 | build_bsdtar=yes | |
143 | static_bsdtar=no | |
144 | ;; | |
145 | static) | |
146 | build_bsdtar=yes | |
147 | static_bsdtar=yes | |
148 | ;; | |
149 | no) | |
150 | build_bsdtar=no | |
151 | static_bsdtar=no | |
152 | ;; | |
153 | *) | |
154 | AC_MSG_FAILURE([Unsupported value for --enable-bsdtar]) | |
155 | ;; | |
156 | esac | |
157 | ||
158 | AM_CONDITIONAL([BUILD_BSDTAR], [ test "$build_bsdtar" = yes ]) | |
159 | AM_CONDITIONAL([STATIC_BSDTAR], [ test "$static_bsdtar" = yes ]) | |
160 | ||
5d3f56d2 MK |
161 | # |
162 | # Options for building bsdcat. | |
163 | # | |
164 | # Default is to build bsdcat, but allow people to override that. | |
165 | # | |
166 | AC_ARG_ENABLE([bsdcat], | |
167 | [AS_HELP_STRING([--enable-bsdcat], [enable build of bsdcat (default)]) | |
168 | AS_HELP_STRING([--enable-bsdcat=static], [force static build of bsdcat]) | |
169 | AS_HELP_STRING([--enable-bsdcat=shared], [force dynamic build of bsdcat]) | |
170 | AS_HELP_STRING([--disable-bsdcat], [disable build of bsdcat])], | |
171 | [], [enable_bsdcat=yes]) | |
172 | ||
173 | case "$enable_bsdcat" in | |
174 | yes) | |
175 | if test "$enable_static" = "no"; then | |
176 | static_bsdcat=no | |
177 | else | |
178 | static_bsdcat=yes | |
179 | fi | |
180 | build_bsdcat=yes | |
181 | ;; | |
182 | dynamic|shared) | |
183 | if test "$enable_shared" = "no"; then | |
184 | AC_MSG_FAILURE([Shared linking of bsdcat requires shared libarchive]) | |
185 | fi | |
186 | build_bsdcat=yes | |
187 | static_bsdcat=no | |
188 | ;; | |
189 | static) | |
190 | build_bsdcat=yes | |
191 | static_bsdcat=yes | |
192 | ;; | |
193 | no) | |
194 | build_bsdcat=no | |
195 | static_bsdcat=no | |
196 | ;; | |
197 | *) | |
198 | AC_MSG_FAILURE([Unsupported value for --enable-bsdcat]) | |
199 | ;; | |
200 | esac | |
201 | ||
202 | AM_CONDITIONAL([BUILD_BSDCAT], [ test "$build_bsdcat" = yes ]) | |
203 | AM_CONDITIONAL([STATIC_BSDCAT], [ test "$static_bsdcat" = yes ]) | |
204 | ||
b3cfa26b TK |
205 | # |
206 | # Options for building bsdcpio. | |
207 | # | |
208 | # Default is not to build bsdcpio, but that can be overridden. | |
209 | # | |
210 | AC_ARG_ENABLE([bsdcpio], | |
f9a97a03 | 211 | [AS_HELP_STRING([--enable-bsdcpio], [enable build of bsdcpio (default)]) |
b3cfa26b TK |
212 | AS_HELP_STRING([--enable-bsdcpio=static], [static build of bsdcpio]) |
213 | AS_HELP_STRING([--enable-bsdcpio=shared], [dynamic build of bsdcpio]) | |
f9a97a03 TK |
214 | AS_HELP_STRING([--disable-bsdcpio], [disable build of bsdcpio])], |
215 | [], [enable_bsdcpio=yes]) | |
b3cfa26b TK |
216 | |
217 | case "$enable_bsdcpio" in | |
218 | yes) | |
219 | if test "$enable_static" = "no"; then | |
220 | static_bsdcpio=no | |
221 | else | |
222 | static_bsdcpio=yes | |
223 | fi | |
224 | build_bsdcpio=yes | |
225 | ;; | |
226 | dynamic|shared) | |
227 | if test "$enabled_shared" = "no"; then | |
228 | AC_MSG_FAILURE([Shared linking of bsdcpio requires shared libarchive]) | |
229 | fi | |
230 | build_bsdcpio=yes | |
231 | ;; | |
232 | static) | |
233 | build_bsdcpio=yes | |
234 | static_bsdcpio=yes | |
235 | ;; | |
236 | no) | |
237 | build_bsdcpio=no | |
238 | static_bsdcpio=no | |
239 | ;; | |
240 | *) | |
241 | AC_MSG_FAILURE([Unsupported value for --enable-bsdcpio]) | |
242 | ;; | |
243 | esac | |
244 | ||
245 | AM_CONDITIONAL([BUILD_BSDCPIO], [ test "$build_bsdcpio" = yes ]) | |
246 | AM_CONDITIONAL([STATIC_BSDCPIO], [ test "$static_bsdcpio" = yes ]) | |
247 | ||
197cc2d1 CW |
248 | # Set up defines needed before including any headers |
249 | case $host in | |
1e2b6c98 | 250 | *mingw* | *cygwin* | *msys* ) |
1fd0c015 SL |
251 | AC_PREPROC_IFELSE([AC_LANG_PROGRAM( |
252 | [[#ifdef _WIN32_WINNT | |
253 | # error _WIN32_WINNT already defined | |
254 | #endif | |
255 | ]],[[;]]) | |
256 | ],[ | |
257 | AC_DEFINE([_WIN32_WINNT], 0x0502, [Define to '0x0502' for Windows Server 2003 APIs.]) | |
258 | AC_DEFINE([NTDDI_VERSION], 0x05020000, [Define to '0x05020000' for Windows Server 2003 APIs.]) | |
259 | ]) | |
260 | AC_PREPROC_IFELSE([AC_LANG_PROGRAM( | |
261 | [[#ifdef WINVER | |
262 | # error WINVER already defined | |
263 | #endif | |
264 | ]],[[;]]) | |
265 | ],[ | |
266 | AC_DEFINE([WINVER], 0x0502, [Define to '0x0502' for Windows Server 2003 APIs.]) | |
267 | ]) | |
197cc2d1 CW |
268 | ;; |
269 | esac | |
270 | ||
b3cfa26b | 271 | # Checks for header files. |
b3cfa26b TK |
272 | AC_HEADER_DIRENT |
273 | AC_HEADER_SYS_WAIT | |
365a91de | 274 | AC_CHECK_HEADERS([acl/libacl.h attr/xattr.h]) |
b30c530a | 275 | AC_CHECK_HEADERS([copyfile.h ctype.h]) |
c247a74f | 276 | AC_CHECK_HEADERS([errno.h ext2fs/ext2_fs.h fcntl.h grp.h]) |
95c74682 JS |
277 | |
278 | AC_CACHE_CHECK([whether EXT2_IOC_GETFLAGS is usable], | |
279 | [ac_cv_have_decl_EXT2_IOC_GETFLAGS], | |
280 | [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([@%:@include <sys/ioctl.h> | |
281 | @%:@include <ext2fs/ext2_fs.h>], | |
282 | [int x = EXT2_IOC_GETFLAGS])], | |
283 | [AS_VAR_SET([ac_cv_have_decl_EXT2_IOC_GETFLAGS], [yes])], | |
284 | [AS_VAR_SET([ac_cv_have_decl_EXT2_IOC_GETFLAGS], [no])])]) | |
285 | ||
286 | AS_VAR_IF([ac_cv_have_decl_EXT2_IOC_GETFLAGS], [yes], | |
287 | [AC_DEFINE_UNQUOTED([HAVE_WORKING_EXT2_IOC_GETFLAGS], [1], | |
288 | [Define to 1 if you have a working EXT2_IOC_GETFLAGS])]) | |
289 | ||
d216d028 | 290 | AC_CHECK_HEADERS([inttypes.h io.h langinfo.h limits.h]) |
407f6e94 | 291 | AC_CHECK_HEADERS([linux/fiemap.h linux/fs.h linux/magic.h linux/types.h]) |
a9c5818b MM |
292 | |
293 | AC_CACHE_CHECK([whether FS_IOC_GETFLAGS is usable], | |
294 | [ac_cv_have_decl_FS_IOC_GETFLAGS], | |
295 | [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([@%:@include <sys/ioctl.h> | |
296 | @%:@include <linux/fs.h>], | |
297 | [int x = FS_IOC_GETFLAGS])], | |
298 | [AS_VAR_SET([ac_cv_have_decl_FS_IOC_GETFLAGS], [yes])], | |
299 | [AS_VAR_SET([ac_cv_have_decl_FS_IOC_GETFLAGS], [no])])]) | |
300 | ||
301 | AS_VAR_IF([ac_cv_have_decl_FS_IOC_GETFLAGS], [yes], | |
302 | [AC_DEFINE_UNQUOTED([HAVE_WORKING_FS_IOC_GETFLAGS], [1], | |
303 | [Define to 1 if you have a working FS_IOC_GETFLAGS])]) | |
304 | ||
f57d129d | 305 | AC_CHECK_HEADERS([locale.h membership.h paths.h poll.h pthread.h pwd.h]) |
9769e6f7 | 306 | AC_CHECK_HEADERS([readpassphrase.h signal.h spawn.h]) |
8c1c0a7a | 307 | AC_CHECK_HEADERS([stdarg.h stdint.h stdlib.h string.h]) |
365a91de | 308 | AC_CHECK_HEADERS([sys/acl.h sys/cdefs.h sys/ea.h sys/extattr.h]) |
fb67a295 | 309 | AC_CHECK_HEADERS([sys/ioctl.h sys/mkdev.h sys/mount.h]) |
bea9f9cf | 310 | AC_CHECK_HEADERS([sys/param.h sys/poll.h sys/richacl.h]) |
4925fd0b | 311 | AC_CHECK_HEADERS([sys/select.h sys/statfs.h sys/statvfs.h sys/sysmacros.h]) |
365a91de | 312 | AC_CHECK_HEADERS([sys/time.h sys/utime.h sys/utsname.h sys/vfs.h sys/xattr.h]) |
996334f3 | 313 | AC_CHECK_HEADERS([time.h unistd.h utime.h wchar.h wctype.h]) |
d7ae3cca TK |
314 | AC_CHECK_HEADERS([windows.h]) |
315 | # check windows.h first; the other headers require it. | |
316 | AC_CHECK_HEADERS([wincrypt.h winioctl.h],[],[], | |
317 | [[#ifdef HAVE_WINDOWS_H | |
318 | # include <windows.h> | |
319 | #endif | |
320 | ]]) | |
b3cfa26b TK |
321 | |
322 | # Checks for libraries. | |
2186dc24 TK |
323 | AC_ARG_WITH([zlib], |
324 | AS_HELP_STRING([--without-zlib], [Don't build support for gzip through zlib])) | |
325 | ||
326 | if test "x$with_zlib" != "xno"; then | |
327 | AC_CHECK_HEADERS([zlib.h]) | |
328 | AC_CHECK_LIB(z,inflate) | |
329 | fi | |
330 | ||
331 | AC_ARG_WITH([bz2lib], | |
332 | AS_HELP_STRING([--without-bz2lib], [Don't build support for bzip2 through bz2lib])) | |
333 | ||
334 | if test "x$with_bz2lib" != "xno"; then | |
335 | AC_CHECK_HEADERS([bzlib.h]) | |
1a0f8974 | 336 | case "$host_os" in |
1e2b6c98 | 337 | *mingw* | *cygwin* | *msys*) |
1a0f8974 AM |
338 | dnl AC_CHECK_LIB cannot be used on the Windows port of libbz2, therefore |
339 | dnl use AC_LINK_IFELSE. | |
340 | AC_MSG_CHECKING([for BZ2_bzDecompressInit in -lbz2]) | |
341 | old_LIBS="$LIBS" | |
342 | LIBS="-lbz2 $LIBS" | |
343 | AC_LINK_IFELSE( | |
344 | [AC_LANG_SOURCE(#include <bzlib.h> | |
345 | int main() { return BZ2_bzDecompressInit(NULL, 0, 0); })], | |
346 | [ac_cv_lib_bz2_BZ2_bzDecompressInit=yes], | |
347 | [ac_cv_lib_bz2_BZ2_bzDecompressInit=no]) | |
348 | LIBS="$old_LIBS" | |
349 | AC_MSG_RESULT($ac_cv_lib_bz2_BZ2_bzDecompressInit) | |
350 | if test "x$ac_cv_lib_bz2_BZ2_bzDecompressInit" = xyes; then | |
351 | AC_DEFINE([HAVE_LIBBZ2], [1], [Define to 1 if you have the `bz2' library (-lbz2).]) | |
352 | LIBS="-lbz2 $LIBS" | |
353 | fi | |
354 | ;; | |
355 | *) | |
356 | AC_CHECK_LIB(bz2,BZ2_bzDecompressInit) | |
357 | ;; | |
358 | esac | |
2186dc24 TK |
359 | fi |
360 | ||
c5013112 MM |
361 | AC_ARG_WITH([libb2], |
362 | AS_HELP_STRING([--without-libb2], [Don't build support for BLAKE2 through libb2])) | |
363 | ||
364 | if test "x$with_libb2" != "xno"; then | |
365 | AC_CHECK_HEADERS([blake2.h]) | |
366 | AC_CHECK_LIB(b2,blake2sp_init) | |
367 | fi | |
368 | ||
369 | AM_CONDITIONAL([INC_BLAKE2], [test "x$ac_cv_lib_b2_blake2sp_init" != "xyes"]) | |
370 | ||
c91b3538 TK |
371 | AC_ARG_WITH([iconv], |
372 | AS_HELP_STRING([--without-iconv], [Don't try to link against iconv])) | |
373 | ||
374 | if test "x$with_iconv" != "xno"; then | |
d975ebec | 375 | AM_ICONV |
1354b7df | 376 | AC_CHECK_HEADERS([iconv.h],[],[],[#include <stdlib.h>]) |
17fd872a | 377 | if test "x$am_cv_func_iconv" = "xyes"; then |
89032bfd MN |
378 | AC_CHECK_HEADERS([localcharset.h]) |
379 | am_save_LIBS="$LIBS" | |
380 | LIBS="${LIBS} ${LIBICONV}" | |
381 | AC_CHECK_FUNCS([locale_charset]) | |
382 | LIBS="${am_save_LIBS}" | |
383 | if test "x$ac_cv_func_locale_charset" != "xyes"; then | |
384 | # If locale_charset() is not in libiconv, we have to find libcharset. | |
385 | AC_CHECK_LIB(charset,locale_charset) | |
386 | fi | |
387 | fi | |
c91b3538 TK |
388 | fi |
389 | ||
724f3f91 MN |
390 | AC_ARG_WITH([lz4], |
391 | AS_HELP_STRING([--without-lz4], [Don't build support for lz4 through liblz4])) | |
392 | ||
393 | if test "x$with_lz4" != "xno"; then | |
394 | AC_CHECK_HEADERS([lz4.h lz4hc.h]) | |
395 | AC_CHECK_LIB(lz4,LZ4_decompress_safe) | |
396 | fi | |
397 | ||
26838cf5 SP |
398 | AC_ARG_WITH([zstd], |
399 | AS_HELP_STRING([--without-zstd], [Don't build support for zstd through libzstd])) | |
400 | ||
401 | if test "x$with_zstd" != "xno"; then | |
402 | AC_CHECK_HEADERS([zstd.h]) | |
a14c26bd | 403 | AC_CHECK_LIB(zstd,ZSTD_compressStream) |
26838cf5 SP |
404 | fi |
405 | ||
c25e0da2 MN |
406 | AC_ARG_WITH([lzma], |
407 | AS_HELP_STRING([--without-lzma], [Don't build support for xz through lzma])) | |
408 | ||
409 | if test "x$with_lzma" != "xno"; then | |
410 | AC_CHECK_HEADERS([lzma.h]) | |
411 | AC_CHECK_LIB(lzma,lzma_stream_decoder) | |
b05a2733 TK |
412 | # Some pre-release (but widely distributed) versions of liblzma |
413 | # included a disabled version of lzma_stream_encoder_mt that | |
414 | # fools a naive AC_CHECK_LIB or AC_CHECK_FUNC, so we need | |
415 | # to do something more complex here: | |
416 | AC_CACHE_CHECK( | |
417 | [whether we have multithread support in lzma], | |
418 | ac_cv_lzma_has_mt, | |
7c3148ec JS |
419 | [AC_LINK_IFELSE([ |
420 | AC_LANG_PROGRAM([[#include <lzma.h>] | |
421 | [#if LZMA_VERSION < 50020000] | |
422 | [#error unsupported] | |
423 | [#endif]], | |
b05a2733 TK |
424 | [[lzma_stream_encoder_mt(0, 0);]])], |
425 | [ac_cv_lzma_has_mt=yes], [ac_cv_lzma_has_mt=no])]) | |
9690ea4f JR |
426 | if test "x$ac_cv_lzma_has_mt" != xno; then |
427 | AC_DEFINE([HAVE_LZMA_STREAM_ENCODER_MT], [1], [Define to 1 if you have the `lzma_stream_encoder_mt' function.]) | |
428 | fi | |
c25e0da2 MN |
429 | fi |
430 | ||
6b29a1cc | 431 | AC_ARG_WITH([lzo2], |
6a509898 | 432 | AS_HELP_STRING([--with-lzo2], [Build with LZO support from liblzo2])) |
6b29a1cc | 433 | |
525f55c9 | 434 | if test "x$with_lzo2" = "xyes"; then |
6b29a1cc MN |
435 | AC_CHECK_HEADERS([lzo/lzoconf.h lzo/lzo1x.h]) |
436 | AC_CHECK_LIB(lzo2,lzo1x_decompress_safe) | |
437 | fi | |
438 | ||
0869c13c PM |
439 | AC_ARG_WITH([cng], |
440 | AS_HELP_STRING([--without-cng], [Don't build support of CNG(Crypto Next Generation)])) | |
441 | ||
f96a7114 MM |
442 | AC_ARG_WITH([mbedtls], |
443 | AS_HELP_STRING([--with-mbedtls], [Build with crypto support from mbed TLS])) | |
00ac9023 | 444 | AC_ARG_WITH([nettle], |
f96a7114 | 445 | AS_HELP_STRING([--with-nettle], [Build with crypto support from Nettle])) |
eace4421 | 446 | AC_ARG_WITH([openssl], |
d2c0930d | 447 | AS_HELP_STRING([--without-openssl], [Don't build support for mtree and xar hashes through openssl])) |
b0f3a5e1 TK |
448 | case "$host_os" in |
449 | *darwin* ) with_openssl=no ;; | |
450 | esac | |
d2c0930d MN |
451 | |
452 | AC_ARG_WITH([xml2], | |
453 | AS_HELP_STRING([--without-xml2], [Don't build support for xar through libxml2])) | |
454 | AC_ARG_WITH([expat], | |
455 | AS_HELP_STRING([--without-expat], [Don't build support for xar through expat])) | |
456 | ||
457 | if test "x$with_xml2" != "xno"; then | |
f7b0a9f3 KM |
458 | PKG_PROG_PKG_CONFIG |
459 | PKG_CHECK_MODULES(LIBXML2_PC, [libxml-2.0], [ | |
460 | CPPFLAGS="${CPPFLAGS} ${LIBXML2_PC_CFLAGS}" | |
461 | LIBS="${LIBS} ${LIBXML2_PC_LIBS}" | |
5256aa1a | 462 | AC_CHECK_LIB(xml2,xmlInitParser,[true],AC_MSG_FAILURE(Missing xml2 library)) |
f7b0a9f3 | 463 | ], [ |
5256aa1a | 464 | AC_CHECK_LIB(xml2,xmlInitParser) |
f7b0a9f3 | 465 | ]) |
b7115a7d | 466 | AC_CHECK_HEADERS([libxml/xmlreader.h libxml/xmlwriter.h]) |
d2c0930d MN |
467 | fi |
468 | if test "x$ac_cv_header_libxml_xmlreader_h" != "xyes"; then | |
469 | if test "x$with_expat" != "xno"; then | |
aa5b327f MN |
470 | AC_CHECK_HEADERS([expat.h]) |
471 | AC_CHECK_LIB(expat,XML_ParserCreate) | |
d2c0930d MN |
472 | fi |
473 | fi | |
eace4421 | 474 | |
9fe06744 AM |
475 | AC_ARG_ENABLE([posix-regex-lib], |
476 | [AS_HELP_STRING([--enable-posix-regex-lib], | |
477 | [choose what library to use for POSIX regular expression support (default: auto)]) | |
478 | AS_HELP_STRING([--enable-posix-regex-lib=libc], [use libc POSIX regular expression support]) | |
479 | AS_HELP_STRING([--enable-posix-regex-lib=libregex], [use libregex POSIX regular expression support]) | |
480 | AS_HELP_STRING([--enable-posix-regex-lib=libpcreposix], [use libpcreposix POSIX regular expression support]) | |
481 | AS_HELP_STRING([--disable-posix-regex-lib], [don't enable POSIX regular expression support])], | |
482 | [], [enable_posix_regex_lib=auto]) | |
483 | ||
484 | posix_regex_lib_found= | |
485 | if test "$enable_posix_regex_lib" = "auto" || test "$enable_posix_regex_lib" = "libc" || test "$enable_posix_regex_lib" = "libregex"; then | |
486 | AC_CHECK_HEADERS([regex.h]) | |
c9b68f41 | 487 | if test "x$ac_cv_header_regex_h" != "xno"; then |
9797fb4e AM |
488 | AC_CHECK_FUNC(regcomp) |
489 | if test "x$ac_cv_func_regcomp" = xyes; then | |
490 | posix_regex_lib_found=1 | |
491 | else | |
492 | AC_CHECK_LIB(regex,regcomp) | |
493 | if test "x$ac_cv_lib_regex_regcomp" = xyes; then | |
494 | posix_regex_lib_found=1 | |
495 | fi | |
496 | fi | |
c9b68f41 MN |
497 | fi |
498 | fi | |
9fe06744 AM |
499 | if test -z $posix_regex_lib_found && (test "$enable_posix_regex_lib" = "auto" || test "$enable_posix_regex_lib" = "libpcreposix"); then |
500 | AC_CHECK_HEADERS([pcreposix.h]) | |
9797fb4e | 501 | AC_CHECK_LIB(pcreposix,regcomp) |
d16c4871 AM |
502 | if test "x$ac_cv_lib_pcreposix_regcomp" != xyes; then |
503 | AC_MSG_NOTICE(trying libpcreposix check again with libpcre) | |
504 | unset ac_cv_lib_pcreposix_regcomp | |
505 | AC_CHECK_LIB(pcre,pcre_exec) | |
506 | AC_CHECK_LIB(pcreposix,regcomp) | |
507 | if test "x$ac_cv_lib_pcre_pcre_exec" = xyes && test "x$ac_cv_lib_pcreposix_regcomp" = xyes; then | |
508 | AC_MSG_CHECKING(if PCRE_STATIC needs to be defined) | |
509 | AC_LINK_IFELSE( | |
510 | [AC_LANG_SOURCE(#include <pcreposix.h> | |
511 | int main() { return regcomp(NULL, NULL, 0); })], | |
512 | [without_pcre_static=yes], | |
513 | [without_pcre_static=no]) | |
514 | AC_LINK_IFELSE( | |
515 | [AC_LANG_SOURCE(#define PCRE_STATIC | |
516 | #include <pcreposix.h> | |
517 | int main() { return regcomp(NULL, NULL, 0); })], | |
518 | [with_pcre_static=yes], | |
519 | [with_pcre_static=no]) | |
520 | if test "x$without_pcre_static" != xyes && test "x$with_pcre_static" = xyes; then | |
521 | AC_MSG_RESULT(yes) | |
522 | AC_DEFINE([PCRE_STATIC], [1], [Define to 1 if PCRE_STATIC needs to be defined.]) | |
523 | elif test "x$without_pcre_static" = xyes || test "x$with_pcre_static" = xyes; then | |
524 | AC_MSG_RESULT(no) | |
525 | fi | |
526 | posix_regex_lib_found=1 | |
91717f72 | 527 | fi |
d16c4871 AM |
528 | else |
529 | posix_regex_lib_found=1 | |
9797fb4e | 530 | fi |
9fe06744 | 531 | fi |
c9b68f41 | 532 | |
b3cfa26b TK |
533 | # TODO: Give the user the option of using a pre-existing system |
534 | # libarchive. This will define HAVE_LIBARCHIVE which will cause | |
535 | # bsdtar_platform.h to use #include <...> for the libarchive headers. | |
536 | # Need to include Makefile.am magic to link against system | |
537 | # -larchive in that case. | |
538 | #AC_CHECK_LIB(archive,archive_version) | |
539 | ||
9f6c6d5d EVW |
540 | # Checks for supported compiler flags |
541 | AX_APPEND_COMPILE_FLAGS([-Wall -Wformat -Wformat-security]) | |
542 | ||
b3cfa26b TK |
543 | # Checks for typedefs, structures, and compiler characteristics. |
544 | AC_C_CONST | |
a580c98e | 545 | # la_TYPE_UID_T defaults to "int", which is incorrect for MinGW |
92165c97 CW |
546 | # and MSVC. Use a customized version. |
547 | la_TYPE_UID_T | |
b3cfa26b TK |
548 | AC_TYPE_MODE_T |
549 | # AC_TYPE_OFF_T defaults to "long", which limits us to 4GB files on | |
550 | # most systems... default to "long long" instead. | |
551 | AC_CHECK_TYPE(off_t, [long long]) | |
552 | AC_TYPE_SIZE_T | |
553 | AC_CHECK_TYPE(id_t, [unsigned long]) | |
554 | AC_CHECK_TYPE(uintptr_t, [unsigned int]) | |
8ac32d27 | 555 | |
9d72ea76 MN |
556 | # Check for tm_gmtoff in struct tm |
557 | AC_CHECK_MEMBERS([struct tm.tm_gmtoff, struct tm.__tm_gmtoff],,, | |
558 | [ | |
559 | #include <time.h> | |
560 | ]) | |
561 | ||
a3b61f44 MN |
562 | # Check for f_namemax in struct statfs |
563 | AC_CHECK_MEMBERS([struct statfs.f_namemax],,, | |
564 | [ | |
565 | #include <sys/param.h> | |
566 | #include <sys/mount.h> | |
567 | ]) | |
568 | ||
19c22e92 BK |
569 | # Check for f_iosize in struct statvfs |
570 | AC_CHECK_MEMBERS([struct statvfs.f_iosize],,, | |
571 | [ | |
572 | #include <sys/statvfs.h> | |
573 | ]) | |
574 | ||
8ac32d27 TK |
575 | # Check for birthtime in struct stat |
576 | AC_CHECK_MEMBERS([struct stat.st_birthtime]) | |
577 | ||
b3cfa26b | 578 | # Check for high-resolution timestamps in struct stat |
8ac32d27 | 579 | AC_CHECK_MEMBERS([struct stat.st_birthtimespec.tv_nsec]) |
b3cfa26b TK |
580 | AC_CHECK_MEMBERS([struct stat.st_mtimespec.tv_nsec]) |
581 | AC_CHECK_MEMBERS([struct stat.st_mtim.tv_nsec]) | |
d831cc4b BJ |
582 | AC_CHECK_MEMBERS([struct stat.st_mtime_n]) # AIX |
583 | AC_CHECK_MEMBERS([struct stat.st_umtime]) # Tru64 | |
a0b5f839 | 584 | AC_CHECK_MEMBERS([struct stat.st_mtime_usec]) # Hurd |
c15d8e24 TK |
585 | # Check for block size support in struct stat |
586 | AC_CHECK_MEMBERS([struct stat.st_blksize]) | |
c5e9786e TK |
587 | # Check for st_flags in struct stat (BSD fflags) |
588 | AC_CHECK_MEMBERS([struct stat.st_flags]) | |
b3cfa26b TK |
589 | |
590 | # If you have uintmax_t, we assume printf supports %ju | |
591 | # If you have unsigned long long, we assume printf supports %llu | |
592 | # TODO: Check for %ju and %llu support directly. | |
593 | AC_CHECK_TYPES([uintmax_t, unsigned long long]) | |
594 | ||
566a6636 TK |
595 | # We use C99-style integer types |
596 | # Declare them if the local platform doesn't already do so. | |
b3cfa26b | 597 | AC_TYPE_INTMAX_T |
b3cfa26b | 598 | AC_TYPE_UINTMAX_T |
566a6636 | 599 | AC_TYPE_INT64_T |
b3cfa26b | 600 | AC_TYPE_UINT64_T |
566a6636 TK |
601 | AC_TYPE_INT32_T |
602 | AC_TYPE_UINT32_T | |
603 | AC_TYPE_INT16_T | |
604 | AC_TYPE_UINT16_T | |
3de335e1 | 605 | AC_TYPE_UINT8_T |
b3cfa26b | 606 | |
2f637b08 TK |
607 | AC_CHECK_DECLS([SIZE_MAX, INT32_MAX, INT32_MIN]) |
608 | AC_CHECK_DECLS([INT64_MAX, INT64_MIN, UINT64_MAX, UINT32_MAX]) | |
b699d5c6 | 609 | AC_CHECK_DECLS([INTMAX_MAX, INTMAX_MIN, UINTMAX_MAX]) |
a1f91bd1 MN |
610 | |
611 | AC_CHECK_DECL([SSIZE_MAX], | |
612 | [AC_DEFINE(HAVE_DECL_SSIZE_MAX, 1, [Define to 1 if you have the declaration of `SSIZE_MAX', and to 0 if you don't.])], | |
613 | [], | |
614 | [#include <limits.h>]) | |
b3cfa26b TK |
615 | |
616 | AC_CHECK_DECL([EFTYPE], | |
617 | [AC_DEFINE(HAVE_EFTYPE, 1, [A possible errno value for invalid file format errors])], | |
618 | [], | |
619 | [#include <errno.h>]) | |
620 | AC_CHECK_DECL([EILSEQ], | |
621 | [AC_DEFINE(HAVE_EILSEQ, 1, [A possible errno value for invalid file format errors])], | |
622 | [], | |
623 | [#include <errno.h>]) | |
778a496c CW |
624 | AC_CHECK_TYPE([wchar_t], |
625 | [AC_DEFINE_UNQUOTED(AS_TR_CPP(HAVE_[]wchar_t), 1, [Define to 1 if the system has the type `wchar_t'.])dnl | |
626 | AC_CHECK_SIZEOF([wchar_t])], | |
627 | []) | |
628 | ||
b3cfa26b TK |
629 | AC_HEADER_TIME |
630 | ||
631 | # Checks for library functions. | |
632 | AC_PROG_GCC_TRADITIONAL | |
633 | AC_HEADER_MAJOR | |
634 | AC_FUNC_FSEEKO | |
635 | AC_FUNC_MEMCMP | |
636 | AC_FUNC_LSTAT | |
637 | AC_FUNC_STAT | |
638 | AC_FUNC_STRERROR_R | |
639 | AC_FUNC_STRFTIME | |
640 | AC_FUNC_VPRINTF | |
197cc2d1 CW |
641 | # check for: |
642 | # CreateHardLinkA(LPCSTR, LPCSTR, LPSECURITY_ATTRIBUTES) | |
643 | # To avoid necessity for including windows.h or special forward declaration | |
644 | # workarounds, we use 'void *' for 'struct SECURITY_ATTRIBUTES *' | |
645 | AC_CHECK_STDCALL_FUNC([CreateHardLinkA],[const char *, const char *, void *]) | |
d5ed4f85 | 646 | AC_CHECK_FUNCS([arc4random_buf chflags chown chroot ctime_r]) |
ba463cc3 | 647 | AC_CHECK_FUNCS([fchdir fchflags fchmod fchown fcntl fdopendir fork]) |
4f1939c9 MN |
648 | AC_CHECK_FUNCS([fstat fstatat fstatfs fstatvfs ftruncate]) |
649 | AC_CHECK_FUNCS([futimens futimes futimesat]) | |
a3b61f44 | 650 | AC_CHECK_FUNCS([geteuid getpid getgrgid_r getgrnam_r]) |
21467bd9 | 651 | AC_CHECK_FUNCS([getpwnam_r getpwuid_r getvfsbyname gmtime_r]) |
496b1876 | 652 | AC_CHECK_FUNCS([lchflags lchmod lchown link localtime_r lstat lutimes]) |
47a98250 | 653 | AC_CHECK_FUNCS([mbrtowc memmove memset]) |
496b1876 | 654 | AC_CHECK_FUNCS([mkdir mkfifo mknod mkstemp]) |
8c1c0a7a | 655 | AC_CHECK_FUNCS([nl_langinfo openat pipe poll posix_spawnp readlink readlinkat]) |
9769e6f7 | 656 | AC_CHECK_FUNCS([readpassphrase]) |
4ba1f7d7 | 657 | AC_CHECK_FUNCS([select setenv setlocale sigaction statfs statvfs]) |
c581b317 MM |
658 | AC_CHECK_FUNCS([strchr strdup strerror strncpy_s strnlen strrchr symlink]) |
659 | AC_CHECK_FUNCS([timegm tzset unlinkat unsetenv utime utimensat utimes vfork]) | |
b6ba5603 | 660 | AC_CHECK_FUNCS([wcrtomb wcscmp wcscpy wcslen wctomb wmemcmp wmemcpy wmemmove]) |
0d47a868 | 661 | AC_CHECK_FUNCS([_ctime64_s _fseeki64]) |
a11f1586 | 662 | AC_CHECK_FUNCS([_get_timezone _gmtime64_s _localtime64_s _mkgmtime64]) |
ed585028 CW |
663 | # detects cygwin-1.7, as opposed to older versions |
664 | AC_CHECK_FUNCS([cygwin_conv_path]) | |
b3cfa26b | 665 | |
e7642e12 JS |
666 | # DragonFly uses vfsconf, FreeBSD xvfsconf. |
667 | AC_CHECK_TYPES(struct vfsconf,,, | |
668 | [#if HAVE_SYS_TYPES_H | |
669 | #include <sys/types.h> | |
670 | #endif | |
671 | #include <sys/mount.h> | |
672 | ]) | |
673 | ||
a847b455 TK |
674 | AC_CHECK_TYPES(struct xvfsconf,,, |
675 | [#if HAVE_SYS_TYPES_H | |
676 | #include <sys/types.h> | |
677 | #endif | |
678 | #include <sys/mount.h> | |
679 | ]) | |
680 | ||
09654df8 TK |
681 | # There are several variants of readdir_r around; we only |
682 | # accept the POSIX-compliant version. | |
683 | AC_COMPILE_IFELSE( | |
684 | [AC_LANG_PROGRAM([[#include <dirent.h>]], | |
685 | [[DIR *dir; struct dirent e, *r; | |
c8f97841 | 686 | return(readdir_r(dir, &e, &r));]])], |
09654df8 TK |
687 | [AC_DEFINE(HAVE_READDIR_R,1,[Define to 1 if you have a POSIX compatible readdir_r])] |
688 | ) | |
d5ed4f85 JS |
689 | # dirfd can be either a function or a macro. |
690 | AC_COMPILE_IFELSE( | |
691 | [AC_LANG_PROGRAM([[#include <dirent.h> | |
692 | DIR *dir;]], | |
693 | [[return(dirfd(dir));]])], | |
694 | [AC_DEFINE(HAVE_DIRFD,1,[Define to 1 if you have a dirfd function or macro])] | |
695 | ) | |
09654df8 | 696 | |
b3cfa26b TK |
697 | # FreeBSD's nl_langinfo supports an option to specify whether the |
698 | # current locale uses month/day or day/month ordering. It makes the | |
699 | # output a little prettier... | |
700 | AC_CHECK_DECL([D_MD_ORDER], | |
701 | [AC_DEFINE(HAVE_D_MD_ORDER, 1, [Define to 1 if nl_langinfo supports D_MD_ORDER])], | |
702 | [], | |
703 | [#if HAVE_LANGINFO_H | |
704 | #include <langinfo.h> | |
705 | #endif | |
706 | ]) | |
707 | ||
b3cfa26b TK |
708 | # Check for dirent.d_namlen field explicitly |
709 | # (This is a bit more straightforward than, if not quite as portable as, | |
710 | # the recipe given by the autoconf maintainers.) | |
711 | AC_CHECK_MEMBER(struct dirent.d_namlen,,, | |
712 | [#if HAVE_DIRENT_H | |
713 | #include <dirent.h> | |
714 | #endif | |
715 | ]) | |
716 | ||
717 | # Check for Extended Attributes support | |
718 | AC_ARG_ENABLE([xattr], | |
719 | AS_HELP_STRING([--disable-xattr], | |
b30c530a | 720 | [Disable Extended Attributes support (default: check)])) |
b3cfa26b TK |
721 | |
722 | if test "x$enable_xattr" != "xno"; then | |
37740e26 | 723 | AC_SEARCH_LIBS([setxattr], [attr gnu]) |
365a91de | 724 | AC_CHECK_DECLS([EXTATTR_NAMESPACE_USER], [], [], [#include <sys/types.h> |
6d23f1c5 JS |
725 | #include <sys/extattr.h> |
726 | ]) | |
365a91de MM |
727 | AC_CHECK_DECLS([XATTR_NOFOLLOW], [], [], [#include <sys/xattr.h> |
728 | ]) | |
729 | if test "x$ac_cv_header_sys_xattr_h" = "xyes" \ | |
730 | -a "x$ac_cv_have_decl_XATTR_NOFOLLOW" = "xyes"; then | |
731 | # Darwin extended attributes support | |
732 | AC_CACHE_VAL([ac_cv_archive_xattr_darwin], | |
733 | [AC_CHECK_FUNCS(fgetxattr \ | |
734 | flistxattr \ | |
735 | fsetxattr \ | |
736 | getxattr \ | |
737 | listxattr \ | |
738 | setxattr, | |
739 | [ac_cv_archive_xattr_darwin=yes], | |
740 | [ac_cv_archive_xattr_darwin=no], | |
741 | [#include <sys/xattr.h> | |
742 | ]) | |
743 | ] | |
744 | ) | |
745 | elif test "x$ac_cv_header_sys_extattr_h" = "xyes" \ | |
746 | -a "x$ac_cv_have_decl_EXTATTR_NAMESPACE_USER" = "xyes"; then | |
747 | # FreeBSD extended attributes support | |
748 | AC_CACHE_VAL([ac_cv_archive_xattr_freebsd], | |
749 | [AC_CHECK_FUNCS(extattr_get_fd \ | |
750 | extattr_get_file \ | |
751 | extattr_get_link \ | |
752 | extattr_list_fd \ | |
753 | extattr_list_file \ | |
754 | extattr_list_link \ | |
755 | extattr_set_fd \ | |
756 | extattr_set_link, | |
757 | [ac_cv_archive_xattr_freebsd=yes], | |
758 | [ac_cv_archive_xattr_freebsd=no], | |
759 | [#include <sys/types.h> | |
760 | #include <sys/extattr.h> | |
761 | ]) | |
762 | ] | |
763 | ) | |
764 | elif test "x$ac_cv_header_sys_xattr_h" = "xyes" \ | |
765 | -o "x$ac_cv_header_attr_xattr_h" = "xyes"; then | |
766 | # Linux extended attributes support | |
767 | AC_CACHE_VAL([ac_cv_archive_xattr_linux], | |
768 | [AC_CHECK_FUNCS(fgetxattr \ | |
769 | flistxattr \ | |
770 | fsetxattr \ | |
771 | getxattr \ | |
772 | lgetxattr \ | |
773 | listxattr \ | |
774 | llistxattr \ | |
775 | lsetxattr, | |
776 | [ac_cv_archive_xattr_linux=yes], | |
777 | [ac_cv_archive_xattr_linux=no], | |
778 | [#if HAVE_SYS_TYPES_H | |
779 | #include <sys/types.h> | |
780 | #endif | |
781 | #if HAVE_SYS_XATTR_H | |
782 | #include <sys/xattr.h> | |
783 | #endif | |
784 | #if HAVE_ATTR_XATTR_H | |
785 | #include <attr/xatr.h> | |
786 | #endif | |
787 | ]) | |
788 | ] | |
789 | ) | |
790 | elif test "x$ac_cv_header_sys_ea_h" = "xyes"; then | |
791 | # AIX extended attributes support | |
792 | AC_CACHE_VAL([ac_cv_archive_xattr_aix], | |
793 | [AC_CHECK_FUNCS(fgetea \ | |
794 | flistea \ | |
795 | fsetea \ | |
796 | getea \ | |
797 | lgetea \ | |
798 | listea \ | |
799 | llistea \ | |
800 | lsetea, | |
801 | [ac_cv_archive_xattr_aix=yes], | |
802 | [ac_cv_archive_xattr_aix=no], | |
803 | [#include <sys/ea.h> | |
804 | ]) | |
805 | ] | |
806 | ) | |
807 | fi | |
808 | ||
809 | AC_MSG_CHECKING([for extended attributes support]) | |
810 | if test "x$ac_cv_archive_xattr_linux" = "xyes"; then | |
811 | AC_DEFINE([ARCHIVE_XATTR_LINUX], [1], [Linux xattr support]) | |
812 | AC_MSG_RESULT([Linux]) | |
813 | elif test "x$ac_cv_archive_xattr_darwin" = "xyes"; then | |
814 | AC_DEFINE([ARCHIVE_XATTR_DARWIN], [1], [Darwin xattr support]) | |
815 | AC_MSG_RESULT([Darwin]) | |
816 | elif test "x$ac_cv_archive_xattr_freebsd" = "xyes"; then | |
817 | AC_DEFINE([ARCHIVE_XATTR_FREEBSD], [1], [FreeBSD xattr support]) | |
818 | AC_MSG_RESULT([FreeBSD]) | |
819 | elif test "x$ac_cv_archive_xattr_aix" = "xyes"; then | |
820 | AC_DEFINE([ARCHIVE_XATTR_AIX], [1], [AIX xattr support]) | |
821 | AC_MSG_RESULT([AIX]) | |
822 | else | |
823 | AC_MSG_RESULT([none]) | |
824 | fi | |
b3cfa26b TK |
825 | fi |
826 | ||
827 | # Check for ACL support | |
828 | # | |
829 | # The ACL support in libarchive is written against the POSIX1e draft, | |
830 | # which was never officially approved and varies quite a bit across | |
831 | # platforms. Worse, some systems have completely non-POSIX acl functions, | |
832 | # which makes the following checks rather more complex than I would like. | |
833 | # | |
834 | AC_ARG_ENABLE([acl], | |
835 | AS_HELP_STRING([--disable-acl], | |
b30c530a | 836 | [Disable ACL support (default: check)])) |
b3cfa26b TK |
837 | |
838 | if test "x$enable_acl" != "xno"; then | |
f57d129d MM |
839 | # Libacl |
840 | AC_CHECK_LIB([acl], [acl_get_file]) | |
841 | ||
842 | AC_CHECK_TYPES([acl_t, acl_entry_t, acl_permset_t, acl_tag_t], [], [], [ | |
843 | #if HAVE_SYS_TYPES_H | |
844 | #include <sys/types.h> | |
845 | #endif | |
846 | #if HAVE_SYS_ACL_H | |
847 | #include <sys/acl.h> | |
848 | #endif | |
849 | ]) | |
b3cfa26b | 850 | |
bea9f9cf MM |
851 | AC_CHECK_LIB([richacl], [richacl_get_file]) |
852 | ||
853 | AC_CHECK_TYPES([[struct richace], [struct richacl]], [], [], [ | |
854 | #if HAVE_SYS_RICHACL_H | |
855 | #include <sys/richacl.h> | |
856 | #endif | |
857 | ]) | |
858 | ||
f57d129d MM |
859 | # Solaris and derivates ACLs |
860 | AC_CHECK_FUNCS(acl facl) | |
b3cfa26b | 861 | |
bea9f9cf MM |
862 | if test "x$ac_cv_lib_richacl_richacl_get_file" = "xyes" \ |
863 | -a "x$ac_cv_type_struct_richace" = "xyes" \ | |
864 | -a "x$ac_cv_type_struct_richacl" = "xyes"; then | |
865 | AC_CACHE_VAL([ac_cv_archive_acl_librichacl], | |
866 | [AC_CHECK_FUNCS(richacl_alloc \ | |
867 | richacl_equiv_mode \ | |
868 | richacl_free \ | |
869 | richacl_get_fd \ | |
870 | richacl_get_file \ | |
871 | richacl_set_fd \ | |
872 | richacl_set_file, | |
873 | [ac_cv_archive_acl_librichacl=yes], [ac_cv_archive_acl_librichacl=no], [#include <sys/richacl.h>])]) | |
874 | fi | |
875 | ||
f57d129d MM |
876 | if test "x$ac_cv_func_acl" = "xyes" \ |
877 | -a "x$ac_cv_func_facl" = "xyes"; then | |
878 | AC_CHECK_TYPES([aclent_t], [], [], [[#include <sys/acl.h>]]) | |
879 | if test "x$ac_cv_type_aclent_t" = "xyes"; then | |
880 | AC_CACHE_VAL([ac_cv_archive_acl_sunos], | |
881 | [AC_CHECK_DECLS([GETACL, SETACL, GETACLCNT], | |
882 | [ac_cv_archive_acl_sunos=yes], [ac_cv_archive_acl_sunos=no], | |
883 | [#include <sys/acl.h>])]) | |
884 | AC_CHECK_TYPES([ace_t], [], [], [[#include <sys/acl.h>]]) | |
885 | if test "x$ac_cv_type_ace_t" = "xyes"; then | |
886 | AC_CACHE_VAL([ac_cv_archive_acl_sunos_nfs4], | |
887 | [AC_CHECK_DECLS([ACE_GETACL, ACE_SETACL, ACE_GETACLCNT], | |
888 | [ac_cv_archive_acl_sunos_nfs4=yes], | |
889 | [ac_cv_archive_acl_sonos_nfs4=no], | |
890 | [#include <sys/acl.h>])]) | |
891 | fi | |
892 | fi | |
893 | elif test "x$ac_cv_type_acl_t" = "xyes" \ | |
894 | -a "x$ac_cv_type_acl_entry_t" = "xyes" \ | |
895 | -a "x$ac_cv_type_acl_permset_t" = "xyes" \ | |
896 | -a "x$ac_cv_type_acl_tag_t" = "xyes"; then | |
897 | # POSIX.1e ACL functions | |
898 | AC_CACHE_VAL([ac_cv_posix_acl_funcs], | |
899 | [AC_CHECK_FUNCS(acl_add_perm \ | |
900 | acl_clear_perms \ | |
901 | acl_create_entry \ | |
902 | acl_delete_def_file \ | |
903 | acl_free \ | |
904 | acl_get_entry \ | |
905 | acl_get_fd \ | |
906 | acl_get_file \ | |
907 | acl_get_permset \ | |
908 | acl_get_qualifier \ | |
909 | acl_get_tag_type \ | |
910 | acl_init \ | |
911 | acl_set_fd \ | |
912 | acl_set_file \ | |
913 | acl_set_qualifier \ | |
914 | acl_set_tag_type, | |
915 | [ac_cv_posix_acl_funcs=yes], [ac_cv_posix_acl_funcs=no], | |
916 | [#if HAVE_SYS_TYPES_H | |
917 | #include <sys/types.h> | |
918 | #endif | |
919 | #if HAVE_SYS_ACL_H | |
920 | #include <sys/acl.h> | |
921 | #endif | |
922 | ]) | |
992652f4 MM |
923 | ]) |
924 | ||
f57d129d | 925 | AC_CHECK_FUNCS(acl_get_perm) |
9f43a7d6 | 926 | |
f57d129d MM |
927 | if test "x$ac_cv_posix_acl_funcs" = "xyes" \ |
928 | -a "x$ac_cv_header_acl_libacl_h" = "xyes" \ | |
929 | -a "x$ac_cv_lib_acl_acl_get_file" = "xyes" \ | |
930 | -a "x$ac_cv_func_acl_get_perm"; then | |
931 | AC_CACHE_VAL([ac_cv_archive_acl_libacl], | |
932 | [ac_cv_archive_acl_libacl=yes]) | |
933 | AC_DEFINE([ARCHIVE_ACL_LIBACL], [1], | |
934 | [POSIX.1e ACL support via libacl]) | |
935 | else | |
936 | # FreeBSD/Darwin | |
937 | AC_CHECK_FUNCS(acl_add_flag_np \ | |
938 | acl_clear_flags_np \ | |
939 | acl_get_brand_np \ | |
940 | acl_get_entry_type_np \ | |
941 | acl_get_flag_np \ | |
942 | acl_get_flagset_np \ | |
943 | acl_get_fd_np \ | |
944 | acl_get_link_np \ | |
945 | acl_get_perm_np \ | |
946 | acl_is_trivial_np \ | |
947 | acl_set_entry_type_np \ | |
948 | acl_set_fd_np \ | |
949 | acl_set_link_np,,, | |
950 | [#include <sys/types.h> | |
951 | #include <sys/acl.h>]) | |
952 | ||
953 | AC_CHECK_FUNCS(mbr_uid_to_uuid \ | |
954 | mbr_uuid_to_id \ | |
955 | mbr_gid_to_uuid,,, | |
956 | [#include <membership.h>]) | |
957 | ||
958 | AC_CHECK_DECLS([ACL_TYPE_EXTENDED, ACL_TYPE_NFS4, ACL_USER, | |
959 | ACL_SYNCHRONIZE], [], [], | |
960 | [#include <sys/types.h> | |
961 | #include <sys/acl.h>]) | |
962 | if test "x$ac_cv_posix_acl_funcs" = "xyes" \ | |
963 | -a "x$ac_cv_func_acl_get_fd_np" = "xyes" \ | |
964 | -a "x$ac_cv_func_acl_get_perm" != "xyes" \ | |
965 | -a "x$ac_cv_func_acl_get_perm_np" = "xyes" \ | |
966 | -a "x$ac_cv_func_acl_set_fd_np" = "xyes"; then | |
967 | if test "x$ac_cv_have_decl_ACL_USER" = "xyes"; then | |
968 | AC_CACHE_VAL([ac_cv_archive_acl_freebsd], | |
969 | [ac_cv_archive_acl_freebsd=yes]) | |
970 | if test "x$ac_cv_have_decl_ACL_TYPE_NFS4" = "xyes" \ | |
971 | -a "x$ac_cv_func_acl_add_flag_np" = "xyes" \ | |
972 | -a "x$ac_cv_func_acl_get_brand_np" = "xyes" \ | |
973 | -a "x$ac_cv_func_acl_get_entry_type_np" = "xyes" \ | |
974 | -a "x$ac_cv_func_acl_get_flagset_np" = "xyes" \ | |
975 | -a "x$ac_cv_func_acl_set_entry_type_np" = "xyes"; then | |
976 | AC_CACHE_VAL([ac_cv_archive_acl_freebsd_nfs4], | |
977 | [ac_cv_archive_acl_freebsd_nfs4=yes]) | |
978 | fi | |
979 | elif test "x$ac_cv_have_decl_ACL_TYPE_EXTENDED" = "xyes" \ | |
980 | -a "x$ac_cv_func_acl_add_flag_np" = "xyes" \ | |
981 | -a "x$ac_cv_func_acl_get_flagset_np" = "xyes" \ | |
982 | -a "x$ac_cv_func_acl_get_link_np" = "xyes" \ | |
983 | -a "x$ac_cv_func_acl_set_link_np" = "xyes" \ | |
984 | -a "x$ac_cv_func_mbr_uid_to_uuid" = "xyes" \ | |
985 | -a "x$ac_cv_func_mbr_uuid_to_id" = "xyes" \ | |
986 | -a "x$ac_cv_func_mbr_gid_to_uuid" = "xyes"; then | |
987 | AC_CACHE_VAL([ac_cv_archive_acl_darwin], | |
988 | [ac_cv_archive_acl_darwin=yes]) | |
989 | fi | |
990 | fi | |
991 | fi | |
992 | fi | |
993 | AC_MSG_CHECKING([for ACL support]) | |
bea9f9cf MM |
994 | if test "x$ac_cv_archive_acl_libacl" = "xyes" \ |
995 | -a "x$ac_cv_archive_acl_librichacl" = "xyes"; then | |
996 | AC_MSG_RESULT([libacl (POSIX.1e) + librichacl (NFSv4)]) | |
997 | AC_DEFINE([ARCHIVE_ACL_LIBACL], [1], | |
998 | [Linux POSIX.1e ACL support via libacl]) | |
999 | AC_DEFINE([ARCHIVE_ACL_LIBRICHACL], [1], | |
1000 | [Linux NFSv4 ACL support via librichacl]) | |
1001 | elif test "x$ac_cv_archive_acl_libacl" = "xyes"; then | |
f57d129d | 1002 | AC_MSG_RESULT([libacl (POSIX.1e)]) |
bea9f9cf MM |
1003 | AC_DEFINE([ARCHIVE_ACL_LIBACL], [1], |
1004 | [Linux POSIX.1e ACL support via libacl]) | |
1005 | elif test "x$ac_cv_archive_acl_librichacl" = "xyes"; then | |
1006 | AC_MSG_RESULT([librichacl (NFSv4)]) | |
1007 | AC_DEFINE([ARCHIVE_ACL_LIBRICHACL], [1], | |
1008 | [Linux NFSv4 ACL support via librichacl]) | |
f57d129d MM |
1009 | elif test "x$ac_cv_archive_acl_darwin" = "xyes"; then |
1010 | AC_DEFINE([ARCHIVE_ACL_DARWIN], [1], [Darwin ACL support]) | |
1011 | AC_MSG_RESULT([Darwin (limited NFSv4)]) | |
1012 | elif test "x$ac_cv_archive_acl_sunos" = "xyes"; then | |
1013 | AC_DEFINE([ARCHIVE_ACL_SUNOS], [1], [Solaris ACL support]) | |
1014 | if test "x$ac_cv_archive_acl_sunos_nfs4" = "xyes"; then | |
1015 | AC_DEFINE([ARCHIVE_ACL_SUNOS_NFS4], [1], | |
1016 | [Solaris NFSv4 ACL support]) | |
1017 | AC_MSG_RESULT([Solaris (POSIX.1e and NFSv4)]) | |
1018 | else | |
1019 | AC_MSG_RESULT([Solaris (POSIX.1e)]) | |
1020 | fi | |
1021 | elif test "x$ac_cv_archive_acl_freebsd" = "xyes"; then | |
1022 | AC_DEFINE([ARCHIVE_ACL_FREEBSD], [1], [FreeBSD ACL support]) | |
1023 | if test "x$ac_cv_archive_acl_freebsd_nfs4" = "xyes"; then | |
1024 | AC_DEFINE([ARCHIVE_ACL_FREEBSD_NFS4], [1], | |
1025 | [FreeBSD NFSv4 ACL support]) | |
1026 | AC_MSG_RESULT([FreeBSD (POSIX.1e and NFSv4)]) | |
1027 | else | |
1028 | AC_MSG_RESULT([FreeBSD (POSIX.1e)]) | |
1029 | fi | |
1030 | else | |
1031 | AC_MSG_RESULT([none]) | |
1032 | fi | |
b3cfa26b TK |
1033 | fi |
1034 | ||
f57d129d | 1035 | |
bea9f9cf MM |
1036 | AM_CONDITIONAL([INC_LINUX_ACL], |
1037 | [test "x$ac_cv_archive_acl_libacl" = "xyes" \ | |
1038 | -o "x$ac_cv_archive_acl_librichacl" = "xyes"]) | |
f57d129d MM |
1039 | AM_CONDITIONAL([INC_SUNOS_ACL], [test "x$ac_cv_archive_acl_sunos" = "xyes"]) |
1040 | AM_CONDITIONAL([INC_DARWIN_ACL], | |
1041 | [test "x$ac_cv_archive_acl_darwin" = "xyes"]) | |
1042 | AM_CONDITIONAL([INC_FREEBSD_ACL], | |
1043 | [test "x$ac_cv_archive_acl_freebsd" = "xyes"]) | |
1044 | ||
b3cfa26b TK |
1045 | # Additional requirements |
1046 | AC_SYS_LARGEFILE | |
1047 | ||
2d53ab9e AM |
1048 | dnl NOTE: Crypto checks must run last. |
1049 | AC_DEFUN([CRYPTO_CHECK], [ | |
1050 | if test "$found_$1" != yes; then | |
2d53ab9e | 1051 | saved_CPPFLAGS="$CPPFLAGS" |
38644a9a | 1052 | CPPFLAGS="$CPPFLAGS -I. -I$srcdir -I$srcdir/libarchive" |
2d53ab9e AM |
1053 | touch "check_crypto_md.h" |
1054 | AC_MSG_CHECKING([support for ARCHIVE_CRYPTO_$1_$2]) | |
1055 | AC_LINK_IFELSE([AC_LANG_SOURCE([ | |
1056 | #define ARCHIVE_$1_COMPILE_TEST | |
1057 | #define ARCHIVE_CRYPTO_$1_$2 | |
1058 | #define PLATFORM_CONFIG_H "check_crypto_md.h" | |
1059 | ||
c4c6533b | 1060 | $(cat "$srcdir/libarchive/archive_digest.c") |
2d53ab9e AM |
1061 | |
1062 | int | |
1063 | main(int argc, char **argv) | |
1064 | { | |
1065 | archive_$3_ctx ctx; | |
1066 | archive_$3_init(&ctx); | |
1067 | archive_$3_update(&ctx, *argv, argc); | |
1068 | archive_$3_final(&ctx, NULL); | |
1069 | return 0; | |
1070 | } | |
1071 | ])], | |
1072 | [ AC_MSG_RESULT([yes]) | |
1073 | found_$1=yes | |
177cf35b | 1074 | found_$2=yes |
2d53ab9e AM |
1075 | AC_DEFINE(ARCHIVE_CRYPTO_$1_$2, 1, [ $1 via ARCHIVE_CRYPTO_$1_$2 supported.]) |
1076 | ], | |
1077 | [ AC_MSG_RESULT([no])]) | |
2d53ab9e AM |
1078 | CPPFLAGS="$saved_CPPFLAGS" |
1079 | rm "check_crypto_md.h" | |
1080 | fi | |
1081 | ]) | |
1082 | ||
275000df MN |
1083 | AC_DEFUN([CRYPTO_CHECK_WIN], [ |
1084 | if test "$found_$1" != yes; then | |
1085 | AC_MSG_CHECKING([support for ARCHIVE_CRYPTO_$1_WIN]) | |
1086 | AC_LINK_IFELSE([AC_LANG_SOURCE([ | |
275000df MN |
1087 | #define ARCHIVE_$1_COMPILE_TEST |
1088 | #include <windows.h> | |
1089 | #include <wincrypt.h> | |
1090 | ||
1091 | int | |
1092 | main(int argc, char **argv) | |
1093 | { | |
1094 | (void)argc; | |
1095 | (void)argv; | |
1096 | ||
1097 | return ($2); | |
1098 | } | |
1099 | ])], | |
1100 | [ AC_MSG_RESULT([yes]) | |
1101 | found_$1=yes | |
177cf35b | 1102 | found_WIN=yes |
275000df MN |
1103 | AC_DEFINE(ARCHIVE_CRYPTO_$1_WIN, 1, [ $1 via ARCHIVE_CRYPTO_$1_WIN supported.]) |
1104 | ], | |
1105 | [ AC_MSG_RESULT([no])]) | |
1106 | fi | |
1107 | ]) | |
1108 | ||
1109 | case "$host_os" in | |
1e2b6c98 | 1110 | *mingw* | *cygwin* | *msys*) |
275000df MN |
1111 | ;; |
1112 | *) | |
1113 | CRYPTO_CHECK(MD5, LIBC, md5) | |
1114 | CRYPTO_CHECK(MD5, LIBSYSTEM, md5) | |
1115 | CRYPTO_CHECK(RMD160, LIBC, rmd160) | |
1116 | CRYPTO_CHECK(SHA1, LIBC, sha1) | |
1117 | CRYPTO_CHECK(SHA1, LIBSYSTEM, sha1) | |
1118 | CRYPTO_CHECK(SHA256, LIBC, sha256) | |
1119 | CRYPTO_CHECK(SHA256, LIBC2, sha256) | |
1120 | CRYPTO_CHECK(SHA256, LIBC3, sha256) | |
1121 | CRYPTO_CHECK(SHA256, LIBSYSTEM, sha256) | |
1122 | CRYPTO_CHECK(SHA384, LIBC, sha384) | |
1123 | CRYPTO_CHECK(SHA384, LIBC2, sha384) | |
1124 | CRYPTO_CHECK(SHA384, LIBC3, sha384) | |
1125 | CRYPTO_CHECK(SHA384, LIBSYSTEM, sha384) | |
1126 | CRYPTO_CHECK(SHA512, LIBC, sha512) | |
1127 | CRYPTO_CHECK(SHA512, LIBC2, sha512) | |
1128 | CRYPTO_CHECK(SHA512, LIBC3, sha512) | |
1129 | CRYPTO_CHECK(SHA512, LIBSYSTEM, sha512) | |
1130 | ;; | |
1131 | esac | |
2d53ab9e | 1132 | |
0869c13c PM |
1133 | if test "x$with_cng" != "xno"; then |
1134 | AC_CHECK_HEADERS([bcrypt.h],[ | |
1135 | LIBS="$LIBS -lbcrypt" | |
1136 | ],[], | |
1137 | [[#ifdef HAVE_WINDOWS_H | |
1138 | # include <windows.h> | |
1139 | #endif | |
1140 | ]]) | |
1141 | fi | |
1142 | ||
f96a7114 MM |
1143 | if test "x$with_mbedtls" = "xyes"; then |
1144 | AC_CHECK_HEADERS([mbedtls/aes.h mbedtls/md.h mbedtls/pkcs5.h]) | |
1145 | saved_LIBS=$LIBS | |
1146 | AC_CHECK_LIB(mbedcrypto,mbedtls_sha1_init) | |
1147 | CRYPTO_CHECK(MD5, MBEDTLS, md5) | |
1148 | CRYPTO_CHECK(RMD160, MBEDTLS, rmd160) | |
1149 | CRYPTO_CHECK(SHA1, MBEDTLS, sha1) | |
1150 | CRYPTO_CHECK(SHA256, MBEDTLS, sha256) | |
1151 | CRYPTO_CHECK(SHA384, MBEDTLS, sha384) | |
1152 | CRYPTO_CHECK(SHA512, MBEDTLS, sha512) | |
1153 | if test "x$found_MBEDTLS" != "xyes"; then | |
1154 | LIBS=$saved_LIBS | |
1155 | fi | |
1156 | fi | |
1157 | ||
1158 | if test "x$with_nettle" = "xyes"; then | |
177cf35b | 1159 | AC_CHECK_HEADERS([nettle/md5.h nettle/ripemd160.h nettle/sha.h]) |
48e40df7 | 1160 | AC_CHECK_HEADERS([nettle/pbkdf2.h nettle/aes.h nettle/hmac.h]) |
177cf35b | 1161 | saved_LIBS=$LIBS |
48e40df7 | 1162 | AC_CHECK_LIB(nettle,nettle_sha1_init) |
177cf35b AM |
1163 | CRYPTO_CHECK(MD5, NETTLE, md5) |
1164 | CRYPTO_CHECK(RMD160, NETTLE, rmd160) | |
1165 | CRYPTO_CHECK(SHA1, NETTLE, sha1) | |
1166 | CRYPTO_CHECK(SHA256, NETTLE, sha256) | |
1167 | CRYPTO_CHECK(SHA384, NETTLE, sha384) | |
1168 | CRYPTO_CHECK(SHA512, NETTLE, sha512) | |
1169 | if test "x$found_NETTLE" != "xyes"; then | |
1170 | LIBS=$saved_LIBS | |
1171 | fi | |
00ac9023 | 1172 | fi |
48e40df7 | 1173 | |
2d53ab9e | 1174 | if test "x$with_openssl" != "xno"; then |
177cf35b AM |
1175 | AC_CHECK_HEADERS([openssl/evp.h]) |
1176 | saved_LIBS=$LIBS | |
045e5c5a | 1177 | case "$host_os" in |
1e2b6c98 | 1178 | *mingw* | *cygwin* | *msys*) |
045e5c5a AM |
1179 | case "$host_cpu" in |
1180 | x86_64) | |
48e40df7 | 1181 | AC_CHECK_LIB(eay64,OPENSSL_config) |
045e5c5a | 1182 | if test "x$ac_cv_lib_eay64_main" != "xyes"; then |
48e40df7 | 1183 | AC_CHECK_LIB(eay32,OPENSSL_config) |
045e5c5a AM |
1184 | fi |
1185 | ;; | |
1186 | *) | |
48e40df7 | 1187 | AC_CHECK_LIB(eay32,OPENSSL_config) |
045e5c5a AM |
1188 | ;; |
1189 | esac | |
1190 | ;; | |
1191 | *) | |
48e40df7 | 1192 | AC_CHECK_LIB(crypto,OPENSSL_config) |
045e5c5a AM |
1193 | ;; |
1194 | esac | |
fdd5acfe AM |
1195 | CRYPTO_CHECK(MD5, OPENSSL, md5) |
1196 | CRYPTO_CHECK(RMD160, OPENSSL, rmd160) | |
1197 | CRYPTO_CHECK(SHA1, OPENSSL, sha1) | |
1198 | CRYPTO_CHECK(SHA256, OPENSSL, sha256) | |
1199 | CRYPTO_CHECK(SHA384, OPENSSL, sha384) | |
1200 | CRYPTO_CHECK(SHA512, OPENSSL, sha512) | |
b2b69d4f | 1201 | AC_CHECK_FUNCS([PKCS5_PBKDF2_HMAC_SHA1]) |
2d53ab9e | 1202 | fi |
f8709112 TK |
1203 | |
1204 | # Probe libmd AFTER OpenSSL/libcrypto. | |
1205 | # The two are incompatible and OpenSSL is more complete. | |
177cf35b AM |
1206 | AC_CHECK_HEADERS([md5.h ripemd.h sha.h sha256.h sha512.h]) |
1207 | saved_LIBS=$LIBS | |
48e40df7 | 1208 | AC_CHECK_LIB(md,MD5Init) |
fdd5acfe AM |
1209 | CRYPTO_CHECK(MD5, LIBMD, md5) |
1210 | CRYPTO_CHECK(RMD160, LIBMD, rmd160) | |
1211 | CRYPTO_CHECK(SHA1, LIBMD, sha1) | |
1212 | CRYPTO_CHECK(SHA256, LIBMD, sha256) | |
1213 | CRYPTO_CHECK(SHA512, LIBMD, sha512) | |
177cf35b AM |
1214 | if test "x$found_LIBMD" != "xyes"; then |
1215 | LIBS=$saved_LIBS | |
1216 | fi | |
2d53ab9e | 1217 | |
c078ff5d | 1218 | case "$host_os" in |
1e2b6c98 | 1219 | *mingw* | *cygwin* | *msys*) |
c078ff5d AM |
1220 | CRYPTO_CHECK_WIN(MD5, CALG_MD5) |
1221 | CRYPTO_CHECK_WIN(SHA1, CALG_SHA1) | |
1222 | CRYPTO_CHECK_WIN(SHA256, CALG_SHA_256) | |
1223 | CRYPTO_CHECK_WIN(SHA384, CALG_SHA_384) | |
1224 | CRYPTO_CHECK_WIN(SHA512, CALG_SHA_512) | |
1225 | ;; | |
1226 | esac | |
1227 | ||
af77429c PB |
1228 | # Ensure test directories are present if building out-of-tree |
1229 | AC_CONFIG_COMMANDS([mkdirs], | |
41a759a7 | 1230 | [mkdir -p libarchive/test tar/test cat/test cpio/test]) |
af77429c | 1231 | |
b3cfa26b | 1232 | AC_OUTPUT |