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)
Commit Message
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@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
Comments
On Thursday 28 January 2010, Paul Menzel wrote:
> Therefore include strictly necessary options in `Make.global` and include
> this in all the Makefiles before `Make.config`.
If these options are strictly necessary, shouldn't the leading "-" be dropped
from all "-include $(VDRDIR)/Make.global" lines?
Am 28.01.2010 22:52, schrieb Ville Skyttä:
> On Thursday 28 January 2010, Paul Menzel wrote:
>
>> Therefore include strictly necessary options in `Make.global` and include
>> this in all the Makefiles before `Make.config`.
>
> If these options are strictly necessary, shouldn't the leading "-" be dropped
> from all "-include $(VDRDIR)/Make.global" lines?
In this case, yes, but many cross-version plugins will need to be more
flexible here, either by doing a messy VDR version check, or by simply
just using -inlcude anyway.
Cheers,
Udo
Am Samstag, den 30.01.2010, 11:57 +0100 schrieb Udo Richter:
> Am 28.01.2010 22:52, schrieb Ville Skyttä:
> > On Thursday 28 January 2010, Paul Menzel wrote:
> >
> >> Therefore include strictly necessary options in `Make.global` and include
> >> this in all the Makefiles before `Make.config`.
> >
> > If these options are strictly necessary, shouldn't the leading "-" be dropped
> > from all "-include $(VDRDIR)/Make.global" lines?
>
> In this case, yes, but many cross-version plugins will need to be more
> flexible here, either by doing a messy VDR version check, or by simply
> just using -inlcude anyway.
Sorry, I do not know if I understood you correctly. Do you mean that
some other plugins (which are not shipped with VDR, i. e. the patch does
not need to be changed in that regard) need to use `-include
$(VDRDIR)/Make.global` instead of `include $(VDRDIR)/Make.global`?
Do the authors of those plugins generally know about that kind of stuff
or does this have to be documented somewhere?
Thanks,
Paul
Am 30.01.2010 12:12, schrieb Paul Menzel:
> Sorry, I do not know if I understood you correctly. Do you mean that
> some other plugins (which are not shipped with VDR, i. e. the patch does
> not need to be changed in that regard) need to use `-include
> $(VDRDIR)/Make.global` instead of `include $(VDRDIR)/Make.global`?
>
> Do the authors of those plugins generally know about that kind of stuff
> or does this have to be documented somewhere?
Plugins shipped with VDR usually only need to work with this version of
VDR, they (and the newplugin script) don't provide backwards
compatibility. Plugin authors that want to support a wider range of VDR
versions with one release will usually need to adapt their behavior to
the VDR version they compile with.
In this case, they will have to add -fPIC and the FILE_OFFSET stuff for
older versions of VDR, and only include Make.global for the upcoming VDR
versions.
However, this is not a concern for VDR or for this patch. Its ok for VDR
to look ahead, and not to carry endless compatibility hacks with it.
Cheers,
Udo
On Sat, Jan 30, 2010 at 4:21 AM, Udo Richter <udo_richter@gmx.de> wrote:
> However, this is not a concern for VDR or for this patch. Its ok for VDR
> to look ahead, and not to carry endless compatibility hacks with it.
I couldn't agree more. I cant stand when something is bloated down
with that, just because some users out there refuse to update their
system. I understand 'if its not broke, dont fix it', but that doesnt
mean be an anchor weighing everything down. If you choose to stay in
the dark ages, then suffer the consequences. ;)
@@ -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
new file mode 100644
@@ -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
@@ -32,6 +32,7 @@ CONFDIR = $(VIDEODIR)
DOXYGEN = /usr/bin/doxygen
DOXYFILE = Doxyfile
+-include Make.global
-include Make.config
SILIB = $(LSIDIR)/libsi.a
@@ -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 = ../../..
@@ -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 = ../../..
@@ -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 = ../../..
@@ -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 = ../../..
@@ -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 = ../../..
@@ -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 = ../../..
@@ -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 = ../../..
@@ -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 = ../../..