From 4c39034f5dfdccb83c8acb3bd544e5f38fea7cef Mon Sep 17 00:00:00 2001 From: Jean-Francois Dockes Date: Thu, 21 May 2020 09:41:58 +0200 Subject: [PATCH] small tweaks to facilitate the mac homebrew build --- src/autogen.sh | 13 ++++++++++++- src/common/rclinit.cpp | 9 ++++++++- 2 files changed, 20 insertions(+), 2 deletions(-) diff --git a/src/autogen.sh b/src/autogen.sh index cd7e93be..b22c5093 100755 --- a/src/autogen.sh +++ b/src/autogen.sh @@ -1,7 +1,18 @@ #!/bin/sh +set -x + aclocal -libtoolize --copy + +if test X"$HOMEBREW_ENV" != X; then + glt=`which glibtoolize` +fi +if test X"$glt" != X; then + $glt --copy +else + libtoolize --copy +fi + automake --add-missing --force-missing --copy autoconf # Our ylwrap gets clobbered by the above. diff --git a/src/common/rclinit.cpp b/src/common/rclinit.cpp index 8224fc8d..ad7c7dc3 100644 --- a/src/common/rclinit.cpp +++ b/src/common/rclinit.cpp @@ -273,7 +273,10 @@ RclConfig *recollinit(int flags, if (cleanup) atexit(cleanup); -#ifdef MACPORTS +#if defined(MACPORTS) || defined(HOMEBREW) + // The MACPORTS and HOMEBREW flags are set by the resp. portfile + // and recipee + // Apple keeps changing the way to set the environment (PATH) for // a desktop app (started by launchd or whatever). Life is too // short. @@ -281,7 +284,11 @@ RclConfig *recollinit(int flags, if (!cp) //?? cp = ""; string PATH(cp); +#if defined(MACPORTS) PATH = string("/opt/local/bin/") + ":" + PATH; +#elif defined(HOMEBREW) + PATH = string("/usr/local/bin/") + ":" + PATH; +#endif setenv("PATH", PATH.c_str(), 1); #endif