building on freeBSD

Philipp <[email protected]> Sat, 23 May 2026 22:33:52 +0200
Newsgroups gmane.mail.nmh.devel
Message-ID <[email protected]>
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

and gives following output on my machine:

> make: /usr/share/mk/bsd.port.mk:27: Cannot open /usr/ports/Mk/bsd.port.mk
> 	in /dev/stdin:1
> make: Fatal errors encountered -- cannot continue
> make: stopped in /home/satanist

/home/satanist is my home directory. Only the last line is written to
stdout and the exitcode is 1.

I have some ideas how to fix this:

* only output a warning when FreeBSD is detected
* fallback to /usr/local/ when the command fails
* remove the special handling completly
* add a specia --localbase to configure when run on *BSD

I have no idea what the best way is to fix this.

Philipp