Bug 240701 - textproc/groff: Fix build with libc++ 9.0.0
Summary: textproc/groff: Fix build with libc++ 9.0.0
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Some People
Assignee: Dimitry Andric
URL:
Keywords:
Depends on:
Blocks: 240629
  Show dependency treegraph
 
Reported: 2019-09-20 06:06 UTC by Dimitry Andric
Modified: 2019-10-01 06:02 UTC (History)
1 user (show)

See Also:
bapt: maintainer-feedback+


Attachments
Fix groff build with libc++ 9.0.0 (870 bytes, patch)
2019-09-20 06:06 UTC, Dimitry Andric
koobs: maintainer-approval+
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Dimitry Andric freebsd_committer freebsd_triage 2019-09-20 06:06:20 UTC
Created attachment 207643 [details]
Fix groff build with libc++ 9.0.0

Because libc++ 9.0.0 now includes <math.h> from <stdlib.h>, groff fails to build with error similar to:

n file included from src/libs/libgroff/assert.cpp:20:
In file included from /usr/include/c++/v1/stdlib.h:100:
./lib/math.h:38:3: error: "Please include config.h first."
 #error "Please include config.h first."
  ^
./lib/math.h:40:1: error: unknown type name '_GL_INLINE_HEADER_BEGIN'
_GL_INLINE_HEADER_BEGIN
^

Here is a patch which fixes that in the least intrusive way.  Another way would be to #include "config.h" at the top of every .cpp file, but that is more more churn.
Comment 1 Baptiste Daroussin freebsd_committer freebsd_triage 2019-09-20 07:17:39 UTC
approved, just commit
Comment 2 Kubilay Kocak freebsd_committer freebsd_triage 2019-09-20 08:30:31 UTC
^Triage: Re-assign per comment 1
Comment 3 Kubilay Kocak freebsd_committer freebsd_triage 2019-09-20 08:31:18 UTC
Comment on attachment 207643 [details]
Fix groff build with libc++ 9.0.0

^Triage: Track maintainer approval, using the attachment maintainer-approval flag (per comment 1)
Comment 4 commit-hook freebsd_committer freebsd_triage 2019-09-20 19:48:29 UTC
A commit references this bug:

Author: dim
Date: Fri Sep 20 19:48:01 UTC 2019
New revision: 512436
URL: https://svnweb.freebsd.org/changeset/ports/512436

Log:
  Fix groff build with libc++ 9.0.0

  Because libc++ 9.0.0 now includes <math.h> from <stdlib.h>, groff fails
  to build with an error similar to:

  In file included from src/libs/libgroff/assert.cpp:20:
  In file included from /usr/include/c++/v1/stdlib.h:100:
  ./lib/math.h:38:3: error: "Please include config.h first."
   #error "Please include config.h first."
    ^
  ./lib/math.h:40:1: error: unknown type name '_GL_INLINE_HEADER_BEGIN'
  _GL_INLINE_HEADER_BEGIN
  ^

  Fix this in the least intrusive way, by simply including config.h
  instead of emitting an error message.

  Approved by:	bapt (maintainer)
  PR:		240701
  MFH:		2019Q3

Changes:
  head/textproc/groff/files/patch-lib_math.in.h
Comment 5 commit-hook freebsd_committer freebsd_triage 2019-10-01 06:02:01 UTC
A commit references this bug:

Author: dim
Date: Tue Oct  1 06:00:59 UTC 2019
New revision: 513456
URL: https://svnweb.freebsd.org/changeset/ports/513456

Log:
  MFH: r512436

  Fix groff build with libc++ 9.0.0

  Because libc++ 9.0.0 now includes <math.h> from <stdlib.h>, groff fails
  to build with an error similar to:

  In file included from src/libs/libgroff/assert.cpp:20:
  In file included from /usr/include/c++/v1/stdlib.h:100:
  ./lib/math.h:38:3: error: "Please include config.h first."
   #error "Please include config.h first."
    ^
  ./lib/math.h:40:1: error: unknown type name '_GL_INLINE_HEADER_BEGIN'
  _GL_INLINE_HEADER_BEGIN
  ^

  Fix this in the least intrusive way, by simply including config.h
  instead of emitting an error message.

  Approved by:	portmgr (joneum)
  PR:		240701

Changes:
_U  branches/2019Q3/
  branches/2019Q3/textproc/groff/files/patch-lib_math.in.h