diff options
author | Norbert Thiebaud <nthiebaud@gmail.com> | 2015-06-09 20:05:32 -0500 |
---|---|---|
committer | Norbert Thiebaud <nthiebaud@gmail.com> | 2015-06-11 04:29:04 +0000 |
commit | 5fc0cbbc1254223fedf0f78c5e7539219b228697 (patch) | |
tree | 186cffbca8e6655e7ac13a7363b8450e3c7946e4 /configure.ac | |
parent | c8344322a7af75b84dd3ca8f78b05543a976dfd5 (diff) |
harden build enviroment on mac with LODE
mac build really does not like finding extra stuff in the PATH
or in /usr/local/bin
as this is prone to happen with macport/fink/etc..
or somethings just due to some other 'ported to mac' pre-canned
binaries..
for instance one has found a python3 in /usr/local/bin
which confused configure to believe it was ok to use
'system python', which break on mac.
This patch sanitize PATH during ./autogen.sh, when running
in a LODE environment.
it leave only LODE_HOME/opt/bin:/usr/bin:/bin:/usr/sbin:/sbin and optionally
the path where git is located if that is not /usr/bin
(it is quite common depending on how one installed git, to haev it in /usr/local/git/bin
for instance)
This is strictly a 'nanny' patch.. but it should not impact anyone
that is not ( on Mac and using LODE ).
Change-Id: I865047cfeb102ecb22777a1f7fb7cbdd374448aa
Reviewed-on: https://gerrit.libreoffice.org/16222
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Norbert Thiebaud <nthiebaud@gmail.com>
Diffstat (limited to 'configure.ac')
-rw-r--r-- | configure.ac | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/configure.ac b/configure.ac index d214864adb55..879b370d3ea4 100644 --- a/configure.ac +++ b/configure.ac @@ -100,6 +100,26 @@ add_warning() echo "$COLORWARN $@" >> warn } +dnl Some Mac User have the bad habbit of letting a lot fo crap +dnl accumulate in their PATH and even adding stuff in /usr/local/bin +dnl that confuse the build. +dnl For the ones that use LODE, let's be nice and protect them +dnl from themselves + +mac_sanitize_path() +{ + mac_path="$LODE_HOME/opt/bin:/usr/bin:/bin:/usr/sbin:/sbin" +dnl a common but nevertheless necessary thing that may be in a fancy +dnl path location is git, so make sure we have it + mac_git_path=`which git 2>/dev/null` + if test -n "$mac_git_path" -a -x "$mac_git_path" -a "$mac_git_path" != "/usr/bin/git" ; then + mac_path="$mac_path:`dirname $mac_git_path`" + fi + PATH="$mac_path" + unset mac_path + unset git_mac_path +} + echo "********************************************************************" echo "*" echo "* Running ${PACKAGE_NAME} build configuration." @@ -667,6 +687,10 @@ darwin*) # Mac OS X or iOS test_cups=no else _os=Darwin + if test -n "$LODE_HOME" ; then + mac_sanitize_path + AC_MSG_NOTICE([sanitized the PATH to $PATH]) + fi INSTROOTSUFFIX=/$PRODUCTNAME.app/Contents SDKDIRNAME=AC_PACKAGE_NAME${PRODUCTVERSION}_SDK fi |