From: Jean-Baptiste Kempf Date: Thu, 3 Mar 2011 21:32:08 +0000 (+0100) Subject: Configure.ac: simplify dvbpsi detection X-Git-Tag: 1.2.0-pre1~3570 X-Git-Url: https://git.sesse.net/?a=commitdiff_plain;h=91d1635c577791f204183238c263f1c215c1dbf0;p=vlc Configure.ac: simplify dvbpsi detection --- diff --git a/configure.ac b/configure.ac index e58790840c..d52efe6094 100644 --- a/configure.ac +++ b/configure.ac @@ -1970,107 +1970,36 @@ dnl dnl libdvbpsi ts demux/mux dnl AC_ARG_ENABLE(dvbpsi, - [ --enable-dvbpsi dvbpsi ts mux and demux module (default enabled)]) + [ --enable-dvbpsi dvbpsi ts mux and demux module (default auto)]) have_dvbpsi=no -if test "${enable_dvbpsi}" != "no" -then - AC_ARG_WITH(dvbpsi, - [ --with-dvbpsi=PATH libdvbpsi headers and libraries]) - AC_ARG_WITH(dvbpsi, - [ --with-dvbpsi-tree=PATH libdvbpsi tree for static linking]) - case "${with_dvbpsi}" in - ""|yes) - if test -z "${with_dvbpsi_tree}" - then - AC_CHECK_HEADERS(dvbpsi/dr.h, - [ VLC_ADD_PLUGIN([ts]) - if test "${enable_sout}" != "no"; then - VLC_ADD_PLUGIN([mux_ts]) - fi - VLC_ADD_LIBS([mux_ts ts dvb],[-ldvbpsi]) - have_dvbpsi=yes], - [ AC_MSG_WARN([cannot find libdvbpsi headers]) ], - [#if defined( HAVE_STDINT_H ) -# include -#elif defined( HAVE_INTTYPES_H ) -# include -#endif -#include -#include -#include -#include ]) - else - AC_MSG_CHECKING(for libdvbpsi.a in ${with_dvbpsi_tree}) - real_dvbpsi_tree="`cd ${with_dvbpsi_tree} 2>/dev/null && pwd`" - if test -z "${real_dvbpsi_tree}" - then - dnl The given directory can't be found - AC_MSG_RESULT(no) - AC_MSG_ERROR([cannot cd to ${with_dvbpsi_tree}]) - fi - if test -f "${real_dvbpsi_tree}/src/.libs/libdvbpsi.a" - then - dnl Use a custom libdvbpsi - AC_MSG_RESULT(${real_dvbpsi_tree}/src/.libs/libdvbpsi.a) - VLC_ADD_PLUGIN([ts]) - if test "${enable_sout}" != "no"; then - VLC_ADD_PLUGIN([mux_ts]) - fi - VLC_ADD_CPPFLAGS([mux_ts ts dvb],[-I${real_dvbpsi_tree}/src]) - VLC_ADD_LIBS([mux_ts ts dvb],[${real_dvbpsi_tree}/src/.libs/libdvbpsi.a]) - have_dvbpsi=yes - else - dnl The given libdvbpsi wasn't built - AC_MSG_RESULT(no) - AC_MSG_ERROR([cannot find ${real_dvbpsi_tree}/src/.libs/libdvbpsi.a, make sure you compiled libdvbpsi in ${with_dvbpsi_tree}]) - fi - fi - ;; - no) - dnl Compile without dvbpsi - ;; - *) - AC_MSG_CHECKING(for dvbpsi headers in ${with_dvbpsi}) - if test -z "${with_dvbpsi}" - then - LDFLAGS_test="" - CPPFLAGS_test="" - else - LDFLAGS_test="-L${with_dvbpsi}/lib" - CPPFLAGS_test="-I${with_dvbpsi}/include" - fi - CPPFLAGS="${CPPFLAGS_save} ${CPPFLAGS_test}" +if test "${enable_dvbpsi}" != "no"; then AC_CHECK_HEADERS([dvbpsi/dr.h],[ VLC_ADD_PLUGIN([ts]) if test "${enable_sout}" != "no"; then - AC_CHECK_LIB(dvbpsi, dvbpsi_SDTServiceAddDescriptor, - [VLC_ADD_PLUGIN([mux_ts])], [], [${LDFLAGS_test} -ldvbpsi]) + AC_CHECK_LIB(dvbpsi, dvbpsi_SDTServiceAddDescriptor, [VLC_ADD_PLUGIN([mux_ts])], [], [-ldvbpsi]) fi - VLC_ADD_CPPFLAGS([mux_ts ts dvb],[${CPPFLAGS_test}]) - VLC_ADD_LIBS([mux_ts ts dvb],[${LDFLAGS_test} -ldvbpsi]) + VLC_ADD_LIBS([mux_ts ts dvb],[-ldvbpsi]) have_dvbpsi=yes + + AC_CHECK_LIB(dvbpsi, dvbpsi_GenSDTSections, [ + AC_DEFINE(HAVE_DVBPSI_SDT, 1, [Define if you have dvbpsi_GenSDTSections.]) + ], [], [${LIBS_ts}]) ],[ - if test -n "${enable_dvbpsi}" - then - AC_MSG_ERROR([Could not find libdvbpsi on your system: you may get it from www.videolan.org, you'll need at least version 0.1.6]) + if test -n "${enable_dvbpsi}"; then + AC_MSG_ERROR([Could not find libdvbpsi on your system: you need at least version 0.1.6]) + else + AC_MSG_WARN([Could not find libdvbpsi on your system: you need at least version 0.1.6]) fi - ], - [#if defined( HAVE_STDINT_H ) -# include -#elif defined( HAVE_INTTYPES_H ) -# include -#endif -#include -#include -#include -#include ]) - CPPFLAGS="${CPPFLAGS_save}" - ;; - esac - AC_CHECK_LIB(dvbpsi, dvbpsi_GenSDTSections, [ - AC_DEFINE(HAVE_DVBPSI_SDT, 1, [Define if you have dvbpsi_GenSDTSections.]) - ], [], [${LIBS_ts}]) - + ],[ #if defined( HAVE_STDINT_H ) + # include + #elif defined( HAVE_INTTYPES_H ) + # include + #endif + #include + #include + #include + #include + ]) fi dnl