Re: [DISCUSSION REQUEST] reintroduce a common make configuration file in VDR-1.7.35

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 26.12.2012 20:19, Udo Richter wrote:
...
Oh, and by the way, with introducing $(CWD) some previously relative paths got hard coded, so moving these builds around or accessing them from different mount points might now be broken. For example, my default lib dir changed from ./PLUGINS/lib to /usr/src/pc/vdr/vdr-1.7.34/PLUGINS/lib, which only
makes sense within a single virtual machine that cannot even run VDR at all. I'll have to add some overrides for that.

The attached patch changes the VDR Makefile back to using relative paths
if the plugins are built locally.
The patch also contains

- Making sure that plugins include the VDR header files from the actual VDR source
  directory when doing "make plugins" (suggested by Christoper Reimer).
- Increased the version numbers of all plugins to reflect the recent Makefile changes.
- If set, DVBDIR is now conveyed to plugins via the CFLAGS.
- Removed some redundancy from Make.config.template.
- Changed "==" to "=" in the Makefile to make it POSIX style.
- 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).


...still considering what to do with the plugin configuration stuff. Currently I tend to
put a "plgcfg" entry into vdr.pc, since apparently everybody wants this to be somewhere else.
I'm just glad Linux distribution managers don't build cars - otherwise we would most
likely be long dead before we find the brake pedal... ;-)

Klaus
--- Makefile	2012/12/23 11:28:13	2.36
+++ Makefile	2012/12/27 16:02:53
@@ -4,7 +4,7 @@
 # See the main source file 'vdr.c' for copyright information and
 # how to reach the author.
 #
-# $Id: Makefile 2.36 2012/12/23 11:28:13 kls Exp $
+# $Id: Makefile 2.41 2012/12/27 14:00:51 kls Exp kls $
 
 .DELETE_ON_ERROR:
 
@@ -17,14 +17,13 @@
 CXXFLAGS ?= $(CFLAGS) -Werror=overloaded-virtual -Wno-parentheses
 
 CFLAGS   += -fPIC
-CXXFLAGS += -fPIC
 
 CDEFINES  = -D_GNU_SOURCE
 CDEFINES += -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE
 
 # Directories:
 
-CWD     := $(shell pwd)
+CWD      = .
 LSIDIR   = ./libsi
 DESTDIR ?=
 PREFIX  ?= /usr/local
@@ -49,6 +48,12 @@
 
 -include Make.config
 
+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\
@@ -127,15 +132,16 @@
 .PHONY: vdr.pc
 vdr.pc:
 	@echo "bindir=$(BINDIR)" > $@
+	@echo "mandir=$(MANDIR)" >> $@
 	@echo "configdir=$(CONFDIRDEF)" >> $@
 	@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" >> $@
@@ -193,10 +199,14 @@
 	       continue;\
 	       fi;\
             target=all;\
-	    if [ "$(LIBDIR)" == "$(CWD)/PLUGINS/lib" ] && [ "$(LOCDIR)" == "$(CWD)/locale" ]; then\
-	       target=install;\
+	    if [ "$(LIBDIR)" = "$(CWD)/PLUGINS/lib" ] && [ "$(LOCDIR)" = "$(CWD)/locale" ]; then\
+	       target="install-lib install-i18n";\
+	       fi;\
+	    includes=;\
+	    if [ "$(INCDIR)" != "$(CWD)/include" ]; then\
+	       includes="INCLUDES=-I$(UP3)/include";\
 	       fi;\
-	    $(MAKE) --no-print-directory -C "$(PLUGINDIR)/src/$$i" VDRDIR=$(CWD) $$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
@@ -239,7 +249,7 @@
 
 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:
_______________________________________________
vdr mailing list
vdr@xxxxxxxxxxx
http://www.linuxtv.org/cgi-bin/mailman/listinfo/vdr

[Index of Archives]     [Linux Media]     [Asterisk]     [DCCP]     [Netdev]     [Xorg]     [Util Linux NG]     [Xfree86]     [Big List of Linux Books]     [Fedora Users]     [Fedora Women]     [ALSA Devel]     [Linux USB]

  Powered by Linux