summaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
authorThomas Günther <tom@toms-cafe.de>2010-03-27 00:22:17 +0100
committerThomas Günther <tom@toms-cafe.de>2010-03-27 00:22:17 +0100
commit780c9f6d98de42a1004878d23007d487152d2de6 (patch)
tree63224c5d2e9e68437bca79c81bb98500181dce4b /Makefile
parent87cd7e0c9d86169c872b58de5ca9db8703cbdcef (diff)
downloadvdr-plugin-osdpip-780c9f6d98de42a1004878d23007d487152d2de6.tar.gz
vdr-plugin-osdpip-780c9f6d98de42a1004878d23007d487152d2de6.tar.bz2
Use pkg-config to find compilation flags, libs etc for ffmpeg
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile30
1 files changed, 18 insertions, 12 deletions
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