bugGNU troff - Bugs: bug #60035, build failure on macOS


bug #60035: build failure on macOS

Submitted by:  G. Branden Robinson <gbranden>
Submitted on:  Wed 10 Feb 2021 07:26:01 PM UTC  
Category:  None Severity:  4 - Important
Item Group:  Build/Installation Status:  Fixed
Privacy:  Public Assigned to:  G. Branden Robinson <gbranden>
Open/Closed:  Closed Planned Release:  1.23.0

Add a New Comment (Rich Markup)

You are not logged in

Please log in, so followups can be emailed to you.


Wed 10 Feb 2021 08:18:32 PM UTC, comment #1: 

Fingers crossed.

commit 979f3f4266151c7681a68a40d2c4913842a7271d (HEAD -> master, origin/master, origin/HEAD)
Author: G. Branden Robinson <g.branden.robinson@gmail.com>
Date:   Thu Feb 11 07:09:21 2021 +1100

    Address build failure on macOS.

    Follow the advice of the gnulib manual ("Changing your source for use
    with gnulib") more scrupulously; include config.h in more files.

    * src/libs/libgroff/assert.cpp [HAVE_CONFIG_H]: #include config.h using
      angle brackets instead of quotation marks.

    * src/libs/libgroff/curtime.cpp [HAVE_CONFIG_H]:
    * src/libs/libgroff/device.cpp [HAVE_CONFIG_H]:
    * src/libs/libgroff/errarg.cpp [HAVE_CONFIG_H]:
    * src/libs/libgroff/error.cpp [HAVE_CONFIG_H]:
    * src/libs/libgroff/fatal.cpp [HAVE_CONFIG_H]:
    * src/libs/libgroff/string.cpp [HAVE_CONFIG_H]:
    * src/libs/libgroff/strsave.cpp [HAVE_CONFIG_H]:
    * src/preproc/eqn/other.cpp [HAVE_CONFIG_H]:
    * src/preproc/eqn/text.cpp [HAVE_CONFIG_H]:
    * src/preproc/pic/object.cpp [HAVE_CONFIG_H]: Do it.

    Fixes <https://savannah.gnu.org/bugs/?60035>.

G. Branden Robinson <gbranden>
Project AdministratorIn charge of this item.
Wed 10 Feb 2021 07:26:01 PM UTC, original submission:  

A generalization of bug #59276.

See thread beginning at:


and especially T. Kurt Bond's analysis at:


Here's the body of the final message inline so this report has some direct context.

It turns out that Dave Kemper <saint.snit@gmail.com>'s suggestion that it
was related to bug 59276
(http://savannah.gnu.org/bugs/index.php?59276) was correct.

I use Homebrew <https://brew.sh/> on macOS to install Unix packages
(instead of macports).  I recently did a "brew cleanup", which removes
old versions of packages.  This broke the brew installed groff, because it
depended on an older version of ghostscript that had been "cleaned up".  So
I tried "brew install -s groff" where the "-s" tells it to install from
source and it built correctly. I noticed that it was patching several files
in the process. I remembered that I'd tried building groff 1.22.4 from the
release tarball recently and it had *not* built correctly.

So I looked at the patch Homebrew was using (which you can find here
online) and found that the *only* thing that it does is add '#include
"config.h"' to the following files:


(Well, in some of those it adds '#ifdef HAVE_CONFIG_H/#endif' lines around
the include of config.h, but in others it doesn't.)

The file src/libs/libgroff/curtime.cpp is where the error shows up in my

So I cloned a fresh copy of the groff git repo, applied the patch, and
didn't apply the hunks for that already had that '#include "config.h"' line
in them (src/libs/libgroff/assert.cpp, src/libs/libgroff/errarg.cpp,
src/libs/libgroff/error.cpp, and src/preproc/eqn/eqn.ypp).  But the
following files did get patched:


I then ran bootstrap, configure, and make and the build finished without an
error.  Then a make check worked fine.  I did a make install, which I'd
configured to install to a particular directory, added that directory to
the front of PATH and rebuilt one of my documents.  It looked fine.

The link Dave Kemper pointed to -
https://www.gnu.org/software/gnulib/manual/html_node/Source-changes.html -
points out that that any source file that includes a '-I' that refers to
the Gnulib source directory needs to have ‘#include <config.h>’ at the
top.  (I'll note that the patch discussed above consistently uses '#include
"config.h"' instead of "#include <config.h>". )  I looked briefly at the
Makefile to see if I could figure out which files those should be, since
the output of make doesn't actually include the exact command executed, but
I'm not familiar with automake and figuring it out looked difficult for

I briefly looked at how Macports <https://www.macports.org/> does it, and
the patch file
it uses just adds '#include <config.h>' to lib/math.in.h instead, which
seems like changing the gnulib source instead of changing the groff source
that uses gnulib, which doesn't seem like the right thing to do.

Anyway, I hope this explains the problem and the possible solution

G. Branden Robinson <gbranden>
Project AdministratorIn charge of this item.


(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach Files:

No files currently attached


Depends on the following items: None found

Items that depend on this one: None found


Carbon-Copy List
  • -email is unavailable- added by gbranden (Submitted the item)

    Do you think this task is very important?
    If so, you can add your encouragement to it.
    This task has 0 encouragements so far.

    Only logged-in users can vote.




    Follow 3 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2021-02-10 gbranden StatusIn Progress => Fixed
        Open/ClosedOpen => Closed
        Planned ReleaseNone => 1.23.0

    Back to the top

    Powered by Savane 3.6