[v3] Makefile: pass `LDFLAGS` to compiler
Commit Message
Date: Sun, 12 Dec 2010 18:19:42 +0100
Some distributions pass special flags to the linker [1][2]. Respect those by using `LDFLAGS`.
Instead of [1] this patch was made using the following command based on `vdr-plugin.eclass` [3].
find PLUGINS -name Makefile | xargs sed -i '/LDFLAGS/!s:-shared:$(LDFLAGS) -shared:'
Additionally the main Makefile and the script `newplugin` are changed too.
The changes have been present in OpenEmbedded and Gentoo for a while already and can be assumend tested.
The implicit rules are not changed. This could been done easily using the following command.
$ find PLUGINS -name Makefile | xargs sed -i 's/$(CXX) $(CXXFLAGS) -c $(DEFINES) $(INCLUDES) $</$(CXX) $(CXXFLAGS) $(LDFLAGS) -c $(DEFINES) $(INCLUDES) $</'
[1] http://cgit.openembedded.org/cgit.cgi/openembedded/tree/recipes/vdr/vdr-1.7.10/linkerflags.patch
[2] http://www.linuxtv.org/pipermail/vdr/2010-September/023623.html
[3] http://sources.gentoo.org/cgi-bin/viewvc.cgi/gentoo-x86/eclass/vdr-plugin.eclass?view=markup (code line 232)
Signed-off-by: Paul Menzel <paulepanter@users.sourceforge.net>
Signed-off-by: Joerg Bornkessel <ml@websitec.de>
---
v2 ? v3: Change script `newplugin`. Patch submitted by Joerg [4].
[4] http://www.linuxtv.org/pipermail/vdr/2010-December/024068.html
---
Makefile | 2 +-
PLUGINS/src/dvbsddevice/Makefile | 2 +-
PLUGINS/src/hello/Makefile | 2 +-
PLUGINS/src/osddemo/Makefile | 2 +-
PLUGINS/src/pictures/Makefile | 2 +-
PLUGINS/src/servicedemo/Makefile | 4 ++--
PLUGINS/src/skincurses/Makefile | 2 +-
PLUGINS/src/status/Makefile | 2 +-
PLUGINS/src/svdrpdemo/Makefile | 2 +-
newplugin | 2 +-
10 files changed, 11 insertions(+), 11 deletions(-)
From 774e9db004fcef15c34871b0cab60dd04078e6d4 Mon Sep 17 00:00:00 2001
From: Paul Menzel <paulepanter@users.sourceforge.net>
Date: Sun, 12 Dec 2010 18:19:42 +0100
Subject: [PATCH] Makefile: pass `LDFLAGS` to compiler
Some distributions pass special flags to the linker [1][2]. Respect those by using `LDFLAGS`.
Instead of [1] this patch was made using the following command based on `vdr-plugin.eclass` [3].
find PLUGINS -name Makefile | xargs sed -i '/LDFLAGS/!s:-shared:$(LDFLAGS) -shared:'
Additionally the main Makefile and the script `newplugin` are changed too.
The changes have been present in OpenEmbedded and Gentoo for a while already and can be assumend tested.
The implicit rules are not changed. This could been done easily using the following command.
$ find PLUGINS -name Makefile | xargs sed -i 's/$(CXX) $(CXXFLAGS) -c $(DEFINES) $(INCLUDES) $</$(CXX) $(CXXFLAGS) $(LDFLAGS) -c $(DEFINES) $(INCLUDES) $</'
[1] http://cgit.openembedded.org/cgit.cgi/openembedded/tree/recipes/vdr/vdr-1.7.10/linkerflags.patch
[2] http://www.linuxtv.org/pipermail/vdr/2010-September/023623.html
[3] http://sources.gentoo.org/cgi-bin/viewvc.cgi/gentoo-x86/eclass/vdr-plugin.eclass?view=markup (code line 232)
Signed-off-by: Paul Menzel <paulepanter@users.sourceforge.net>
---
Makefile | 2 +-
PLUGINS/src/dvbsddevice/Makefile | 2 +-
PLUGINS/src/hello/Makefile | 2 +-
PLUGINS/src/osddemo/Makefile | 2 +-
PLUGINS/src/pictures/Makefile | 2 +-
PLUGINS/src/servicedemo/Makefile | 4 ++--
PLUGINS/src/skincurses/Makefile | 2 +-
PLUGINS/src/status/Makefile | 2 +-
PLUGINS/src/svdrpdemo/Makefile | 2 +-
newplugin | 2 +-
10 files changed, 11 insertions(+), 11 deletions(-)
@@ -95,7 +95,7 @@ $(DEPFILE): Makefile
# The main program:
vdr: $(OBJS) $(SILIB)
- $(CXX) $(CXXFLAGS) -rdynamic $(OBJS) $(LIBS) $(LIBDIRS) $(SILIB) -o vdr
+ $(CXX) $(CXXFLAGS) -rdynamic $(LDFLAGS) $(OBJS) $(LIBS) $(LIBDIRS) $(SILIB) -o vdr
# The libsi library:
@@ -99,7 +99,7 @@ i18n: $(I18Nmsgs) $(I18Npot)
### Targets:
libvdr-$(PLUGIN).so: $(OBJS)
- $(CXX) $(CXXFLAGS) -shared $(OBJS) -o $@
+ $(CXX) $(CXXFLAGS) $(LDFLAGS) -shared $(OBJS) -o $@
@cp --remove-destination $@ $(LIBDIR)/$@.$(APIVERSION)
dist: clean
@@ -99,7 +99,7 @@ i18n: $(I18Nmsgs)
### Targets:
libvdr-$(PLUGIN).so: $(OBJS)
- $(CXX) $(CXXFLAGS) -shared $(OBJS) -o $@
+ $(CXX) $(CXXFLAGS) $(LDFLAGS) -shared $(OBJS) -o $@
@cp --remove-destination $@ $(LIBDIR)/$@.$(APIVERSION)
dist: clean
@@ -72,7 +72,7 @@ $(DEPFILE): Makefile
### Targets:
libvdr-$(PLUGIN).so: $(OBJS)
- $(CXX) $(CXXFLAGS) -shared $(OBJS) -o $@
+ $(CXX) $(CXXFLAGS) $(LDFLAGS) -shared $(OBJS) -o $@
@cp --remove-destination $@ $(LIBDIR)/$@.$(APIVERSION)
dist: clean
@@ -99,7 +99,7 @@ i18n: $(I18Nmsgs) $(I18Npot)
### Targets:
libvdr-$(PLUGIN).so: $(OBJS)
- $(CXX) $(CXXFLAGS) -shared $(OBJS) -o $@
+ $(CXX) $(CXXFLAGS) $(LDFLAGS) -shared $(OBJS) -o $@
@cp --remove-destination $@ $(LIBDIR)/$@.$(APIVERSION)
dist: clean
@@ -74,11 +74,11 @@ $(DEPFILE): Makefile
### Targets:
libvdr-$(PLUGIN1).so: $(PLUGIN1).o
- $(CXX) $(CXXFLAGS) -shared $(PLUGIN1).o -o $@
+ $(CXX) $(CXXFLAGS) $(LDFLAGS) -shared $(PLUGIN1).o -o $@
@cp --remove-destination $@ $(LIBDIR)/$@.$(APIVERSION)
libvdr-$(PLUGIN2).so: $(PLUGIN2).o
- $(CXX) $(CXXFLAGS) -shared $(PLUGIN2).o -o $@
+ $(CXX) $(CXXFLAGS) $(LDFLAGS) -shared $(PLUGIN2).o -o $@
@cp --remove-destination $@ $(LIBDIR)/$@.$(APIVERSION)
dist: clean
@@ -99,7 +99,7 @@ i18n: $(I18Nmsgs) $(I18Npot)
### Targets:
libvdr-$(PLUGIN).so: $(OBJS)
- $(CXX) $(CXXFLAGS) -shared $(OBJS) -lncursesw -o $@
+ $(CXX) $(CXXFLAGS) $(LDFLAGS) -shared $(OBJS) -lncursesw -o $@
@cp --remove-destination $@ $(LIBDIR)/$@.$(APIVERSION)
dist: clean
@@ -72,7 +72,7 @@ $(DEPFILE): Makefile
### Targets:
libvdr-$(PLUGIN).so: $(OBJS)
- $(CXX) $(CXXFLAGS) -shared $(OBJS) -o $@
+ $(CXX) $(CXXFLAGS) $(LDFLAGS) -shared $(OBJS) -o $@
@cp --remove-destination $@ $(LIBDIR)/$@.$(APIVERSION)
dist: clean
@@ -72,7 +72,7 @@ $(DEPFILE): Makefile
### Targets:
libvdr-$(PLUGIN).so: $(OBJS)
- $(CXX) $(CXXFLAGS) -shared $(OBJS) -o $@
+ $(CXX) $(CXXFLAGS) $(LDFLAGS) -shared $(OBJS) -o $@
@cp --remove-destination $@ $(LIBDIR)/$@.$(APIVERSION)
dist: clean
@@ -158,7 +158,7 @@ i18n: \$(I18Nmsgs) \$(I18Npot)
### Targets:
libvdr-\$(PLUGIN).so: \$(OBJS)
- \$(CXX) \$(CXXFLAGS) -shared \$(OBJS) -o \$\@
+ \$(CXX) \$(CXXFLAGS) \$(LDFLAGS) -shared \$(OBJS) -o \$\@
\@cp --remove-destination \$\@ \$(LIBDIR)/\$\@.\$(APIVERSION)
dist: clean
--
1.7.2.3