Bug 223578

Summary: [PATCH] devel/ncurses: do not pollute CFLAGS
Product: Ports & Packages Reporter: Jung-uk Kim <jkim>
Component: Individual Port(s)Assignee: Steve Wills <swills>
Status: Closed FIXED    
Severity: Affects Only Me Keywords: patch
Priority: --- Flags: bugzilla: maintainer-feedback? (swills)
Version: Latest   
Hardware: Any   
OS: Any   
See Also: https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=234049
Attachments:
Description Flags
Do not add bogus macros to CFLAGS. none

Description Jung-uk Kim freebsd_committer freebsd_triage 2017-11-09 23:50:18 UTC
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.
Comment 1 Baptiste Daroussin freebsd_committer freebsd_triage 2017-11-10 01:17:50 UTC
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
Comment 2 commit-hook freebsd_committer freebsd_triage 2017-11-10 15:28:07 UTC
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
Comment 3 Steve Wills freebsd_committer freebsd_triage 2017-11-10 15:30:17 UTC
Committed, thanks!
Comment 4 Jan Beich freebsd_committer freebsd_triage 2017-11-10 18:13:26 UTC
It doesn't make sense to leave DragonFly to use -D_XOPEN_SOURCE=* given
https://github.com/DragonFlyBSD/DeltaPorts/commit/6d6268c42e62c700f91cd4840732c5d7d2bc8c8b