[117518] trunk/base
cal at macports.org
cal at macports.org
Sun Mar 2 08:00:30 PST 2014
Revision: 117518
https://trac.macports.org/changeset/117518
Author: cal at macports.org
Date: 2014-03-02 08:00:30 -0800 (Sun, 02 Mar 2014)
Log Message:
-----------
configure.ac: Reset $PATH to the default before configuring
... and remove some references to /usr/local that we really don't want. Also
make sure all binaries that are in /sbin or /usr/sbin have an appropriate PATH
hint in AC_CHECK_PROG, just in case somebody doesn't have the sbin directories
in his $PATH (which should never happen now that configure resets the PATH, but
better be safe than sorry).
This avoids MacPorts thinking this was a SystemStarter-system because it can't
find /sbin/launchd during configure.
Modified Paths:
--------------
trunk/base/aclocal.m4
trunk/base/configure.ac
Modified: trunk/base/aclocal.m4
===================================================================
--- trunk/base/aclocal.m4 2014-03-02 14:21:22 UTC (rev 117517)
+++ trunk/base/aclocal.m4 2014-03-02 16:00:30 UTC (rev 117518)
@@ -895,32 +895,14 @@
dnl This macro ensures MP installation prefix paths are NOT in PATH
dnl for configure to prevent potential problems when base/ code is updated
dnl and ports are installed that would match needed items.
-AC_DEFUN([MP_PATH_SCAN],[
- oldprefix=$prefix
- if test "x$prefix" = "xNONE" ; then
- prefix=$ac_default_prefix
- fi
- oldPATH=$PATH
- newPATH=
- as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
- for as_dir in $oldPATH
- do
- IFS=$as_save_IFS
- case "$as_dir" in
- $prefix/*)
- ;;
- *)
- if test -z "$newPATH"; then
- newPATH=$as_dir
- else
- newPATH=$newPATH$PATH_SEPARATOR$as_dir
- fi
- ;;
- esac
- done
- PATH=$newPATH; export PATH
- AC_SUBST(PATH_CLEANED,$newPATH)
- prefix=$oldprefix
+dnl This macro also resets the PATH to a standard value for this system; some
+dnl checks might fail if e.g. /sbin was missing.
+AC_DEFUN([MP_PATH_RESET],[
+ AC_MSG_CHECKING([for a clean \$PATH])
+ PATH="/usr/bin:/bin:/usr/sbin:/sbin"
+ export PATH
+ AC_SUBST(PATH_CLEANED,$PATH)
+ AC_MSG_RESULT([$PATH])
])
dnl This macro tests for sed support of -E (BSD) or -r (GNU)
Modified: trunk/base/configure.ac
===================================================================
--- trunk/base/configure.ac 2014-03-02 14:21:22 UTC (rev 117517)
+++ trunk/base/configure.ac 2014-03-02 16:00:30 UTC (rev 117518)
@@ -14,8 +14,9 @@
AC_MSG_RESULT([$MACPORTS_VERSION])
AC_SUBST(MACPORTS_VERSION)
-# Check user PATH for MP paths, and remove as necessary.
-MP_PATH_SCAN
+# Reset user PATH to /usr/bin:/bin:/usr/sbin:/sbin to avoid problems (e.g.
+# when /sbin isn't on the PATH)
+MP_PATH_RESET
AC_PATH_PROG(SW_VERS, sw_vers)
AC_PATH_PROG(DEFAULTS, defaults)
@@ -109,13 +110,13 @@
AC_PATH_PROG(CVS, [cvs], [])
AC_PATH_PROG(DIFF, [diff], [])
AC_PATH_PROG(DSCL, [dscl], [])
-AC_PATH_PROG(DSEDITGROUP, [dseditgroup], [])
+AC_PATH_PROG(DSEDITGROUP, [dseditgroup], [], [$PATH:/usr/sbin])
AC_PATH_PROG(FILE, [file], [])
AC_PATH_PROG(FIND, [find], [])
AC_PATH_PROG(GIT, [git], [])
-AC_PATH_PROGS(GNUMAKE, [gnumake gmake], [], [$PATH:/usr/local/bin])
-AC_PATH_PROGS(GNUPATCH, [gnupatch gpatch], [], [$PATH:/usr/local/bin])
-AC_PATH_PROGS(GNUTAR, [gnutar gtar], [], [$PATH:/usr/local/bin])
+AC_PATH_PROGS(GNUMAKE, [gnumake gmake], [])
+AC_PATH_PROGS(GNUPATCH, [gnupatch gpatch], [])
+AC_PATH_PROGS(GNUTAR, [gnutar gtar], [])
AC_PATH_PROG(GZIP, [gzip], [])
AC_PATH_PROG(HDIUTIL, [hdiutil], [])
AC_PATH_PROG(HG, [hg], [])
@@ -137,7 +138,7 @@
AC_PATH_PROG(SANDBOX_EXEC, [sandbox-exec], [], [/usr/bin])
AC_PATH_PROG(SED, [sed])
AC_PATH_PROG(SVN, [svn], [])
-AC_PATH_PROG(SWIG, [swig], [], [$PATH:/usr/local/bin])
+AC_PATH_PROG(SWIG, [swig], [], [])
AC_PATH_PROG(TAR, [tar])
AC_PATH_PROG(UNZIP, [unzip])
AC_PATH_PROG(XAR, [xar], [])
@@ -146,7 +147,7 @@
AC_PATH_PROG(XZ, [xz], [])
AC_PATH_PROG(ZIP, [zip])
-AC_CHECK_PROG(HAVE_LAUNCHD, [launchd], [yes], [])
+AC_CHECK_PROG(HAVE_LAUNCHD, [launchd], [yes], [], [/sbin])
# Define some precious variables allowing user to override PATH for some programs
AC_ARG_VAR(BSDMAKE, [path to bsdmake/pmake command])
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.macosforge.org/pipermail/macports-changes/attachments/20140302/c8240d9e/attachment.html>
More information about the macports-changes
mailing list