mkvtoolnix/configure.in
2005-02-26 13:15:49 +00:00

911 lines
25 KiB
Plaintext

AC_INIT(src/merge/mkvmerge.cpp)
AC_PREREQ(2.50)
AC_CONFIG_HEADERS(config.h:config.h.in)
PACKAGE="mkvtoolnix"
VERSION="1.4.0"
AC_SUBST(PACKAGE)
AC_SUBST(VERSION)
SAVED_CFLAGS="$CFLAGS"
AC_PROG_CC
CFLAGS="$SAVED_CFLAGS"
AC_PROG_CC_C_O
AC_PROG_CPP
SAVED_CXXFLAGS="$CXXFLAGS"
AC_PROG_CXX
CXXFLAGS="$SAVED_CXXFLAGS"
AC_PROG_MAKE_SET
AC_PROG_INSTALL
AC_CHECK_TOOL(RANLIB, ranlib, :)
AC_CHECK_TOOL(STRIP, strip, :)
AC_CHECK_TOOL(AR, ar, :)
AC_CHECK_TOOL(LD, ld, :)
dnl Check for headers
AC_HEADER_STDC()
AC_CHECK_HEADERS([inttypes.h stdint.h sys/types.h])
AC_CHECK_FUNCS(vsscanf,,)
dnl Optional features that are built and those that aren't
opt_features_yes=""
opt_features_no=""
dnl Stolen from VideoLAN Client, http://www.videolan.org/
dnl
dnl Endianness check, AC_C_BIGENDIAN doesn't work if we are cross-compiling
dnl
dnl We give the user the opportunity to specify
dnl --with-words=big or --with-words=little ; otherwise, try to guess
dnl
AC_ARG_WITH(words,
[ --with-words=endianness set endianness (big or little)])
case "${with_words}" in
big)
ac_cv_c_bigendian=yes
;;
little)
ac_cv_c_bigendian=no
;;
*)
dnl Try to guess endianness by matching patterns on a compiled
dnl binary, by looking for an ASCII or EBCDIC string
AC_CACHE_CHECK([whether the byte order is big-endian],
[ac_cv_c_bigendian],
[ac_cv_c_bigendian="unknown"
[cat >conftest.c <<EOF
short am[] = { 0x4249, 0x4765, 0x6e44, 0x6961, 0x6e53, 0x7953, 0 };
short ai[] = { 0x694c, 0x5454, 0x656c, 0x6e45, 0x6944, 0x6e61, 0 };
void _a(void) { char*s = (char*)am; s = (char *)ai; }
short ei[] = { 0x89D3, 0xe3e3, 0x8593, 0x95c5, 0x89c4, 0x9581, 0 };
short em[] = { 0xc2c9, 0xc785, 0x95c4, 0x8981, 0x95e2, 0xa8e2, 0 };
void _e(void) { char*s = (char*)em; s = (char*)ei; }
int main(void) { _a(); _e(); return 0; }
EOF
]
if test -f conftest.c
then
if ${CC-cc} -c conftest.c -o conftest.o >>config.log 2>&1 \
&& test -f conftest.o
then
if test "`strings conftest.o | grep BIGenDianSyS`"
then
ac_cv_c_bigendian="yes"
fi
if test "`strings conftest.o | grep LiTTleEnDian`"
then
ac_cv_c_bigendian="no"
fi
fi
fi
])
if test "${ac_cv_c_bigendian}" = "unknown"
then
AC_MSG_ERROR([Could not guess endianness, please use --with-words])
fi
;;
esac
dnl Now we know what to use for endianness, just put it in the header
if test "${ac_cv_c_bigendian}" = "yes"
then
AC_DEFINE(WORDS_BIGENDIAN, 1, big endian system)
fi
dnl
dnl Extra include and library dirs that someone would like to specify.
dnl
AC_ARG_WITH(extra-includes,
[ --with-extra-includes=DIR Path to other include directories separated by ';'],,
with_extra_include_given=no)
AC_ARG_WITH(extra-libs,
[ --with-extra-libs=DIR Path to other library directories separated by ';'],,
with_extra_libs_given=no)
EXTRA_CFLAGS=
USER_CFLAGS="$CFLAGS"
USER_CPPFLAGS="$CPPFLAGS"
USER_CXXFLAGS="$CXXFLAGS"
USER_LDFLAGS="$LDFLAGS"
if test "$with_extra_includes" != ""; then
DIRS=`echo $with_extra_includes | cut -d '=' -f 2 | sed 's,;, -I,g'`
EXTRA_CFLAGS="-I$DIRS"
CFLAGS="$CFLAGS -I$DIRS"
CXXFLAGS="$CXXFLAGS -I$DIRS"
CPPFLAGS="$CPPFLAGS -I$DIRS"
fi
EXTRA_LDFLAGS=
if test "$with_extra_libs" != ""; then
DIRS=`echo $with_extra_libs | cut -d '=' -f 2 | sed 's,;, -L,g'`
EXTRA_LDFLAGS="-L$DIRS"
LDFLAGS="$LDFLAGS -L$DIRS"
fi
AC_SUBST(EXTRA_CFLAGS)
AC_SUBST(EXTRA_LDFLAGS)
dnl
dnl Debugging and profiling options
dnl
AC_ARG_ENABLE([debug],
[ --enable-debug compile with debug information (no)])
if test x"$enable_debug" = x"yes"; then
dnl debug information
DEBUG_CFLAGS="-g -DDEBUG"
OPTIMIZATION_CFLAGS=""
else
DEBUG_CFLAGS=""
OPTIMIZATION_CFLAGS="-O3"
fi
AC_ARG_ENABLE([profiling],
[ --enable-profiling compile with profiling information (no)])
if test x"$enable_profiling" = x"yes"; then
dnl profiling information
PROFILING_CFLAGS="-pg"
PROFILING_LIBS="-pg"
else
PROFILING_CFLAGS=""
PROFILING_LIBS=""
fi
AC_SUBST(DEBUG_CFLAGS)
AC_SUBST(PROFILING_CFLAGS)
AC_SUBST(PROFILING_LIBS)
AC_SUBST(OPTIMIZATION_CFLAGS)
dnl
dnl Check the gcc version for the genreation of dependecy information
dnl
AC_CACHE_CHECK([gcc version],
[ac_cv_gcc_version],[
ac_cv_gcc_version="`$CXX -dumpversion`"
])
case "$ac_cv_gcc_version" in
2.*)
GCC_DEP_STYLE=v2
;;
3.*)
GCC_DEP_STYLE=v3
;;
*)
GCC_DEP_STYLE=v3
;;
esac
AC_SUBST(GCC_DEP_STYLE)
dnl
dnl Check for mingw
dnl
AC_CACHE_CHECK([if being compiled with mingw32],
[ac_cv_mingw32],[
if test "x`$CXX --version | grep -i mingw`" = "x" ; then
ac_cv_mingw32=no
else
ac_cv_mingw32=yes
fi])
if test "x$ac_cv_mingw32" = "xyes"; then
export MINGW=1
MINGW_GUIAPP=-mwindows
LIBMTXCOMMONDLL=1
else
LIBMTXCOMMONDLL=0
fi
AC_SUBST(MINGW)
AC_SUBST(MINGW_LIBS)
AC_SUBST(MINGW_GUIAPP)
AC_SUBST(LIBMTXCOMMONDLL)
dnl
dnl Test if the 64bit integer types are available, and if not if they
dnl can be typedef'ed manually.
dnl
AC_MSG_CHECKING(for int64_t)
AC_LANG_PUSH(C++)
AC_CACHE_VAL(ac_cv_has_int64_t,[
AC_TRY_COMPILE([
#if HAVE_INTTYPES_H
# include <inttypes.h>
#endif
#if HAVE_STDINT_H
# include <stdint.h>
#endif
#if HAVE_SYS_TYPES_H
# include <sys/types.h>
#endif
],
[int64_t foo;],
ac_cv_has_int64_t=yes,
ac_cv_has_int64_t=no)
])
AC_MSG_RESULT($ac_cv_has_int64_t)
AC_MSG_CHECKING(for uint64_t)
AC_CACHE_VAL(ac_cv_has_uint64_t,[
AC_TRY_COMPILE([
#if HAVE_INTTYPES_H
# include <inttypes.h>
#endif
#if HAVE_STDINT_H
# include <stdint.h>
#endif
#if HAVE_SYS_TYPES_H
# include <sys/types.h>
#endif
],
[int64_t foo;],
ac_cv_has_uint64_t=yes,
ac_cv_has_uint64_t=no)
])
AC_MSG_RESULT($ac_cv_has_uint64_t)
AC_LANG_POP
AC_CHECK_SIZEOF(int)
AC_CHECK_SIZEOF(long)
AC_CHECK_SIZEOF(long long)
if test x$ac_cv_has_int64_t = "xyes" ; then
TYPE64="int64_t"
else
case 8 in
$ac_cv_sizeof_int) TYPE64="int";;
$ac_cv_sizeof_long) TYPE64="long";;
$ac_cv_sizeof_long_long) TYPE64="long long";;
esac
AC_DEFINE(HAVE_NO_INT64_T, 1, [int64_t does not exist])
AC_DEFINE_UNQUOTED(INT64_TYPE, $TYPE64,
[the type to define int64_t manually])
fi
if test x$ac_cv_has_uint64_t = "xyes" ; then
TYPEU64="int64_t"
else
case 8 in
$ac_cv_sizeof_int) TYPEU64="unsigned int";;
$ac_cv_sizeof_long) TYPEU64="unsigned long";;
$ac_cv_sizeof_long_long) TYPEU64="unsigned long long";;
esac
AC_DEFINE(HAVE_NO_UINT64_T, 1, [uint64_t does not exist])
AC_DEFINE_UNQUOTED(UINT64_TYPE, $TYPEU64,
[the type to define uint64_t manually])
fi
if test -z "$TYPE64"; then
AC_MSG_ERROR(No 64 bit type found on this platform!)
fi
if test -z "$TYPEU64"; then
AC_MSG_ERROR(No unsigned 64 bit type found on this platform!)
fi
dnl
dnl Check for posix_fadvise and its definitions
dnl
AC_ARG_ENABLE(posix-fadvise,
[ --disable-posix-fadvise do not use posix_fadvise (auto)],,
[enable_posix_fadvise=yes])
if test x"$enable_posix_fadvise" != "xno" ; then
AC_CACHE_CHECK([for posix_fadvise], [ac_cv_posix_fadvise],[
ac_cv_posix_fadvise="no"
AC_LANG_PUSH(C++)
AC_TRY_COMPILE([
#include <fcntl.h>
],[
posix_fadvise(0, 0, 0, POSIX_FADV_WILLNEED);
posix_fadvise(0, 0, 0, POSIX_FADV_DONTNEED);
],[ac_cv_posix_fadvise="yes"])
AC_LANG_POP
])
if test x"$ac_cv_posix_fadvise" = "xyes" ; then
AC_DEFINE([HAVE_POSIX_FADVISE], 1, [define if posix_advise and its definitions are available])
fi
fi
dnl
dnl Test for libiconv
dnl
dnl This macros shamelessly stolen from
dnl http://gcc.gnu.org/ml/gcc-bugs/2001-06/msg01398.html.
dnl Written by Bruno Haible.
dnl
dnl Some systems have iconv in libc, some have it in libiconv (OSF/1 and
dnl those with the standalone portable GNU libiconv installed).
dnl
AC_CACHE_CHECK(for iconv, am_cv_func_iconv, [
am_cv_func_iconv="no, consider installing GNU libiconv"
am_cv_lib_iconv=no
AC_TRY_LINK([#include <stdlib.h>
#include <iconv.h>],
[iconv_t cd = iconv_open("","");
iconv(cd,NULL,NULL,NULL,NULL);
iconv_close(cd);],
am_cv_func_iconv=yes)
if test "$am_cv_func_iconv" != yes; then
am_save_LIBS="$LIBS"
LIBS="$LIBS -liconv"
AC_TRY_LINK([#include <stdlib.h>
#include <iconv.h>],
[iconv_t cd = iconv_open("","");
iconv(cd,NULL,NULL,NULL,NULL);
iconv_close(cd);],
am_cv_lib_iconv=yes
am_cv_func_iconv=yes)
LIBS="$am_save_LIBS"
fi
])
if test "$am_cv_func_iconv" = yes; then
AC_MSG_CHECKING([for iconv declaration])
AC_CACHE_VAL(am_cv_proto_iconv, [
AC_TRY_COMPILE([
#include <stdlib.h>
#include <iconv.h>
extern
#ifdef __cplusplus
"C"
#endif
#if defined(__STDC__) || defined(__cplusplus)
size_t iconv (iconv_t cd, char * *inbuf, size_t *inbytesleft, char * *outbuf, size_t *outbytesleft);
#else
size_t iconv();
#endif
], [], am_cv_proto_iconv_arg1="", am_cv_proto_iconv_arg1="const")
am_cv_proto_iconv="extern size_t iconv (iconv_t cd, $am_cv_proto_iconv_arg1 char * *inbuf, size_t *inbytesleft, char * *outbuf, size_t *outbytesleft);"])
am_cv_proto_iconv=`echo "[$]am_cv_proto_iconv" | tr -s ' ' | sed -e 's/( /(/'`
AC_MSG_RESULT([$]{ac_t:-
}[$]am_cv_proto_iconv)
AC_DEFINE_UNQUOTED(ICONV_CONST, $am_cv_proto_iconv_arg1,
[Define as const if the declaration of iconv() needs const.])
else
echo '*** The iconv library is needed but could not be found.'
echo '*** Please install it and re-run configure.'
exit 1
fi
ICONV_LIBS=
if test "$am_cv_lib_iconv" = yes; then
ICONV_LIBS="-liconv"
fi
AC_SUBST(ICONV_LIBS)
dnl
dnl Check for libogg
dnl
AC_CHECK_LIB(ogg, ogg_sync_init,
[ OGG_LIBS="-logg"
ogg_found=yes ],
[ ogg_found=no ],)
if test "$ogg_found" = "no"; then
AC_MSG_ERROR([Could not find the Ogg library])
fi
AC_CHECK_HEADERS(ogg/ogg.h, , ogg_found=no)
if test "$ogg_found" = "no"; then
AC_MSG_ERROR([Could not find the Ogg header files])
fi
AC_SUBST(OGG_LIBS)
dnl
dnl Check for libvorbis
dnl
AC_CHECK_LIB(vorbis, vorbis_synthesis_init,
[ VORBIS_LIBS="-lvorbis -lm"
vorbis_found=yes ],
[ vorbis_found=no ],
$OGG_LIBS -lm)
if test "$vorbis_found" = "no"; then
AC_MSG_ERROR([Could not find the Vorbis library])
fi
AC_CHECK_HEADERS(vorbis/codec.h, , vorbis_found=no)
if test "$vorbis_found" = "no"; then
AC_MSG_ERROR([Could not find the Vorbis header files])
fi
AC_SUBST(VORBIS_LIBS)
dnl
dnl Check for libFLAC
dnl
AC_CHECK_LIB(FLAC, FLAC__seekable_stream_decoder_new,
[ FLAC_LIBS="-lFLAC -lm"
flac_found=yes ],
[ flac_found=no ],
"-lm")
if test "$flac_found" = "yes"; then
AC_CHECK_MEMBER(FLAC__StreamMetadata_StreamInfo.sample_rate, ,
[ flac_found=no ],
[ #include <FLAC/format.h>
])
fi
if test x"$flac_found" = xyes ; then
AC_CHECK_LIB(FLAC, FLAC__seekable_stream_decoder_skip_single_frame,
[ flac_decoder_skip_found=yes ],
[ flac_decoder_skip_found=no ],
$FLAC_LIBS)
if test x"$flac_decoder_skip_found" = xyes; then
opt_features_yes="$opt_features_yes; FLAC audio (1.1.1 or newer)"
AC_DEFINE(HAVE_FLAC_DECODER_SKIP, [1], [Define if FLAC__stream_decoder_skip_single_frame exists])
else
opt_features_yes="$opt_features_yes; FLAC audio (1.1.0 or older)"
fi
AC_DEFINE(HAVE_FLAC_FORMAT_H, [1], [Define if the FLAC headers are present])
else
FLAC_LIBS=""
opt_features_no="$opt_features_no; FLAC audio"
fi
AC_SUBST(FLAC_LIBS)
dnl
dnl Test for libebml, and define EBML_CFLAGS and EBML_LIBS
dnl
ebml_ver_req_major=0
ebml_ver_req_minor=7
ebml_ver_req_micro=3
AC_CACHE_CHECK([for libebml version >= ${ebml_ver_req_major}.${ebml_ver_req_minor}.${ebml_ver_req_micro}],
[ac_cv_ebml_found],[
EBML_LIBS="-lebml"
ac_save_CXXFLAGS="$CXXFLAGS"
ac_save_LIBS="$LIBS"
LIBS="$LIBS $EBML_LIBS"
AC_LANG_PUSH(C++)
AC_TRY_COMPILE([
#include <ebml/EbmlVersion.h>
#include <ebml/EbmlDummy.h>
using namespace libebml;
#if LIBEBML_VERSION < ((${ebml_ver_req_major} << 16) + (${ebml_ver_req_minor} << 8) + ${ebml_ver_req_micro})
# error libebml is too old
#endif
],
[],
ac_cv_ebml_found=yes,
ac_cv_ebml_found=no)
if test "${ac_cv_ebml_found}" = "no" ; then
EBML_CFLAGS="-I/usr/local/include"
EBML_LIBS="-L/usr/local/lib $EBML_LIBS"
CXXFLAGS="-I/usr/local/include $CXXFLAGS"
LIBS="-L/usr/local/lib $LIBS"
AC_TRY_COMPILE([
#include <ebml/EbmlVersion.h>
#include <ebml/EbmlDummy.h>
using namespace libebml;
#if LIBEBML_VERSION < ((${ebml_ver_req_major} << 16) + (${ebml_ver_req_minor} << 8) + ${ebml_ver_req_micro})
# error libebml is too old
#endif
],
[],
ac_cv_ebml_found=yes,
ac_cv_ebml_found=no)
fi
AC_LANG_POP
CXXFLAGS="$ac_save_CXXFLAGS"
LIBS="$ac_save_LIBS"
])
if test x"${ac_cv_ebml_found}" != "xyes" ; then
echo '*** Your Ebml version is too old. Upgrade to at least version'
echo '*** '${ebml_ver_req_major}.${ebml_ver_req_minor}.${ebml_ver_req_micro}' and re-run configure.'
exit 1
fi
dnl
dnl Test if libebml has to be compiled with -DEBML_DLL on Windows.
dnl
AC_CACHE_CHECK([if linking against libebml requires -DEBML_DLL],
[ac_cv_ebml_dll],[
AC_LANG_PUSH(C++)
ac_save_CXXFLAGS="$CXXFLAGS"
ac_save_LIBS="$LIBS"
CXXFLAGS="$CXXFLAGS $EBML_CFLAGS"
LIBS="$LIBS $EBML_LIBS"
AC_TRY_LINK([
#include <ebml/EbmlVersion.h>
#include <ebml/EbmlDummy.h>
using namespace libebml;
],
[EbmlDummy d;],
ac_cv_ebml_dll=no,
ac_cv_ebml_dll="not found")
if test x"${ac_cv_mingw32}" = "xyes" ; then
if test x"${ac_cv_ebml_dll}" != "xno" ; then
CXXFLAGS="$CXXFLAGS -DEBML_DLL"
AC_TRY_LINK([
#include <ebml/EbmlVersion.h>
#include <ebml/EbmlDummy.h>
using namespace libebml;
],
[EbmlDummy d;],
ac_cv_ebml_dll=yes)
fi
fi
AC_LANG_POP
CXXFLAGS="${ac_save_CXXFLAGS}"
LIBS="${ac_save_LIBS}"
])
if test x"${ac_cv_ebml_dll}" != "xyes" -a x"${ac_cv_ebml_dll}" != "xno" ; then
echo '*** libebml was not found.'
exit 1
fi
if test x"${ac_cv_ebml_dll}" = "xyes" ; then
EBML_CFLAGS="$EBML_CFLAGS -DEBML_DLL"
fi
AC_SUBST(EBML_CFLAGS)
AC_SUBST(EBML_LIBS)
dnl
dnl Test for libmatroska, and define MATROSKA_CFLAGS and MATROSKA_LIBS
dnl
kax_ver_req_major=0
kax_ver_req_minor=7
kax_ver_req_micro=5
AC_CACHE_CHECK([for libmatroska version >= ${kax_ver_req_major}.${kax_ver_req_minor}.${kax_ver_req_micro}],
[ac_cv_matroska_found],
[
MATROSKA_LIBS="-lmatroska"
ac_save_CXXFLAGS="$CXXFLAGS"
ac_save_LIBS="$LIBS"
CXXFLAGS="$CFLAGS $MATROSKA_CFLAGS"
LIBS="$LIBS $MATROSKA_LIBS $EBML_LIBS"
rm -f conf.matroskatest
AC_LANG_PUSH(C++)
AC_TRY_COMPILE([
#include <ebml/EbmlConfig.h>
#include <matroska/KaxVersion.h>
#include <matroska/KaxTracks.h>
using namespace libmatroska;
#if LIBMATROSKA_VERSION < ((${kax_ver_req_major} << 16) + (${kax_ver_req_minor} << 8) + ${kax_ver_req_micro})
# error libmatroska is too old
#endif
],
[],
ac_cv_matroska_found=yes,
ac_cv_matroska_found=no)
if test x"${ac_cv_matroska_found}" != "xyes" ; then
MATROSKA_CFLAGS="-I/usr/local/include"
MATROSKA_LIBS="-L/usr/local/lib $MATROSKA_LIBS"
CXXFLAGS="-I/usr/local/include $CXXFLAGS"
LIBS="-L/usr/local/lib $LIBS"
AC_TRY_COMPILE([
#include <ebml/EbmlConfig.h>
#include <matroska/KaxVersion.h>
#include <matroska/KaxTracks.h>
using namespace libmatroska;
#if LIBMATROSKA_VERSION < ((${kax_ver_req_major} << 16) + (${kax_ver_req_minor} << 8) + ${kax_ver_req_micro})
# error libmatroska is too old
#endif
],
[],
ac_cv_matroska_found=yes,
ac_cv_matroska_found=no)
fi
AC_LANG_POP
CXXFLAGS="$ac_save_CXXFLAGS"
LIBS="$ac_save_LIBS"
])
if test x"${ac_cv_matroska_found}" != "xyes" ; then
echo '*** Your Matroska version is too old. Upgrade to at least version'
echo '*** '${kax_ver_req_major}.${kax_ver_req_minor}.${kax_ver_req_micro}' and re-run configure.'
exit 1
fi
AC_CACHE_CHECK([if linking against libmatroska requires -DMATROSKA_DLL],
[ac_cv_matroska_dll],[
AC_LANG_PUSH(C++)
ac_save_CXXFLAGS="$CXXFLAGS"
ac_save_LIBS="$LIBS"
CXXFLAGS="$CXXFLAGS $EBML_CFLAGS $MATROSKA_CFLAGS"
LIBS="$LIBS $MATROSKA_LIBS $EBML_LIBS"
AC_TRY_LINK([
#include <matroska/KaxVersion.h>
#include <matroska/KaxSegment.h>
using namespace libmatroska;
],
[KaxSegment s;],
ac_cv_matroska_dll=no,
ac_cv_matroska_dll="not found")
if test x"${ac_cv_mingw32}" = "xyes" ; then
if test x"${ac_cv_matroska_dll}" != "xno" ; then
CXXFLAGS="$CXXFLAGS -DMATROSKA_DLL"
AC_TRY_LINK([
#include <matroska/KaxVersion.h>
#include <matroska/KaxSegment.h>
using namespace libmatroska;
],
[KaxSegment s;],
ac_cv_matroska_dll=yes)
fi
fi
AC_LANG_POP
CXXFLAGS="${ac_save_CXXFLAGS}"
LIBS="${ac_save_LIBS}"
])
if test x"${ac_cv_matroska_dll}" != "xyes" -a x"${ac_cv_matroska_dll}" != "xno" ; then
echo '*** libmatroska was not found.'
exit 1
fi
if test x"${ac_cv_matroska_dll}" = "xyes" ; then
MATROSKA_CFLAGS="$MATROSKA_CFLAGS -DMATROSKA_DLL"
fi
if test x"${ac_cv_ebml_dll}" != "xyes" -o x"${ac_cv_matroska_dll}" != "xyes" ; then
LIBMTXCOMMONDLL=0
fi
AC_SUBST(MATROSKA_CFLAGS)
AC_SUBST(MATROSKA_LIBS)
dnl
dnl Check for libexpat
dnl
AC_CHECK_LIB(expat, XML_ParserCreate,
[ EXPAT_LIBS="-lexpat"
expat_found=yes ],
[ expat_found=no ],)
if test "$expat_found" = "no"; then
AC_MSG_ERROR([Could not find the Expat library])
fi
AC_CHECK_HEADERS(expat.h, , expat_found=no)
if test "$expat_found" = "no"; then
AC_MSG_ERROR([Could not find expat.h])
fi
AC_SUBST(EXPAT_CFLAGS)
AC_SUBST(EXPAT_LIBS)
dnl
dnl Check for zlib
dnl
AC_CHECK_LIB(z, zlibVersion,
[ ZLIB_LIBS="-lz"
zlib_found=yes ],
[ zlib_found=no ],)
if test "$zlib_found" = "no"; then
AC_MSG_ERROR([Could not find the zlib library])
fi
AC_CHECK_HEADERS(zlib.h, , zlib_found=no)
AC_SUBST(ZLIB_LIBS)
dnl
dnl Check for liblzo
dnl
AC_ARG_ENABLE([lzo],
[ --enable-lzo compile in support for LZO compression (auto)])
if test x"$enable_lzo" = x"yes" -o x"$enable_lzo" = "x"; then
AC_CHECK_LIB(lzo, lzo1x_1_compress,
[ LZO_LIBS="-llzo"
lzo_found=yes ],
[ lzo_found=no ],)
if test "$lzo_found" = "yes"; then
AC_CHECK_HEADERS(lzo1x.h, , lzo_found=no)
fi
fi
if test x"$lzo_found" = xyes ; then
opt_features_yes="$opt_features_yes; LZO compression"
else
opt_features_no="$opt_features_no; LZO compression"
fi
AC_SUBST(LZO_LIBS)
dnl
dnl Check for libbz2
dnl
AC_ARG_ENABLE([bz2],
[ --enable-bz2 compile in support for BZ2 compression (auto)])
if test x"$enable_bz2" = x"yes" -o x"$enable_bz2" = "x"; then
AC_CHECK_LIB(bz2, BZ2_bzCompress,
[ BZ2_LIBS="-lbz2"
bz2_found=yes ],
[ bz2_found=no ],)
if test "$bz2_found" = "yes"; then
AC_CHECK_HEADERS(bzlib.h, , bz2_found=no)
fi
fi
if test x"$bz2_found" = xyes ; then
opt_features_yes="$opt_features_yes; BZ2 compression"
else
opt_features_no="$opt_features_no; BZ2 compression"
fi
AC_SUBST(BZ2_LIBS)
dnl
dnl Check for wxWindows
dnl
AC_ARG_ENABLE([gui],
[ --enable-gui compile mkvinfo's GUI and mmg (yes)])
AC_MSG_CHECKING(for wxWidgets)
if test x"$enable_gui" = x"yes" -o x"$enable_gui" = "x"; then
if wx-config --cxxflags > /dev/null 2>&1; then
wxwversion=`wx-config --version`
wxw_ver_req_major=2
wxw_ver_req_minor=4
wxw_ver_req_micro=0
set - `echo $wxwversion | sed 's/\./\ /g'`
if test "x$1" = "x" -o $1 -lt ${wxw_ver_req_major} ; then
wxwver_ok=0
elif test $1 -gt ${wxw_ver_req_major} ; then
wxwver_ok=1
else
if test "x$2" = "x" -o $2 -lt ${wxw_ver_req_minor} ; then
wxwver_ok=0
elif test $2 -gt ${wxw_ver_req_minor} ; then
wxwver_ok=1
else
if test "x$3" = "x" -o $3 -lt ${wxw_ver_req_micro} ; then
wxwver_ok=0
else
wxwver_ok=1
fi
fi
fi
if test "$wxwver_ok" = "1" ; then
WXWINDOWS_CFLAGS=`wx-config --cxxflags`
WXWINDOWS_LIBS=`wx-config --libs`
AC_CACHE_VAL(am_cv_wx_compilation, [
AC_LANG_PUSH(C++)
ac_save_CXXFLAGS="$CXXFLAGS"
ac_save_LIBS="$LIBS"
CXXFLAGS="$CXXFLAGS $WXWINDOWS_CFLAGS"
LIBS="$LDFLAGS $WXWINDOWS_LIBS"
AC_TRY_LINK([
#include <wx/dnd.h>
#include <wx/treectrl.h>
], [
wxDragResult result = wxDragError;
wxTreeItemId id;
], [ am_cv_wx_compilation=1 ], [ am_cv_wx_compilation=0 ])
AC_LANG_POP()
CXXFLAGS="$ac_save_CXXFLAGS"
LIBS="$ac_save_LIBS"
])
if test x"$am_cv_wx_compilation" = x1; then
if test "x$MINGW" = "x1" ; then
WXWINDOWS_INCLUDES=""
set - `echo $WXWINDOWS_CFLAGS`
while test "x$1" != "x" ; do
case "$1" in
-I*)
WXWINDOWS_INCLUDES="$WXWINDOWS_INCLUDES $1"
;;
esac
shift
done
fi
AC_DEFINE(HAVE_WXWINDOWS, 1, [Define if wxWindows is present])
MMG_SUBDIRS=mmg
AC_MSG_RESULT($wxwversion ok)
have_wxwindows=yes
USE_WXWINDOWS=yes
opt_features_yes="$opt_features_yes; GUIs"
else
AC_MSG_RESULT(no: test program could not be compiled)
fi
else
AC_MSG_RESULT(no: version $wxwversion is too old)
fi
else
AC_MSG_RESULT(no: wx-config was not found)
fi
else
AC_MSG_RESULT(no: disabled by user request)
fi
if test x"$have_wxwindows" != "xyes" ; then
opt_features_no="$opt_features_no; GUIs"
fi
AC_SUBST(WXWINDOWS_CFLAGS)
AC_SUBST(WXWINDOWS_INCLUDES)
AC_SUBST(WXWINDOWS_LIBS)
AC_SUBST(MMG_SUBDIRS)
AC_SUBST(USE_WXWINDOWS)
dnl
dnl Which translations should be installed?
dnl
dnl AC_CHECK_FUNCS(gettext, gettext_found=yes, gettext_found=no)
dnl if test x"$gettext_found" != xyes ; then
dnl AC_CHECK_LIB(intl, gettext,
dnl [ LIBINTL_LIBS="-lintl";
dnl gettext_found=yes ], gettext_found=no)
dnl fi
dnl if test x"$gettext_found" = xyes ; then
dnl AC_CHECK_HEADERS(libintl.h, libintl_h_found=yes, libintl_h_found=no)
dnl if test x"$libintl_h_found" = xyes ; then
dnl AC_MSG_CHECKING(the translations to install)
dnl if test x"$LINGUAS" = x ; then
dnl TRANSLATIONS_POS="`echo po/*.po`"
dnl else
dnl for i in $LINGUAS; do
dnl if test -f "po/$i.po" ; then
dnl TRANSLATIONS_POS="$TRANSLATIONS_POS po/$i.po"
dnl fi
dnl done
dnl fi
dnl TRANSLATIONS="`echo "$TRANSLATIONS_POS" | \
dnl sed -e 's/po\///g' -e 's/\.po//g'`"
dnl AC_MSG_RESULT($TRANSLATIONS)
dnl fi
dnl opt_features_yes="$opt_features_yes; translations (gettext)"
dnl else
dnl opt_features_no="$opt_features_yes; translations (gettext)"
dnl fi
AC_SUBST(LIBINTL_LIBS)
AC_SUBST(TRANSLATIONS_POS)
AC_SUBST(TRANSLATIONS)
CFLAGS="$USER_CPPFLAGS @EXTRA_CFLAGS@ @OPTIMIZATION_CFLAGS@ $USER_CFLAGS -Wall -Wno-sign-compare -Wno-comment -D_LARGEFILE64_SOURCE -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 @EXTRA_CFLAGS@ @DEBUG_CFLAGS@ @PROFILING_CFLAGS@ @MATROSKA_CFLAGS@ @EBML_CFLAGS@"
CXXFLAGS="$USER_CPPFLAGS @EXTRA_CFLAGS@ @OPTIMIZATION_CFLAGS@ $USER_CXXFLAGS -Wall -Wno-sign-compare -Wno-comment -D_LARGEFILE64_SOURCE -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 @EXTRA_CFLAGS@ @DEBUG_CFLAGS@ @PROFILING_CFLAGS@ @MATROSKA_CFLAGS@ @EBML_CFLAGS@ @WXWINDOWS_CFLAGS@"
LDFLAGS="$USER_LDFLAGS @EXTRA_LDFLAGS@ @PROFILING_LIBS@"
AC_SUBST(LDFLAGS)
AC_OUTPUT(Makefile avilib-0.6.10/Makefile librmff/Makefile src/Makefile src/common/Makefile src/input/Makefile src/output/Makefile src/mpegparser/Makefile src/mmg/Makefile src/extract/Makefile src/merge/Makefile src/info/Makefile)
opt_features_yes="`echo "$opt_features_yes" | sed 's/^\;//'`"
opt_features_no="`echo "$opt_features_no" | sed 's/^\;//'`"
echo ''
echo '*** The mkvtoolnix configuration is complete.'
echo '*** Optional features that are built: '"$opt_features_yes"
echo '*** Optional features that are NOT built: '"$opt_features_no"