[opensuse-packaging] redefine CXXFLAGS in prjconf
Hi, is it possible to redefine CXXFLAGS in prjconf? Thanks, Pete -- To unsubscribe, e-mail: opensuse-packaging+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-packaging+owner@opensuse.org
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: adrian@suse.de 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: opensuse-packaging+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-packaging+owner@opensuse.org
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: opensuse-packaging+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-packaging+owner@opensuse.org
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: opensuse-packaging+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-packaging+owner@opensuse.org
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: opensuse-packaging+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-packaging+owner@opensuse.org
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: opensuse-packaging+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-packaging+owner@opensuse.org
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: adrian@suse.de 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: opensuse-packaging+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-packaging+owner@opensuse.org
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: opensuse-packaging+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-packaging+owner@opensuse.org
On Sun, 04 Jun 2017 00:18:20 +0200
Hans-Peter Jansen
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: opensuse-packaging+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-packaging+owner@opensuse.org
participants (5)
-
Adrian Schröter
-
Cristian Rodríguez
-
Hans-Peter Jansen
-
Jan Engelhardt
-
Victor Pereira