[gentoo-user] Re: ebuild: package specific CFLAGS
On 04/28/2017 10:10 PM, Ian Zimmerman wrote: > I'm trying to create an ebuild of a crufty old program that needs > -fgnu89-inline in compiler flags to have any chance of building. > > What's the way to do that in an ebuild? I could have something like > > src_configure() { > econf $(use_enable nls) CFLAGS=-fgnu89-inline > } > > but then, will this not _override_ (rather than add to, as desired) the > CFLAGS from make.conf? > If you want a particular flag to be added to CFLAGS/CXXFLAGS within an ebuild, you can inherit flag-o-matic, then call "append-flags -fgnu89-inline" in src_configure before the econf line. If you explicitly only want to set CFLAGS (and not CXXFLAGS), then call "append-cflags" (there is also a append-cppflags, append-cxxflags, append-ldflags, append-fflags). -- Jonathan Callen signature.asc Description: OpenPGP digital signature
[gentoo-user] Re: ebuild: package specific CFLAGS
Am Sat, 29 Apr 2017 00:14:10 -0400 schrieb John Covici: > On Fri, 28 Apr 2017 22:10:42 -0400, > Ian Zimmerman wrote: > > > > I'm trying to create an ebuild of a crufty old program that needs > > -fgnu89-inline in compiler flags to have any chance of building. > > > > What's the way to do that in an ebuild? I could have something like > > > > src_configure() { > > econf $(use_enable nls) CFLAGS=-fgnu89-inline > > } > > > > but then, will this not _override_ (rather than add to, as desired) > > the CFLAGS from make.conf? > > Maybe you'd be better off setting an environment variable outside the > ebuild in a shell script in /etc/portage/env where you can put the > whole CCFLAGS . You should also say that you need to reference that in /etc/portage/packages.env, similar to how packages.use works. Just that instead of use flags, you give filenames from /etc/portage/env. -- Regards, Kai Replies to list-only preferred.