Re: Building zsh/db/gdbm on MacOS Sequoia
Bart Schaefer <[email protected]> Sun, 28 Jun 2026 11:49:28 -0700
| Newsgroups | gmane.comp.shells.zsh.devel |
|---|---|
| Message-ID | <CAH+w=7bi+7EVbC0ZS=JrsZf_K0+bhLb-NYXx6tuY6yrH91OKeQ@mail.gmail.com> |
On Fri, Jun 26, 2026 at 7:56 PM Mikael Magnusson <[email protected]> wrote: > > Yeah, the asymmetry is that pcre has pcre-config, and gdbm doesn't > have that nor a pkgconfig file, so there's not really anything we > could do short of find -name libgdbm.so / I was thinking something like this.
conf_gdbm.txt
(text/plain, 978 B)
diff --git a/configure.ac b/configure.ac
index 3d8e98a83..64bd796f9 100644
--- a/configure.ac
+++ b/configure.ac
@@ -417,6 +417,12 @@ fi],
[AC_DEFINE(DEFAULT_READNULLCMD,"more")]
)
+dnl Check for MacPorts support
+AC_ARG_VAR(MAC_PORTS, ["port" command is found])
+case "$host_os" in
+darwin*) AC_CHECK_PROG([MAC_PORTS],port,port contents);;
+esac
+
dnl Do you want to look for pcre support?
AC_ARG_ENABLE(pcre,
AS_HELP_STRING([--enable-pcre],[enable the search for the pcre2 library (may create run-time library dependencies)]))
@@ -947,6 +953,13 @@ elif test x$zsh_cv_decl_ospeed_must_define = xyes; then
fi
if test x$enable_gdbm = xyes; then
+ if test "x$MAC_PORTS" != x; then
+ CPPFLAGS="`$MAC_PORTS gdbm |
+ sed -n '/\/include\//{s,include/.*,include,;s/^[ ]*/-I/;p;q;}'` \
+ $CPPFLAGS"
+ LDFLAGS="`$MAC_PORTS gdbm |
+ sed -n '/\/lib\//{s,lib/.*,lib,;s/^[ ]*/-L/;p;q;}'`"
+ fi
AC_CHECK_HEADERS(gdbm.h)
save_LIBS=$LIBS
LIBS=