Re: building on freeBSD

Philipp <[email protected]> Sun, 24 May 2026 02:24:02 +0200
Newsgroups gmane.mail.nmh.devel
Message-ID <[email protected]>
[2026-05-23 23:46] Marcin Cieslak <[email protected]>
> On Sat, 23 May 2026, Philipp wrote:
> > Hi
> >
> > When building on FreeBSD you need additional LDFLAGS and CPPFLAGS which
> > includes the localbase. For simpler setup the configure.ac contains
> > a check for FreeBSD and adds the localbase to the compiler flags.
> >
> > The problem is the command to find the localbase assumes the portstree
> > is availible. When the portstree is not availible the configure script
> > fails while checking for connect.
> >
> > So the command is:
> >
> >> echo '.include <bsd.port.mk>' | make -k -f /dev/stdin -V LOCALBASE
>
> nmh uses GNU make which is not really compatible with the BSD make
> except for some very simple Makefiles.

This command is in configure.ac at line 164 (part of the nmh repo) and
is run by the configure.

> There are three solutions to this:
>
> 1) Use the nmh port from the FreeBSD ports collection (this is what I do)

I wanted to build nmh to run some tests with a intresting mail which causes
bugs for me. So installing nmh from ports doesn't help.

> 2) Use GNU make (installed from FreeBSD ports/packages or otherwsie as "g=
make")
>
> 3) Prepare BSDmakefile and add it to the repository. =

> <bsd.port.mk> is a part of FreeBSD ports infrastructure so it is pretty n=
ormal
> it requires the ports tree to be available.

I think you missunderstand what the problem is. I just cloned the nmh
repo and run ./autogen.sh and ./configure. This failed because the
CPPFLAGS and LDFLAGS where missconfigured by the configure script.

I looked a bit more at the problem and found the mentioned command in
the configure script. As workaround for me I change the check, set the
CPPFLAGS and LDFLAGS manual and the build completed. This works for
me, but it could be handled better.

Philipp