From patchwork Sun Jun 11 16:03:13 2006 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Udo Richter X-Patchwork-Id: 12330 Received: from mail.gmx.de ([213.165.64.21] helo=mail.gmx.net) by www.linuxtv.org with smtp (Exim 4.50) id 1FpSPh-0004Ar-B7 for vdr@linuxtv.org; Sun, 11 Jun 2006 18:03:45 +0200 Received: (qmail invoked by alias); 11 Jun 2006 16:03:14 -0000 Received: from p548A3C1C.dip0.t-ipconnect.de (EHLO [192.168.73.1]) [84.138.60.28] by mail.gmx.net (mp037) with SMTP; 11 Jun 2006 18:03:14 +0200 X-Authenticated: #1417946 Message-ID: <448C3EC1.4020207@gmx.de> Date: Sun, 11 Jun 2006 18:03:13 +0200 From: Udo Richter User-Agent: Thunderbird 2.0a1 (Windows/20060609) MIME-Version: 1.0 To: VDR Mailing List Subject: Re: [vdr] VDR version 1.4.1, pic issue References: <448BE671.3020100@cadsoft.de> <200606111559.14428.prakash@punnoor.de> In-Reply-To: <200606111559.14428.prakash@punnoor.de> X-Y-GMX-Trusted: 0 X-BeenThere: vdr@linuxtv.org X-Mailman-Version: 2.1.5 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: Sun, 11 Jun 2006 16:03:45 -0000 Status: O X-Status: X-Keywords: X-UID: 9771 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: 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) Cheers, Udo --- 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 +CXXFLAGS += -fPIC +endif + ### The directory environment: #DVBDIR = /usr/src/v4l-dvb/linux