1 AC_INIT([wimlib], [0.6.2], [ebiggers3@gmail.com])
2 AC_CONFIG_SRCDIR([src/wim.c])
3 AM_INIT_AUTOMAKE([-Wall -Werror])
4 AC_CONFIG_MACRO_DIR([m4])
8 AC_CONFIG_HEADERS([config.h])
9 AC_CONFIG_FILES([Makefile
17 if test "x$am_cv_func_iconv" != "xyes"; then
18 AC_MSG_ERROR([Cannot find the iconv() function.
19 iconv() is used to convert between UTF-8 and UTF-16 encodings of WIM
20 filenames and XML data. Wimlib cannot be compiled without it. iconv()
21 is available in the latest version of glibc and sometimes in other
25 LIBXML2_LDADD=`pkg-config libxml-2.0 --libs`
26 LIBXML2_CFLAGS=`pkg-config libxml-2.0 --cflags`
27 AC_CHECK_LIB([xml2], [xmlParseFile], [have_libxml=true],
28 [AC_MSG_ERROR(["cannot find libxml2"])])
29 AC_SUBST([LIBXML2_LDADD], [$LIBXML2_LDADD])
30 AC_SUBST([LIBXML2_CFLAGS], [$LIBXML2_CFLAGS])
32 AC_MSG_CHECKING([whether to include debugging messages])
33 AC_ARG_ENABLE([debug],
34 AS_HELP_STRING([--enable-debug], [include lots of debugging messages]),
35 [ENABLE_DEBUG=$enableval],
38 AC_MSG_RESULT([$ENABLE_DEBUG])
39 if test "x$ENABLE_DEBUG" = "xyes"; then
40 AC_DEFINE([ENABLE_DEBUG], [1],
41 [Define to 1 if including lots of debug messages.])
44 AC_MSG_CHECKING([whether to include more debugging messages])
45 AC_ARG_ENABLE([more_debug],
46 AS_HELP_STRING([--enable-more-debug],
47 [include even more debugging messages]),
48 [ENABLE_MORE_DEBUG=$enableval],
49 [ENABLE_MORE_DEBUG=no]
51 AC_MSG_RESULT([$ENABLE_MORE_DEBUG])
52 if test "x$ENABLE_MORE_DEBUG" = "xyes"; then
53 AC_DEFINE([ENABLE_MORE_DEBUG], [1],
54 [Define to 1 if including even more debug messages.])
57 AC_MSG_CHECKING([whether to include error messages])
58 AC_ARG_ENABLE([error_messages],
59 AS_HELP_STRING([--disable-error-messages],
60 [do not compile in error messsages]),
61 [ENABLE_ERROR_MESSAGES=$enableval],
62 [ENABLE_ERROR_MESSAGES=yes]
64 AC_MSG_RESULT([$ENABLE_ERROR_MESSAGES])
65 if test "x$ENABLE_ERROR_MESSAGES" = "xyes"; then
66 AC_DEFINE([ENABLE_ERROR_MESSAGES], [1],
67 [Define to 1 if including error messages])
70 AC_MSG_CHECKING([whether to support custom memory allocation functions])
71 AC_ARG_ENABLE([custom_memory_allocator],
72 AS_HELP_STRING([--disable-custom-memory-allocator],
73 [do not support the use of custom memory allocation
75 [ENABLE_CUSTOM_MEMORY_ALLOCATOR=$enableval],
76 [ENABLE_CUSTOM_MEMORY_ALLOCATOR=yes]
78 AC_MSG_RESULT([$ENABLE_CUSTOM_MEMORY_ALLOCATOR])
79 if test "x$ENABLE_CUSTOM_MEMORY_ALLOCATOR" = "xyes"; then
80 AC_DEFINE([ENABLE_CUSTOM_MEMORY_ALLOCATOR], [1],
81 [Define to 1 if supporting custom memory allocation functions])
84 AC_MSG_CHECKING([whether to include assertions])
85 AC_ARG_ENABLE([assertions],
86 AS_HELP_STRING([--disable-assertions], [do not include assertions]),
87 [ENABLE_ASSERTIONS=$enableval],
88 [ENABLE_ASSERTIONS=yes]
90 AC_MSG_RESULT([$ENABLE_ASSERTIONS])
91 if test "x$ENABLE_ASSERTIONS" = "xyes"; then
92 AC_DEFINE([ENABLE_ASSERTIONS], [1], [Define to 1 if including assertions.])
96 AC_MSG_CHECKING([whether to include compression verification])
97 AC_ARG_ENABLE([verify_compression],
98 AS_HELP_STRING([--disable-verify-compression], [disable
99 checking if blocks we compress can be correctly
101 [ENABLE_VERIFY_COMPRESSION=$enableval],
102 [ENABLE_VERIFY_COMPRESSION=yes]
104 AC_MSG_RESULT([$ENABLE_VERIFY_COMPRESSION])
105 if test "x$ENABLE_VERIFY_COMPRESSION" = "xyes"; then
106 AC_DEFINE([ENABLE_VERIFY_COMPRESSION], [1], [Define to 1 to verify
110 AC_MSG_CHECKING([whether to include support for mounting WIMs])
112 AS_HELP_STRING([--without-fuse], [build without libfuse.
113 This will disable the ability to mount
115 [WITH_FUSE=$withval],
118 AC_MSG_RESULT([$WITH_FUSE])
119 if test "x$WITH_FUSE" = "xyes"; then
120 AC_DEFINE([WITH_FUSE], [1], [Define to 1 if using FUSE.])
122 LIBFUSE_LDADD=`pkg-config --libs fuse`
123 LIBFUSE_CFLAGS=`pkg-config --cflags fuse`
125 AC_CHECK_LIB([fuse], [fuse_main_real], [have_fuse=true],
126 [AC_MSG_ERROR([Cannot find libfuse.
127 Without libfuse, WIMLIB cannot include support for mounting WIMs. You
128 should either install libfuse, or configure with --without-fuse to
129 disable support for mounting WIMs.])
131 AC_CHECK_LIB([rt], [mq_open], [have_posix_mq=true],
132 [AC_MSG_ERROR([Cannot find librt for POSIX message queue
133 functions. Without these functions, WIMLIB cannot include support for
134 mounting WIMs. You should either update your C library to a recent
135 version of glibc, or configure with --without-fuse to disable support
142 AC_SUBST([LIBFUSE_LDADD], [$LIBFUSE_LDADD])
143 AC_SUBST([LIBFUSE_CFLAGS], [$LIBFUSE_CFLAGS])
145 AC_MSG_CHECKING([whether to use SSSE3-accelerated SHA1 ])
146 AC_ARG_ENABLE([ssse3-sha1],
147 AS_HELP_STRING([--enable-ssse3-sha1], [use assembly language implementation
148 of SHA1 from Intel, accelerated with vector
149 instructions (SSSE3-enabled CPU required)]),
150 [ENABLE_SSSE3_SHA1=$enableval],
151 [ENABLE_SSSE3_SHA1=no]
154 AC_MSG_RESULT([$ENABLE_SSSE3_SHA1])
155 if test "x$ENABLE_SSSE3_SHA1" = "xyes"; then
156 AC_DEFINE([ENABLE_SSSE3_SHA1], [1],
157 [Define to 1 if using vectorized implementation of SHA1])
158 SSSE3_SHA1_OBJ=sha1-ssse3.lo
160 AC_SUBST([NASM], [$nasm])
164 AC_SUBST([SSSE3_SHA1_OBJ], [$SSSE3_SHA1_OBJ])
166 if test "x$ENABLE_SSSE3_SHA1" = "xyes"; then
169 AC_ARG_WITH([libcrypto],
170 AS_HELP_STRING([--without-libcrypto], [build in the SHA1 algorithm,
171 rather than use external libcrypto from
172 OpenSSL (default is autodetect)]),
173 [WITH_LIBCRYPTO=$withval],
174 [AC_CHECK_LIB([crypto], [SHA1],
175 [WITH_LIBCRYPTO=yes],
176 [AC_MSG_WARN([Cannot find libcrypto: using stand-alone SHA1 code instead of OpenSSL])
180 AC_MSG_CHECKING([whether to use SHA1 function from system libcrypto])
181 AC_MSG_RESULT([$WITH_LIBCRYPTO])
183 if test "x$WITH_LIBCRYPTO" = "xyes" -a "x$ENABLE_SSSE3_SHA1" = "xno"; then
184 AC_DEFINE([WITH_LIBCRYPTO], [1], [Define to 1 if using libcrypto SHA1])
185 LIBCRYPTO_LDADD=`pkg-config --libs libcrypto`
186 LIBCRYPTO_CFLAGS=`pkg-config --cflags libcrypto`
191 AC_SUBST([LIBCRYPTO_LDADD], [$LIBCRYPTO_LDADD])
192 AC_SUBST([LIBCRYPTO_CFLAGS], [$LIBCRYPTO_CFLAGS])
193 AC_SUBST([SHA1_SOURCES], [$SHA1_SOURCES])