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,

Are there any comments on my revised patch?
If there is no objection, I would like to commit it.

Thank you.

Ryo ONODERA <ryo%tetera.org@localhost> writes:

> Hi,
>
> Jonathan Perkin <jperkin%joyent.com@localhost> writes:
>
>> * On 2019-06-28 at 16:41 BST, Ryo ONODERA wrote:
>>
>>> +.for _version_ in ${_CXX_STD_VERSIONS}
>>> +_CXX_STD_FLAG.${_version_}?=	-std=${_version_}
>>> +.  if !empty(_GCC_VERSION:M[34].[1234].*)
>>> +_CXX_STD_FLAG.c++03?=	-std=c++0x
>>> +_CXX_STD_FLAG.gnu++03?=	-std=gnu++0x
>>> +.  endif
>>> +.endfor
>>
>> This won't work, the latter ?= will never be set as you already set
>> the variable.
>
> Exactly. It is my mistake and should not work.
> However I could get intended value from _CXX_STD_FLAG.c++03 and .gnu++03.
>
> Anyway I will test the following revised patch.
>
> Index: mk/compiler.mk
> ===================================================================
> RCS file: /cvsroot/pkgsrc/mk/compiler.mk,v
> retrieving revision 1.92
> diff -u -r1.92 compiler.mk
> --- mk/compiler.mk	26 Jun 2019 00:22:56 -0000	1.92
> +++ mk/compiler.mk	28 Jun 2019 15:55:28 -0000
> @@ -83,7 +83,8 @@
>  USE_LANGUAGES+=	c
>  .endif
>  
> -.for _version_ in gnu++14 c++14 gnu++11 c++11 gnu++0x c++0x gnu++03 c++03
> +_CXX_STD_VERSIONS=	gnu++14 c++14 gnu++11 c++11 gnu++0x c++0x gnu++03 c++03
> +.for _version_ in ${_CXX_STD_VERSIONS}
>  .  if !empty(USE_LANGUAGES:M${_version_})
>  USE_LANGUAGES+=		c++
>  .  endif
> @@ -177,11 +178,11 @@
>  # the respective mk/compiler/*.mk files.
>  #
>  _CXX_VERSION_REQD=
> -.for _version_ in gnu++14 c++14 gnu++11 c++11 gnu++0x c++0x gnu++03 c++03
> +.for _version_ in ${_CXX_STD_VERSIONS}
>  .  if empty(_CXX_VERSION_REQD) && !empty(USE_LANGUAGES:M${_version_})
>  _CXX_VERSION_REQD=	${_version_}
> -_WRAP_EXTRA_ARGS.CXX+=	-std=${_CXX_VERSION_REQD}
> -CWRAPPERS_PREPEND.cxx+=	-std=${_CXX_VERSION_REQD}
> +_WRAP_EXTRA_ARGS.CXX+=	${_CXX_STD_FLAG.${_CXX_VERSION_REQD}}
> +CWRAPPERS_PREPEND.cxx+=	${_CXX_STD_FLAG.${_CXX_VERSION_REQD}}
>  .  endif
>  .endfor
>  
> Index: mk/compiler/clang.mk
> ===================================================================
> RCS file: /cvsroot/pkgsrc/mk/compiler/clang.mk,v
> retrieving revision 1.20
> diff -u -r1.20 clang.mk
> --- mk/compiler/clang.mk	9 Jan 2019 13:19:03 -0000	1.20
> +++ mk/compiler/clang.mk	28 Jun 2019 15:55:28 -0000
> @@ -95,4 +95,8 @@
>  _WRAP_EXTRA_ARGS.CXX+=	-Qunused-arguments
>  CWRAPPERS_APPEND.cxx+=	-Qunused-arguments
>  
> +.for _version_ in ${_CXX_STD_VERSIONS}
> +_CXX_STD_FLAG.${_version_}?=	-std=${_version_}
> +.endfor
> +
>  .endif	# COMPILER_CLANG_MK
> 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	28 Jun 2019 15:55:28 -0000
> @@ -185,6 +185,14 @@
>  .endif
>  _GCC_PKG=	gcc-${_GCC_VERSION:C/-.*$//}
>  
> +.for _version_ in ${_CXX_STD_VERSIONS}
> +_CXX_STD_FLAG.${_version_}?=	-std=${_version_}
> +.  if !empty(_GCC_VERSION:M[34].[1234].*)
> +_CXX_STD_FLAG.c++03=	-std=c++0x
> +_CXX_STD_FLAG.gnu++03=	-std=gnu++0x
> +.  endif
> +.endfor
> +
>  .if !empty(_CC:M${LOCALBASE}/*)
>  _IS_BUILTIN_GCC=	NO
>  GCC_REQD+=		${_GCC_VERSION}
>
>
> Thank you.
>
>> -- 
>> Jonathan Perkin  -  Joyent, Inc.  -  www.joyent.com
>
> -- 
> Ryo ONODERA // ryo%tetera.org@localhost
> PGP fingerprint = 82A2 DC91 76E0 A10A 8ABB  FD1B F404 27FA C7D1 15F3

-- 
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