1 AC_INIT([wimlib], [0.6.3], [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
34 if test "x$am_cv_func_iconv" != "xyes"; then
35 AC_MSG_ERROR([Cannot find the iconv() function.
36 iconv() is used to convert between UTF-8 and UTF-16 encodings of WIM
37 filenames and XML data. Wimlib cannot be compiled without it. iconv()
38 is available in the latest version of glibc and sometimes in other
42 AC_ARG_WITH(pkgconfigdir,
43 [ --with-pkgconfigdir=DIR pkgconfig file in DIR @<:@LIBDIR/pkgconfig@:>@],
44 [pkgconfigdir=$withval],
45 [pkgconfigdir='${libdir}/pkgconfig'])
46 AC_SUBST(pkgconfigdir)
48 AC_CHECK_LIB([xml2], [xmlParseFile], [have_libxml=true],
49 [AC_MSG_ERROR(["cannot find libxml2"])])
50 LIBXML2_LDADD=`pkg-config libxml-2.0 --libs`
51 LIBXML2_CFLAGS=`pkg-config libxml-2.0 --cflags`
52 AC_SUBST([LIBXML2_LDADD], [$LIBXML2_LDADD])
53 AC_SUBST([LIBXML2_CFLAGS], [$LIBXML2_CFLAGS])
55 AC_MSG_CHECKING([whether to include debugging messages])
56 AC_ARG_ENABLE([debug],
57 AS_HELP_STRING([--enable-debug], [include lots of debugging messages]),
58 [ENABLE_DEBUG=$enableval],
61 AC_MSG_RESULT([$ENABLE_DEBUG])
62 if test "x$ENABLE_DEBUG" = "xyes"; then
63 AC_DEFINE([ENABLE_DEBUG], [1],
64 [Define to 1 if including lots of debug messages.])
67 AC_MSG_CHECKING([whether to include more debugging messages])
68 AC_ARG_ENABLE([more_debug],
69 AS_HELP_STRING([--enable-more-debug],
70 [include even more debugging messages]),
71 [ENABLE_MORE_DEBUG=$enableval],
72 [ENABLE_MORE_DEBUG=no]
74 AC_MSG_RESULT([$ENABLE_MORE_DEBUG])
75 if test "x$ENABLE_MORE_DEBUG" = "xyes"; then
76 AC_DEFINE([ENABLE_MORE_DEBUG], [1],
77 [Define to 1 if including even more debug messages.])
80 AC_MSG_CHECKING([whether to include error messages])
81 AC_ARG_ENABLE([error_messages],
82 AS_HELP_STRING([--disable-error-messages],
83 [do not compile in error messsages]),
84 [ENABLE_ERROR_MESSAGES=$enableval],
85 [ENABLE_ERROR_MESSAGES=yes]
87 AC_MSG_RESULT([$ENABLE_ERROR_MESSAGES])
88 if test "x$ENABLE_ERROR_MESSAGES" = "xyes"; then
89 AC_DEFINE([ENABLE_ERROR_MESSAGES], [1],
90 [Define to 1 if including error messages])
93 AC_MSG_CHECKING([whether to support custom memory allocation functions])
94 AC_ARG_ENABLE([custom_memory_allocator],
95 AS_HELP_STRING([--disable-custom-memory-allocator],
96 [do not support the use of custom memory allocation
98 [ENABLE_CUSTOM_MEMORY_ALLOCATOR=$enableval],
99 [ENABLE_CUSTOM_MEMORY_ALLOCATOR=yes]
101 AC_MSG_RESULT([$ENABLE_CUSTOM_MEMORY_ALLOCATOR])
102 if test "x$ENABLE_CUSTOM_MEMORY_ALLOCATOR" = "xyes"; then
103 AC_DEFINE([ENABLE_CUSTOM_MEMORY_ALLOCATOR], [1],
104 [Define to 1 if supporting custom memory allocation functions])
107 AC_MSG_CHECKING([whether to include assertions])
108 AC_ARG_ENABLE([assertions],
109 AS_HELP_STRING([--disable-assertions], [do not include assertions]),
110 [ENABLE_ASSERTIONS=$enableval],
111 [ENABLE_ASSERTIONS=yes]
113 AC_MSG_RESULT([$ENABLE_ASSERTIONS])
114 if test "x$ENABLE_ASSERTIONS" = "xyes"; then
115 AC_DEFINE([ENABLE_ASSERTIONS], [1], [Define to 1 if including assertions.])
119 AC_MSG_CHECKING([whether to include compression verification])
120 AC_ARG_ENABLE([verify_compression],
121 AS_HELP_STRING([--disable-verify-compression], [disable
122 checking if blocks we compress can be correctly
124 [ENABLE_VERIFY_COMPRESSION=$enableval],
125 [ENABLE_VERIFY_COMPRESSION=yes]
127 AC_MSG_RESULT([$ENABLE_VERIFY_COMPRESSION])
128 if test "x$ENABLE_VERIFY_COMPRESSION" = "xyes"; then
129 AC_DEFINE([ENABLE_VERIFY_COMPRESSION], [1], [Define to 1 to verify
133 AC_MSG_CHECKING([whether to include support for mounting WIMs])
135 AS_HELP_STRING([--without-fuse], [build without libfuse.
136 This will disable the ability to mount
138 [WITH_FUSE=$withval],
141 AC_MSG_RESULT([$WITH_FUSE])
142 if test "x$WITH_FUSE" = "xyes"; then
143 AC_DEFINE([WITH_FUSE], [1], [Define to 1 if using FUSE.])
146 AC_CHECK_LIB([fuse], [fuse_main_real], [have_fuse=true],
147 [AC_MSG_ERROR([Cannot find libfuse.
148 Without libfuse, WIMLIB cannot include support for mounting WIMs. You
149 should either install libfuse, or configure with --without-fuse to
150 disable support for mounting WIMs.])
152 AC_CHECK_LIB([rt], [mq_open], [have_posix_mq=true],
153 [AC_MSG_ERROR([Cannot find librt for POSIX message queue
154 functions. Without these functions, WIMLIB cannot include support for
155 mounting WIMs. You should either update your C library to a recent
156 version of glibc, or configure with --without-fuse to disable support
159 LIBFUSE_LDADD="`pkg-config --libs fuse` -lrt"
160 LIBFUSE_CFLAGS="`pkg-config --cflags fuse`"
165 AC_SUBST([LIBFUSE_LDADD], [$LIBFUSE_LDADD])
166 AC_SUBST([LIBFUSE_CFLAGS], [$LIBFUSE_CFLAGS])
168 AC_MSG_CHECKING([whether to use SSSE3-accelerated SHA1 ])
169 AC_ARG_ENABLE([ssse3-sha1],
170 AS_HELP_STRING([--enable-ssse3-sha1], [use assembly language implementation
171 of SHA1 from Intel, accelerated with vector
172 instructions (SSSE3-enabled CPU required)]),
173 [ENABLE_SSSE3_SHA1=$enableval],
174 [ENABLE_SSSE3_SHA1=no]
177 AC_MSG_RESULT([$ENABLE_SSSE3_SHA1])
178 if test "x$ENABLE_SSSE3_SHA1" = "xyes"; then
179 AC_DEFINE([ENABLE_SSSE3_SHA1], [1],
180 [Define to 1 if using vectorized implementation of SHA1])
181 SSSE3_SHA1_OBJ=sha1-ssse3.lo
183 AC_SUBST([NASM], [$nasm])
187 AC_SUBST([SSSE3_SHA1_OBJ], [$SSSE3_SHA1_OBJ])
189 if test "x$ENABLE_SSSE3_SHA1" = "xyes"; then
192 AC_ARG_WITH([libcrypto],
193 AS_HELP_STRING([--without-libcrypto], [build in the SHA1 algorithm,
194 rather than use external libcrypto from
195 OpenSSL (default is autodetect)]),
196 [WITH_LIBCRYPTO=$withval],
197 [AC_CHECK_LIB([crypto], [SHA1],
198 [WITH_LIBCRYPTO=yes],
199 [AC_MSG_WARN([Cannot find libcrypto: using stand-alone SHA1 code instead of OpenSSL])
203 AC_MSG_CHECKING([whether to use SHA1 function from system libcrypto])
204 AC_MSG_RESULT([$WITH_LIBCRYPTO])
206 if test "x$WITH_LIBCRYPTO" = "xyes" -a "x$ENABLE_SSSE3_SHA1" = "xno"; then
207 AC_DEFINE([WITH_LIBCRYPTO], [1], [Define to 1 if using libcrypto SHA1])
208 LIBCRYPTO_LDADD=`pkg-config --libs libcrypto 2>/dev/null`
209 if test $? -ne 0; then
210 LIBCRYPTO_LDADD=-lcrypto;
212 LIBCRYPTO_CFLAGS=`pkg-config --cflags libcrypto 2>/dev/null`
217 AC_SUBST([LIBCRYPTO_LDADD], [$LIBCRYPTO_LDADD])
218 AC_SUBST([LIBCRYPTO_CFLAGS], [$LIBCRYPTO_CFLAGS])
219 AC_SUBST([SHA1_SOURCES], [$SHA1_SOURCES])