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.

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

Reply via email to