From 25ba888769d342acdc4dd8447c54e3614a90b87a Mon Sep 17 00:00:00 2001 From: Thomas Schmitt Date: Thu, 7 Jan 2010 09:03:46 +0000 Subject: [PATCH] Changed configure test for zlib from compress2() to compressBound() --- configure.ac | 41 ++++++++++++++++++++++++++++++++++++++-- xorriso/configure_ac.txt | 8 +++++--- 2 files changed, 44 insertions(+), 5 deletions(-) diff --git a/configure.ac b/configure.ac index 4b7ab312..cf80f0bf 100644 --- a/configure.ac +++ b/configure.ac @@ -163,15 +163,36 @@ AC_ARG_ENABLE(zlib, if test x$enable_zlib = xyes; then dnl Check whether there is the header for zlib. dnl If not, erase this macro which would enable use of compress2() and others. -dnl The empty parameter after "compress2" causes -lz. +dnl Linking fails on SuSE 9.0 because zlib has compress2() but lacks +dnl compressBound(). So compressBound is the more modern thing to test. +dnl The empty parameter after "compressBound" causes -lz. ZLIB_DEF="-DLibisofs_with_zliB" - AC_CHECK_HEADER(zlib.h, AC_CHECK_LIB(z, compress2, , ZLIB_DEF= ), ZLIB_DEF= ) + AC_CHECK_HEADER(zlib.h, AC_CHECK_LIB(z, compressBound, , ZLIB_DEF= ), ZLIB_DEF= ) else ZLIB_DEF= fi AC_SUBST(ZLIB_DEF) +dnl ts B00107 +dnl Just for the case that it is necessary to give link option -lcdio not only +dnl with libburn but also with libburn apps like xorriso. +dnl On SuSE 10.2 this is not needed. libburn finds libcdio on its own. +AC_ARG_ENABLE(libcdio, +[ --enable-libcdio Enable EXPERIMENTAL use of libcdio as system adapter, default=no], + , enable_libcdio=no) +if test x$enable_libcdio = xyes; then +dnl Check whether there is libcdio-devel and libcdio-runtime. +dnl If not, erase this macro + LIBCDIO_DEF="-DLibburn_use_libcdiO" +dnl The empty yes case obviously causes -lcdio to be linked + AC_CHECK_HEADER(cdio/cdio.h, AC_CHECK_LIB(cdio, mmc_last_cmd_sense, , LIBCDIO_DEF= ), LIBCDIO_DEF= ) +else + LIBCDIO_DEF= +fi +AC_SUBST(LIBCDIO_DEF) + + AC_ARG_ENABLE(external-filters, [ --enable-external-filters Enable use of external filter programs by xorriso, default=yes], , enable_external_filters=yes) @@ -218,6 +239,22 @@ LIBISOFS_REQUIRED=0.6.24 PKG_CHECK_MODULES(LIBBURN, libburn-1 >= $LIBBURN_REQUIRED) PKG_CHECK_MODULES(LIBISOFS, libisofs-1 >= $LIBISOFS_REQUIRED) +if test x$LIBCDIO_DEF = x +then + if test x$enable_libcdio = xyes + then + echo "WARNING: could not enable use of libcdio as system adapter" + fi +fi +else + echo "enabled EXPERIMENTAL use of libcdio as system adapter" + +dnl For some reason this check may not be done earlier or else pkg-config +dnl is not found. + LIBCDIO_REQUIRED=0.83 + PKG_CHECK_MODULES(LIBCDIO, libcdio >= $LIBCDIO_REQUIRED) +fi + dnl Add compiler-specific flags dnl See if the user wants aggressive optimizations of the code diff --git a/xorriso/configure_ac.txt b/xorriso/configure_ac.txt index dcdb2c46..05663a10 100644 --- a/xorriso/configure_ac.txt +++ b/xorriso/configure_ac.txt @@ -171,9 +171,11 @@ AC_ARG_ENABLE(zlib, if test x$enable_zlib = xyes; then dnl Check whether there is the header for zlib. dnl If not, erase this macro which would enable use of compress2() and others. -dnl The empty parameter after "compress2" causes -lz. +dnl Linking fails on SuSE 9.0 because zlib has compress2() but lacks +dnl compressBound(). So compressBound is the more modern thing to test. +dnl The empty parameter after "compressBound" causes -lz. ZLIB_DEF="-DLibisofs_with_zliB" - AC_CHECK_HEADER(zlib.h, AC_CHECK_LIB(z, compress2, , ZLIB_DEF= ), ZLIB_DEF= ) + AC_CHECK_HEADER(zlib.h, AC_CHECK_LIB(z, compressBound, , ZLIB_DEF= ), ZLIB_DEF= ) else ZLIB_DEF= fi @@ -187,7 +189,7 @@ if test x$enable_libcdio = xyes; then dnl Check whether there is libcdio-devel and libcdio-runtime. dnl If not, erase this macro LIBCDIO_DEF="-DLibburn_use_libcdiO" -dnl The empty yes case obviously causes -lacl to be linked +dnl The empty yes case obviously causes -lcdio to be linked AC_CHECK_HEADER(cdio/cdio.h, AC_CHECK_LIB(cdio, mmc_last_cmd_sense, , LIBCDIO_DEF= ), LIBCDIO_DEF= ) else LIBCDIO_DEF=