From patchwork Sat Feb 6 14:10:13 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Paul Menzel X-Patchwork-Id: 12783 Received: from mail.tu-berlin.de ([130.149.7.33]) by mail.linuxtv.org with esmtp (Exim 4.69) (envelope-from ) id 1NdlMW-000119-Sa for vdr@linuxtv.org; Sat, 06 Feb 2010 15:10:18 +0100 X-tubIT-Incoming-IP: 188.40.100.199 Received: from mail.gw90.de ([188.40.100.199]) by mail.tu-berlin.de (exim-4.69/mailfrontend-d) with esmtps [TLSv1:AES256-SHA:256] for id 1NdlMW-0001ys-42; Sat, 06 Feb 2010 15:10:16 +0100 Received: from f053033108.adsl.alicedsl.de ([78.53.33.108] helo=[192.168.178.21]) by mail.gw90.de with esmtpsa (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.69) (envelope-from ) id 1NdlMU-0001nx-TK for vdr@linuxtv.org; Sat, 06 Feb 2010 14:10:15 +0000 From: Paul Menzel To: vdr@linuxtv.org Date: Sat, 06 Feb 2010 15:10:13 +0100 Message-ID: <1265465413.3776.120.camel@mattotaupa> Mime-Version: 1.0 X-Mailer: Evolution 2.28.2 X-tubIT-Score: 0.0 () X-PMX-Version: 5.5.5.374460, Antispam-Engine: 2.7.1.369594, Antispam-Data: 2010.2.6.135719 X-PMX-Spam: Gauge=XI, Probability=11%, Report=' LINES_OF_YELLING_3 0.671, BODY_PARA_IS_SENTENCE_URL 0.1, BODY_SIZE_10000_PLUS 0, INVALID_MSGID_NO_FQDN 0, TO_NO_NAME 0, __CP_MEDIA_BODY 0, __CP_URI_IN_BODY 0, __CT 0, __CTYPE_HAS_BOUNDARY 0, __CTYPE_MULTIPART 0, __HAS_MSGID 0, __HAS_X_MAILER 0, __LINES_OF_YELLING 0, __MIME_VERSION 0, __SANE_MSGID 0, __TO_MALFORMED_2 0' X-LSpam-Score: -3.1 (---) X-LSpam-Report: No, score=-3.1 required=5.0 tests=AWL=0.482, BAYES_00=-2.599, RCVD_IN_DNSWL_LOW=-1 autolearn=ham Subject: [vdr] [PATCH v4] Gather necessary options for build in Make.global and include it. X-BeenThere: vdr@linuxtv.org X-Mailman-Version: 2.1.11 Precedence: list Reply-To: VDR Mailing List List-Id: VDR Mailing List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 06 Feb 2010 14:10:18 -0000 Status: O X-Status: X-Keywords: X-UID: 22288 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`. [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 v2: Use `include` instead of `-include` to get a warning/error if it is not present. [4] v3: Change according to Frank’s comments [5]. • Delete options set in `Make.global` from other Makefiles. • Leave adding `-fPIC` to `C[XX]FLAGS` in `Make.config.template` as the flags get reset including `Make.config`. • Modify `newplugin`. v4: Actually provide a working patch. Thanks to Klaus [6]. • Only use `$(VDRDIR)` after it has been defined. • Escape `$` in Perl script `newplugin`. [4] http://www.gnu.org/software/make/manual/make.html#Include [5] http://www.linuxtv.org/pipermail/vdr/2010-January/022243.html [6] http://www.linuxtv.org/pipermail/vdr/2010-February/022325.html Signed-off-by: Paul Menzel --- Make.config.template | 1 - Make.global | 14 ++++++++++++++ Makefile | 3 +-- PLUGINS/src/dvbsddevice/Makefile | 8 +++++--- PLUGINS/src/hello/Makefile | 6 +++++- PLUGINS/src/osddemo/Makefile | 6 +++++- PLUGINS/src/pictures/Makefile | 6 +++++- PLUGINS/src/servicedemo/Makefile | 6 +++++- PLUGINS/src/skincurses/Makefile | 6 +++++- PLUGINS/src/status/Makefile | 6 +++++- PLUGINS/src/svdrpdemo/Makefile | 6 +++++- newplugin | 8 +++++--- 12 files changed, 60 insertions(+), 16 deletions(-) create mode 100644 Make.global diff --git a/Make.config.template b/Make.config.template index 758fc14..6fffa0e 100644 --- a/Make.config.template +++ b/Make.config.template @@ -19,7 +19,6 @@ 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: 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 01408cb..fea4ebe 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 @@ -60,8 +61,6 @@ DEFINES += -DLIRC_DEVICE=\"$(LIRC_DEVICE)\" -DRCU_DEVICE=\"$(RCU_DEVICE)\" DEFINES += -D_GNU_SOURCE -DEFINES += -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE - DEFINES += -DVIDEODIR=\"$(VIDEODIR)\" DEFINES += -DCONFDIR=\"$(CONFDIR)\" DEFINES += -DPLUGINDIR=\"$(PLUGINLIBDIR)\" diff --git a/PLUGINS/src/dvbsddevice/Makefile b/PLUGINS/src/dvbsddevice/Makefile index 8ef273c..07e820f 100644 --- a/PLUGINS/src/dvbsddevice/Makefile +++ b/PLUGINS/src/dvbsddevice/Makefile @@ -18,7 +18,7 @@ VERSION = $(shell grep 'static const char \*VERSION *=' $(PLUGIN).c | awk '{ pri ### The C++ compiler and options: CXX ?= g++ -CXXFLAGS ?= -fPIC -g -O2 -Wall -Woverloaded-virtual -Wno-parentheses +CXXFLAGS ?= -g -O2 -Wall -Woverloaded-virtual -Wno-parentheses ### The directory environment: @@ -26,6 +26,10 @@ VDRDIR = ../../.. LIBDIR = ../../lib TMPDIR = /tmp +### Make sure that necessary options are included: + +include $(VDRDIR)/Make.global + ### Allow user defined options to overwrite defaults: -include $(VDRDIR)/Make.config @@ -45,8 +49,6 @@ INCLUDES += -I$(VDRDIR)/include DEFINES += -D_GNU_SOURCE -DPLUGIN_NAME_I18N='"$(PLUGIN)"' -DEFINES += -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE - ### The object files (add further files here): OBJS = $(PLUGIN).o dvbsdffdevice.o dvbsdffosd.o diff --git a/PLUGINS/src/hello/Makefile b/PLUGINS/src/hello/Makefile index ea5b806..2f755c0 100644 --- a/PLUGINS/src/hello/Makefile +++ b/PLUGINS/src/hello/Makefile @@ -18,7 +18,7 @@ VERSION = $(shell grep 'static const char \*VERSION *=' $(PLUGIN).c | awk '{ pri ### The C++ compiler and options: CXX ?= g++ -CXXFLAGS ?= -fPIC -g -O2 -Wall -Woverloaded-virtual -Wno-parentheses +CXXFLAGS ?= -g -O2 -Wall -Woverloaded-virtual -Wno-parentheses ### The directory environment: @@ -26,6 +26,10 @@ VDRDIR = ../../.. LIBDIR = ../../lib TMPDIR = /tmp +### Make sure that necessary options are included: + +include $(VDRDIR)/Make.global + ### Allow user defined options to overwrite defaults: -include $(VDRDIR)/Make.config diff --git a/PLUGINS/src/osddemo/Makefile b/PLUGINS/src/osddemo/Makefile index 1b1c622..21c8cb8 100644 --- a/PLUGINS/src/osddemo/Makefile +++ b/PLUGINS/src/osddemo/Makefile @@ -16,7 +16,7 @@ VERSION = $(shell grep 'static const char \*VERSION *=' $(PLUGIN).c | awk '{ pri ### The C++ compiler and options: CXX ?= g++ -CXXFLAGS ?= -fPIC -g -O2 -Wall -Woverloaded-virtual -Wno-parentheses +CXXFLAGS ?= -g -O2 -Wall -Woverloaded-virtual -Wno-parentheses ### The directory environment: @@ -24,6 +24,10 @@ VDRDIR = ../../.. LIBDIR = ../../lib TMPDIR = /tmp +### Make sure that necessary options are included: + +include $(VDRDIR)/Make.global + ### Allow user defined options to overwrite defaults: -include $(VDRDIR)/Make.config diff --git a/PLUGINS/src/pictures/Makefile b/PLUGINS/src/pictures/Makefile index 46a262f..6b768d4 100644 --- a/PLUGINS/src/pictures/Makefile +++ b/PLUGINS/src/pictures/Makefile @@ -18,7 +18,7 @@ VERSION = $(shell grep 'static const char \*VERSION *=' $(PLUGIN).c | awk '{ pri ### The C++ compiler and options: CXX ?= g++ -CXXFLAGS ?= -fPIC -g -O2 -Wall -Woverloaded-virtual -Wno-parentheses +CXXFLAGS ?= -g -O2 -Wall -Woverloaded-virtual -Wno-parentheses ### The directory environment: @@ -26,6 +26,10 @@ VDRDIR = ../../.. LIBDIR = ../../lib TMPDIR = /tmp +### Make sure that necessary options are included: + +include $(VDRDIR)/Make.global + ### Allow user defined options to overwrite defaults: -include $(VDRDIR)/Make.config diff --git a/PLUGINS/src/servicedemo/Makefile b/PLUGINS/src/servicedemo/Makefile index ea7e66a..736d5fe 100644 --- a/PLUGINS/src/servicedemo/Makefile +++ b/PLUGINS/src/servicedemo/Makefile @@ -18,7 +18,7 @@ VERSION = $(shell grep 'static const char \*VERSION *=' $(PLUGIN1).c | awk '{ pr ### The C++ compiler and options: CXX ?= g++ -CXXFLAGS ?= -fPIC -g -O2 -Wall -Woverloaded-virtual -Wno-parentheses +CXXFLAGS ?= -g -O2 -Wall -Woverloaded-virtual -Wno-parentheses ### The directory environment: @@ -26,6 +26,10 @@ VDRDIR = ../../.. LIBDIR = ../../lib TMPDIR = /tmp +### Make sure that necessary options are included: + +include $(VDRDIR)/Make.global + ### Allow user defined options to overwrite defaults: -include $(VDRDIR)/Make.config diff --git a/PLUGINS/src/skincurses/Makefile b/PLUGINS/src/skincurses/Makefile index cade795..639e636 100644 --- a/PLUGINS/src/skincurses/Makefile +++ b/PLUGINS/src/skincurses/Makefile @@ -18,7 +18,7 @@ VERSION = $(shell grep 'static const char \*VERSION *=' $(PLUGIN).c | awk '{ pri ### The C++ compiler and options: CXX ?= g++ -CXXFLAGS ?= -fPIC -g -O2 -Wall -Woverloaded-virtual -Wno-parentheses +CXXFLAGS ?= -g -O2 -Wall -Woverloaded-virtual -Wno-parentheses ### The directory environment: @@ -26,6 +26,10 @@ VDRDIR = ../../.. LIBDIR = ../../lib TMPDIR = /tmp +### Make sure that necessary options are included: + +include $(VDRDIR)/Make.global + ### Allow user defined options to overwrite defaults: -include $(VDRDIR)/Make.config diff --git a/PLUGINS/src/status/Makefile b/PLUGINS/src/status/Makefile index 81d4163..1f99339 100644 --- a/PLUGINS/src/status/Makefile +++ b/PLUGINS/src/status/Makefile @@ -16,7 +16,7 @@ VERSION = $(shell grep 'static const char \*VERSION *=' $(PLUGIN).c | awk '{ pri ### The C++ compiler and options: CXX ?= g++ -CXXFLAGS ?= -fPIC -g -O2 -Wall -Woverloaded-virtual -Wno-parentheses +CXXFLAGS ?= -g -O2 -Wall -Woverloaded-virtual -Wno-parentheses ### The directory environment: @@ -24,6 +24,10 @@ VDRDIR = ../../.. LIBDIR = ../../lib TMPDIR = /tmp +### Make sure that necessary options are included: + +include $(VDRDIR)/Make.global + ### Allow user defined options to overwrite defaults: -include $(VDRDIR)/Make.config diff --git a/PLUGINS/src/svdrpdemo/Makefile b/PLUGINS/src/svdrpdemo/Makefile index c835f3c..7202b36 100644 --- a/PLUGINS/src/svdrpdemo/Makefile +++ b/PLUGINS/src/svdrpdemo/Makefile @@ -16,7 +16,7 @@ VERSION = $(shell grep 'static const char \*VERSION *=' $(PLUGIN).c | awk '{ pri ### The C++ compiler and options: CXX ?= g++ -CXXFLAGS ?= -fPIC -g -O2 -Wall -Woverloaded-virtual -Wno-parentheses +CXXFLAGS ?= -g -O2 -Wall -Woverloaded-virtual -Wno-parentheses ### The directory environment: @@ -24,6 +24,10 @@ VDRDIR = ../../.. LIBDIR = ../../lib TMPDIR = /tmp +### Make sure that necessary options are included: + +include $(VDRDIR)/Make.global + ### Allow user defined options to overwrite defaults: -include $(VDRDIR)/Make.config diff --git a/newplugin b/newplugin index 52ef72e..66f0cb2 100755 --- a/newplugin +++ b/newplugin @@ -77,7 +77,7 @@ VERSION = \$(shell grep 'static const char \\*VERSION *=' \$(PLUGIN).c | awk '{ ### The C++ compiler and options: CXX ?= g++ -CXXFLAGS ?= -fPIC -g -O2 -Wall -Woverloaded-virtual -Wno-parentheses +CXXFLAGS ?= -g -O2 -Wall -Woverloaded-virtual -Wno-parentheses ### The directory environment: @@ -85,6 +85,10 @@ VDRDIR = ../../.. LIBDIR = ../../lib TMPDIR = /tmp +### Make sure that necessary options are included: + +include \$(VDRDIR)/Make.global + ### Allow user defined options to overwrite defaults: -include \$(VDRDIR)/Make.config @@ -104,8 +108,6 @@ INCLUDES += -I\$(VDRDIR)/include DEFINES += -D_GNU_SOURCE -DPLUGIN_NAME_I18N='"\$(PLUGIN)"' -DEFINES += -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE - ### The object files (add further files here): OBJS = \$(PLUGIN).o