[vdr] [PATCH] Gather necessary options for build in Make.global and include it. (was: [Makefile] `-fPIC` not added to externally defined `C[XX]FLAGS` of PLUGINS if `Make.config` not available)
Paul Menzel
paulepanter at users.sourceforge.net
Thu Jan 28 22:23:21 CET 2010
Without this patch, if some options in `Makefile` were set outside `Makefile` and no `Make.config` existed with the necessary options, builds could fail. [1][2][3]
Therefore include strictly necessary options in `Make.global` and include this in all the Makefiles before `Make.config`.
This patch does not delete the those options which were factored out into `Make.global` to make it easier for people to understand the Makefile and what options are needed.
[1] http://www.linuxtv.org/pipermail/vdr/2009-July/020977.html
[2] http://www.linuxtv.org/pipermail/vdr/2009-December/021807.html
[3] http://www.linuxtv.org/pipermail/vdr/2010-January/022235.html
Signed-off-by: Paul Menzel <paulepanter at users.sourceforge.net>
---
Make.config.template | 6 ------
Make.global | 14 ++++++++++++++
Makefile | 1 +
PLUGINS/src/dvbsddevice/Makefile | 4 ++++
PLUGINS/src/hello/Makefile | 4 ++++
PLUGINS/src/osddemo/Makefile | 4 ++++
PLUGINS/src/pictures/Makefile | 4 ++++
PLUGINS/src/servicedemo/Makefile | 4 ++++
PLUGINS/src/skincurses/Makefile | 4 ++++
PLUGINS/src/status/Makefile | 4 ++++
PLUGINS/src/svdrpdemo/Makefile | 4 ++++
11 files changed, 47 insertions(+), 6 deletions(-)
create mode 100644 Make.global
diff --git a/Make.config.template b/Make.config.template
index 758fc14..3296992 100644
--- a/Make.config.template
+++ b/Make.config.template
@@ -16,12 +16,6 @@ CFLAGS = -g -O2 -Wall
CXX = g++
CXXFLAGS = -g -O2 -Wall -Woverloaded-virtual -Wno-parentheses
-ifdef PLUGIN
-CFLAGS += -fPIC
-CXXFLAGS += -fPIC
-DEFINES += -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE
-endif
-
### The directory environment:
#DVBDIR = /usr/src/v4l-dvb/linux
diff --git a/Make.global b/Make.global
new file mode 100644
index 0000000..5ef70f0
--- /dev/null
+++ b/Make.global
@@ -0,0 +1,14 @@
+#
+# Strictly necessary Makefile options for the Video Disk Recorder
+#
+# See the main source file 'vdr.c' for copyright information and
+# how to reach the author.
+
+# Plugins need to be compiled with position independent code, otherwise linking
+# VDR against it will fail.
+ifdef PLUGIN
+CFLAGS += -fPIC
+CXXFLAGS += -fPIC
+endif
+
+DEFINES += -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE
diff --git a/Makefile b/Makefile
index e13ea5e..faa36e7 100644
--- a/Makefile
+++ b/Makefile
@@ -32,6 +32,7 @@ CONFDIR = $(VIDEODIR)
DOXYGEN = /usr/bin/doxygen
DOXYFILE = Doxyfile
+-include Make.global
-include Make.config
SILIB = $(LSIDIR)/libsi.a
diff --git a/PLUGINS/src/dvbsddevice/Makefile b/PLUGINS/src/dvbsddevice/Makefile
index 8ef273c..4eeec31 100644
--- a/PLUGINS/src/dvbsddevice/Makefile
+++ b/PLUGINS/src/dvbsddevice/Makefile
@@ -20,6 +20,10 @@ VERSION = $(shell grep 'static const char \*VERSION *=' $(PLUGIN).c | awk '{ pri
CXX ?= g++
CXXFLAGS ?= -fPIC -g -O2 -Wall -Woverloaded-virtual -Wno-parentheses
+### Make sure that necessary options are included:
+
+-include $(VDRDIR)/Make.global
+
### The directory environment:
VDRDIR = ../../..
diff --git a/PLUGINS/src/hello/Makefile b/PLUGINS/src/hello/Makefile
index ea5b806..67a54d5 100644
--- a/PLUGINS/src/hello/Makefile
+++ b/PLUGINS/src/hello/Makefile
@@ -20,6 +20,10 @@ VERSION = $(shell grep 'static const char \*VERSION *=' $(PLUGIN).c | awk '{ pri
CXX ?= g++
CXXFLAGS ?= -fPIC -g -O2 -Wall -Woverloaded-virtual -Wno-parentheses
+### Make sure that necessary options are included:
+
+-include $(VDRDIR)/Make.global
+
### The directory environment:
VDRDIR = ../../..
diff --git a/PLUGINS/src/osddemo/Makefile b/PLUGINS/src/osddemo/Makefile
index 1b1c622..802f678 100644
--- a/PLUGINS/src/osddemo/Makefile
+++ b/PLUGINS/src/osddemo/Makefile
@@ -18,6 +18,10 @@ VERSION = $(shell grep 'static const char \*VERSION *=' $(PLUGIN).c | awk '{ pri
CXX ?= g++
CXXFLAGS ?= -fPIC -g -O2 -Wall -Woverloaded-virtual -Wno-parentheses
+### Make sure that necessary options are included:
+
+-include $(VDRDIR)/Make.global
+
### The directory environment:
VDRDIR = ../../..
diff --git a/PLUGINS/src/pictures/Makefile b/PLUGINS/src/pictures/Makefile
index 46a262f..8305cd3 100644
--- a/PLUGINS/src/pictures/Makefile
+++ b/PLUGINS/src/pictures/Makefile
@@ -20,6 +20,10 @@ VERSION = $(shell grep 'static const char \*VERSION *=' $(PLUGIN).c | awk '{ pri
CXX ?= g++
CXXFLAGS ?= -fPIC -g -O2 -Wall -Woverloaded-virtual -Wno-parentheses
+### Make sure that necessary options are included:
+
+-include $(VDRDIR)/Make.global
+
### The directory environment:
VDRDIR = ../../..
diff --git a/PLUGINS/src/servicedemo/Makefile b/PLUGINS/src/servicedemo/Makefile
index ea7e66a..9113217 100644
--- a/PLUGINS/src/servicedemo/Makefile
+++ b/PLUGINS/src/servicedemo/Makefile
@@ -20,6 +20,10 @@ VERSION = $(shell grep 'static const char \*VERSION *=' $(PLUGIN1).c | awk '{ pr
CXX ?= g++
CXXFLAGS ?= -fPIC -g -O2 -Wall -Woverloaded-virtual -Wno-parentheses
+### Make sure that necessary options are included:
+
+-include $(VDRDIR)/Make.global
+
### The directory environment:
VDRDIR = ../../..
diff --git a/PLUGINS/src/skincurses/Makefile b/PLUGINS/src/skincurses/Makefile
index cade795..42934d7 100644
--- a/PLUGINS/src/skincurses/Makefile
+++ b/PLUGINS/src/skincurses/Makefile
@@ -20,6 +20,10 @@ VERSION = $(shell grep 'static const char \*VERSION *=' $(PLUGIN).c | awk '{ pri
CXX ?= g++
CXXFLAGS ?= -fPIC -g -O2 -Wall -Woverloaded-virtual -Wno-parentheses
+### Make sure that necessary options are included:
+
+-include $(VDRDIR)/Make.global
+
### The directory environment:
VDRDIR = ../../..
diff --git a/PLUGINS/src/status/Makefile b/PLUGINS/src/status/Makefile
index 81d4163..543b2ef 100644
--- a/PLUGINS/src/status/Makefile
+++ b/PLUGINS/src/status/Makefile
@@ -18,6 +18,10 @@ VERSION = $(shell grep 'static const char \*VERSION *=' $(PLUGIN).c | awk '{ pri
CXX ?= g++
CXXFLAGS ?= -fPIC -g -O2 -Wall -Woverloaded-virtual -Wno-parentheses
+### Make sure that necessary options are included:
+
+-include $(VDRDIR)/Make.global
+
### The directory environment:
VDRDIR = ../../..
diff --git a/PLUGINS/src/svdrpdemo/Makefile b/PLUGINS/src/svdrpdemo/Makefile
index c835f3c..53fa8a5 100644
--- a/PLUGINS/src/svdrpdemo/Makefile
+++ b/PLUGINS/src/svdrpdemo/Makefile
@@ -18,6 +18,10 @@ VERSION = $(shell grep 'static const char \*VERSION *=' $(PLUGIN).c | awk '{ pri
CXX ?= g++
CXXFLAGS ?= -fPIC -g -O2 -Wall -Woverloaded-virtual -Wno-parentheses
+### Make sure that necessary options are included:
+
+-include $(VDRDIR)/Make.global
+
### The directory environment:
VDRDIR = ../../..
--
1.6.6
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: Dies ist ein digital signierter Nachrichtenteil
URL: <http://www.linuxtv.org/pipermail/vdr/attachments/20100128/56815c64/attachment.pgp>
More information about the vdr
mailing list