Use pkg-config to check for libavcodec & libavformat

This commit is contained in:
Julien BLACHE 2009-04-01 17:10:28 +02:00
parent 2daa9835a3
commit 7ce2e75859
2 changed files with 7 additions and 30 deletions

View File

@ -103,6 +103,10 @@ PKG_CHECK_MODULES(AVAHI, [ avahi-client >= 0.6.24 ])
PKG_CHECK_MODULES(SQLITE3, [ sqlite3 ],
AC_DEFINE(HAVE_SQLITE3, 1, [define if sqlite3 is available]))
if test x$use_ffmpeg = xtrue; then
PKG_CHECK_MODULES(FFMPEG, [ libavcodec libavformat ])
fi
AC_ARG_WITH(static-libs,
[--with-static-libs[[=DIR]] use static libs in DIR],[
if test "$withval" != "no" -a "$withval" != "yes"; then
@ -127,22 +131,6 @@ AC_ARG_WITH(ssl-libs,
fi
])
AC_ARG_WITH(ffmpeg-includes,
[--with-ffmpeg-includes[[=DIR]] use ffmpeg include files in DIR],[
if test "$withval" != "no" -a "$withval" != "yes"; then
Z_DIR=$withval
CPPFLAGS="${CPPFLAGS} -I$withval"
fi
])
AC_ARG_WITH(ffmpeg-libs,
[--with-ffmpeg-libs[[=DIR]] use ffmpeg lib files in DIR],[
if test "$withval" != "no" -a "$withval" != "yes"; then
Z_DIR=$withval
LDFLAGS="${LDFLAGS} -L$withval -R$withval"
fi
])
AC_ARG_WITH(id3tag,
[--with-id3tag[[=DIR]] use id3tag in DIR],[
if test "$withval" != "no" -a "$withval" != "yes"; then
@ -225,18 +213,6 @@ if test x$use_flac = xtrue; then
fi
fi
if test x$use_ffmpeg = xtrue; then
AC_CHECK_HEADERS(avcodec.h,, [
AC_MSG_ERROR([avcodec.h not found... Must have ffmpeg installed])])
dnl AC_CHECK_LIB(avcodec,avcodec_find_decoder,,echo "Must have libavcodec";exit)
if test x"$STATIC_LIBS" != x"no"; then
LIBS="${LIBS} ${STATIC_LIBS}/libavcodec.a ${STATIC_LIBS}/libavformat.a ${STATIC_LIBS}/libavutil.a"
else
LIBS="${LIBS} -lavcodec -lavformat -lavutil"
fi
fi
if test x$use_musepack = xtrue; then
AC_PATH_PROG(TAGLIB_CONFIG, taglib-config, no)
AC_CHECK_HEADERS(taglib/tag_c.h,, [

View File

@ -11,11 +11,12 @@ rsp_la_SOURCES = compat.c rsp.c xml-rpc.c
if COND_FFMPEG
ssc_ffmpeg_LTLIBRARIES=ssc-ffmpeg.la
ssc_ffmpeg_la_CPPFLAGS = @FFMPEG_CFLAGS@
ssc_ffmpeg_la_LIBADD = @FFMPEG_LIBS@
ssc_ffmpeg_la_LDFLAGS=-module -avoid-version
ssc_ffmpeg_la_SOURCES=ssc-ffmpeg.c
endif
ssc_ffmpeg_la_LDFLAGS=-module -avoid-version
ssc_script_LTLIBRARIES=ssc-script.la
ssc_script_la_LDFLAGS=-module -avoid-version
ssc_script_la_SOURCES=ssc-script.c