Browse files

Merge pull request #38 from wsnipex/external-ffmpeg

configure: enable --enable-external-libraries switch
  • Loading branch information...
2 parents b908d34 + 4887ff4 commit ed77bf76a29ad2b727fdae5bcefe1f9c0ec796f7 @opdenkamp committed Oct 9, 2012
Showing with 28 additions and 1 deletion.
  1. +1 −1 addons/Makefile.include.am
  2. +27 −0 configure.ac
View
2 addons/Makefile.include.am
@@ -2,7 +2,7 @@
# Makefile include for XBMC PVR add-ons
#
-INCLUDES = -I. -I$(abs_top_srcdir)/xbmc -I$(abs_top_srcdir)/lib @HOST_INCLUDES@
+INCLUDES = -I. @FFMPEG_INCLUDES@ -I$(abs_top_srcdir)/xbmc -I$(abs_top_srcdir)/lib @HOST_INCLUDES@
WARNINGS = -Wall -Wextra -Wno-missing-field-initializers -Woverloaded-virtual -Wno-parentheses
DEFINES = @ARCH_DEFINES@ -DUSE_DEMUX -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS
AM_CXXFLAGS = -g -O2 -fPIC $(WARNINGS) $(DEFINES) @HOST_CXXFLAGS@
View
27 configure.ac
@@ -22,6 +22,13 @@ AC_ARG_ENABLE([release],
[use_release=$enableval],
[use_release=no])
+### External libraries options
+AC_ARG_ENABLE([external-ffmpeg],
+ [AS_HELP_STRING([--enable-external-ffmpeg],
+ [enable use of external ffmpeg libraries (default is no) 'Linux only'])],
+ [use_external_ffmpeg=$enableval],
+ [use_external_ffmpeg=no])
+
BUILD_TYPE="debug"
if test "$use_release" = "yes"; then
BUILD_TYPE="release"
@@ -78,9 +85,29 @@ case "${host}" in
*-freebsd*)
OS="freebsd"
ARCH_DEFINES="-DTARGET_POSIX -DTARGET_FREEBSD -D_LINUX"
+ use_external_ffmpeg="yes" # same as on xbmc
;;
esac
+### External libraries checks
+# FFmpeg
+if test "$use_external_ffmpeg" = "yes"; then
+ PKG_CHECK_MODULES([FFMPEG], [libavcodec],
+ [FFMPEG_INCLUDES="$FFMPEG_CFLAGS"; LIBS="$LIBS $FFMPEG_LIBS"],
+ AC_MSG_ERROR(cannot find libavcodec))
+
+ # Possible places the ffmpeg headers may be
+ AC_CHECK_HEADERS([libavcodec/avcodec.h],[FFMPEG_INCLUDES="-I$($PKG_CONFIG --variable=includedir libavcodec)/libavcodec"],
+ [AC_CHECK_HEADERS([ffmpeg/avcodec.h],[FFMPEG_INCLUDES="-I$($PKG_CONFIG --variable=includedir libavcodec)/ffmpeg"],
+ [AC_MSG_ERROR(avcodec.h not found)])
+ ])
+
+ echo "FFMPEG_INCLUDES: $FFMPEG_INCLUDES"
+fi
+AC_SUBST(FFMPEG_INCLUDES)
+
+### End external Libraries
+
### Check for Intree building
if test "x${cross_compiling}" = "xyes" || test "x${cross_compiling}" = "xmaybe"; then
# don't call AC_CHECK_FILE when (maybe) cross-compiling

1 comment on commit ed77bf7

@EricV

Thanks!

Please sign in to comment.