2007-12-08 23:42:33 +01:00
|
|
|
# -*- Autoconf -*-
|
|
|
|
# Process this file with autoconf to produce a configure script.
|
|
|
|
|
|
|
|
###############################################################################
|
|
|
|
#
|
2009-04-13 10:27:40 +02:00
|
|
|
# Author: Lasse Collin
|
2007-12-08 23:42:33 +01:00
|
|
|
#
|
2009-04-13 10:27:40 +02:00
|
|
|
# This file has been put into the public domain.
|
|
|
|
# You can do whatever you want with this file.
|
2007-12-08 23:42:33 +01:00
|
|
|
#
|
|
|
|
###############################################################################
|
|
|
|
|
|
|
|
# NOTE: Don't add useless checks. autoscan detects this and that, but don't
|
|
|
|
# let it confuse you. For example, we don't care about checking for behavior
|
|
|
|
# of malloc(), stat(), or lstat(), since we don't use those functions in
|
|
|
|
# a way that would cause the problems the autoconf macros check.
|
|
|
|
|
2010-01-27 12:31:03 +01:00
|
|
|
AC_PREREQ([2.64])
|
2007-12-08 23:42:33 +01:00
|
|
|
|
2009-02-13 17:00:03 +01:00
|
|
|
AC_INIT([XZ Utils], m4_esyscmd([/bin/sh version.sh]),
|
2010-01-27 12:31:03 +01:00
|
|
|
[lasse.collin@tukaani.org], [xz], [http://tukaani.org/xz/])
|
2007-12-08 23:42:33 +01:00
|
|
|
AC_CONFIG_SRCDIR([src/liblzma/common/common.h])
|
2009-07-18 17:54:55 +02:00
|
|
|
AC_CONFIG_AUX_DIR([build-aux])
|
2009-03-01 08:00:06 +01:00
|
|
|
AC_CONFIG_MACRO_DIR([m4])
|
2009-07-18 17:54:55 +02:00
|
|
|
AC_CONFIG_HEADER([config.h])
|
2007-12-08 23:42:33 +01:00
|
|
|
|
|
|
|
echo
|
2008-12-12 23:54:11 +01:00
|
|
|
echo "$PACKAGE_STRING"
|
2007-12-08 23:42:33 +01:00
|
|
|
|
|
|
|
echo
|
|
|
|
echo "System type:"
|
|
|
|
# This is needed to know if assembler optimizations can be used.
|
|
|
|
AC_CANONICAL_HOST
|
|
|
|
|
2009-06-30 16:09:57 +02:00
|
|
|
# We do some special things on Windows (32-bit or 64-bit) builds.
|
|
|
|
case $host_os in
|
|
|
|
mingw* | cygwin*) is_w32=yes ;;
|
|
|
|
*) is_w32=no ;;
|
|
|
|
esac
|
|
|
|
AM_CONDITIONAL([COND_W32], [test "$is_w32" = yes])
|
|
|
|
|
2009-09-11 09:24:09 +02:00
|
|
|
# We need to use $EXEEXT with $(LN_S) when creating symlinks to
|
|
|
|
# executables. Cygwin is an exception to this, since it is recommended
|
|
|
|
# that symlinks don't have the .exe suffix. To make this work, we
|
|
|
|
# define LN_EXEEXT.
|
|
|
|
case $host_os in
|
|
|
|
cygwin) LN_EXEEXT= ;;
|
|
|
|
*) LN_EXEEXT='$(EXEEXT)' ;;
|
|
|
|
esac
|
|
|
|
AC_SUBST([LN_EXEEXT])
|
2008-08-28 21:53:15 +02:00
|
|
|
|
2007-12-08 23:42:33 +01:00
|
|
|
echo
|
|
|
|
echo "Configure options:"
|
2009-02-09 13:54:31 +01:00
|
|
|
AM_CFLAGS=
|
2007-12-08 23:42:33 +01:00
|
|
|
|
2008-08-28 21:53:15 +02:00
|
|
|
|
|
|
|
#############
|
|
|
|
# Debugging #
|
|
|
|
#############
|
|
|
|
|
2007-12-08 23:42:33 +01:00
|
|
|
AC_MSG_CHECKING([if debugging code should be compiled])
|
2008-12-30 23:57:27 +01:00
|
|
|
AC_ARG_ENABLE([debug], AC_HELP_STRING([--enable-debug], [Enable debugging code.]),
|
2007-12-08 23:42:33 +01:00
|
|
|
[], enable_debug=no)
|
|
|
|
if test "x$enable_debug" = xyes; then
|
|
|
|
AC_MSG_RESULT([yes])
|
|
|
|
else
|
2008-12-30 23:57:27 +01:00
|
|
|
AC_DEFINE([NDEBUG], [1], [Define to 1 to disable debugging code.])
|
2007-12-08 23:42:33 +01:00
|
|
|
AC_MSG_RESULT([no])
|
|
|
|
fi
|
|
|
|
|
2008-08-28 21:53:15 +02:00
|
|
|
|
|
|
|
###########
|
|
|
|
# Filters #
|
|
|
|
###########
|
|
|
|
|
2008-09-27 18:09:21 +02:00
|
|
|
m4_define([SUPPORTED_FILTERS], [lzma1,lzma2,subblock,delta,x86,powerpc,ia64,arm,armthumb,sparc])dnl
|
2008-08-28 21:53:15 +02:00
|
|
|
m4_define([SIMPLE_FILTERS], [x86,powerpc,ia64,arm,armthumb,sparc])
|
2008-09-27 18:09:21 +02:00
|
|
|
m4_define([LZ_FILTERS], [lzma1,lzma2])
|
2008-08-28 21:53:15 +02:00
|
|
|
|
|
|
|
m4_foreach([NAME], [SUPPORTED_FILTERS],
|
|
|
|
[enable_filter_[]NAME=no
|
|
|
|
enable_encoder_[]NAME=no
|
|
|
|
enable_decoder_[]NAME=no
|
|
|
|
])dnl
|
|
|
|
|
|
|
|
AC_MSG_CHECKING([which encoders to build])
|
|
|
|
AC_ARG_ENABLE([encoders], AC_HELP_STRING([--enable-encoders=LIST],
|
|
|
|
[Comma-separated list of encoders to build. Default=all.
|
|
|
|
Available encoders:]
|
|
|
|
m4_translit(m4_defn([SUPPORTED_FILTERS]), [,], [ ])),
|
|
|
|
[], [enable_encoders=SUPPORTED_FILTERS])
|
2008-12-31 16:41:46 +01:00
|
|
|
enable_encoders=`echo "$enable_encoders" | sed 's/,subblock//; s/,/ /g'`
|
2008-08-28 21:53:15 +02:00
|
|
|
if test "x$enable_encoders" = xno || test "x$enable_encoders" = x; then
|
|
|
|
AC_MSG_RESULT([(none)])
|
2007-12-08 23:42:33 +01:00
|
|
|
else
|
2009-05-02 13:46:50 +02:00
|
|
|
AC_DEFINE([HAVE_ENCODER], [1],
|
|
|
|
[Define to 1 if encoder components are enabled.])
|
2008-08-28 21:53:15 +02:00
|
|
|
for arg in $enable_encoders
|
2007-12-08 23:42:33 +01:00
|
|
|
do
|
2008-08-28 21:53:15 +02:00
|
|
|
case $arg in m4_foreach([NAME], [SUPPORTED_FILTERS], [
|
|
|
|
NAME)
|
|
|
|
enable_filter_[]NAME=yes
|
|
|
|
enable_encoder_[]NAME=yes
|
|
|
|
AC_DEFINE(HAVE_ENCODER_[]m4_toupper(NAME), [1],
|
|
|
|
[Define to 1 if] NAME [encoder is enabled.])
|
|
|
|
;;])
|
|
|
|
*)
|
|
|
|
AC_MSG_RESULT([])
|
|
|
|
AC_MSG_ERROR([unknown filter: $arg])
|
2007-12-08 23:42:33 +01:00
|
|
|
;;
|
2008-08-28 21:53:15 +02:00
|
|
|
esac
|
|
|
|
done
|
|
|
|
AC_MSG_RESULT([$enable_encoders])
|
|
|
|
fi
|
|
|
|
|
|
|
|
AC_MSG_CHECKING([which decoders to build])
|
|
|
|
AC_ARG_ENABLE([decoders], AC_HELP_STRING([--enable-decoders=LIST],
|
|
|
|
[Comma-separated list of decoders to build. Default=all.
|
|
|
|
Available decoders are the same as available encoders.]),
|
|
|
|
[], [enable_decoders=SUPPORTED_FILTERS])
|
2008-12-31 16:44:20 +01:00
|
|
|
enable_decoders=`echo "$enable_decoders" | sed 's/,subblock//; s/,/ /g'`
|
2008-08-28 21:53:15 +02:00
|
|
|
if test "x$enable_decoders" = xno || test "x$enable_decoders" = x; then
|
|
|
|
AC_MSG_RESULT([(none)])
|
|
|
|
else
|
2009-05-02 13:46:50 +02:00
|
|
|
AC_DEFINE([HAVE_DECODER], [1],
|
|
|
|
[Define to 1 if decoder components are enabled.])
|
2008-08-28 21:53:15 +02:00
|
|
|
for arg in $enable_decoders
|
|
|
|
do
|
|
|
|
case $arg in m4_foreach([NAME], [SUPPORTED_FILTERS], [
|
|
|
|
NAME)
|
|
|
|
enable_filter_[]NAME=yes
|
|
|
|
enable_decoder_[]NAME=yes
|
|
|
|
AC_DEFINE(HAVE_DECODER_[]m4_toupper(NAME), [1],
|
|
|
|
[Define to 1 if] NAME [decoder is enabled.])
|
|
|
|
;;])
|
2007-12-08 23:42:33 +01:00
|
|
|
*)
|
|
|
|
AC_MSG_RESULT([])
|
|
|
|
AC_MSG_ERROR([unknown filter: $arg])
|
|
|
|
;;
|
|
|
|
esac
|
|
|
|
done
|
2008-08-28 21:53:15 +02:00
|
|
|
|
2008-09-27 18:09:21 +02:00
|
|
|
# LZMA2 requires that LZMA1 is enabled.
|
|
|
|
test "x$enable_encoder_lzma2" = xyes && enable_encoder_lzma1=yes
|
|
|
|
test "x$enable_decoder_lzma2" = xyes && enable_decoder_lzma1=yes
|
2008-08-28 21:53:15 +02:00
|
|
|
|
|
|
|
AC_MSG_RESULT([$enable_decoders])
|
2007-12-08 23:42:33 +01:00
|
|
|
fi
|
2008-08-28 21:53:15 +02:00
|
|
|
|
2008-09-27 18:09:21 +02:00
|
|
|
if test "x$enable_encoder_lzma2$enable_encoder_lzma1" = xyesno \
|
|
|
|
|| test "x$enable_decoder_lzma2$enable_decoder_lzma1" = xyesno; then
|
|
|
|
AC_MSG_ERROR([LZMA2 requires that LZMA1 is also enabled.])
|
2007-12-08 23:42:33 +01:00
|
|
|
fi
|
2008-08-28 21:53:15 +02:00
|
|
|
|
2009-05-02 13:46:50 +02:00
|
|
|
AM_CONDITIONAL(COND_MAIN_ENCODER, test "x$enable_encoders" != xno && test "x$enable_encoders" != x)
|
|
|
|
AM_CONDITIONAL(COND_MAIN_DECODER, test "x$enable_decoders" != xno && test "x$enable_decoders" != x)
|
|
|
|
|
2008-08-28 21:53:15 +02:00
|
|
|
m4_foreach([NAME], [SUPPORTED_FILTERS],
|
|
|
|
[AM_CONDITIONAL(COND_FILTER_[]m4_toupper(NAME), test "x$enable_filter_[]NAME" = xyes)
|
|
|
|
AM_CONDITIONAL(COND_ENCODER_[]m4_toupper(NAME), test "x$enable_encoder_[]NAME" = xyes)
|
|
|
|
AM_CONDITIONAL(COND_DECODER_[]m4_toupper(NAME), test "x$enable_decoder_[]NAME" = xyes)
|
|
|
|
])dnl
|
|
|
|
|
|
|
|
# The so called "simple filters" share common code.
|
|
|
|
enable_filter_simple=no
|
|
|
|
enable_encoder_simple=no
|
|
|
|
enable_decoder_simple=no
|
|
|
|
m4_foreach([NAME], [SIMPLE_FILTERS],
|
|
|
|
[test "x$enable_filter_[]NAME" = xyes && enable_filter_simple=yes
|
|
|
|
test "x$enable_encoder_[]NAME" = xyes && enable_encoder_simple=yes
|
|
|
|
test "x$enable_decoder_[]NAME" = xyes && enable_decoder_simple=yes
|
|
|
|
])dnl
|
|
|
|
AM_CONDITIONAL(COND_FILTER_SIMPLE, test "x$enable_filter_simple" = xyes)
|
|
|
|
AM_CONDITIONAL(COND_ENCODER_SIMPLE, test "x$enable_encoder_simple" = xyes)
|
|
|
|
AM_CONDITIONAL(COND_DECODER_SIMPLE, test "x$enable_decoder_simple" = xyes)
|
|
|
|
|
|
|
|
# LZ-based filters share common code.
|
|
|
|
enable_filter_lz=no
|
|
|
|
enable_encoder_lz=no
|
|
|
|
enable_decoder_lz=no
|
|
|
|
m4_foreach([NAME], [LZ_FILTERS],
|
|
|
|
[test "x$enable_filter_[]NAME" = xyes && enable_filter_lz=yes
|
|
|
|
test "x$enable_encoder_[]NAME" = xyes && enable_encoder_lz=yes
|
|
|
|
test "x$enable_decoder_[]NAME" = xyes && enable_decoder_lz=yes
|
|
|
|
])dnl
|
|
|
|
AM_CONDITIONAL(COND_FILTER_LZ, test "x$enable_filter_lz" = xyes)
|
|
|
|
AM_CONDITIONAL(COND_ENCODER_LZ, test "x$enable_encoder_lz" = xyes)
|
|
|
|
AM_CONDITIONAL(COND_DECODER_LZ, test "x$enable_decoder_lz" = xyes)
|
|
|
|
|
|
|
|
|
|
|
|
#################
|
|
|
|
# Match finders #
|
|
|
|
#################
|
|
|
|
|
|
|
|
m4_define([SUPPORTED_MATCH_FINDERS], [hc3,hc4,bt2,bt3,bt4])
|
|
|
|
|
|
|
|
m4_foreach([NAME], [SUPPORTED_MATCH_FINDERS],
|
|
|
|
[enable_match_finder_[]NAME=no
|
|
|
|
])
|
|
|
|
|
2007-12-08 23:42:33 +01:00
|
|
|
AC_MSG_CHECKING([which match finders to build])
|
2008-12-30 23:57:27 +01:00
|
|
|
AC_ARG_ENABLE([match-finders], AC_HELP_STRING([--enable-match-finders=LIST],
|
2007-12-08 23:42:33 +01:00
|
|
|
[Comma-separated list of match finders to build. Default=all.
|
|
|
|
At least one match finder is required for encoding with
|
2008-09-27 18:09:21 +02:00
|
|
|
the LZMA1 and LZMA2 filters. Available match finders:]
|
2008-08-28 21:53:15 +02:00
|
|
|
m4_translit(m4_defn([SUPPORTED_MATCH_FINDERS]), [,], [ ])), [],
|
|
|
|
[enable_match_finders=SUPPORTED_MATCH_FINDERS])
|
2007-12-08 23:42:33 +01:00
|
|
|
enable_match_finders=`echo "$enable_match_finders" | sed 's/,/ /g'`
|
2009-05-02 13:46:50 +02:00
|
|
|
if test "x$enable_encoder_lz" = xyes ; then
|
2007-12-08 23:42:33 +01:00
|
|
|
for arg in $enable_match_finders
|
|
|
|
do
|
2008-08-28 21:53:15 +02:00
|
|
|
case $arg in m4_foreach([NAME], [SUPPORTED_MATCH_FINDERS], [
|
|
|
|
NAME)
|
|
|
|
enable_match_finder_[]NAME=yes
|
|
|
|
AC_DEFINE(HAVE_MF_[]m4_toupper(NAME), [1],
|
|
|
|
[Define to 1 to enable] NAME [match finder.])
|
|
|
|
;;])
|
2007-12-08 23:42:33 +01:00
|
|
|
*)
|
|
|
|
AC_MSG_RESULT([])
|
|
|
|
AC_MSG_ERROR([unknown match finder: $arg])
|
|
|
|
;;
|
|
|
|
esac
|
|
|
|
done
|
|
|
|
AC_MSG_RESULT([$enable_match_finders])
|
|
|
|
else
|
2008-08-28 21:53:15 +02:00
|
|
|
AC_MSG_RESULT([(none because not building any LZ-based encoder)])
|
2007-12-08 23:42:33 +01:00
|
|
|
fi
|
|
|
|
|
2008-08-28 21:53:15 +02:00
|
|
|
|
|
|
|
####################
|
|
|
|
# Integrity checks #
|
|
|
|
####################
|
|
|
|
|
|
|
|
m4_define([SUPPORTED_CHECKS], [crc32,crc64,sha256])
|
|
|
|
|
|
|
|
m4_foreach([NAME], [SUPPORTED_FILTERS],
|
|
|
|
[enable_check_[]NAME=no
|
|
|
|
])dnl
|
|
|
|
|
2007-12-08 23:42:33 +01:00
|
|
|
AC_MSG_CHECKING([which integrity checks to build])
|
2008-12-30 23:57:27 +01:00
|
|
|
AC_ARG_ENABLE([checks], AC_HELP_STRING([--enable-checks=LIST],
|
2007-12-08 23:42:33 +01:00
|
|
|
[Comma-separated list of integrity checks to build.
|
2008-08-28 21:53:15 +02:00
|
|
|
Default=all. Available integrity checks:]
|
|
|
|
m4_translit(m4_defn([SUPPORTED_CHECKS]), [,], [ ])),
|
|
|
|
[], [enable_checks=SUPPORTED_CHECKS])
|
2007-12-08 23:42:33 +01:00
|
|
|
enable_checks=`echo "$enable_checks" | sed 's/,/ /g'`
|
|
|
|
if test "x$enable_checks" = xno || test "x$enable_checks" = x; then
|
|
|
|
AC_MSG_RESULT([(none)])
|
|
|
|
else
|
|
|
|
for arg in $enable_checks
|
|
|
|
do
|
2008-08-28 21:53:15 +02:00
|
|
|
case $arg in m4_foreach([NAME], [SUPPORTED_CHECKS], [
|
|
|
|
NAME)
|
|
|
|
enable_check_[]NAME=yes
|
|
|
|
AC_DEFINE(HAVE_CHECK_[]m4_toupper(NAME), [1],
|
|
|
|
[Define to 1 if] NAME
|
|
|
|
[integrity check is enabled.])
|
|
|
|
;;])
|
2007-12-08 23:42:33 +01:00
|
|
|
*)
|
|
|
|
AC_MSG_RESULT([])
|
|
|
|
AC_MSG_ERROR([unknown integrity check: $arg])
|
|
|
|
;;
|
|
|
|
esac
|
|
|
|
done
|
|
|
|
AC_MSG_RESULT([$enable_checks])
|
|
|
|
fi
|
|
|
|
if test "x$enable_checks_crc32" = xno ; then
|
|
|
|
AC_MSG_ERROR([For now, the CRC32 check must always be enabled.])
|
|
|
|
fi
|
|
|
|
|
2008-08-28 21:53:15 +02:00
|
|
|
m4_foreach([NAME], [SUPPORTED_CHECKS],
|
|
|
|
[AM_CONDITIONAL(COND_CHECK_[]m4_toupper(NAME), test "x$enable_check_[]NAME" = xyes)
|
|
|
|
])dnl
|
|
|
|
|
|
|
|
|
|
|
|
###########################
|
|
|
|
# Assembler optimizations #
|
|
|
|
###########################
|
|
|
|
|
2007-12-08 23:42:33 +01:00
|
|
|
AC_MSG_CHECKING([if assembler optimizations should be used])
|
2008-12-30 23:57:27 +01:00
|
|
|
AC_ARG_ENABLE([assembler], AC_HELP_STRING([--disable-assembler],
|
2007-12-08 23:42:33 +01:00
|
|
|
[Do not use assembler optimizations even if such exist
|
|
|
|
for the architecture.]),
|
2008-06-18 17:02:10 +02:00
|
|
|
[], [enable_assembler=yes])
|
2007-12-08 23:42:33 +01:00
|
|
|
if test "x$enable_assembler" = xyes; then
|
2009-11-22 11:00:30 +01:00
|
|
|
enable_assembler=no
|
|
|
|
case $host_os in
|
|
|
|
# Darwin should work too but only if not creating universal
|
|
|
|
# binaries. Solaris x86 could work too but I cannot test.
|
|
|
|
linux* | *bsd* | mingw* | cygwin*)
|
|
|
|
case $host_cpu in
|
|
|
|
i?86) enable_assembler=x86 ;;
|
|
|
|
x86_64) enable_assembler=x86_64 ;;
|
|
|
|
esac
|
|
|
|
;;
|
2008-01-15 12:29:14 +01:00
|
|
|
esac
|
2007-12-08 23:42:33 +01:00
|
|
|
fi
|
|
|
|
case $enable_assembler in
|
2009-11-22 11:00:30 +01:00
|
|
|
x86 | x86_64 | no)
|
|
|
|
AC_MSG_RESULT([$enable_assembler])
|
2008-01-15 12:29:14 +01:00
|
|
|
;;
|
2007-12-08 23:42:33 +01:00
|
|
|
*)
|
|
|
|
AC_MSG_RESULT([])
|
2008-08-28 21:53:15 +02:00
|
|
|
AC_MSG_ERROR([--enable-assembler accepts only \`yes', \`no', \`x86', or \`x86_64'.])
|
2007-12-08 23:42:33 +01:00
|
|
|
;;
|
|
|
|
esac
|
|
|
|
AM_CONDITIONAL(COND_ASM_X86, test "x$enable_assembler" = xx86)
|
2008-08-28 21:53:15 +02:00
|
|
|
AM_CONDITIONAL(COND_ASM_X86_64, test "x$enable_assembler" = xx86_64)
|
|
|
|
|
|
|
|
|
|
|
|
#####################
|
|
|
|
# Size optimization #
|
|
|
|
#####################
|
|
|
|
|
2007-12-08 23:42:33 +01:00
|
|
|
AC_MSG_CHECKING([if small size is preferred over speed])
|
2008-12-30 23:57:27 +01:00
|
|
|
AC_ARG_ENABLE([small], AC_HELP_STRING([--enable-small],
|
2008-08-28 21:53:15 +02:00
|
|
|
[Make liblzma smaller and a little slower.
|
|
|
|
This is disabled by default to optimize for speed.]),
|
2008-06-18 17:02:10 +02:00
|
|
|
[], [enable_small=no])
|
2007-12-08 23:42:33 +01:00
|
|
|
if test "x$enable_small" = xyes; then
|
2008-12-30 23:57:27 +01:00
|
|
|
AC_DEFINE([HAVE_SMALL], [1], [Define to 1 if optimizing for size.])
|
2007-12-08 23:42:33 +01:00
|
|
|
elif test "x$enable_small" != xno; then
|
|
|
|
AC_MSG_RESULT([])
|
|
|
|
AC_MSG_ERROR([--enable-small accepts only \`yes' or \`no'])
|
|
|
|
fi
|
|
|
|
AC_MSG_RESULT([$enable_small])
|
|
|
|
AM_CONDITIONAL(COND_SMALL, test "x$enable_small" = xyes)
|
|
|
|
|
2008-08-28 21:53:15 +02:00
|
|
|
|
2008-12-30 23:30:49 +01:00
|
|
|
#############
|
|
|
|
# Threading #
|
|
|
|
#############
|
|
|
|
|
|
|
|
AC_MSG_CHECKING([if threading support is wanted])
|
|
|
|
AC_ARG_ENABLE([threads], AC_HELP_STRING([--disable-threads],
|
|
|
|
[Disable threading support.
|
|
|
|
This makes some things thread-unsafe.]),
|
|
|
|
[], [enable_threads=yes])
|
|
|
|
if test "x$enable_threads" != xyes && test "x$enable_threads" != xno; then
|
2009-02-07 20:17:07 +01:00
|
|
|
AC_MSG_RESULT([])
|
2008-12-30 23:30:49 +01:00
|
|
|
AC_MSG_ERROR([--enable-threads accepts only \`yes' or \`no'])
|
|
|
|
fi
|
2009-02-07 20:17:07 +01:00
|
|
|
AC_MSG_RESULT([$enable_threads])
|
2008-12-30 23:30:49 +01:00
|
|
|
# We use the actual result a little later.
|
|
|
|
|
|
|
|
|
2009-10-02 13:35:56 +02:00
|
|
|
#########################
|
|
|
|
# Assumed amount of RAM #
|
|
|
|
#########################
|
|
|
|
|
|
|
|
# We use 32 MiB as default, because it should be small enough for most
|
|
|
|
# cases and allows decompressing files compressed with the default settings.
|
|
|
|
# Probably it is too small for most systems, but it's safer to guess too low.
|
|
|
|
AC_MSG_CHECKING([how much RAM to assume if the real amount is unknown])
|
|
|
|
AC_ARG_ENABLE([assume-ram], AC_HELP_STRING([--enable-assume-ram=SIZE],
|
|
|
|
[If and only if the real amount of RAM cannot be determined,
|
|
|
|
assume SIZE MiB. The default is 32 MiB. This affects the
|
|
|
|
default memory usage limit.]),
|
|
|
|
[], [enable_assume_ram=32])
|
|
|
|
assume_ram_check=`echo "$enable_assume_ram" | tr -d 0123456789`
|
|
|
|
if test -z "$enable_assume_ram" || test -n "$assume_ram_check"; then
|
|
|
|
AC_MSG_RESULT([])
|
|
|
|
AC_MSG_ERROR([--enable-assume-ram accepts only an integer argument])
|
|
|
|
fi
|
|
|
|
AC_MSG_RESULT([$enable_assume_ram MiB])
|
|
|
|
AC_DEFINE_UNQUOTED([ASSUME_RAM], [$enable_assume_ram],
|
|
|
|
[How many MiB of RAM to assume if the real amount cannot
|
|
|
|
be determined.])
|
|
|
|
|
|
|
|
|
2009-02-07 20:17:07 +01:00
|
|
|
############################################
|
|
|
|
# xz/xzdec/lzmadec linkage against liblzma #
|
|
|
|
############################################
|
|
|
|
|
2009-08-13 14:00:21 +02:00
|
|
|
# Link the xz, xzdec, and lzmadec command line tools against static liblzma
|
|
|
|
# unless using --enable-dynamic. Using static liblzma gives a little bit
|
|
|
|
# faster executable on x86, because no register is wasted for PIC. We also
|
|
|
|
# have one dependency less, which allows users to more freely copy the xz
|
|
|
|
# binary to other boxes. However, I wouldn't be surprised if distro
|
|
|
|
# maintainers still prefer dynamic linking, so let's make it easy for them.
|
|
|
|
|
|
|
|
AC_MSG_CHECKING([how programs should be linked against liblzma])
|
|
|
|
AC_ARG_ENABLE([dynamic], [AC_HELP_STRING([--enable-dynamic=TYPE],
|
|
|
|
[Set how command line tools are linked against liblzma.
|
|
|
|
TYPE can be mixed, yes, or no. The default is mixed.])],
|
|
|
|
[], [enable_dynamic=mixed])
|
2009-02-07 20:17:07 +01:00
|
|
|
case $enable_dynamic in
|
2009-08-13 14:00:21 +02:00
|
|
|
mixed)
|
|
|
|
AC_MSG_RESULT([mixed (some dynamically, some statically)])
|
|
|
|
;;
|
2009-02-07 20:17:07 +01:00
|
|
|
yes)
|
|
|
|
AC_MSG_RESULT([dynamically])
|
|
|
|
;;
|
|
|
|
no)
|
|
|
|
AC_MSG_RESULT([statically])
|
|
|
|
;;
|
|
|
|
*)
|
|
|
|
AC_MSG_RESULT([])
|
2009-08-13 14:00:21 +02:00
|
|
|
AC_MSG_ERROR([--enable-dynamic accepts only \`mixed', \`yes', or \`no'])
|
2009-02-07 20:17:07 +01:00
|
|
|
;;
|
|
|
|
esac
|
2009-08-13 14:00:21 +02:00
|
|
|
# We use the actual results later, because we don't know yet
|
|
|
|
# if --disable-shared or --disable-static was used.
|
2009-02-07 20:17:07 +01:00
|
|
|
|
|
|
|
|
2008-01-06 20:47:17 +01:00
|
|
|
###############################################################################
|
|
|
|
# Checks for programs.
|
|
|
|
###############################################################################
|
|
|
|
|
2009-07-05 21:25:17 +02:00
|
|
|
echo
|
|
|
|
gl_POSIX_SHELL
|
|
|
|
if test -z "$POSIX_SHELL" ; then
|
|
|
|
AC_MSG_ERROR([No POSIX conforming shell (sh) was found.])
|
|
|
|
fi
|
|
|
|
|
2007-12-08 23:42:33 +01:00
|
|
|
echo
|
|
|
|
echo "Initializing Automake:"
|
|
|
|
|
2008-04-25 12:32:35 +02:00
|
|
|
AM_INIT_AUTOMAKE([1.10 foreign tar-v7 filename-length-max=99])
|
2008-01-06 20:47:17 +01:00
|
|
|
AC_PROG_LN_S
|
2008-05-11 13:17:21 +02:00
|
|
|
|
|
|
|
AC_PROG_CC_C99
|
|
|
|
if test x$ac_cv_prog_cc_c99 = xno ; then
|
|
|
|
AC_MSG_ERROR([No C99 compiler was found.])
|
|
|
|
fi
|
|
|
|
|
2007-12-08 23:42:33 +01:00
|
|
|
AM_PROG_CC_C_O
|
|
|
|
AM_PROG_AS
|
2008-01-06 20:47:17 +01:00
|
|
|
AC_USE_SYSTEM_EXTENSIONS
|
2007-12-08 23:42:33 +01:00
|
|
|
|
2008-12-30 23:30:49 +01:00
|
|
|
if test "x$enable_threads" = xyes; then
|
|
|
|
echo
|
|
|
|
echo "Threading support:"
|
|
|
|
ACX_PTHREAD
|
|
|
|
LIBS="$LIBS $PTHREAD_LIBS"
|
2009-02-09 13:54:31 +01:00
|
|
|
AM_CFLAGS="$AM_CFLAGS $PTHREAD_CFLAGS"
|
2008-12-30 23:30:49 +01:00
|
|
|
CC="$PTHREAD_CC"
|
|
|
|
fi
|
2007-12-08 23:42:33 +01:00
|
|
|
|
|
|
|
echo
|
|
|
|
echo "Initializing Libtool:"
|
2009-08-27 14:43:54 +02:00
|
|
|
LT_PREREQ([2.2])
|
|
|
|
LT_INIT([win32-dll])
|
|
|
|
LT_LANG([Windows Resource])
|
2007-12-08 23:42:33 +01:00
|
|
|
|
2009-06-30 16:09:57 +02:00
|
|
|
# This is a bit wrong since it is possible to request that only some libs
|
|
|
|
# are built as shared. Using that feature isn't so common though, and this
|
|
|
|
# breaks only on Windows (at least for now) if the user enables only some
|
|
|
|
# libs as shared.
|
|
|
|
AM_CONDITIONAL([COND_SHARED], [test "x$enable_shared" != xno])
|
|
|
|
|
2007-12-08 23:42:33 +01:00
|
|
|
|
|
|
|
###############################################################################
|
|
|
|
# Checks for libraries.
|
|
|
|
###############################################################################
|
|
|
|
|
|
|
|
echo
|
|
|
|
echo "Initializing gettext:"
|
|
|
|
AM_GNU_GETTEXT_VERSION([0.16.1])
|
|
|
|
AM_GNU_GETTEXT([external])
|
|
|
|
|
|
|
|
###############################################################################
|
|
|
|
# Checks for header files.
|
|
|
|
###############################################################################
|
|
|
|
|
|
|
|
echo
|
|
|
|
echo "System headers and functions:"
|
|
|
|
|
|
|
|
# There is currently no workarounds in this package if some of
|
|
|
|
# these headers are missing.
|
|
|
|
AC_CHECK_HEADERS([fcntl.h limits.h sys/time.h],
|
|
|
|
[],
|
|
|
|
[AC_MSG_ERROR([Required header file(s) are missing.])])
|
|
|
|
|
|
|
|
|
|
|
|
###############################################################################
|
|
|
|
# Checks for typedefs, structures, and compiler characteristics.
|
|
|
|
###############################################################################
|
|
|
|
|
2008-05-11 13:17:21 +02:00
|
|
|
dnl We don't need these as long as we need a C99 compiler anyway.
|
|
|
|
dnl AC_C_INLINE
|
|
|
|
dnl AC_C_RESTRICT
|
2007-12-08 23:42:33 +01:00
|
|
|
|
2008-01-06 15:27:41 +01:00
|
|
|
AC_HEADER_STDBOOL
|
|
|
|
|
|
|
|
AC_TYPE_UINT8_T
|
2008-11-19 22:55:22 +01:00
|
|
|
AC_TYPE_UINT16_T
|
2008-01-06 15:27:41 +01:00
|
|
|
AC_TYPE_INT32_T
|
|
|
|
AC_TYPE_UINT32_T
|
|
|
|
AC_TYPE_INT64_T
|
|
|
|
AC_TYPE_UINT64_T
|
|
|
|
AC_TYPE_UINTPTR_T
|
|
|
|
|
|
|
|
AC_CHECK_SIZEOF([size_t])
|
|
|
|
|
2007-12-08 23:42:33 +01:00
|
|
|
# The command line tool can copy high resolution timestamps if such
|
|
|
|
# information is availabe in struct stat. Otherwise one second accuracy
|
2008-11-19 19:46:52 +01:00
|
|
|
# is used.
|
|
|
|
AC_CHECK_MEMBERS([
|
|
|
|
struct stat.st_atim.tv_nsec,
|
|
|
|
struct stat.st_atimespec.tv_nsec,
|
|
|
|
struct stat.st_atimensec,
|
|
|
|
struct stat.st_uatime,
|
|
|
|
struct stat.st_atim.st__tim.tv_nsec])
|
2007-12-08 23:42:33 +01:00
|
|
|
|
|
|
|
AC_SYS_LARGEFILE
|
|
|
|
AC_C_BIGENDIAN
|
|
|
|
|
|
|
|
|
|
|
|
###############################################################################
|
|
|
|
# Checks for library functions.
|
|
|
|
###############################################################################
|
|
|
|
|
|
|
|
# Gnulib replacements as needed
|
|
|
|
gl_GETOPT
|
|
|
|
|
2008-11-19 19:46:52 +01:00
|
|
|
# Find the best function to set timestamps.
|
|
|
|
AC_CHECK_FUNCS([futimens futimes futimesat utimes utime], [break])
|
2007-12-08 23:42:33 +01:00
|
|
|
|
2009-09-19 08:47:30 +02:00
|
|
|
TUKLIB_PROGNAME
|
2009-10-04 21:57:12 +02:00
|
|
|
TUKLIB_INTEGER
|
2009-09-19 08:47:30 +02:00
|
|
|
TUKLIB_PHYSMEM
|
|
|
|
TUKLIB_CPUCORES
|
2007-12-08 23:42:33 +01:00
|
|
|
|
|
|
|
|
|
|
|
###############################################################################
|
2009-02-09 13:54:31 +01:00
|
|
|
# If using GCC, set some additional AM_CFLAGS:
|
2007-12-08 23:42:33 +01:00
|
|
|
###############################################################################
|
|
|
|
|
2009-07-01 11:21:24 +02:00
|
|
|
if test "$GCC" = yes ; then
|
2007-12-08 23:42:33 +01:00
|
|
|
echo
|
|
|
|
echo "GCC extensions:"
|
2009-07-01 11:21:24 +02:00
|
|
|
fi
|
2009-06-30 16:09:57 +02:00
|
|
|
|
2009-07-01 11:21:24 +02:00
|
|
|
# Always do the visibility check but don't set AM_CFLAGS on Windows.
|
|
|
|
# This way things get set properly even on Windows.
|
|
|
|
gl_VISIBILITY
|
|
|
|
if test -n "$CFLAG_VISIBILITY" && test "$is_w32" = no; then
|
|
|
|
AM_CFLAGS="$AM_CFLAGS $CFLAG_VISIBILITY"
|
|
|
|
fi
|
2007-12-08 23:42:33 +01:00
|
|
|
|
2009-07-01 11:21:24 +02:00
|
|
|
if test "$GCC" = yes ; then
|
2007-12-08 23:42:33 +01:00
|
|
|
# Enable as much warnings as possible. These commented warnings won't
|
2008-12-12 23:54:11 +01:00
|
|
|
# work for this package though:
|
2007-12-08 23:42:33 +01:00
|
|
|
# * -Wunreachable-code breaks several assert(0) cases, which are
|
|
|
|
# backed up with "return LZMA_PROG_ERROR".
|
|
|
|
# * -Wcast-qual would break various things where we need a non-const
|
|
|
|
# pointer although we don't modify anything through it.
|
|
|
|
# * -Wcast-align breaks optimized CRC32 and CRC64 implementation
|
|
|
|
# on some architectures (not on x86), where this warning is bogus,
|
|
|
|
# because we take care of correct alignment.
|
2007-12-10 14:02:50 +01:00
|
|
|
# * -Winline, -Wdisabled-optimization, -Wunsafe-loop-optimizations
|
|
|
|
# don't seem so useful here; at least the last one gives some
|
|
|
|
# warnings which are not bugs.
|
2008-01-05 18:42:04 +01:00
|
|
|
for NEW_FLAG in \
|
2009-02-09 13:54:31 +01:00
|
|
|
-Wall \
|
2008-01-05 18:42:04 +01:00
|
|
|
-Wextra \
|
2009-02-09 13:54:31 +01:00
|
|
|
-Wformat=2 \
|
|
|
|
-Winit-self \
|
|
|
|
-Wmissing-include-dirs \
|
|
|
|
-Wstrict-aliasing \
|
|
|
|
-Wfloat-equal \
|
|
|
|
-Wundef \
|
|
|
|
-Wshadow \
|
|
|
|
-Wpointer-arith \
|
|
|
|
-Wbad-function-cast \
|
|
|
|
-Wwrite-strings \
|
|
|
|
-Wlogical-op \
|
|
|
|
-Waggregate-return \
|
|
|
|
-Wstrict-prototypes \
|
|
|
|
-Wold-style-definition \
|
|
|
|
-Wmissing-prototypes \
|
|
|
|
-Wmissing-declarations \
|
|
|
|
-Wmissing-noreturn \
|
|
|
|
-Wredundant-decls
|
2007-12-08 23:42:33 +01:00
|
|
|
do
|
|
|
|
AC_MSG_CHECKING([if $CC accepts $NEW_FLAG])
|
|
|
|
OLD_CFLAGS="$CFLAGS"
|
2009-02-09 13:54:31 +01:00
|
|
|
CFLAGS="$CFLAGS $NEW_FLAG"
|
2007-12-08 23:42:33 +01:00
|
|
|
AC_COMPILE_IFELSE([void foo(void) { }], [
|
2009-02-09 13:54:31 +01:00
|
|
|
AM_CFLAGS="$AM_CFLAGS $NEW_FLAG"
|
2007-12-08 23:42:33 +01:00
|
|
|
AC_MSG_RESULT([yes])
|
|
|
|
], [
|
|
|
|
AC_MSG_RESULT([no])
|
|
|
|
])
|
2009-02-09 13:54:31 +01:00
|
|
|
CFLAGS="$OLD_CFLAGS"
|
2007-12-08 23:42:33 +01:00
|
|
|
done
|
|
|
|
|
|
|
|
AC_ARG_ENABLE([werror],
|
|
|
|
AC_HELP_STRING([--enable-werror], [Enable -Werror to abort
|
|
|
|
compilation on all compiler warnings.]),
|
|
|
|
[], [enable_werror=no])
|
|
|
|
if test "x$enable_werror" = "xyes"; then
|
2009-02-09 13:54:31 +01:00
|
|
|
AM_CFLAGS="$AM_CFLAGS -Werror"
|
2007-12-08 23:42:33 +01:00
|
|
|
fi
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
|
|
###############################################################################
|
|
|
|
# Create the makefiles and config.h
|
|
|
|
###############################################################################
|
|
|
|
|
|
|
|
echo
|
|
|
|
|
|
|
|
# Don't build the lib directory at all if we don't need any replacement
|
|
|
|
# functions.
|
|
|
|
AM_CONDITIONAL([COND_GNULIB], test -n "$LIBOBJS")
|
|
|
|
|
2009-02-09 13:54:31 +01:00
|
|
|
# Add default AM_CFLAGS.
|
|
|
|
AC_SUBST([AM_CFLAGS])
|
|
|
|
|
2009-08-13 14:00:21 +02:00
|
|
|
# Set additional flags for static/dynamic linking. The idea is that every
|
|
|
|
# program (not library) being built will use either STATIC_{CPPFLAGS,LDFLAGS}
|
|
|
|
# or DYNAMIC_{CPPFLAGS,LDFLAGS} depending on which type of linkage is
|
|
|
|
# preferred. These preferences get overriden by use of --disable-static,
|
|
|
|
# --disable-shared, or --enable-dynamic.
|
|
|
|
#
|
|
|
|
# This is quite messy, because we want to use LZMA_API_STATIC when linking
|
|
|
|
# against static liblzma. It's needed on Windows.
|
|
|
|
if test "x$enable_static" = xno; then
|
|
|
|
enable_dynamic=yes
|
|
|
|
fi
|
|
|
|
if test "x$enable_shared" = xno; then
|
|
|
|
enable_dynamic=no
|
|
|
|
fi
|
|
|
|
case $enable_dynamic in
|
|
|
|
yes)
|
|
|
|
STATIC_CPPFLAGS=
|
|
|
|
STATIC_LDFLAGS=
|
|
|
|
DYNAMIC_CPPFLAGS=
|
|
|
|
DYNAMIC_LDFLAGS=
|
|
|
|
;;
|
|
|
|
mixed)
|
|
|
|
STATIC_CPPFLAGS="-DLZMA_API_STATIC"
|
|
|
|
STATIC_LDFLAGS="-static"
|
|
|
|
DYNAMIC_CPPFLAGS=
|
|
|
|
DYNAMIC_LDFLAGS=
|
|
|
|
;;
|
|
|
|
no)
|
|
|
|
STATIC_CPPFLAGS="-DLZMA_API_STATIC"
|
|
|
|
STATIC_LDFLAGS="-static"
|
|
|
|
DYNAMIC_CPPFLAGS="-DLZMA_API_STATIC"
|
|
|
|
DYNAMIC_LDFLAGS="-static"
|
|
|
|
;;
|
|
|
|
esac
|
|
|
|
AC_SUBST([STATIC_CPPFLAGS])
|
|
|
|
AC_SUBST([STATIC_LDFLAGS])
|
|
|
|
AC_SUBST([DYNAMIC_CPPFLAGS])
|
|
|
|
AC_SUBST([DYNAMIC_LDFLAGS])
|
|
|
|
|
2009-07-05 21:25:17 +02:00
|
|
|
# This is needed for src/scripts.
|
|
|
|
xz=`echo xz | sed "$program_transform_name"`
|
|
|
|
AC_SUBST([xz])
|
|
|
|
|
2007-12-08 23:42:33 +01:00
|
|
|
AC_CONFIG_FILES([
|
|
|
|
Doxyfile
|
|
|
|
Makefile
|
|
|
|
po/Makefile.in
|
|
|
|
lib/Makefile
|
|
|
|
src/Makefile
|
2008-12-30 23:30:49 +01:00
|
|
|
src/liblzma/liblzma.pc
|
2007-12-08 23:42:33 +01:00
|
|
|
src/liblzma/Makefile
|
|
|
|
src/liblzma/api/Makefile
|
2008-11-19 22:52:24 +01:00
|
|
|
src/xz/Makefile
|
|
|
|
src/xzdec/Makefile
|
2009-08-13 11:55:45 +02:00
|
|
|
src/lzmainfo/Makefile
|
2007-12-08 23:42:33 +01:00
|
|
|
src/scripts/Makefile
|
2009-07-05 21:25:17 +02:00
|
|
|
src/scripts/xzdiff
|
|
|
|
src/scripts/xzgrep
|
|
|
|
src/scripts/xzmore
|
|
|
|
src/scripts/xzless
|
2007-12-08 23:42:33 +01:00
|
|
|
tests/Makefile
|
2008-01-18 19:18:08 +01:00
|
|
|
debug/Makefile
|
2007-12-08 23:42:33 +01:00
|
|
|
])
|
|
|
|
|
|
|
|
AC_OUTPUT
|
2009-11-20 11:51:19 +01:00
|
|
|
|
|
|
|
# Some warnings
|
|
|
|
if test x$tuklib_cv_physmem_method = xunknown; then
|
|
|
|
echo
|
|
|
|
echo "WARNING:"
|
|
|
|
echo "No supported method to detect the amount of RAM."
|
|
|
|
echo "Consider using --enable-assume-ram (if you didn't already)"
|
|
|
|
echo "or make a patch to add support for this operating system."
|
|
|
|
fi
|
|
|
|
|
|
|
|
# Not threading yet so don't warn.
|
|
|
|
#if test x$tuklib_cv_cpucores_method = xunknown; then
|
|
|
|
# echo
|
|
|
|
# echo "WARNING:"
|
|
|
|
# echo "No supported method to detect the number of CPU cores."
|
|
|
|
#fi
|