groff
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Fwd: groff git HEAD not building on macOS? (was: Long text in tbl wo


From: T. Kurt Bond
Subject: Re: Fwd: groff git HEAD not building on macOS? (was: Long text in tbl won't wrap, maybe related to mom)
Date: Wed, 10 Feb 2021 14:03:42 -0500

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
<https://raw.githubusercontent.com/Homebrew/formula-patches/8059b3027a4aa68d8f42e1281cc3a81449ca0010/groff/1.22.4.patch>
online) and found that the *only* thing that it does is add '#include
"config.h"' to the following files:

src/libs/libgroff/assert.cpp
src/libs/libgroff/errarg.cpp
src/libs/libgroff/error.cpp
src/preproc/eqn/eqn.ypp
*src/libs/libgroff/curtime.cpp*
src/libs/libgroff/device.cpp
src/libs/libgroff/fatal.cpp
src/libs/libgroff/string.cpp
src/libs/libgroff/strsave.cpp
src/preproc/eqn/text.cpp
src/preproc/eqn/other.cpp
src/preproc/pic/object.cpp


(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
build.

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:

src/libs/libgroff/curtime.cpp
src/libs/libgroff/device.cpp
src/libs/libgroff/fatal.cpp
src/libs/libgroff/string.cpp
src/libs/libgroff/strsave.cpp
src/preproc/eqn/text.cpp
src/preproc/eqn/other.cpp
src/preproc/pic/object.cpp


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
me.

I briefly looked at how Macports <https://www.macports.org/> does it, and
the patch file
<https://github.com/macports/macports-ports/blob/master/sysutils/groff/files/patch-implicitly-defined.diff>
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
understandably.

On Wed, Feb 10, 2021 at 11:51 AM T. Kurt Bond <tkurtbond@gmail.com> wrote:

> When compiling groff from git I always start by running bootstrap.  I
> still have the same problem.
>
> To repeat more concisely, here's the first error from the build:
>
>   CXX      src/libs/libgroff/libgroff_a-curtime.o
> In file included from ../src/libs/libgroff/curtime.cpp:20:
> In file included from
> /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/stdlib.h:100:
> ./lib/math.h:38:3: error: "Please include config.h first."
>  #error "Please include config.h first."
>
>
> Why is a system include file
> (/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/stdlib.h)
> including groff's lib/math.h?
>
> The next few errors appear to be lib/math.h complaining about things
> that aren't defined because config.h hasn't been included.
>
>
>
>
>
> On Tue, Feb 9, 2021 at 8:31 PM Bjarni Ingi Gislason <bjarniig@rhi.hi.is>
> wrote:
>
>>   The gnulib's version is probably out of date.
>>
>>   Read "INSTALL.REPO" and run groff's "bootstrap" to update "gnulib".
>>
>> --
>> Bjarni I. Gislason
>>
>
>
> --
> T. Kurt Bond, tkurtbond@gmail.com, https://tkurtbond.github.io
>


-- 
T. Kurt Bond, tkurtbond@gmail.com, https://tkurtbond.github.io


reply via email to

[Prev in Thread] Current Thread [Next in Thread]