[v3] Gather necessary options for build in Make.global and include it.

Message ID 1264774791.3902.48.camel@mattotaupa
State New
Headers

Commit Message

Paul Menzel Jan. 29, 2010, 2:19 p.m. UTC
  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`.

[4] http://www.gnu.org/software/make/manual/make.html#Include
[5] http://www.linuxtv.org/pipermail/vdr/2010-January/022243.html

Signed-off-by: Paul Menzel <paulepanter@users.sourceforge.net>
---
 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
  

Comments

Klaus Schmidinger Feb. 6, 2010, 11:29 a.m. UTC | #1
On 29.01.2010 15:19, Paul Menzel wrote:
> 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`.
> 
> [4] http://www.gnu.org/software/make/manual/make.html#Include
> [5] http://www.linuxtv.org/pipermail/vdr/2010-January/022243.html
> 
> Signed-off-by: Paul Menzel <paulepanter@users.sourceforge.net>
> ...

Is it safe to assume that this is the final version everybody
has agreed upon?

Klaus
  
Paul Menzel Feb. 6, 2010, 11:43 a.m. UTC | #2
Am Samstag, den 06.02.2010, 12:29 +0100 schrieb Klaus Schmidinger:
> On 29.01.2010 15:19, Paul Menzel wrote:
> > 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`.
> > 
> > [4] http://www.gnu.org/software/make/manual/make.html#Include
> > [5] http://www.linuxtv.org/pipermail/vdr/2010-January/022243.html
> > 
> > Signed-off-by: Paul Menzel <paulepanter@users.sourceforge.net>
> > ...
> 
> Is it safe to assume that this is the final version everybody
> has agreed upon?

I think so, since nobody commented on this anymore, it can be applied.
Frank told me I should submit it to you. Great that you were faster.

I do not know when you will release the 1.7.13. If it is still some days
away then maybe we can set a limit of seven days to give everyone a
chance again to comment on this patch and you can apply it afterward.


Thanks,

Paul
  
Klaus Schmidinger Feb. 6, 2010, noon UTC | #3
On 06.02.2010 12:43, Paul Menzel wrote:
> Am Samstag, den 06.02.2010, 12:29 +0100 schrieb Klaus Schmidinger:
>> On 29.01.2010 15:19, Paul Menzel wrote:
>>> 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`.
>>>
>>> [4] http://www.gnu.org/software/make/manual/make.html#Include
>>> [5] http://www.linuxtv.org/pipermail/vdr/2010-January/022243.html
>>>
>>> Signed-off-by: Paul Menzel <paulepanter@users.sourceforge.net>
>>> ...
>> Is it safe to assume that this is the final version everybody
>> has agreed upon?
> 
> I think so, since nobody commented on this anymore, it can be applied.
> Frank told me I should submit it to you. Great that you were faster.
> 
> I do not know when you will release the 1.7.13. If it is still some days
> away then maybe we can set a limit of seven days to give everyone a
> chance again to comment on this patch and you can apply it afterward.

I'm either applying it today, or ignore it altogether ;-)
I believe there has been enough time for complaints.

Klaus
  
Klaus Schmidinger Feb. 6, 2010, 12:17 p.m. UTC | #4
On 29.01.2010 15:19, Paul Menzel wrote:
> 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`.
> 
> [4] http://www.gnu.org/software/make/manual/make.html#Include
> [5] http://www.linuxtv.org/pipermail/vdr/2010-January/022243.html
> 
> Signed-off-by: Paul Menzel <paulepanter@users.sourceforge.net>
> ...
> --- a/PLUGINS/src/dvbsddevice/Makefile
> +++ b/PLUGINS/src/dvbsddevice/Makefile
> @@ -18,7 +18,11 @@ 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
> +
> +### Make sure that necessary options are included:
> +
> +include $(VDRDIR)/Make.global
> ...

This fails when doing

  make clean-plugins

make[1]: Entering directory `/home/kls/vdr/VDR/PLUGINS/src/dvbsddevice'
Makefile:25: /Make.global: No such file or directory
make[1]: *** No rule to make target `/Make.global'.  Stop.
make[1]: Leaving directory `/home/kls/vdr/VDR/PLUGINS/src/dvbsddevice'

