On Tue, Feb 02, 2021 at 04:22:19PM +0100, Theo Buehler wrote:
> That's what FreeBSD did also:
> https://github.com/freebsd/freebsd-ports/commit/4cab0ea0d675f223f701cdff709d2e65851aa657
>
> The port has more than 50 global symbols defined in more than half a
> dozen headers, so let upstream deal with this.
OK kn
A little "# 50 duplicate symbols" seems helpful around where you're
adding the flag.
> Unsure where to add -fcommon. I saw patches adding it to COPTS, others
> added it to CFLAGS or CPPFLAGS. What is preferred?
Not every variable works for every port as they are handled differently
in the environment, overwritten by later assignments or ignored in the
first place.
Afaik COPTS gets added to CFLAGS by the ports framework so there's not
much difference between adding to either of the two.
> Index: Makefile
> ===================================================================
> RCS file: /cvs/ports/math/dieharder/Makefile,v
> retrieving revision 1.4
> diff -u -p -r1.4 Makefile
> --- Makefile 12 Jul 2019 20:47:40 -0000 1.4
> +++ Makefile 2 Feb 2021 15:20:20 -0000
> @@ -3,7 +3,7 @@
> COMMENT = random number generator (rng) testing suite
>
> DISTNAME = dieharder-3.31.1
> -REVISION = 1
> +REVISION = 2
> SHARED_LIBS += dieharder 0.0 # 0.0
> CATEGORIES = math
>
> @@ -21,6 +21,8 @@ WANTLIB += c gsl gslcblas m
> CONFIGURE_STYLE = gnu
> CONFIGURE_ENV += CPPFLAGS="-I${LOCALBASE}/include" \
> LDFLAGS="-L${LOCALBASE}/lib"
> +
> +CFLAGS += -fcommon
>
> BUILD_DEPENDS = textproc/latex2html
> LIB_DEPENDS = devel/gsl
>