mkvtoolnix/configure.in

879 lines
24 KiB
Plaintext

dnl process this file with autoconf to generate the configure script
AC_INIT(src/mkvmerge.cpp)
AC_PREREQ(2.50)
AM_INIT_AUTOMAKE(mkvtoolnix,0.7.2)
AM_CONFIG_HEADER(config.h)
AC_PROG_CC
AC_PROG_CC_C_O
AC_PROG_CPP
AC_PROG_CXX
AC_PROG_MAKE_SET
dnl Find the right ranlib, even when cross-compiling
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()
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],,
with_extra_include_given=no)
AC_ARG_WITH(extra-libs,
[ --with-extra-libs=DIR Path to other library directories],,
with_extra_libs_given=no)
EXTRA_CFLAGS=
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])
if test x"$enable_debug" = x"yes"; then
dnl debug information
DEBUG_CFLAGS="-g -DDEBUG"
else
DEBUG_CFLAGS=""
fi
AC_ARG_ENABLE([profiling],
[ --enable-profiling compile with profiling information])
if test x"$enable_profiling" = x"yes"; then
dnl profiling information
PROFILING_CFLAGS="-pg"
PROFILING_LIBS=""
else
PROFILING_CFLAGS=""
PROFILING_LIBS=""
fi
AC_SUBST(DEBUG_CFLAGS)
AC_SUBST(PROFILING_CFLAGS)
AC_SUBST(PROFILING_LIBS)
dnl
dnl Check for mingw
dnl
AC_CACHE_CHECK([if being compiled with mingw32],
[ac_cv_mingw32],[
if test "x`gcc --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
fi
AC_SUBST(MINGW_LIBS)
AC_SUBST(MINGW_GUIAPP)
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_ARG_WITH([libiconv-prefix],
[ --with-libiconv-prefix=DIR search for libiconv in DIR/include and DIR/lib],[
for dir in `echo "$withval" | tr : ' '`; do
if test -d $dir/include; then CPPFLAGS="$CPPFLAGS -I$dir/include"; fi
if test -d $dir/lib; then LDFLAGS="$LDFLAGS -L$dir/lib"; fi
done
])
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)
dnl AC_DEFINE_UNQUOTED(ICONV_CONST, $am_cv_proto_iconv_arg1,
dnl [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_ARG_WITH(ogg-prefix,
[ --with-ogg-prefix=PFX Prefix where libogg is installed],
ogg_prefix="$withval", ogg_prefix="")
AC_ARG_WITH(ogg-includes,
[ --with-ogg-includes=DIR Directory where libogg headers are installed],
ogg_includes="$withval", ogg_includes="")
AC_ARG_WITH(ogg-libraries,
[ --with-ogg-libraries=DIR Directory where libogg is installed],
ogg_libraries="$withval", ogg_libraries="")
if test "x$ogg_prefix" != "x"; then
OGG_CFLAGS="-I$ogg_prefix/include"
OGG_LIBS="-L$ogg_prefix/lib"
else
if test "x$ogg_includes" != "x"; then
OGG_CFLAGS="-I$ogg_includes"
elif test "x$prefix" != "xNONE"; then
OGG_CFLAGS="-I$prefix"
fi
if test "x$ogg_libraries" != "x"; then
OGG_LIBS="-L$ogg_libraries"
elif test "x$prefix" != "xNONE"; then
OGG_LIBS="-L$prefix"
fi
fi
AC_CHECK_LIB(ogg, ogg_sync_init,
[ OGG_LIBS="$OGG_LIBS -logg"
ogg_found=yes ],
[ ogg_found=no ],
"$OGG_LIBS")
if test "$ogg_found" = "no"; then
AC_MSG_ERROR([Could not find the Ogg library])
fi
ogg_save_CFLAGS="$CFLAGS"
CFLAGS="$CFLAGS $OGG_CFLAGS"
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
CFLAGS="$ogg_save_CFLAGS"
AC_SUBST(OGG_CFLAGS)
AC_SUBST(OGG_LIBS)
dnl
dnl Check for libvorbis
dnl
AC_ARG_WITH(vorbis-prefix,
[ --with-vorbis-prefix=PFX Prefix where libvorbis is installed],
vorbis_prefix="$withval", vorbis_prefix="")
AC_ARG_WITH(vorbis-includes,
[ --with-vorbis-includes=DIR Directory where libvorbis headers are installed],
vorbis_includes="$withval", vorbis_includes="")
AC_ARG_WITH(vorbis-libraries,
[ --with-vorbis-libraries=DIR Directory where libvorbis is installed],
vorbis_libraries="$withval", vorbis_libraries="")
if test "x$vorbis_prefix" != "x"; then
VORBIS_CFLAGS="-I$vorbis_prefix/include"
VORBIS_LIBS="-L$vorbis_prefix/lib"
else
if test "x$vorbis_includes" != "x"; then
VORBIS_CFLAGS="-I$vorbis_includes"
elif test "x$prefix" != "xNONE"; then
VORBIS_CFLAGS="-I$prefix"
fi
if test "x$vorbis_libraries" != "x"; then
VORBIS_LIBS="-L$vorbis_libraries"
elif test "x$prefix" != "xNONE"; then
VORBIS_LIBS="-L$prefix"
fi
fi
AC_CHECK_LIB(vorbis, vorbis_synthesis_init,
[ VORBIS_LIBS="$VORBIS_LIBS -lvorbis -lm"
vorbis_found=yes ],
[ vorbis_found=no ],
$VORBIS_LIBS $OGG_LIBS)
if test "$vorbis_found" = "no"; then
AC_MSG_ERROR([Could not find the Vorbis library])
fi
vorbis_save_CFLAGS="$CFLAGS"
CFLAGS="$CFLAGS $VORBIS_CFLAGS"
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
CFLAGS="$vorbis_save_CFLAGS"
AC_SUBST(VORBIS_CFLAGS)
AC_SUBST(VORBIS_LIBS)
dnl
dnl Test for libebml, and define EBML_CFLAGS and EBML_LIBS
dnl
AC_ARG_WITH(ebml-prefix,
[ --with-ebml-prefix=PFX Prefix where libebml is installed],
ebml_prefix="$withval", ebml_prefix="")
AC_ARG_WITH(ebml-include,
[ --with-ebml-include=DIR Path to where the libebml include files are installed],
ebml_include="$withval", ebml_include="")
AC_ARG_WITH(ebml-lib,
[ --with-ebml-lib=DIR Path to where libebml is installed],
ebml_lib="$withval", ebml_lib="")
AC_ARG_ENABLE(ebmltest,
[ --disable-ebmltest Do not try to compile and run a test EBML program],,
enable_ebmltest=yes)
if test "x$ebml_prefix" != "x"; then
ebml_args="$ebml_args --prefix=$ebml_prefix"
if test "x$ebml_include" != "x"; then
EBML_CFLAGS="-I$ebml_include"
else
EBML_CFLAGS="-I$ebml_prefix/include"
fi
if test "x$ebml_lib" != "x"; then
EBML_LIBS="-L$ebml_lib"
else
EBML_LIBS="-L$ebml_prefix/lib"
fi
elif test "x$prefix" != "xNONE"; then
ebml_args="$ebml_args --prefix=$prefix"
if test "x$ebml_include" != "x"; then
EBML_CFLAGS="-I$ebml_include"
else
EBML_CFLAGS="-I$prefix/include"
fi
if test "x$ebml_lib" != "x"; then
EBML_LIBS="-L$ebml_lib"
else
EBML_LIBS="-L$prefix/lib"
fi
else
if test "x$ebml_include" != "x"; then
EBML_CFLAGS="-I$ebml_include"
fi
if test "x$ebml_lib" != "x"; then
EBML_LIBS="-L$ebml_lib"
else
EBML_LIBS="-L/usr/local/lib"
fi
fi
EBML_LIBS="$EBML_LIBS -lebml"
AC_MSG_CHECKING(for EBML)
no_ebml=""
if test "x$enable_ebmltest" = "xyes" ; then
ac_save_CXXFLAGS="$CXXFLAGS"
ac_save_LIBS="$LIBS"
CXXFLAGS="$CFLAGS $EBML_CFLAGS"
LIBS="$LIBS $EBML_LIBS"
dnl
dnl Now check if the installed EBML is sufficiently new.
dnl
rm -f conf.ebmltest
AC_LANG_PUSH(C++)
AC_TRY_RUN([
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <ebml/EbmlVersion.h>
using namespace libebml;
int main ()
{
FILE *f;
f = fopen("conf.ebmltest", "wb");
if (f == NULL)
return 1;
fprintf(f, "%s\n", EbmlCodeVersion.c_str());
fclose(f);
return 0;
}
],, no_ebml=yes,[echo $ac_n "cross compiling; assumed OK... $ac_c"])
AC_LANG_POP
CXXFLAGS="$ac_save_CXXFLAGS"
LIBS="$ac_save_LIBS"
fi
if test "x$no_ebml" = "x" -a -f conf.ebmltest ; then
AC_MSG_RESULT(yes)
else
AC_MSG_RESULT(no)
exit 1
fi
ebml_ver_req_major=0
ebml_ver_req_minor=6
ebml_ver_req_micro=2
AC_MSG_CHECKING(Ebml version >= ${ebml_ver_req_major}.${ebml_ver_req_minor}.${ebml_ver_req_micro})
ebml_version=`cat conf.ebmltest`
set - `sed 's/\./\ /g' < conf.ebmltest`
if test "x$1" = "x" -o $1 -lt ${ebml_ver_req_major} ; then
mver_ok=0
elif test $1 -gt ${ebml_ver_req_major} ; then
mver_ok=1
else
if test "x$2" = "x" -o $2 -lt ${ebml_ver_req_minor} ; then
mver_ok=0
elif test $2 -gt ${ebml_ver_req_minor} ; then
mver_ok=1
else
if test "x$3" = "x" -o $3 -lt ${ebml_ver_req_micro} ; then
mver_ok=0
else
mver_ok=1
fi
fi
fi
if test "$mver_ok" = "1" ; then
AC_MSG_RESULT(ok ($ebml_version))
else
AC_MSG_RESULT(too old ($ebml_version))
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
rm -f conf.ebmltest
AC_SUBST(EBML_CFLAGS)
AC_SUBST(EBML_LIBS)
dnl
dnl Test for libmatroska, and define MATROSKA_CFLAGS and MATROSKA_LIBS
dnl
AC_ARG_WITH(matroska-prefix,
[ --with-matroska-prefix=PFX Prefix where libmatroska is installed],
matroska_prefix="$withval", matroska_prefix="")
AC_ARG_WITH(matroska-include,
[ --with-matroska-include=DIR Path to where the libmatroska include files installed],
matroska_include="$withval", matroska_include="")
AC_ARG_WITH(matroska-lib,
[ --with-matroska-lib=DIR Path to where the libmatroska library installed],
matroska_lib="$withval", matroska_lib="")
AC_ARG_ENABLE(matroskatest,
[ --disable-matroskatest Do not try to compile and run a test Matroska program],,
enable_matroskatest=yes)
if test "x$matroska_prefix" != "x"; then
matroska_args="$matroska_args --prefix=$matroska_prefix"
if test "x$matroska_include" != "x"; then
MATROSKA_CFLAGS="-I$matroska_include"
else
MATROSKA_CFLAGS="-I$matroska_prefix/include"
fi
if test "x$matroska_lib" != "x"; then
MATROSKA_LIBS="-L$matroska_lib"
else
MATROSKA_LIBS="-L$matroska_prefix/lib"
fi
elif test "x$prefix" != "xNONE"; then
matroska_args="$matroska_args --prefix=$prefix"
if test "x$matroska_include" != "x"; then
MATROSKA_CFLAGS="-I$matroska_include"
else
MATROSKA_CFLAGS="-I$prefix/include"
fi
if test "x$matroska_lib" != "x"; then
MATROSKA_LIBS="-L$matroska_lib"
else
MATROSKA_LIBS="-L$prefix/lib"
fi
else
if test "x$matroska_include" != "x"; then
MATROSKA_CFLAGS="-I$matroska_include"
fi
if test "x$matroska_lib" != "x"; then
MATROSKA_LIBS="-L$matroska_lib"
else
MATROSKA_LIBS="-L/usr/local/lib"
fi
fi
MATROSKA_LIBS="$MATROSKA_LIBS -lmatroska"
AC_MSG_CHECKING(for Matroska)
no_matroska=""
if test "x$enable_matroskatest" = "xyes" ; then
ac_save_CXXFLAGS="$CXXFLAGS"
ac_save_LIBS="$LIBS"
CXXFLAGS="$CXXFLAGS $MATROSKA_CFLAGS $EBML_CFLAGS"
LIBS="$LIBS $MATROSKA_LIBS $EBML_LIBS"
dnl
dnl Now check if the installed Matroska is sufficiently new.
dnl
rm -f conf.matroskatest
AC_LANG_PUSH(C++)
AC_TRY_RUN([
#include <stdio.h>
#include <stdlib.h>
#include <ebml/EbmlConfig.h>
#include <matroska/KaxVersion.h>
using namespace LIBMATROSKA_NAMESPACE;
int main ()
{
FILE *f;
f = fopen("conf.matroskatest", "wb");
if (f == NULL)
return 1;
fprintf(f, "%s\n", KaxCodeVersion.c_str());
fclose(f);
return 0;
}
],, no_matroska=yes,[echo $ac_n "cross compiling; assumed OK... $ac_c"])
AC_LANG_POP
CXXFLAGS="$ac_save_CXXFLAGS"
LIBS="$ac_save_LIBS"
fi
if test "x$no_matroska" = "x" -a -f conf.matroskatest ; then
AC_MSG_RESULT(yes)
else
AC_MSG_RESULT(no)
exit 1
fi
kax_ver_req_major=0
kax_ver_req_minor=6
kax_ver_req_micro=1
AC_MSG_CHECKING(Matroska version >= ${kax_ver_req_major}.${kax_ver_req_minor}.${kax_ver_req_micro})
matroska_version=`cat conf.matroskatest`
set - `sed 's/\./\ /g' < conf.matroskatest`
if test "x$1" = "x" -o $1 -lt ${kax_ver_req_major} ; then
mver_ok=0
elif test $1 -gt ${kax_ver_req_major} ; then
mver_ok=1
else
if test "x$2" = "x" -o $2 -lt ${kax_ver_req_minor} ; then
mver_ok=0
elif test $2 -gt ${kax_ver_req_minor} ; then
mver_ok=1
else
if test "x$3" = "x" -o $3 -lt ${kax_ver_req_micro} ; then
mver_ok=0
else
mver_ok=1
fi
fi
fi
if test "$mver_ok" = "1" ; then
AC_MSG_RESULT(ok ($matroska_version))
else
AC_MSG_RESULT(too old ($matroska_version))
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
rm -f conf.matroskatest
AC_SUBST(MATROSKA_CFLAGS)
AC_SUBST(MATROSKA_LIBS)
dnl
dnl Check for libexpat
dnl
AC_ARG_WITH(expat-prefix,
[ --with-expat-prefix=PFX Path to where the Expat library is installed],,
with_expat_given=no)
AC_ARG_WITH(expat-includes,
[ --with-expat-includes=DIR Path to the Expat include file],,
with_expat_includes_given=no)
AC_ARG_WITH(expat-libraries,
[ --with-expat-libraries=DIR Path to where the Expat library is installed],,
with_expat_libraries_given=no)
EXPAT_CFLAGS=
EXPAT_LIBS=
if test "$with_expat_includes" != ""; then
EXPAT_CFLAGS="-I$with_expat_includes"
elif test "$with_expat_prefix" != "yes" -a "$with_expat_prefix" != ""; then
EXPAT_CFLAGS="-I$with_expat_prefix/include"
fi
if test "$with_expat_libraries" != ""; then
EXPAT_LIBS="-L$with_expat_libraries"
elif test "$with_expat_prefix" != "yes" -a "$with_expat_prefix" != ""; then
EXPAT_LIBS="-L$with_expat_prefix/lib"
fi
AC_CHECK_LIB(expat, XML_ParserCreate,
[ EXPAT_LIBS="$EXPAT_LIBS -lexpat"
expat_found=yes ],
[ expat_found=no ],
"$EXPAT_LIBS")
if test "$expat_found" = "no"; then
AC_MSG_ERROR([Could not find the Expat library])
fi
expat_save_CFLAGS="$CFLAGS"
CFLAGS="$CFLAGS $EXPAT_CFLAGS"
AC_CHECK_HEADERS(expat.h, , expat_found=no)
if test "$expat_found" = "no"; then
AC_MSG_ERROR([Could not find expat.h])
fi
CFLAGS="$expat_save_CFLAGS"
if test "x$expat_found" = "xno"; then
exit 1
fi
AC_SUBST(EXPAT_CFLAGS)
AC_SUBST(EXPAT_LIBS)
dnl
dnl Check for zlib
dnl
AC_ARG_WITH(zlib,
[ --with-zlib-prefix=PFX Path to where the zlib library is installed],,
with_zlib_given=no)
ZLIB_CFLAGS=
ZLIB_LIBS=
if test "$with_zlib_prefix" != "yes" -a "$with_zlib_prefix" != ""; then
ZLIB_CFLAGS="-I$with_zlib_prefix/include"
ZLIB_LIBS="-L$with_zlib_prefix/lib"
fi
AC_CHECK_LIB(z, zlibVersion,
[ ZLIB_LIBS="$ZLIB_LIBS -lz"
zlib_found=yes ],
[ zlib_found=no ],
"$ZLIB_LIBS")
if test "$zlib_found" = "no"; then
AC_MSG_ERROR([Could not find the zlib library])
fi
zlib_save_CFLAGS="$CFLAGS"
CFLAGS="$CFLAGS $ZLIB_CFLAGS"
AC_CHECK_HEADERS(zlib.h, , zlib_found=no)
CFLAGS="$zlib_save_CFLAGS"
AC_SUBST(ZLIB_CFLAGS)
AC_SUBST(ZLIB_LIBS)
dnl
dnl Check for liblzo
dnl
AC_ARG_WITH(lzo,
[ --with-lzo-prefix=PFX Path to where the lzo library is installed],,
with_lzo_given=no)
LZO_CFLAGS=
LZO_LIBS=
if test "$with_lzo_prefix" != "yes" -a "$with_lzo_prefix" != ""; then
LZO_CFLAGS="-I$with_lzo_prefix/include"
LZO_LIBS="-L$with_lzo_prefix/lib"
fi
AC_CHECK_LIB(lzo, lzo1x_1_compress,
[ LZO_LIBS="$LZO_LIBS -llzo"
lzo_found=yes ],
[ lzo_found=no ],
"$LZO_LIBS")
if test "$lzo_found" = "no"; then
AC_MSG_ERROR([Could not find the lzo library])
fi
lzo_save_CFLAGS="$CFLAGS"
CFLAGS="$CFLAGS $LZO_CFLAGS"
AC_CHECK_HEADERS(lzo1x.h, , lzo_found=no)
CFLAGS="$lzo_save_CFLAGS"
AC_SUBST(LZO_CFLAGS)
AC_SUBST(LZO_LIBS)
dnl
dnl Check for libbz2
dnl
AC_ARG_WITH(bz2,
[ --with-bz2-prefix=PFX Path to where the bz2 library is installed],,
with_bz2_given=no)
BZ2_CFLAGS=
BZ2_LIBS=
if test "$with_bz2_prefix" != "yes" -a "$with_bz2_prefix" != ""; then
BZ2_CFLAGS="-I$with_bz2_prefix/include"
BZ2_LIBS="-L$with_bz2_prefix/lib"
fi
AC_CHECK_LIB(bz2, BZ2_bzCompress,
[ BZ2_LIBS="$BZ2_LIBS -lbz2"
bz2_found=yes ],
[ bz2_found=no ],
"$BZ2_LIBS")
if test "$bz2_found" = "no"; then
AC_MSG_ERROR([Could not find the bz2 library])
fi
bz2_save_CFLAGS="$CFLAGS"
CFLAGS="$CFLAGS $BZ2_CFLAGS"
AC_CHECK_HEADERS(bzlib.h, , bz2_found=no)
CFLAGS="$bz2_save_CFLAGS"
AC_SUBST(BZ2_CFLAGS)
AC_SUBST(BZ2_LIBS)
dnl
dnl Check for wxWindows
dnl
AC_MSG_CHECKING(for wxWindows)
if wx-config --cxxflags > /dev/null 2>&1; then
wxwversion=`wx-config --version`
wxwver_ok=`echo $wxwversion | sed 's;\.;\ ;g' | (read -a mver
if test ${mver[[0]]} -gt 2 ; then
wxwver_ok=1
elif test ${mver[[0]]} -lt 2 ; then
wxwver_ok=0
else
if test ${mver[[1]]} -ge 4 ; then
wxwver_ok=1
else
wxwver_ok=0
fi
fi
echo $wxwver_ok )`
if test "$wxwver_ok" = "1" ; then
if test "$MINGW" = "1" ; then
WXWINDOWS_CFLAGS=$(wx-config --cxxflags | sed 's;-I;-Ic:/cygwin;g')
WXWINDOWS_LDFLAGS=$(wx-config --ldflags | sed 's;-L;-Lc:/cygwin;g')
WXWINDOWS_LIBS=$(wx-config --libs | sed -e 's;-L;-Lc:/cygwin;g' -e 's; /usr/local/lib/libwx; c:/cygwin/usr/local/lib/libwx;g')
else
WXWINDOWS_CFLAGS=$(wx-config --cxxflags)
WXWINDOWS_LDFLAGS=$(wx-config --ldflags)
WXWINDOWS_LIBS=$(wx-config --libs)
fi
AC_DEFINE(HAVE_WXWINDOWS, 1, [Define if wxWindows is present])
MMG_SUBDIRS=mmg
AC_MSG_RESULT($wxwversion ok)
have_wxwindows=yes
else
AC_MSG_RESULT(no: version $wxwversion is too old)
fi
else
AC_MSG_RESULT(no: wx-config was not found)
fi
AC_SUBST(WXWINDOWS_CFLAGS)
AC_SUBST(WXWINDOWS_LDFLAGS)
AC_SUBST(WXWINDOWS_LIBS)
AC_SUBST(MMG_SUBDIRS)
AM_CONDITIONAL(HAVE_WXWINDOWS, test x"$have_wxwindows" = "xyes")
dnl
dnl Option to use the (old) avilib library instead of the AVI classes
dnl
AC_ARG_WITH(avilib,
[ --with-avilib=version Which avilib should be used (noclasses, 0.6.10)],
with_avilib_given=yes, with_avilib_given=no)
AC_MSG_CHECKING(which AVI libraries to use)
# Defaults: use aviclasses and prefer the new avilib.
have_aviclasses=yes
if test "x$with_avilib_given" = "xyes"; then
set - `echo ${with_avilib} | sed 's/,/ /g'`
while test "x$1" != "x"; do
case "$1" in
noclasses)
have_aviclasses=no
;;
"0.6.10")
have_avilib0_6_10=yes
;;
*)
echo ""
echo "*** Unknown AVI library \"$1\" in \"${with_avilib}\". "
echo "*** Supported values are:"
echo "*** 0.6.10 - the new avilib with OpenDML support"
echo "*** noclasses - Do not use the AVI classes by Cyrius with "
echo "*** OpenDML support"
exit 1
;;
esac
shift
done
fi
if test "x$have_aviclasses" = "xyes"; then
AC_DEFINE(HAVE_AVICLASSES, 1,
[Define if the newer AVIclasses should be used.])
AVICLASSES_LIBS="-laviclasses"
avi_libs_to_use="classes "
fi
if test "x$have_avilib0_6_10" = "xyes" -a "x$have_avilib" = "xyes"; then
echo ""
echo "*** You cannot include both the old avilib and the new"
echo "*** one (0.6.10)."
exit 1
fi
if test "x$have_avilib" = "xyes"; then
avi_libs_to_use="${avi_libs_to_use}old "
else
AC_DEFINE(HAVE_AVILIB0_6_10, 1,
[Define if the newer avilib from transcode 0.6.10 should be used.])
avi_libs_to_use="${avi_libs_to_use}0.6.10 "
have_avilib0_6_10=yes
fi
AM_CONDITIONAL(HAVE_AVILIB, test x"$have_avilib0_6_10" != "xyes")
AM_CONDITIONAL(HAVE_AVILIB0_6_10, test x"$have_avilib0_6_10" == "xyes")
AM_CONDITIONAL(HAVE_AVICLASSES, test x"$have_aviclasses" = "xyes")
AVILIB_LIBS="-lavi"
AC_MSG_RESULT($avi_libs_to_use)
AC_SUBST(AVILIB_LIBS)
AC_SUBST(AVICLASSES_LIBS)
CFLAGS="-Wall -Wno-sign-compare -Wno-comment -D_LARGEFILE64_SOURCE -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 @EXTRA_CFLAGS@ @OGG_CFLAGS@ @VORBIS_CFLAGS@ @DEBUG_CFLAGS@ @PROFILING_CFLAGS@ @MATROSKA_CFLAGS@ @EBML_CFLAGS@"
CXXFLAGS="-Wall -Wno-sign-compare -Wno-comment -D_LARGEFILE64_SOURCE -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 @EXTRA_CFLAGS@ @OGG_CFLAGS@ @VORBIS_CFLAGS@ @DEBUG_CFLAGS@ @PROFILING_CFLAGS@ @MATROSKA_CFLAGS@ @EBML_CFLAGS@ @WXWINDOWS_CFLAGS@ @EXPAT_CFLAGS@ @ZLIB_CFLAGS@ @LZO_CFLAGS@ @BZ2_CFLAGS@"
CPPFLAGS="@EXTRA_CFLAGS@"
LDFLAGS="@EXTRA_LDFLAGS@"
AC_OUTPUT(Makefile avilib-0.6.10/Makefile aviclasses/Makefile src/Makefile src/common/Makefile src/input/Makefile src/output/Makefile src/mmg/Makefile doc/Makefile)