Apparently $(VDRDIR) is not yet defined at that point.

> ... 
> diff --git a/newplugin b/newplugin
> index 52ef72e..6c9be35 100755
> --- a/newplugin
> +++ b/newplugin
> @@ -77,7 +77,11 @@ 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
> +
> +### Make sure that necessary options are included:
> +
> +include $(VDRDIR)/Make.global

I assume this last line should read

+include \$(VDRDIR)/Make.global


Please provide a revised (and tested ;-) patch.

Klaus
  
Paul Menzel Feb. 6, 2010, 12:23 p.m. UTC | #5
Am Samstag, den 06.02.2010, 13:00 +0100 schrieb Klaus Schmidinger:
> On 06.02.2010 12:43, Paul Menzel wrote:

[…]

> > I do not know when you will release the 1.7.13. If it is still some days
> > away then maybe we can set a limit of seven days to give everyone a
> > chance again to comment on this patch and you can apply it afterward.
> 
> I'm either applying it today, or ignore it altogether ;-)
> I believe there has been enough time for complaints.

Then please apply it.


Thanks,

Paul
  
Klaus Schmidinger Feb. 6, 2010, 12:25 p.m. UTC | #6
On 06.02.2010 13:23, Paul Menzel wrote:
> Am Samstag, den 06.02.2010, 13:00 +0100 schrieb Klaus Schmidinger:
>> On 06.02.2010 12:43, Paul Menzel wrote:
> 
> […]
> 
>>> I do not know when you will release the 1.7.13. If it is still some days
>>> away then maybe we can set a limit of seven days to give everyone a
>>> chance again to comment on this patch and you can apply it afterward.
>> I'm either applying it today, or ignore it altogether ;-)
>> I believe there has been enough time for complaints.
> 
> Then please apply it.

I was just about to do that, when I came across a problem
while testing it.
See my posting just a few minutes ago.

Klaus
  
Paul Menzel Feb. 6, 2010, 2:11 p.m. UTC | #7
Am Samstag, den 06.02.2010, 13:25 +0100 schrieb Klaus Schmidinger:
> On 06.02.2010 13:23, Paul Menzel wrote:
> > Am Samstag, den 06.02.2010, 13:00 +0100 schrieb Klaus Schmidinger:
> >> On 06.02.2010 12:43, Paul Menzel wrote:
> > 
> > […]
> > 
> >>> I do not know when you will release the 1.7.13. If it is still some days
> >>> away then maybe we can set a limit of seven days to give everyone a
> >>> chance again to comment on this patch and you can apply it afterward.
> >> I'm either applying it today, or ignore it altogether ;-)
> >> I believe there has been enough time for complaints.
> > 
> > Then please apply it.
> 
> I was just about to do that, when I came across a problem
> while testing it.
> See my posting just a few minutes ago.

Sorry about that. I just resend a working patch which you can apply.


Thanks,

Paul
  
Paul Menzel Feb. 7, 2010, 1:41 p.m. UTC | #8
Am Samstag, den 06.02.2010, 13:17 +0100 schrieb Klaus Schmidinger:
> On 29.01.2010 15:19, Paul Menzel wrote:

[…]

