From f70414cf5b6f2fe44187e7bf35efd270c3def585 Mon Sep 17 00:00:00 2001
From: Klaus Schmidinger <vdr@tvdr.de>
Date: Thu, 27 Dec 2012 16:15:38 +0100
Subject: Using relative paths again when building plugins locally

---
 CONTRIBUTORS |  1 +
 HISTORY      |  1 +
 Makefile     | 20 +++++++++++---------
 3 files changed, 13 insertions(+), 9 deletions(-)

diff --git a/CONTRIBUTORS b/CONTRIBUTORS
index c48f304b..6c87a3e9 100644
--- a/CONTRIBUTORS
+++ b/CONTRIBUTORS
@@ -1763,6 +1763,7 @@ Udo Richter <udo_richter@gmx.de>
  for suggesting to check cIoThrottle::Engaged() in cRemoveDeletedRecordingsThread::Action()
  for suggesting to shift editing marks that don't point to an I-frame towards the next I-frame
  when a recording is played
+ for requesting to keep using relative paths when building plugins locally
 
 Sven Kreiensen <svenk@kammer.uni-hannover.de>
  for his help in keeping 'channels.conf.terr' up to date
diff --git a/HISTORY b/HISTORY
index bb5fbbe6..64a9bfac 100644
--- a/HISTORY
+++ b/HISTORY
@@ -7476,3 +7476,4 @@ Video Disk Recorder Revision History
 - Now using targets "install-lib" and "install-i18n" when building plugins locally.
 - Added MANDIR to the vdr.pc file, so that plugins that need it can retrieve it via
   MANDIR = $(DESTDIR)$(call PKGCFG,mandir).
+- Using relative paths again when building plugins locally (by request of Udo Richter).
diff --git a/Makefile b/Makefile
index e20fe708..11c59729 100644
--- a/Makefile
+++ b/Makefile
@@ -4,7 +4,7 @@
 # See the main source file 'vdr.c' for copyright information and
 # how to reach the author.
 #
-# $Id: Makefile 2.41 2012/12/27 14:00:51 kls Exp $
+# $Id: Makefile 2.42 2012/12/27 16:02:53 kls Exp $
 
 .DELETE_ON_ERROR:
 
@@ -23,7 +23,7 @@ CDEFINES += -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE
 
 # Directories:
 
-CWD     := $(shell pwd)
+CWD      = .
 LSIDIR   = ./libsi
 DESTDIR ?=
 PREFIX  ?= /usr/local
@@ -52,6 +52,8 @@ ifdef DVBDIR
 CFLAGS += -I$(DVBDIR)/include
 endif
 
+UP3 = $(if $(findstring "$(LIBDIR)-$(LOCDIR)","$(CWD)/PLUGINS/lib-$(CWD)/locale"),../../../,)
+
 SILIB    = $(LSIDIR)/libsi.a
 
 OBJS = audio.o channels.o ci.o config.o cutter.o device.o diseqc.o dvbdevice.o dvbci.o\
@@ -135,11 +137,11 @@ vdr.pc:
 	@echo "videodir=$(VIDEODIR)" >> $@
 	@echo "cachedir=$(CACHEDIRDEF)" >> $@
 	@echo "resdir=$(RESDIRDEF)" >> $@
-	@echo "libdir=$(LIBDIR)" >> $@
-	@echo "locdir=$(LOCDIR)" >> $@
+	@echo "libdir=$(UP3)$(LIBDIR)" >> $@
+	@echo "locdir=$(UP3)$(LOCDIR)" >> $@
 	@echo "apiversion=$(APIVERSION)" >> $@
-	@echo "cflags=$(CFLAGS) $(CDEFINES) -I$(INCDIR)" >> $@
-	@echo "cxxflags=$(CXXFLAGS) $(CDEFINES) -I$(INCDIR)" >> $@
+	@echo "cflags=$(CFLAGS) $(CDEFINES) -I$(UP3)$(INCDIR)" >> $@
+	@echo "cxxflags=$(CXXFLAGS) $(CDEFINES) -I$(UP3)$(INCDIR)" >> $@
 	@echo "" >> $@
 	@echo "Name: VDR" >> $@
 	@echo "Description: Video Disk Recorder" >> $@
@@ -202,9 +204,9 @@ plugins: include-dir vdr.pc
 	       fi;\
 	    includes=;\
 	    if [ "$(INCDIR)" != "$(CWD)/include" ]; then\
-	       includes="INCLUDES=-I$(CWD)/include";\
+	       includes="INCLUDES=-I$(UP3)/include";\
 	       fi;\
-	    $(MAKE) --no-print-directory -C "$(PLUGINDIR)/src/$$i" VDRDIR=$(CWD) $$includes $$target || failed="$$failed $$i";\
+	    $(MAKE) --no-print-directory -C "$(PLUGINDIR)/src/$$i" VDRDIR=$(UP3)$(CWD) $$includes $$target || failed="$$failed $$i";\
 	    done;\
 	if [ -n "$$noapiv" ] ; then echo; echo "*** plugins without APIVERSION:$$noapiv"; echo; fi;\
 	if [ -n "$$failed" ] ; then echo; echo "*** failed plugins:$$failed"; echo; exit 1; fi
@@ -247,7 +249,7 @@ install-doc:
 
 install-plugins: plugins
 	@for i in `ls $(PLUGINDIR)/src | grep -v '[^a-z0-9]'`; do\
-	     $(MAKE) --no-print-directory -C "$(PLUGINDIR)/src/$$i" VDRDIR=$(CWD) DESTDIR=$(DESTDIR) install;\
+	     $(MAKE) --no-print-directory -C "$(PLUGINDIR)/src/$$i" VDRDIR=$(UP3)$(CWD) DESTDIR=$(DESTDIR) install;\
 	     done
 
 # Includes:
-- 
cgit v1.2.3