[vdr] [PATCH v2] Makefile: pass `LDFLAGS` to compiler

Joerg Bornkessel ml at websitec.de
Mon Dec 13 23:49:08 CET 2010


> Am Montag, den 13.12.2010, 11:56 +0100 schrieb Paul Menzel:
>> Am Montag, den 13.12.2010, 11:29 +0100 schrieb Paul Menzel:
>> > Am Montag, den 13.12.2010, 00:29 +0100 schrieb Joerg Bornkessel:
>> > 
>> > > > Am Samstag, den 25.09.2010, 13:15 +0200 schrieb Joerg Bornkessel:
>> > > 
>> > > > […]
>> > > 
>> > > 
>> > > >> [2] http://www.gentoo.org/proj/en/qa/asneeded.xml
>> > > 
>> > > > Should `LDFLAGS` also be passed to the compiler when building the
>> > > > plugins?
>> > > 
>> > > We have this fixed global on Gentoo for all plugins.
>> > > All plugin Makefile's are sed'ed/patched to use the LDFLAGS.
>> > 
>> > Sorry, I do not know Gentoo’s build system. I found the patch for VDR
>> > [1] and the ebuild file [2].
>> > 
>> > I was wondering why skincurses had no patch applied or change regarding
>> > `LDFLAGS` [3] and for example vdr-burn [4] has a separate patch. Then I
>> > found `vdr-plugin.eclass` [5] where the replacement is done using `sed`.
>> > 
>> > > > I made a patch from your message which does not include any changes to
>> > > > the plugins.
>> > >
>> > > I dont know, what distri you use,
>> > 
>> > I am using the OpenEmbedded framework [6].
>> > 
>> > > one way would be to fix this in the make.global ( used up from
>> > > vdr-1.7.(not shure yet)) and inherit this in the plugin Makefile.
>> > > 
>> > > Should be standard in the vdr-1.7.x adapted plugin Makefiles
>> > 
>> > That is what my patch is for. I will send an updated patch.
>> 
>> One question left. Why does not `LDFLAGS` need to be passed in the
>> implicit rules?
>> 
>>         ### Implicit rules:
>>         
>>         %.o: %.c
>>               $(CXX) $(CXXFLAGS) $(LDFLAGS) -c $(DEFINES) $(INCLUDES) $<

> I guess that no linking is happening here?

> Please find below an updated patch. It would be great if you could add
> your Signed-off-by line or acknowledge it in some why, so Klaus can
> apply it.


> Thanks,

> Paul


>> > [1] http://sources.gentoo.org/cgi-bin/viewvc.cgi/gentoo-x86/media-video/vdr/files/vdr-1.6.0-ldflags.patch?view=markup
>> > [2] http://sources.gentoo.org/cgi-bin/viewvc.cgi/gentoo-x86/media-video/vdr/vdr-1.6.0_p2-r5.ebuild?view=markup
>> > [3] http://sources.gentoo.org/cgi-bin/viewvc.cgi/gentoo-x86/media-plugins/vdr-skincurses/ChangeLog?view=markup
>> > [4] http://sources.gentoo.org/cgi-bin/viewvc.cgi/gentoo-x86/media-plugins/vdr-burn/files/vdr-burn-0.2.0_beta1_ldflags.diff?revision=1.1&view=markup
>> > [5] http://sources.gentoo.org/cgi-bin/viewvc.cgi/gentoo-x86/eclass/vdr-plugin.eclass?view=markup
>> > [6] http://www.openembedded.org/

> 8<-------------------------------------------------------------------->8
> Date: Sun, 12 Dec 2010 18:19:42 +0100
> Subject: [PATCH v2] 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 was 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 at 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 +-
>  9 files changed, 10 insertions(+), 10 deletions(-)

> diff --git a/Makefile b/Makefile
> index 26f54ea..48e3309 100644
> --- a/Makefile
> +++ b/Makefile
> @@ -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:
>  
> diff --git a/PLUGINS/src/dvbsddevice/Makefile
> b/PLUGINS/src/dvbsddevice/Makefile
> index 32d0f50..afc801b 100644
> --- a/PLUGINS/src/dvbsddevice/Makefile
> +++ b/PLUGINS/src/dvbsddevice/Makefile
> @@ -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
> diff --git a/PLUGINS/src/hello/Makefile b/PLUGINS/src/hello/Makefile
> index a5703f6..9e51cf7 100644
> --- a/PLUGINS/src/hello/Makefile
> +++ b/PLUGINS/src/hello/Makefile
> @@ -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
> diff --git a/PLUGINS/src/osddemo/Makefile b/PLUGINS/src/osddemo/Makefile
> index d9ed4c5..eb98160 100644
> --- a/PLUGINS/src/osddemo/Makefile
> +++ b/PLUGINS/src/osddemo/Makefile
> @@ -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
> diff --git a/PLUGINS/src/pictures/Makefile b/PLUGINS/src/pictures/Makefile
> index 19c6fc6..a573363 100644
> --- a/PLUGINS/src/pictures/Makefile
> +++ b/PLUGINS/src/pictures/Makefile
> @@ -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
> diff --git a/PLUGINS/src/servicedemo/Makefile
> b/PLUGINS/src/servicedemo/Makefile
> index 18bfd26..8cba989 100644
> --- a/PLUGINS/src/servicedemo/Makefile
> +++ b/PLUGINS/src/servicedemo/Makefile
> @@ -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
> diff --git a/PLUGINS/src/skincurses/Makefile
> b/PLUGINS/src/skincurses/Makefile
> index 080c3e6..e1e3ae6 100644
> --- a/PLUGINS/src/skincurses/Makefile
> +++ b/PLUGINS/src/skincurses/Makefile
> @@ -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
> diff --git a/PLUGINS/src/status/Makefile b/PLUGINS/src/status/Makefile
> index 556a09e..fa59016 100644
> --- a/PLUGINS/src/status/Makefile
> +++ b/PLUGINS/src/status/Makefile
> @@ -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
> diff --git a/PLUGINS/src/svdrpdemo/Makefile b/PLUGINS/src/svdrpdemo/Makefile
> index 4a803c6..1101634 100644
> --- a/PLUGINS/src/svdrpdemo/Makefile
> +++ b/PLUGINS/src/svdrpdemo/Makefile
> @@ -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

Paul,
is it possible to add the patch/diff attached to the mail?
I get the patches always inherited in the mail.
Its more ezy to handle by Klaus then.

btw,
also it should patched then the script newplugin in the main vdr src
dir, see attached file.

And finaly, if the patch is applyed in the core vdr,
plugin developer should be forced to fix this also in her
development trees ;)


-- 
Regards
Gentoo Developer
Joerg Bornkessel <hd_brummy at gentoo.org>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: newplugin_ldflags.diff
Type: application/octet-stream
Size: 358 bytes
Desc: not available
URL: <http://www.linuxtv.org/pipermail/vdr/attachments/20101213/8fac1018/attachment-0001.obj>


More information about the vdr mailing list