[vdr] VDR version 1.4.1, pic issue

Klaus Schmidinger Klaus.Schmidinger at cadsoft.de
Sun Jun 11 23:36:47 CEST 2006

Udo Richter wrote:
> Prakash Punnoor wrote:
>> But If I set flags in Make.conf, the -fPIc doesn't get added for 
>> plugins, and I can't seem to make this happen by patching (I don't 
>> know much about Makefile syntax) other than adding -fPIC directly into 
>> the %.o: %.c rule line in each plugin's Makefile.
> This is a fundamental problem, since Make.config is used for VDR core 
> *and* plugins. There is currently no mechanism to set CXXFLAGS for 
> plugins differently than for core VDR.
> Probably the easiest way is to add -fPIC to Make.config anyway, even if 
> core VDR doesn't need it. Enforcing the -fPIC flag even if it is not 
> part of CXXFLAGS is not the way to go, you cannot expect every compiler 
> to understand it.
> Implementing something like PLUGINCXXFLAGS for plugins would do the job, 
> but since you'll never get all plugins to support it, its not the final 
> solution either.
> Another good solution would be to do a conditional part in Make.config, 
> like this:
> --- Make.config.template    2006-05-28 15:08:29.687375000 +0200
> +++ Make.config.template    2006-06-11 17:50:14.467000000 +0200
> @@ -16,6 +16,11 @@
>  CXX      = g++
>  CXXFLAGS = -g -O2 -Wall -Woverloaded-virtual
> +ifdef PLUGIN
> +CFLAGS += -fPIC
> +endif
> +
>  ### The directory environment:
>  #DVBDIR   = /usr/src/v4l-dvb/linux
> The existence of the PLUGIN makefile variable should work for almost all 
> plugins. Another way would be to set some marker variable at the 
> beginning of the VDR Makefile, or to move the VDRVERSION declaration in 
> front of the -include statement. (but of course for core VDR only, not 
> for plugin makefiles)

Maybe it would have been better to leave the -fPIC thing as it has been
for so long - as it is now, plugins will actually be compiled _without_
it, which is probably a lot worse than compiling the main program _with_


More information about the vdr mailing list