Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

configure: enable --enable-external-libraries switch

allows building with external ffmpeg
  • Loading branch information...
commit 4887ff4adc10f1b3b34e656e001b5a9437a651e7 1 parent 9e7a5ba
Wolfgang Schupp wsnipex authored
Showing with 28 additions and 1 deletion.
  1. +1 −1  addons/Makefile.include.am
  2. +27 −0 configure.ac
2  addons/Makefile.include.am
View
@@ -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@
27 configure.ac
View
@@ -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"
@@ -69,9 +76,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
Please sign in to comment.
Something went wrong with that request. Please try again.