1 AC_INIT([wimlib], [0.6.4], [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
32 if test "x$am_cv_func_iconv" != "xyes"; then
33 AC_MSG_ERROR([Cannot find the iconv() function.
34 iconv() is used to convert between UTF-8 and UTF-16 encodings of WIM
35 filenames and XML data. Wimlib cannot be compiled without it. iconv()
36 is available in the latest version of glibc and sometimes in other
40 AC_ARG_WITH(pkgconfigdir,
41 [ --with-pkgconfigdir=DIR pkgconfig file in DIR @<:@LIBDIR/pkgconfig@:>@],
42 [pkgconfigdir=$withval],
43 [pkgconfigdir='${libdir}/pkgconfig'])
44 AC_SUBST(pkgconfigdir)
46 AC_CHECK_LIB([xml2], [xmlParseFile], [have_libxml=true],
47 [AC_MSG_ERROR(["cannot find libxml2"])])
48 LIBXML2_LDADD=`pkg-config libxml-2.0 --libs`
49 LIBXML2_CFLAGS=`pkg-config libxml-2.0 --cflags`
50 AC_SUBST([LIBXML2_LDADD], [$LIBXML2_LDADD])
51 AC_SUBST([LIBXML2_CFLAGS], [$LIBXML2_CFLAGS])
53 AC_MSG_CHECKING([whether to include debugging messages])
54 AC_ARG_ENABLE([debug],
55 AS_HELP_STRING([--enable-debug], [include lots of debugging messages]),
56 [ENABLE_DEBUG=$enableval],
59 AC_MSG_RESULT([$ENABLE_DEBUG])
60 if test "x$ENABLE_DEBUG" = "xyes"; then
61 AC_DEFINE([ENABLE_DEBUG], [1],
62 [Define to 1 if including lots of debug messages.])
65 AC_MSG_CHECKING([whether to include more debugging messages])
66 AC_ARG_ENABLE([more_debug],
67 AS_HELP_STRING([--enable-more-debug],
68 [include even more debugging messages]),
69 [ENABLE_MORE_DEBUG=$enableval],
70 [ENABLE_MORE_DEBUG=no]
72 AC_MSG_RESULT([$ENABLE_MORE_DEBUG])
73 if test "x$ENABLE_MORE_DEBUG" = "xyes"; then
74 AC_DEFINE([ENABLE_MORE_DEBUG], [1],
75 [Define to 1 if including even more debug messages.])
78 AC_MSG_CHECKING([whether to include error messages])
79 AC_ARG_ENABLE([error_messages],
80 AS_HELP_STRING([--disable-error-messages],
81 [do not compile in error messsages]),
82 [ENABLE_ERROR_MESSAGES=$enableval],
83 [ENABLE_ERROR_MESSAGES=yes]
85 AC_MSG_RESULT([$ENABLE_ERROR_MESSAGES])
86 if test "x$ENABLE_ERROR_MESSAGES" = "xyes"; then
87 AC_DEFINE([ENABLE_ERROR_MESSAGES], [1],
88 [Define to 1 if including error messages])
91 AC_MSG_CHECKING([whether to support custom memory allocation functions])
92 AC_ARG_ENABLE([custom_memory_allocator],
93 AS_HELP_STRING([--disable-custom-memory-allocator],
94 [do not support the use of custom memory allocation
96 [ENABLE_CUSTOM_MEMORY_ALLOCATOR=$enableval],
97 [ENABLE_CUSTOM_MEMORY_ALLOCATOR=yes]
99 AC_MSG_RESULT([$ENABLE_CUSTOM_MEMORY_ALLOCATOR])
100 if test "x$ENABLE_CUSTOM_MEMORY_ALLOCATOR" = "xyes"; then
101 AC_DEFINE([ENABLE_CUSTOM_MEMORY_ALLOCATOR], [1],
102 [Define to 1 if supporting custom memory allocation functions])
105 AC_MSG_CHECKING([whether to include assertions])
106 AC_ARG_ENABLE([assertions],
107 AS_HELP_STRING([--disable-assertions], [do not include assertions]),
108 [ENABLE_ASSERTIONS=$enableval],
109 [ENABLE_ASSERTIONS=yes]
111 AC_MSG_RESULT([$ENABLE_ASSERTIONS])
112 if test "x$ENABLE_ASSERTIONS" = "xyes"; then
113 AC_DEFINE([ENABLE_ASSERTIONS], [1], [Define to 1 if including assertions.])
117 AC_MSG_CHECKING([whether to include compression verification])
118 AC_ARG_ENABLE([verify_compression],
119 AS_HELP_STRING([--disable-verify-compression], [disable
120 checking if blocks we compress can be correctly
122 [ENABLE_VERIFY_COMPRESSION=$enableval],
123 [ENABLE_VERIFY_COMPRESSION=yes]
125 AC_MSG_RESULT([$ENABLE_VERIFY_COMPRESSION])
126 if test "x$ENABLE_VERIFY_COMPRESSION" = "xyes"; then
127 AC_DEFINE([ENABLE_VERIFY_COMPRESSION], [1], [Define to 1 to verify
131 AC_MSG_CHECKING([whether to include support for mounting WIMs])
133 AS_HELP_STRING([--without-fuse], [build without libfuse.
134 This will disable the ability to mount
136 [WITH_FUSE=$withval],
139 AC_MSG_RESULT([$WITH_FUSE])
140 if test "x$WITH_FUSE" = "xyes"; then
141 AC_DEFINE([WITH_FUSE], [1], [Define to 1 if using FUSE.])
143 LIBFUSE_LDADD=`pkg-config --libs fuse`
144 LIBFUSE_CFLAGS=`pkg-config --cflags 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
163 AC_SUBST([LIBFUSE_LDADD], [$LIBFUSE_LDADD])
164 AC_SUBST([LIBFUSE_CFLAGS], [$LIBFUSE_CFLAGS])
166 AC_MSG_CHECKING([whether to use SSSE3-accelerated SHA1 ])
167 AC_ARG_ENABLE([ssse3-sha1],
168 AS_HELP_STRING([--enable-ssse3-sha1], [use assembly language implementation
169 of SHA1 from Intel, accelerated with vector
170 instructions (SSSE3-enabled CPU required)]),
171 [ENABLE_SSSE3_SHA1=$enableval],
172 [ENABLE_SSSE3_SHA1=no]
175 AC_MSG_RESULT([$ENABLE_SSSE3_SHA1])
176 if test "x$ENABLE_SSSE3_SHA1" = "xyes"; then
177 AC_DEFINE([ENABLE_SSSE3_SHA1], [1],
178 [Define to 1 if using vectorized implementation of SHA1])
179 SSSE3_SHA1_OBJ=sha1-ssse3.lo
181 AC_SUBST([NASM], [$nasm])
185 AC_SUBST([SSSE3_SHA1_OBJ], [$SSSE3_SHA1_OBJ])
187 if test "x$ENABLE_SSSE3_SHA1" = "xyes"; then
190 AC_ARG_WITH([libcrypto],
191 AS_HELP_STRING([--without-libcrypto], [build in the SHA1 algorithm,
192 rather than use external libcrypto from
193 OpenSSL (default is autodetect)]),
194 [WITH_LIBCRYPTO=$withval],
195 [AC_CHECK_LIB([crypto], [SHA1],
196 [WITH_LIBCRYPTO=yes],
197 [AC_MSG_WARN([Cannot find libcrypto: using stand-alone SHA1 code instead of OpenSSL])
201 AC_MSG_CHECKING([whether to use SHA1 function from system libcrypto])
202 AC_MSG_RESULT([$WITH_LIBCRYPTO])
204 if test "x$WITH_LIBCRYPTO" = "xyes" -a "x$ENABLE_SSSE3_SHA1" = "xno"; then
205 AC_DEFINE([WITH_LIBCRYPTO], [1], [Define to 1 if using libcrypto SHA1])
206 LIBCRYPTO_LDADD=`pkg-config --libs libcrypto`
207 LIBCRYPTO_CFLAGS=`pkg-config --cflags libcrypto`
212 AC_SUBST([LIBCRYPTO_LDADD], [$LIBCRYPTO_LDADD])
213 AC_SUBST([LIBCRYPTO_CFLAGS], [$LIBCRYPTO_CFLAGS])
214 AC_SUBST([SHA1_SOURCES], [$SHA1_SOURCES])