Commit 425e7f20 authored by Antoine Cellerier's avatar Antoine Cellerier

Only link avcodec with libavcodec, avformat with libavformat, swscale with...

Only link avcodec with libavcodec, avformat with libavformat, swscale with libswscale, imgresample with libavcodec (small hack include to fix AC_CHECK_LIB code), postproc with libpostproc.
parent 3a49e9f3
...@@ -2925,19 +2925,18 @@ AC_ARG_ENABLE(avcodec, ...@@ -2925,19 +2925,18 @@ AC_ARG_ENABLE(avcodec,
[ --enable-avcodec libavcodec codec (default enabled)]) [ --enable-avcodec libavcodec codec (default enabled)])
if test "${enable_avcodec}" != "no" if test "${enable_avcodec}" != "no"
then then
PKG_CHECK_MODULES(AVCODEC,[libavcodec, libavutil], PKG_CHECK_MODULES(AVCODEC,[libavcodec],
[ [
VLC_SAVE_FLAGS VLC_SAVE_FLAGS
CPPFLAGS="${CPPFLAGS} ${AVCODEC_CFLAGS}" CPPFLAGS="${CPPFLAGS} ${AVCODEC_CFLAGS}"
CFLAGS="${CFLAGS} ${AVCODEC_CFLAGS}" CFLAGS="${CFLAGS} ${AVCODEC_CFLAGS}"
AC_CHECK_HEADERS(libavcodec/avcodec.h ffmpeg/avcodec.h) AC_CHECK_HEADERS(libavcodec/avcodec.h ffmpeg/avcodec.h)
AC_CHECK_HEADERS(libavutil/avutil.h ffmpeg/avutil.h)
VLC_ADD_PLUGIN([avcodec]) VLC_ADD_PLUGIN([avcodec])
VLC_ADD_LIBS([avcodec],[$AVCODEC_LIBS]) VLC_ADD_LIBS([avcodec],[$AVCODEC_LIBS])
VLC_ADD_CFLAGS([avcodec],[$AVCODEC_CFLAGS]) VLC_ADD_CFLAGS([avcodec],[$AVCODEC_CFLAGS])
VLC_RESTORE_FLAGS VLC_RESTORE_FLAGS
],[ ],[
AC_MSG_ERROR([Could not find libavcodec or libavutil. Use --disable-avcodec to ignore this error.]) AC_MSG_ERROR([Could not find libavcodec. Use --disable-avcodec to ignore this error.])
]) ])
fi fi
...@@ -2949,20 +2948,18 @@ AC_ARG_ENABLE(avformat, ...@@ -2949,20 +2948,18 @@ AC_ARG_ENABLE(avformat,
[ --enable-avformat libavformat containers (default enabled)]) [ --enable-avformat libavformat containers (default enabled)])
if test "${enable_avformat}" != "no" if test "${enable_avformat}" != "no"
then then
PKG_CHECK_MODULES(AVFORMAT,[libavformat, libavcodec, libavutil], PKG_CHECK_MODULES(AVFORMAT,[libavformat],
[ [
VLC_SAVE_FLAGS VLC_SAVE_FLAGS
CPPFLAGS="${CPPFLAGS} ${AVFORMAT_CFLAGS}" CPPFLAGS="${CPPFLAGS} ${AVFORMAT_CFLAGS}"
CFLAGS="${CFLAGS} ${AVFORMAT_CFLAGS}" CFLAGS="${CFLAGS} ${AVFORMAT_CFLAGS}"
AC_CHECK_HEADERS(libavformat/avformat.h ffmpeg/avformat.h) AC_CHECK_HEADERS(libavformat/avformat.h ffmpeg/avformat.h)
AC_CHECK_HEADERS(libavcodec/avcodec.h ffmpeg/avcodec.h)
AC_CHECK_HEADERS(libavutil/avutil.h ffmpeg/avutil.h)
VLC_ADD_PLUGIN([avformat]) VLC_ADD_PLUGIN([avformat])
VLC_ADD_LIBS([avformat],[$AVFORMAT_LIBS]) VLC_ADD_LIBS([avformat],[$AVFORMAT_LIBS])
VLC_ADD_CFLAGS([avformat],[$AVFORMAT_CFLAGS]) VLC_ADD_CFLAGS([avformat],[$AVFORMAT_CFLAGS])
VLC_RESTORE_FLAGS VLC_RESTORE_FLAGS
],[ ],[
AC_MSG_ERROR([Could not find libavformat, libavcodec or libavutil. Use --disable-avformat to ignore this error.]) AC_MSG_ERROR([Could not find libavformat. Use --disable-avformat to ignore this error.])
]) ])
fi fi
...@@ -2974,19 +2971,18 @@ AC_ARG_ENABLE(swscale, ...@@ -2974,19 +2971,18 @@ AC_ARG_ENABLE(swscale,
[ --enable-swscale libswscale image scaling and conversion (default enabled)]) [ --enable-swscale libswscale image scaling and conversion (default enabled)])
if test "${enable_swscale}" != "no" if test "${enable_swscale}" != "no"
then then
PKG_CHECK_MODULES(SWSCALE,[libswscale, libavutil], PKG_CHECK_MODULES(SWSCALE,[libswscale],
[ [
VLC_SAVE_FLAGS VLC_SAVE_FLAGS
CPPFLAGS="${CPPFLAGS} ${SWSCALE_CFLAGS}" CPPFLAGS="${CPPFLAGS} ${SWSCALE_CFLAGS}"
CFLAGS="${CFLAGS} ${SWSCALE_CFLAGS}" CFLAGS="${CFLAGS} ${SWSCALE_CFLAGS}"
AC_CHECK_HEADERS(libswscale/swscale.h ffmpeg/swscale.h) AC_CHECK_HEADERS(libswscale/swscale.h ffmpeg/swscale.h)
AC_CHECK_HEADERS(libavutil/avutil.h ffmpeg/avutil.h)
VLC_ADD_PLUGIN([swscale]) VLC_ADD_PLUGIN([swscale])
VLC_ADD_LIBS([swscale],[$SWSCALE_LIBS]) VLC_ADD_LIBS([swscale],[$SWSCALE_LIBS])
VLC_ADD_CFLAGS([swscale],[$SWSCALE_CFLAGS]) VLC_ADD_CFLAGS([swscale],[$SWSCALE_CFLAGS])
VLC_RESTORE_FLAGS VLC_RESTORE_FLAGS
],[ ],[
AC_MSG_WARN([Could not find libswscale or libavutil. Trying to enable imgresample.]) AC_MSG_WARN([Could not find libswscale. Trying to enable imgresample.])
enable_imgresample=yes enable_imgresample=yes
]) ])
fi fi
...@@ -3003,13 +2999,12 @@ AC_ARG_ENABLE(imgresample, ...@@ -3003,13 +2999,12 @@ AC_ARG_ENABLE(imgresample,
[ --enable-imgresample deprecated libavcodec image scaling and conversion (default disabled)]) [ --enable-imgresample deprecated libavcodec image scaling and conversion (default disabled)])
if test "${enable_imgresample}" = "yes" if test "${enable_imgresample}" = "yes"
then then
PKG_CHECK_MODULES(IMGRESAMPLE,[libavcodec, libavutil], PKG_CHECK_MODULES(IMGRESAMPLE,[libavcodec],
[ [
VLC_SAVE_FLAGS VLC_SAVE_FLAGS
CPPFLAGS="${CPPFLAGS} ${IMGRESAMPLE_CFLAGS}" CPPFLAGS="${CPPFLAGS} ${IMGRESAMPLE_CFLAGS}"
CFLAGS="${CFLAGS} ${IMGRESAMPLE_CFLAGS}" CFLAGS="${CFLAGS} ${IMGRESAMPLE_CFLAGS}"
AC_CHECK_HEADERS(libavcodec/avcodec.h ffmpeg/avcodec.h) AC_CHECK_HEADERS(libavcodec/avcodec.h ffmpeg/avcodec.h)
AC_CHECK_HEADERS(libavutil/avutil.h ffmpeg/avutil.h)
AC_CHECK_LIB(avcodec,img_resample, AC_CHECK_LIB(avcodec,img_resample,
[ [
VLC_ADD_PLUGIN([imgresample]) VLC_ADD_PLUGIN([imgresample])
...@@ -3021,10 +3016,14 @@ then ...@@ -3021,10 +3016,14 @@ then
then then
AC_MSG_ERROR([swscale (and its fallback module imgresample) support will be missing. Use --disable-swscale to ignore this error. (This basically means that you will be missing any good software scaling module and some video chroma converters.)]) AC_MSG_ERROR([swscale (and its fallback module imgresample) support will be missing. Use --disable-swscale to ignore this error. (This basically means that you will be missing any good software scaling module and some video chroma converters.)])
fi fi
],${IMGRESAMPLE_LIBS}) # That sed hack to add -rpath is kind of ugly but at least it fixes
# detection when linking against a shared libavcodec with
# a libavutil not in one of your ld.so.conf directories.
# (for example a local install)
],[${IMGRESAMPLE_LIBS} `echo ${IMGRESAMPLE_LIBS}|sed s'/-L/-Wl,-rpath=/'`])
VLC_RESTORE_FLAGS VLC_RESTORE_FLAGS
],[ ],[
AC_MSG_WARN([Could not find libavcodec or libavutil.]) AC_MSG_WARN([Could not find libavcodec.])
]) ])
fi fi
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment