redefine CXXFLAGS in prjconf

classic Classic list List threaded Threaded
9 messages Options
Reply | Threaded
Open this post in threaded view
|

redefine CXXFLAGS in prjconf

Hans-Peter Jansen-2
Hi,

is it possible to redefine CXXFLAGS in prjconf?

Thanks,
Pete
--
To unsubscribe, e-mail: [hidden email]
To contact the owner, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: redefine CXXFLAGS in prjconf

Adrian Schröter
On Sonntag, 4. Juni 2017, 00:18:20 CEST wrote Hans-Peter Jansen:
> Hi,
>
> is it possible to redefine CXXFLAGS in prjconf?

not directly, but you can specify the optflags handed over to rpm-build.
Proper spec files are using them for CFLAGS/CXXFLAGS

These are our defaults:

# osc meta prjconf openSUSE:Factory | grep -i optflags

--

Adrian Schroeter
email: [hidden email]

SUSE Linux GmbH, GF: Felix Imendörffer, Jane Smithard, Graham Norton, HRB 21284 (AG Nürnberg)
 
Maxfeldstraße 5                        
90409 Nürnberg
Germany


--
To unsubscribe, e-mail: [hidden email]
To contact the owner, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: redefine CXXFLAGS in prjconf

Hans-Peter Jansen-2
Hi Adrian,

On Sonntag, 4. Juni 2017 08:40:12 Adrian Schröter wrote:

> On Sonntag, 4. Juni 2017, 00:18:20 CEST wrote Hans-Peter Jansen:
> > Hi,
> >
> > is it possible to redefine CXXFLAGS in prjconf?
>
> not directly, but you can specify the optflags handed over to rpm-build.
> Proper spec files are using them for CFLAGS/CXXFLAGS
>
> These are our defaults:
>
> # osc meta prjconf openSUSE:Factory | grep -i optflags

will try that. Hopefully gcc will not complain, if given g++ options
(-std=c++11). Is the star argument of optflags supported properly by older
distributions?

I thought of redefining %configure already, but asked in order to not miss a
more minimum invasive option...

Thank you,
Pete
--
To unsubscribe, e-mail: [hidden email]
To contact the owner, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: redefine CXXFLAGS in prjconf

Jan Engelhardt-4

On Sunday 2017-06-04 10:09, Hans-Peter Jansen wrote:
>>
>> # osc meta prjconf openSUSE:Factory | grep -i optflags
>
>will try that. Hopefully gcc will not complain, if given g++ options

Nope; optflags is used to populate both CFLAGS, CXXFLAGS and Fortran Flags,
and true to its name, was meant for language-independent optimization flags.
If your package needs c++11, say so in the .spec file with an export
CXXFLAGS=... line
--
To unsubscribe, e-mail: [hidden email]
To contact the owner, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: redefine CXXFLAGS in prjconf

Hans-Peter Jansen-2
On Sonntag, 4. Juni 2017 10:28:02 Jan Engelhardt wrote:
> On Sunday 2017-06-04 10:09, Hans-Peter Jansen wrote:
> >> # osc meta prjconf openSUSE:Factory | grep -i optflags
> >
> >will try that. Hopefully gcc will not complain, if given g++ options
>
> Nope; optflags is used to populate both CFLAGS, CXXFLAGS and Fortran Flags,
> and true to its name, was meant for language-independent optimization flags.
> If your package needs c++11, say so in the .spec file with an export
> CXXFLAGS=... line

Thanks Jan for chiming in, but the idea was to *avoid* changing all the specs
in a project in order to build for older distributions, which had other
defaults compared to the Factory g++...

Cheers,
Pete
--
To unsubscribe, e-mail: [hidden email]
To contact the owner, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: redefine CXXFLAGS in prjconf

Jan Engelhardt-4

On Sunday 2017-06-04 11:22, Hans-Peter Jansen wrote:
>> Nope; optflags is used to populate both CFLAGS, CXXFLAGS and Fortran Flags,
>> and true to its name, was meant for language-independent optimization flags.
>> If your package needs c++11, say so in the .spec file with an export
>> CXXFLAGS=... line
>
>Thanks Jan for chiming in, but the idea was to *avoid* changing all the specs
>in a project in order to build for older distributions, which had other
>defaults compared to the Factory g++...

If a package requires a specific version of C++, it should (at the upstream
level) use -std=, because defaults can change (especially with the increased
pace of C++ now).
--
To unsubscribe, e-mail: [hidden email]
To contact the owner, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: redefine CXXFLAGS in prjconf

Adrian Schröter
In reply to this post by Hans-Peter Jansen-2
On Sonntag, 4. Juni 2017, 10:09:20 CEST wrote Hans-Peter Jansen:

> Hi Adrian,
>
> On Sonntag, 4. Juni 2017 08:40:12 Adrian Schröter wrote:
> > On Sonntag, 4. Juni 2017, 00:18:20 CEST wrote Hans-Peter Jansen:
> > > Hi,
> > >
> > > is it possible to redefine CXXFLAGS in prjconf?
> >
> > not directly, but you can specify the optflags handed over to rpm-build.
> > Proper spec files are using them for CFLAGS/CXXFLAGS
> >
> > These are our defaults:
> >
> > # osc meta prjconf openSUSE:Factory | grep -i optflags
>
> will try that. Hopefully gcc will not complain, if given g++ options
> (-std=c++11). Is the star argument of optflags supported properly by older
> distributions?

this is just OBS mechanics, the distro build will get it via the optflags rpm
macro.

> I thought of redefining %configure already, but asked in order to not miss a
> more minimum invasive option...

nah .... a compiler wrapper might be the better option then ...
--

Adrian Schroeter
email: [hidden email]

SUSE Linux GmbH, GF: Felix Imendörffer, Jane Smithard, Graham Norton, HRB 21284 (AG Nürnberg)
 
Maxfeldstraße 5                        
90409 Nürnberg
Germany


--
To unsubscribe, e-mail: [hidden email]
To contact the owner, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: redefine CXXFLAGS in prjconf

Cristian Rodríguez-2
In reply to this post by Hans-Peter Jansen-2


El 04-06-2017 a las 4:09, Hans-Peter Jansen escribió:

> will try that. Hopefully gcc will not complain, if given g++ options
> (-std=c++11). Is the star argument of optflags supported properly by older
> distributions?

The compiler already defaults to c+11.. (gnu11 to be precise, and this
is what you most likely want)

See the GCC manual for the deprecated aliases to c+11 that old products
support..
--
To unsubscribe, e-mail: [hidden email]
To contact the owner, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: redefine CXXFLAGS in prjconf

Victor Pereira
In reply to this post by Hans-Peter Jansen-2
On Sun, 04 Jun 2017 00:18:20 +0200
Hans-Peter Jansen <[hidden email]> wrote:

> Hi,
>
> is it possible to redefine CXXFLAGS in prjconf?
>
> Thanks,
> Pete

I faced the same problem, (I wanted to add ASAN for all packages in a
project, without change all specs) and what partially worked for me was
to overwrite the %configure macro (but not all packages were using it)
and write a gcc wrapper, which sets the variables that I wanted.


--
Victor Pereira

SUSE LINUX GmbH, GF: Jeff Hawn, Jennifer Guild, Felix Imendörffer, HRB
21284 (AG Nürnberg)

Maxfeldstraße 5

90409 Nürnberg

--
To unsubscribe, e-mail: [hidden email]
To contact the owner, e-mail: [hidden email]