> > --- a/PLUGINS/src/dvbsddevice/Makefile
> > +++ b/PLUGINS/src/dvbsddevice/Makefile
> > @@ -18,7 +18,11 @@ 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
> > +
> > +### Make sure that necessary options are included:
> > +
> > +include $(VDRDIR)/Make.global
> > ...
> 
> This fails when doing
> 
>   make clean-plugins
> 
> make[1]: Entering directory `/home/kls/vdr/VDR/PLUGINS/src/dvbsddevice'
> Makefile:25: /Make.global: No such file or directory
> make[1]: *** No rule to make target `/Make.global'.  Stop.
> make[1]: Leaving directory `/home/kls/vdr/VDR/PLUGINS/src/dvbsddevice'
> 
> Apparently $(VDRDIR) is not yet defined at that point.

Fixed.

> > ... 
> > diff --git a/newplugin b/newplugin
> > index 52ef72e..6c9be35 100755
> > --- a/newplugin
> > +++ b/newplugin
> > @@ -77,7 +77,11 @@ 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
> > +
> > +### Make sure that necessary options are included:
> > +
> > +include $(VDRDIR)/Make.global
> 
> I assume this last line should read
> 
> +include \$(VDRDIR)/Make.global

Fixed.

> Please provide a revised (and tested ;-) patch.

I sent the revised and tested (`make`, `make plugins`, `make
clean-plugins`) patch to the list.

[vdr] [PATCH v4] Gather necessary options for build in Make.global and include it.


Sorry for the inconvenience. Thanks,

Paul


[1] http://www.linuxtv.org/pipermail/vdr/2010-February/022333.html
  

Patch

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 e13ea5e..a2659be 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..345543e 100644
--- a/PLUGINS/src/dvbsddevice/Makefile
+++ b/PLUGINS/src/dvbsddevice/Makefile
@@ -18,7 +18,11 @@  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
+
+### Make sure that necessary options are included:
+
+include $(VDRDIR)/Make.global
 
 ### The directory environment:
 
@@ -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..1ec3170 100644
--- a/PLUGINS/src/hello/Makefile
+++ b/PLUGINS/src/hello/Makefile
@@ -18,7 +18,11 @@  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
+
+### Make sure that necessary options are included:
+
+include $(VDRDIR)/Make.global
 
 ### The directory environment:
 
diff --git a/PLUGINS/src/osddemo/Makefile b/PLUGINS/src/osddemo/Makefile
index 1b1c622..2a7f836 100644
--- a/PLUGINS/src/osddemo/Makefile
+++ b/PLUGINS/src/osddemo/Makefile
@@ -16,7 +16,11 @@  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
+
+### Make sure that necessary options are included:
+
+include $(VDRDIR)/Make.global
 
 ### The directory environment:
 
diff --git a/PLUGINS/src/pictures/Makefile b/PLUGINS/src/pictures/Makefile
index 46a262f..19701de 100644
--- a/PLUGINS/src/pictures/Makefile
+++ b/PLUGINS/src/pictures/Makefile
@@ -18,7 +18,11 @@  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
+
+### Make sure that necessary options are included:
+
+include $(VDRDIR)/Make.global
 
 ### The directory environment:
 
diff --git a/PLUGINS/src/servicedemo/Makefile b/PLUGINS/src/servicedemo/Makefile
index ea7e66a..dca8ce4 100644
--- a/PLUGINS/src/servicedemo/Makefile
+++ b/PLUGINS/src/servicedemo/Makefile
@@ -18,7 +18,11 @@  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
+
+### Make sure that necessary options are included:
+
+include $(VDRDIR)/Make.global
 
 ### The directory environment:
 
diff --git a/PLUGINS/src/skincurses/Makefile b/PLUGINS/src/skincurses/Makefile
index cade795..50fd3c5 100644
--- a/PLUGINS/src/skincurses/Makefile
+++ b/PLUGINS/src/skincurses/Makefile
@@ -18,7 +18,11 @@  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
+
+### Make sure that necessary options are included:
+
+include $(VDRDIR)/Make.global
 
 ### The directory environment:
 
diff --git a/PLUGINS/src/status/Makefile b/PLUGINS/src/status/Makefile
index 81d4163..89165b3 100644
--- a/PLUGINS/src/status/Makefile
+++ b/PLUGINS/src/status/Makefile
@@ -16,7 +16,11 @@  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
+
+### Make sure that necessary options are included:
+
+include $(VDRDIR)/Make.global
 
 ### The directory environment:
 
diff --git a/PLUGINS/src/svdrpdemo/Makefile b/PLUGINS/src/svdrpdemo/Makefile
index c835f3c..0f8f811 100644
--- a/PLUGINS/src/svdrpdemo/Makefile
+++ b/PLUGINS/src/svdrpdemo/Makefile
@@ -16,7 +16,11 @@  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
+
+### Make sure that necessary options are included:
+
+include $(VDRDIR)/Make.global
 
 ### The directory environment:
 
diff --git a/newplugin b/newplugin
index 52ef72e..6c9be35 100755
--- a/newplugin
+++ b/newplugin
@@ -77,7 +77,11 @@  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
+
+### Make sure that necessary options are included:
+
+include $(VDRDIR)/Make.global
 
 ### The directory environment:
 
@@ -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