From 780c9f6d98de42a1004878d23007d487152d2de6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thomas=20G=C3=BCnther?= Date: Sat, 27 Mar 2010 00:22:17 +0100 Subject: Use pkg-config to find compilation flags, libs etc for ffmpeg --- HISTORY | 1 + Makefile | 30 ++++++++++++++++++------------ decoder.h | 4 ++-- 3 files changed, 21 insertions(+), 14 deletions(-) diff --git a/HISTORY b/HISTORY index 6f0e58a..422f201 100644 --- a/HISTORY +++ b/HISTORY @@ -9,6 +9,7 @@ ____-__-__: Version 0.1.0 - Updated project homepage url in README - Updated FSF address in the license information - Added support for VDR >= 1.7.13 (Make.global) +- Use pkg-config to find compilation flags, libs etc for ffmpeg 2010-01-01: Version 0.0.10a - added support for VDR 1.7.x diff --git a/Makefile b/Makefile index fb01ff7..ef4ed4c 100644 --- a/Makefile +++ b/Makefile @@ -14,6 +14,8 @@ ### has a changed structure of its header files. WITH_NEW_FFMPEG_HEADERS=1 +#FFMDIR = ../../../../ffmpeg + # The official name of this plugin. # This name will be used in the '-P...' option of VDR to load the plugin. # By default the main source file also carries this name. @@ -33,7 +35,6 @@ CXXFLAGS ?= -g -O2 -Wall -Woverloaded-virtual -Wno-parentheses ### The directory environment: -FFMDIR = ../../../../ffmpeg-0.4.8 VDRDIR = ../../.. LIBDIR = ../../lib TMPDIR = /tmp @@ -61,22 +62,27 @@ INCLUDES += -I$(VDRDIR)/include DEFINES += -D_GNU_SOURCE -DPLUGIN_NAME_I18N='"$(PLUGIN)"' -INCLUDES += -I$(FFMDIR)/libavcodec -LIBS += -L$(FFMDIR)/libavcodec -lavcodec +ifdef FFMDIR + INCLUDES += -I$(FFMDIR)/libavcodec + LIBS += -L$(FFMDIR)/libavcodec -lavcodec + ifndef WITHOUT_SWSCALER + DEFINES += -DUSE_SWSCALE + LIBS += -L$(FFMDIR)/libswscale -lswscale + endif +else + INCLUDES += $(shell pkg-config --cflags libavcodec) + LIBS += $(shell pkg-config --libs libavcodec) + ifndef WITHOUT_SWSCALE + DEFINES += -DUSE_SWSCALE + INCLUDES += $(shell pkg-config --cflags libswscale) + LIBS += $(shell pkg-config --libs libswscale) + endif +endif ifdef FFMPEG_STATIC DEFINES += -DHAVE_FFMPEG_STATIC endif -ifndef WITHOUT_SWSCALE - DEFINES += -DUSE_SWSCALE - ifneq ($(shell which pkg-config),) - LIBS += $(shell pkg-config --silence-errors --libs libswscale) - else - LIBS += -lswscale - endif -endif - ifdef WITH_NEW_FFMPEG_HEADERS DEFINES += -DUSE_NEW_FFMPEG_HEADERS endif diff --git a/decoder.h b/decoder.h index d139b58..f503402 100644 --- a/decoder.h +++ b/decoder.h @@ -20,9 +20,9 @@ extern "C" #include #endif #else - #include + #include #ifdef USE_SWSCALE - #include + #include #endif #endif } -- cgit v1.2.3