tech-pkg archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: GCC g++ 4.4.7 does not accept -std=c++03



Hi,

Greg Troxel <gdt%lexort.com@localhost> writes:

> Ryo ONODERA <ryo%tetera.org@localhost> writes:
>
>> Hi,
>>
>> Thanks for your response and
>> I have found that I had sent income message.
>>
>> textproc/hunspell has USE_LANGUAGES=c++03 line and fails with the error on CentOS 6.10.
>
> That leads to --std=c++03.   That seems ok, but you are using a compiler
> which does not support that flag, and may or may not actually support
> c++03.
>
> See
>   https://netbsd.org/~bacon/auto-pkgsrc-setup
> for scripts to work around older compilers on GNU/Linux by building a
> newer one.
>
> Or, you can try to modify pkgsrc to pass a different flag.  If you just
> want to build yourself, and not commit the change, you can hack
> mk/compiler.mk near line 179; search for _CXX_VERSION_REQD=.
> Basically, when the language is c++03, pass in --std=c++0x instead.

Thanks for your pointer.
I will commit the following patch.

Index: mk/compiler/gcc.mk
===================================================================
RCS file: /cvsroot/pkgsrc/mk/compiler/gcc.mk,v
retrieving revision 1.198
diff -u -r1.198 gcc.mk
--- mk/compiler/gcc.mk	12 Nov 2018 14:22:58 -0000	1.198
+++ mk/compiler/gcc.mk	26 Jun 2019 15:55:12 -0000
@@ -185,6 +185,11 @@
 .endif
 _GCC_PKG=	gcc-${_GCC_VERSION:C/-.*$//}
 
+.if !empty(_GCC_VERSION:M[34].[1234].*)
+BUILDLINK_TRANSFORM+=	opt:-std=c++03:-std=c++0x
+BUILDLINK_TRANSFORM+=	opt:-std=gnu++03:-std=gnu++0x
+.endif
+
 .if !empty(_CC:M${LOCALBASE}/*)
 _IS_BUILTIN_GCC=	NO
 GCC_REQD+=		${_GCC_VERSION}


-- 
Ryo ONODERA // ryo%tetera.org@localhost
PGP fingerprint = 82A2 DC91 76E0 A10A 8ABB  FD1B F404 27FA C7D1 15F3


Home | Main Index | Thread Index | Old Index