From: Lyndon Nerenberg Date: Tue, 30 Sep 2014 05:42:28 +0000 (-0700) Subject: FreeBSD packages destination directory fixup. X-Git-Url: https://diplodocus.org/git/nmh/commitdiff_plain/5ebb429354533b5aa255283a512dde3a284eec3a?ds=inline;hp=eb433de218fc35876757c356fcb709d9f9d10d09 FreeBSD packages destination directory fixup. If the ports collection is not installed, assume ports/packages install under /usr/local. Also, when querying , use the value of the $(LOCALBASE) macro. ($(PREFIX) is for port-specific overrides of $(LOCALBASE).) --- diff --git a/configure.ac b/configure.ac index 0e7d604f..88f7e65d 100644 --- a/configure.ac +++ b/configure.ac @@ -153,13 +153,18 @@ dnl FreeBSD needs a bit of magic to bring getline() into scope. dnl We do this here rather than in (say) h/mh.h because this macro must dnl be defined before is pulled in. dnl -dnl And while we're here, add the ports tree to the cpp and ld search -dnl paths. +dnl And while we're here, add the packages tree to the cpp and ld search +dnl paths. Note that FreeBSD's pkg(8) seems to be hardwired to use /usr/local. +dnl If /usr/ports is installed, we use its idea of where things are installed, +dnl otherwise we assume /usr/local. + AS_IF([test `uname` = FreeBSD], [CPPFLAGS="${CPPFLAGS:+$CPPFLAGS }-D_WITH_GETLINE" - nmh_cv_freebsd_portsdir=`echo '.include ' | make -f /dev/stdin -V PREFIX` - CPPFLAGS="${CPPFLAGS:+$CPPFLAGS }-I$nmh_cv_freebsd_portsdir/include" - LDFLAGS="${LDFLAGS:+$LDFLAGS }-L$nmh_cv_freebsd_portsdir/lib" + nmh_cv_freebsd_localbase=`echo '.include ' \ + | make -k -f /dev/stdin -V LOCALBASE 2>/dev/null | sed 1q` + test -z "$nmh_cv_freebsd_localbase" && nmh_cv_freebsd_localbase=/usr/local + CPPFLAGS="${CPPFLAGS:+$CPPFLAGS }-I$nmh_cv_freebsd_localbase/include" + LDFLAGS="${LDFLAGS:+$LDFLAGS }-L$nmh_cv_freebsd_localbase/lib" ]) dnl --------------