Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: Building zsh/db/gdbm on MacOS Sequoia



On Fri, Jun 26, 2026 at 7:56 PM Mikael Magnusson <mikachu@xxxxxxxxx> 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.
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=


Messages sorted by: Reverse Date, Date, Thread, Author