On Fri, Feb 18, 2022 at 10:34:54AM -0500, Kurt Mosiejczuk wrote:
> So xapian-bindings specifies -fdeclspec as part of the CXXFLAGS for
> CONFIGURE_ENV. This is (presumably) to make ruby work using clang.
> But it breaks compilation with ports-gcc. So let's make adding declspec
> only come into play when using clang.

Make sense.

> This fixes the build on sparc64.
> 
> ok?
> 
> --Kurt
> 
> Index: Makefile
> ===================================================================
> RCS file: /cvs/ports/databases/xapian-bindings/Makefile,v
> retrieving revision 1.37
> diff -u -p -r1.37 Makefile
> --- Makefile  9 Jan 2022 12:12:39 -0000       1.37
> +++ Makefile  18 Feb 2022 15:24:40 -0000
> @@ -49,8 +49,7 @@ SUBST_VARS+=                MODRUBY_BINREV
>  
>  CONFIGURE_STYLE=     autoconf
>  AUTOCONF_VERSION=    2.69
> -CONFIGURE_ENV=               RUBY="${RUBY}" RDOC="${RUBY:S/ruby/rdoc/}" \
> -                     CXXFLAGS="${CXXFLAGS} -fdeclspec"
> +CONFIGURE_ENV=               RUBY="${RUBY}" RDOC="${RUBY:S/ruby/rdoc/}"
>  CONFIGURE_ARGS=              --with-perl \
>                       --with-python3 \
>                       --with-ruby \

That won't pass CXXFLAGS on !clang archs any longer, is that intended?
Or is is still picked up correctly?

> @@ -66,5 +65,10 @@ pre-configure:
>  
>  post-install:
>       mv ${PREFIX}/share/doc/xapian-bindings/ruby{,${MODRUBY_BINREV}}
> +
> +.include <bsd.port.arch.mk>
> +.if ${PROPERTIES:Mclang}
> +CONFIGURE_ENV +=     CXXFLAGS="${CXXFLAGS} -fdeclspec"
> +.endif
>  
>  .include <bsd.port.mk>
> 

Why not keep passing CXXFLAGS in CONFIGURE_ENV and conditionally
amending CXXFLAGS here?

CONFIGURE_ENV = CXXFLAGS=${CXXFLAGS}

.if clang
CXXFLAGS += ...
.endif

Reply via email to