Created attachment 187891 [details] Do not add bogus macros to CFLAGS. Some ports cannot be built with devel/ncurses because "pkgconf --cflags ncurses" adds "-D_BSD_TYPES -D__BSD_VISIBLE -D_POSIX_C_SOURCE=200112L -D_XOPEN_SOURCE=600" to CFLAGS via configure scripts. This may cause conflicts with ports' own CFLAGS and/or CPPFLAGS. For example, see bug 211973, comment 22. Actually, I found these flags are archaic from 5.x era and even harmful for all supported releases. I also verified that it generates the same binaries and works fine without the CFLAGS.
I agree with jkim there, it would be nice to upstream that change as well Note that dragonfly probably deserves the same treatment as freebsd
A commit references this bug: Author: swills Date: Fri Nov 10 15:27:41 UTC 2017 New revision: 453902 URL: https://svnweb.freebsd.org/changeset/ports/453902 Log: devel/ncurses: do not pollute CFLAGS PR: 223578 Submitted by: jkim Changes: head/devel/ncurses/Makefile head/devel/ncurses/files/ head/devel/ncurses/files/patch-configure
Committed, thanks!
It doesn't make sense to leave DragonFly to use -D_XOPEN_SOURCE=* given https://github.com/DragonFlyBSD/DeltaPorts/commit/6d6268c42e62c700f91cd4840732c5d7d2bc8c8b