2 # Process this file with autoconf to produce a configure script.
4 ###############################################################################
8 # This file has been put into the public domain.
9 # You can do whatever you want with this file.
11 ###############################################################################
13 # NOTE: Don't add useless checks. autoscan detects this and that, but don't
14 # let it confuse you. For example, we don't care about checking for behavior
15 # of malloc(), stat(), or lstat(), since we don't use those functions in
16 # a way that would cause the problems the autoconf macros check.
20 AC_INIT([XZ Utils], m4_esyscmd([/bin/sh build-aux/version.sh]),
21 [lasse.collin@tukaani.org], [xz], [http://tukaani.org/xz/])
22 AC_CONFIG_SRCDIR([src/liblzma/common/common.h])
23 AC_CONFIG_AUX_DIR([build-aux])
24 AC_CONFIG_MACRO_DIR([m4])
25 AC_CONFIG_HEADER([config.h])
28 echo "$PACKAGE_STRING"
32 # This is needed to know if assembler optimizations can be used.
35 # We do some special things on Windows (32-bit or 64-bit) builds.
37 mingw* | cygwin*) is_w32=yes ;;
40 AM_CONDITIONAL([COND_W32], [test "$is_w32" = yes])
42 # We need to use $EXEEXT with $(LN_S) when creating symlinks to
43 # executables. Cygwin is an exception to this, since it is recommended
44 # that symlinks don't have the .exe suffix. To make this work, we
48 *) LN_EXEEXT='$(EXEEXT)' ;;
53 echo "Configure options:"
61 AC_MSG_CHECKING([if debugging code should be compiled])
62 AC_ARG_ENABLE([debug], AC_HELP_STRING([--enable-debug], [Enable debugging code.]),
64 if test "x$enable_debug" = xyes; then
67 AC_DEFINE([NDEBUG], [1], [Define to 1 to disable debugging code.])
76 m4_define([SUPPORTED_FILTERS], [lzma1,lzma2,delta,x86,powerpc,ia64,arm,armthumb,sparc])dnl
77 m4_define([SIMPLE_FILTERS], [x86,powerpc,ia64,arm,armthumb,sparc])
78 m4_define([LZ_FILTERS], [lzma1,lzma2])
80 m4_foreach([NAME], [SUPPORTED_FILTERS],
81 [enable_filter_[]NAME=no
82 enable_encoder_[]NAME=no
83 enable_decoder_[]NAME=no
86 AC_MSG_CHECKING([which encoders to build])
87 AC_ARG_ENABLE([encoders], AC_HELP_STRING([--enable-encoders=LIST],
88 [Comma-separated list of encoders to build. Default=all.
90 m4_translit(m4_defn([SUPPORTED_FILTERS]), [,], [ ])),
91 [], [enable_encoders=SUPPORTED_FILTERS])
92 enable_encoders=`echo "$enable_encoders" | sed 's/,/ /g'`
93 if test "x$enable_encoders" = xno || test "x$enable_encoders" = x; then
94 AC_MSG_RESULT([(none)])
96 for arg in $enable_encoders
98 case $arg in m4_foreach([NAME], [SUPPORTED_FILTERS], [
100 enable_filter_[]NAME=yes
101 enable_encoder_[]NAME=yes
102 AC_DEFINE(HAVE_ENCODER_[]m4_toupper(NAME), [1],
103 [Define to 1 if] NAME [encoder is enabled.])
107 AC_MSG_ERROR([unknown filter: $arg])
111 AC_MSG_RESULT([$enable_encoders])
114 AC_MSG_CHECKING([which decoders to build])
115 AC_ARG_ENABLE([decoders], AC_HELP_STRING([--enable-decoders=LIST],
116 [Comma-separated list of decoders to build. Default=all.
117 Available decoders are the same as available encoders.]),
118 [], [enable_decoders=SUPPORTED_FILTERS])
119 enable_decoders=`echo "$enable_decoders" | sed 's/,/ /g'`
120 if test "x$enable_decoders" = xno || test "x$enable_decoders" = x; then
121 AC_MSG_RESULT([(none)])
123 for arg in $enable_decoders
125 case $arg in m4_foreach([NAME], [SUPPORTED_FILTERS], [
127 enable_filter_[]NAME=yes
128 enable_decoder_[]NAME=yes
129 AC_DEFINE(HAVE_DECODER_[]m4_toupper(NAME), [1],
130 [Define to 1 if] NAME [decoder is enabled.])
134 AC_MSG_ERROR([unknown filter: $arg])
139 # LZMA2 requires that LZMA1 is enabled.
140 test "x$enable_encoder_lzma2" = xyes && enable_encoder_lzma1=yes
141 test "x$enable_decoder_lzma2" = xyes && enable_decoder_lzma1=yes
143 AC_MSG_RESULT([$enable_decoders])
146 if test "x$enable_encoder_lzma2$enable_encoder_lzma1" = xyesno \
147 || test "x$enable_decoder_lzma2$enable_decoder_lzma1" = xyesno; then
148 AC_MSG_ERROR([LZMA2 requires that LZMA1 is also enabled.])
151 AM_CONDITIONAL(COND_MAIN_ENCODER, test "x$enable_encoders" != xno && test "x$enable_encoders" != x)
152 AM_CONDITIONAL(COND_MAIN_DECODER, test "x$enable_decoders" != xno && test "x$enable_decoders" != x)
154 m4_foreach([NAME], [SUPPORTED_FILTERS],
155 [AM_CONDITIONAL(COND_FILTER_[]m4_toupper(NAME), test "x$enable_filter_[]NAME" = xyes)
156 AM_CONDITIONAL(COND_ENCODER_[]m4_toupper(NAME), test "x$enable_encoder_[]NAME" = xyes)
157 AM_CONDITIONAL(COND_DECODER_[]m4_toupper(NAME), test "x$enable_decoder_[]NAME" = xyes)
160 # The so called "simple filters" share common code.
161 enable_filter_simple=no
162 enable_encoder_simple=no
163 enable_decoder_simple=no
164 m4_foreach([NAME], [SIMPLE_FILTERS],
165 [test "x$enable_filter_[]NAME" = xyes && enable_filter_simple=yes
166 test "x$enable_encoder_[]NAME" = xyes && enable_encoder_simple=yes
167 test "x$enable_decoder_[]NAME" = xyes && enable_decoder_simple=yes
169 AM_CONDITIONAL(COND_FILTER_SIMPLE, test "x$enable_filter_simple" = xyes)
170 AM_CONDITIONAL(COND_ENCODER_SIMPLE, test "x$enable_encoder_simple" = xyes)
171 AM_CONDITIONAL(COND_DECODER_SIMPLE, test "x$enable_decoder_simple" = xyes)
173 # LZ-based filters share common code.
177 m4_foreach([NAME], [LZ_FILTERS],
178 [test "x$enable_filter_[]NAME" = xyes && enable_filter_lz=yes
179 test "x$enable_encoder_[]NAME" = xyes && enable_encoder_lz=yes
180 test "x$enable_decoder_[]NAME" = xyes && enable_decoder_lz=yes
182 AM_CONDITIONAL(COND_FILTER_LZ, test "x$enable_filter_lz" = xyes)
183 AM_CONDITIONAL(COND_ENCODER_LZ, test "x$enable_encoder_lz" = xyes)
184 AM_CONDITIONAL(COND_DECODER_LZ, test "x$enable_decoder_lz" = xyes)
191 m4_define([SUPPORTED_MATCH_FINDERS], [hc3,hc4,bt2,bt3,bt4])
193 m4_foreach([NAME], [SUPPORTED_MATCH_FINDERS],
194 [enable_match_finder_[]NAME=no
197 AC_MSG_CHECKING([which match finders to build])
198 AC_ARG_ENABLE([match-finders], AC_HELP_STRING([--enable-match-finders=LIST],
199 [Comma-separated list of match finders to build. Default=all.
200 At least one match finder is required for encoding with
201 the LZMA1 and LZMA2 filters. Available match finders:]
202 m4_translit(m4_defn([SUPPORTED_MATCH_FINDERS]), [,], [ ])), [],
203 [enable_match_finders=SUPPORTED_MATCH_FINDERS])
204 enable_match_finders=`echo "$enable_match_finders" | sed 's/,/ /g'`
205 if test "x$enable_encoder_lz" = xyes ; then
206 for arg in $enable_match_finders
208 case $arg in m4_foreach([NAME], [SUPPORTED_MATCH_FINDERS], [
210 enable_match_finder_[]NAME=yes
211 AC_DEFINE(HAVE_MF_[]m4_toupper(NAME), [1],
212 [Define to 1 to enable] NAME [match finder.])
216 AC_MSG_ERROR([unknown match finder: $arg])
220 AC_MSG_RESULT([$enable_match_finders])
222 AC_MSG_RESULT([(none because not building any LZ-based encoder)])
230 m4_define([SUPPORTED_CHECKS], [crc32,crc64,sha256])
232 m4_foreach([NAME], [SUPPORTED_CHECKS],
233 [enable_check_[]NAME=no
236 AC_MSG_CHECKING([which integrity checks to build])
237 AC_ARG_ENABLE([checks], AC_HELP_STRING([--enable-checks=LIST],
238 [Comma-separated list of integrity checks to build.
239 Default=all. Available integrity checks:]
240 m4_translit(m4_defn([SUPPORTED_CHECKS]), [,], [ ])),
241 [], [enable_checks=SUPPORTED_CHECKS])
242 enable_checks=`echo "$enable_checks" | sed 's/,/ /g'`
243 if test "x$enable_checks" = xno || test "x$enable_checks" = x; then
244 AC_MSG_RESULT([(none)])
246 for arg in $enable_checks
248 case $arg in m4_foreach([NAME], [SUPPORTED_CHECKS], [
250 enable_check_[]NAME=yes
251 AC_DEFINE(HAVE_CHECK_[]m4_toupper(NAME), [1],
252 [Define to 1 if] NAME
253 [integrity check is enabled.])
257 AC_MSG_ERROR([unknown integrity check: $arg])
261 AC_MSG_RESULT([$enable_checks])
263 if test "x$enable_checks_crc32" = xno ; then
264 AC_MSG_ERROR([For now, the CRC32 check must always be enabled.])
267 m4_foreach([NAME], [SUPPORTED_CHECKS],
268 [AM_CONDITIONAL(COND_CHECK_[]m4_toupper(NAME), test "x$enable_check_[]NAME" = xyes)
272 ###########################
273 # Assembler optimizations #
274 ###########################
276 AC_MSG_CHECKING([if assembler optimizations should be used])
277 AC_ARG_ENABLE([assembler], AC_HELP_STRING([--disable-assembler],
278 [Do not use assembler optimizations even if such exist
279 for the architecture.]),
280 [], [enable_assembler=yes])
281 if test "x$enable_assembler" = xyes; then
284 # Darwin should work too but only if not creating universal
285 # binaries. Solaris x86 could work too but I cannot test.
286 linux* | *bsd* | mingw* | cygwin* | *djgpp*)
288 i?86) enable_assembler=x86 ;;
289 x86_64) enable_assembler=x86_64 ;;
294 case $enable_assembler in
296 AC_MSG_RESULT([$enable_assembler])
300 AC_MSG_ERROR([--enable-assembler accepts only \`yes', \`no', \`x86', or \`x86_64'.])
303 AM_CONDITIONAL(COND_ASM_X86, test "x$enable_assembler" = xx86)
304 AM_CONDITIONAL(COND_ASM_X86_64, test "x$enable_assembler" = xx86_64)
307 #####################
308 # Size optimization #
309 #####################
311 AC_MSG_CHECKING([if small size is preferred over speed])
312 AC_ARG_ENABLE([small], AC_HELP_STRING([--enable-small],
313 [Make liblzma smaller and a little slower.
314 This is disabled by default to optimize for speed.]),
315 [], [enable_small=no])
316 if test "x$enable_small" = xyes; then
317 AC_DEFINE([HAVE_SMALL], [1], [Define to 1 if optimizing for size.])
318 elif test "x$enable_small" != xno; then
320 AC_MSG_ERROR([--enable-small accepts only \`yes' or \`no'])
322 AC_MSG_RESULT([$enable_small])
323 AM_CONDITIONAL(COND_SMALL, test "x$enable_small" = xyes)
330 AC_MSG_CHECKING([if threading support is wanted])
331 AC_ARG_ENABLE([threads], AC_HELP_STRING([--disable-threads],
332 [Disable threading support.
333 This makes some things thread-unsafe.]),
334 [], [enable_threads=yes])
335 if test "x$enable_threads" != xyes && test "x$enable_threads" != xno; then
337 AC_MSG_ERROR([--enable-threads accepts only \`yes' or \`no'])
339 AC_MSG_RESULT([$enable_threads])
340 # We use the actual result a little later.
343 #########################
344 # Assumed amount of RAM #
345 #########################
347 # We use 128 MiB as default, because it will allow decompressing files
348 # created with "xz -9". It would be slightly safer to guess a lower value,
349 # but most systems, on which we don't have any way to determine the amount
350 # of RAM, will probably have at least 128 MiB of RAM.
351 AC_MSG_CHECKING([how much RAM to assume if the real amount is unknown])
352 AC_ARG_ENABLE([assume-ram], AC_HELP_STRING([--enable-assume-ram=SIZE],
353 [If and only if the real amount of RAM cannot be determined,
354 assume SIZE MiB. The default is 128 MiB. This affects the
355 default memory usage limit.]),
356 [], [enable_assume_ram=128])
357 assume_ram_check=`echo "$enable_assume_ram" | tr -d 0123456789`
358 if test -z "$enable_assume_ram" || test -n "$assume_ram_check"; then
360 AC_MSG_ERROR([--enable-assume-ram accepts only an integer argument])
362 AC_MSG_RESULT([$enable_assume_ram MiB])
363 AC_DEFINE_UNQUOTED([ASSUME_RAM], [$enable_assume_ram],
364 [How many MiB of RAM to assume if the real amount cannot
368 #########################
369 # Components to install #
370 #########################
372 AC_ARG_ENABLE([xz], [AC_HELP_STRING([--disable-xz],
373 [do not build the xz tool])],
375 AM_CONDITIONAL([COND_XZ], [test x$enable_xz != xno])
377 AC_ARG_ENABLE([xzdec], [AC_HELP_STRING([--disable-xzdec],
378 [do not build xzdec])],
379 [], [enable_xzdec=yes])
380 AM_CONDITIONAL([COND_XZDEC], [test x$enable_xzdec != xno])
382 AC_ARG_ENABLE([lzmadec], [AC_HELP_STRING([--disable-lzmadec],
383 [do not build lzmadec
384 (it exists primarily for LZMA Utils compatibility)])],
385 [], [enable_lzmadec=yes])
386 AM_CONDITIONAL([COND_LZMADEC], [test x$enable_lzmadec != xno])
388 AC_ARG_ENABLE([lzmainfo], [AC_HELP_STRING([--disable-lzmainfo],
389 [do not build lzmainfo
390 (it exists primarily for LZMA Utils compatibility)])],
391 [], [enable_lzmainfo=yes])
392 AM_CONDITIONAL([COND_LZMAINFO], [test x$enable_lzmainfo != xno])
394 AC_ARG_ENABLE([lzma-links], [AC_HELP_STRING([--disable-lzma-links],
395 [do not create symlinks for LZMA Utils compatibility])],
396 [], [enable_lzma_links=yes])
397 AM_CONDITIONAL([COND_LZMALINKS], [test x$enable_lzma_links != xno])
399 AC_ARG_ENABLE([scripts], [AC_HELP_STRING([--disable-scripts],
400 [do not install the scripts xzdiff, xzgrep, xzless, xzmore,
401 and their symlinks])],
402 [], [enable_scripts=yes])
403 AM_CONDITIONAL([COND_SCRIPTS], [test x$enable_scripts != xno])
406 #####################
407 # Symbol versioning #
408 #####################
410 AC_MSG_CHECKING([if library symbol versioning should be used])
411 AC_ARG_ENABLE([symbol-versions], [AC_HELP_STRING([--enable-symbol-versions],
412 [Use symbol versioning for liblzma. Enabled by default on
413 GNU/Linux, other GNU-based systems, and FreeBSD.])],
414 [], [enable_symbol_versions=auto])
415 if test "x$enable_symbol_versions" = xauto; then
417 gnu* | *-gnu* | freebsd*)
418 enable_symbol_versions=yes
421 enable_symbol_versions=no
425 AC_MSG_RESULT([$enable_symbol_versions])
426 AM_CONDITIONAL([COND_SYMVERS], [test "x$enable_symbol_versions" = xyes])
429 ###############################################################################
430 # Checks for programs.
431 ###############################################################################
435 if test -z "$POSIX_SHELL" ; then
436 AC_MSG_ERROR([No POSIX conforming shell (sh) was found.])
440 echo "Initializing Automake:"
442 AM_INIT_AUTOMAKE([1.10 foreign tar-v7 filename-length-max=99])
446 if test x$ac_cv_prog_cc_c99 = xno ; then
447 AC_MSG_ERROR([No C99 compiler was found.])
452 AC_USE_SYSTEM_EXTENSIONS
454 if test "x$enable_threads" = xyes; then
456 echo "Threading support:"
458 LIBS="$LIBS $PTHREAD_LIBS"
459 AM_CFLAGS="$AM_CFLAGS $PTHREAD_CFLAGS"
461 dnl NOTE: PTHREAD_CC is ignored. It would be useful on AIX, but
462 dnl it's tricky to get it right together with AC_PROG_CC_C99.
463 dnl Thus, this is handled by telling the user in INSTALL to set
464 dnl the correct CC manually.
466 # These are nice to have but not mandatory.
468 CFLAGS="$CFLAGS $PTHREAD_CFLAGS"
469 AC_SEARCH_LIBS([clock_gettime], [rt])
470 AC_CHECK_FUNCS([clock_gettime pthread_condattr_setclock])
471 AC_CHECK_DECLS([CLOCK_MONOTONIC], [], [], [[#include <time.h>]])
475 # As a Debian-specific hack, liblzma can use dlopen() to check if extra
476 # paranoia is needed because unversioned symbols from liblzma.so.2 are
477 # present in the same process. See src/liblzma/common/common.c.
478 AC_MSG_CHECKING([if lzma_code checks should be relaxed for compatibility])
479 AC_ARG_ENABLE([liblzma2-compat], [AC_HELP_STRING([--enable-liblzma2-compat],
480 [Relax run-time checks to accomodate old binaries built
481 with smaller sizeof(lzma_stream). The default is "dynamic",
482 which means to only use the relaxed checks when the dynamic
483 loader reports that liblzma.so.2 is loaded in the same process.])],
484 [], [enable_liblzma2_compat=dynamic])
485 case $enable_liblzma2_compat in
487 AC_SEARCH_LIBS([dlopen], [dl])
488 AC_DEFINE([LIBLZMA2_COMPAT_DYNAMIC], [1],
489 [Define to 1 to use dlopen() to check if lzma_code() checks
490 should be more tolerant because the process is also linked to
491 liblzma from Debian 6.0.])
492 AC_MSG_RESULT([auto])
495 AC_DEFINE([LIBLZMA2_COMPAT], [1],
496 [Define to 1 to unconditionally make lzma_code() checks tolerant
497 to accomodate callers built against liblzma from Debian 6.0.])
505 AC_MSG_ERROR([--enable-liblzma2: unrecognized value $enable_liblzma2_compat])
510 echo "Initializing Libtool:"
513 LT_LANG([Windows Resource])
515 # This is a bit wrong since it is possible to request that only some libs
516 # are built as shared. Using that feature isn't so common though, and this
517 # breaks only on Windows (at least for now) if the user enables only some
519 AM_CONDITIONAL([COND_SHARED], [test "x$enable_shared" != xno])
522 ###############################################################################
523 # Checks for libraries.
524 ###############################################################################
527 echo "Initializing gettext:"
528 AM_GNU_GETTEXT_VERSION([0.16.1])
529 AM_GNU_GETTEXT([external])
531 ###############################################################################
532 # Checks for header files.
533 ###############################################################################
536 echo "System headers and functions:"
538 # There is currently no workarounds in this package if some of
539 # these headers are missing.
540 AC_CHECK_HEADERS([fcntl.h limits.h sys/time.h],
542 [AC_MSG_ERROR([Required header file(s) are missing.])])
545 ###############################################################################
546 # Checks for typedefs, structures, and compiler characteristics.
547 ###############################################################################
549 dnl We don't need these as long as we need a C99 compiler anyway.
563 AC_CHECK_SIZEOF([size_t])
565 # The command line tool can copy high resolution timestamps if such
566 # information is availabe in struct stat. Otherwise one second accuracy
569 struct stat.st_atim.tv_nsec,
570 struct stat.st_atimespec.tv_nsec,
571 struct stat.st_atimensec,
572 struct stat.st_uatime,
573 struct stat.st_atim.st__tim.tv_nsec])
579 ###############################################################################
580 # Checks for library functions.
581 ###############################################################################
583 # Gnulib replacements as needed
586 # Find the best function to set timestamps.
587 AC_CHECK_FUNCS([futimens futimes futimesat utimes utime], [break])
589 # This is nice to have but not mandatory.
590 AC_CHECK_FUNCS([posix_fadvise])
598 # Check for system-provided SHA-256. At least the following is supported:
600 # OS Headers Library Type Function
601 # FreeBSD sys/types.h + sha256.h libmd SHA256_CTX SHA256_Init
602 # NetBSD sys/types.h + sha2.h SHA256_CTX SHA256_Init
603 # OpenBSD sys/types.h + sha2.h SHA2_CTX SHA256Init
604 # Solaris sys/types.h + sha2.h libmd SHA256_CTX SHA256Init
605 # MINIX 3 sys/types.h + minix/sha2.h libutil SHA256_CTX SHA256_Init
606 # Darwin CommonCrypto/CommonDigest.h CC_SHA256_CTX CC_SHA256_Init
608 # Note that Darwin's CC_SHA256_Update takes buffer size as uint32_t instead
611 # We don't check for e.g. OpenSSL or libgcrypt because we don't want
612 # to introduce dependencies to other packages by default. Maybe such
613 # libraries could be supported via additional configure options though.
615 if test "x$enable_check_sha256" = "xyes"; then
616 # Test for Common Crypto before others, because Darwin has sha256.h
617 # too and we don't want to use that, because on older versions it
618 # uses OpenSSL functions, whose SHA256_Init is not guaranteed to
620 sha256_header_found=no
622 [CommonCrypto/CommonDigest.h sha256.h sha2.h minix/sha2.h],
623 [sha256_header_found=yes ; break])
624 if test "x$sha256_header_found" = xyes; then
625 AC_CHECK_TYPES([CC_SHA256_CTX, SHA256_CTX, SHA2_CTX], [], [],
626 [[#ifdef HAVE_SYS_TYPES_H
627 # include <sys/types.h>
629 #ifdef HAVE_COMMONCRYPTO_COMMONDIGEST_H
630 # include <CommonCrypto/CommonDigest.h>
638 #ifdef HAVE_MINIX_SHA2_H
639 # include <minix/sha2.h>
641 AC_SEARCH_LIBS([SHA256_Init], [md util])
642 AC_SEARCH_LIBS([SHA256Init], [md])
643 AC_CHECK_FUNCS([CC_SHA256_Init SHA256_Init SHA256Init],
647 AM_CONDITIONAL([COND_INTERNAL_SHA256],
648 [test "x$ac_cv_func_SHA256_Init" != xyes \
649 && test "x$ac_cv_func_SHA256Init" != xyes \
650 && test "x$ac_cv_func_CC_SHA256_Init" != xyes])
653 ###############################################################################
654 # If using GCC, set some additional AM_CFLAGS:
655 ###############################################################################
657 if test "$GCC" = yes ; then
659 echo "GCC extensions:"
662 # Always do the visibility check but don't set AM_CFLAGS on Windows.
663 # This way things get set properly even on Windows.
665 if test -n "$CFLAG_VISIBILITY" && test "$is_w32" = no; then
666 AM_CFLAGS="$AM_CFLAGS $CFLAG_VISIBILITY"
669 if test "$GCC" = yes ; then
670 # Enable as much warnings as possible. These commented warnings won't
671 # work for this package though:
672 # * -Wunreachable-code breaks several assert(0) cases, which are
673 # backed up with "return LZMA_PROG_ERROR".
674 # * -Wcast-qual would break various things where we need a non-const
675 # pointer although we don't modify anything through it.
676 # * -Wcast-align breaks optimized CRC32 and CRC64 implementation
677 # on some architectures (not on x86), where this warning is bogus,
678 # because we take care of correct alignment.
679 # * -Winline, -Wdisabled-optimization, -Wunsafe-loop-optimizations
680 # don't seem so useful here; at least the last one gives some
681 # warnings which are not bugs.
687 -Wmissing-include-dirs \
693 -Wbad-function-cast \
697 -Wstrict-prototypes \
698 -Wold-style-definition \
699 -Wmissing-prototypes \
700 -Wmissing-declarations \
704 AC_MSG_CHECKING([if $CC accepts $NEW_FLAG])
706 CFLAGS="$CFLAGS $NEW_FLAG"
707 AC_COMPILE_IFELSE([AC_LANG_SOURCE([void foo(void) { }])], [
708 AM_CFLAGS="$AM_CFLAGS $NEW_FLAG"
716 AC_ARG_ENABLE([werror],
717 AC_HELP_STRING([--enable-werror], [Enable -Werror to abort
718 compilation on all compiler warnings.]),
719 [], [enable_werror=no])
720 if test "x$enable_werror" = "xyes"; then
721 AM_CFLAGS="$AM_CFLAGS -Werror"
726 ###############################################################################
727 # Create the makefiles and config.h
728 ###############################################################################
732 # Don't build the lib directory at all if we don't need any replacement
734 AM_CONDITIONAL([COND_GNULIB], test -n "$LIBOBJS")
736 # Add default AM_CFLAGS.
737 AC_SUBST([AM_CFLAGS])
739 # This is needed for src/scripts.
740 xz=`echo xz | sed "$program_transform_name"`
749 src/liblzma/liblzma.pc
751 src/liblzma/api/Makefile
754 src/lzmainfo/Makefile
759 AC_CONFIG_FILES([src/scripts/xzdiff], [chmod +x src/scripts/xzdiff])
760 AC_CONFIG_FILES([src/scripts/xzgrep], [chmod +x src/scripts/xzgrep])
761 AC_CONFIG_FILES([src/scripts/xzmore], [chmod +x src/scripts/xzmore])
762 AC_CONFIG_FILES([src/scripts/xzless], [chmod +x src/scripts/xzless])
767 if test x$tuklib_cv_physmem_method = xunknown; then
770 echo "No supported method to detect the amount of RAM."
771 echo "Consider using --enable-assume-ram (if you didn't already)"
772 echo "or make a patch to add support for this operating system."
775 if test x$tuklib_cv_cpucores_method = xunknown; then
778 echo "No supported method to detect the number of CPU cores."