Changeset 117518


Ignore:
Timestamp:
Mar 2, 2014, 4:00:30 PM (5 years ago)
Author:
cal@…
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.

Location:
trunk/base
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/base/aclocal.m4

    r113877 r117518  
    896896dnl for configure to prevent potential problems when base/ code is updated
    897897dnl and ports are installed that would match needed items.
    898 AC_DEFUN([MP_PATH_SCAN],[
    899         oldprefix=$prefix
    900         if test "x$prefix" = "xNONE" ; then
    901                 prefix=$ac_default_prefix
    902         fi
    903         oldPATH=$PATH
    904         newPATH=
    905         as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
    906         for as_dir in $oldPATH
    907         do
    908                 IFS=$as_save_IFS
    909                 case "$as_dir" in
    910                         $prefix/*)
    911                                 ;;
    912                         *)
    913                                 if test -z "$newPATH"; then
    914                                         newPATH=$as_dir
    915                                 else
    916                                         newPATH=$newPATH$PATH_SEPARATOR$as_dir
    917                                 fi
    918                                 ;;
    919                 esac
    920         done
    921         PATH=$newPATH; export PATH
    922         AC_SUBST(PATH_CLEANED,$newPATH)
    923         prefix=$oldprefix
     898dnl This macro also resets the PATH to a standard value for this system; some
     899dnl checks might fail if e.g. /sbin was missing.
     900AC_DEFUN([MP_PATH_RESET],[
     901        AC_MSG_CHECKING([for a clean \$PATH])
     902        PATH="/usr/bin:/bin:/usr/sbin:/sbin"
     903        export PATH
     904        AC_SUBST(PATH_CLEANED,$PATH)
     905        AC_MSG_RESULT([$PATH])
    924906])
    925907
  • trunk/base/configure.ac

    r116107 r117518  
    1515AC_SUBST(MACPORTS_VERSION)
    1616
    17 # Check user PATH for MP paths, and remove as necessary.
    18 MP_PATH_SCAN
     17# Reset user PATH to /usr/bin:/bin:/usr/sbin:/sbin to avoid problems (e.g.
     18# when /sbin isn't on the PATH)
     19MP_PATH_RESET
    1920
    2021AC_PATH_PROG(SW_VERS, sw_vers)
     
    110111AC_PATH_PROG(DIFF, [diff], [])
    111112AC_PATH_PROG(DSCL, [dscl], [])
    112 AC_PATH_PROG(DSEDITGROUP, [dseditgroup], [])
     113AC_PATH_PROG(DSEDITGROUP, [dseditgroup], [], [$PATH:/usr/sbin])
    113114AC_PATH_PROG(FILE, [file], [])
    114115AC_PATH_PROG(FIND, [find], [])
    115116AC_PATH_PROG(GIT, [git], [])
    116 AC_PATH_PROGS(GNUMAKE, [gnumake gmake], [], [$PATH:/usr/local/bin])
    117 AC_PATH_PROGS(GNUPATCH, [gnupatch gpatch], [], [$PATH:/usr/local/bin])
    118 AC_PATH_PROGS(GNUTAR, [gnutar gtar], [], [$PATH:/usr/local/bin])
     117AC_PATH_PROGS(GNUMAKE, [gnumake gmake], [])
     118AC_PATH_PROGS(GNUPATCH, [gnupatch gpatch], [])
     119AC_PATH_PROGS(GNUTAR, [gnutar gtar], [])
    119120AC_PATH_PROG(GZIP, [gzip], [])
    120121AC_PATH_PROG(HDIUTIL, [hdiutil], [])
     
    138139AC_PATH_PROG(SED, [sed])
    139140AC_PATH_PROG(SVN, [svn], [])
    140 AC_PATH_PROG(SWIG, [swig], [], [$PATH:/usr/local/bin])
     141AC_PATH_PROG(SWIG, [swig], [], [])
    141142AC_PATH_PROG(TAR, [tar])
    142143AC_PATH_PROG(UNZIP, [unzip])
     
    147148AC_PATH_PROG(ZIP, [zip])
    148149
    149 AC_CHECK_PROG(HAVE_LAUNCHD, [launchd], [yes], [])
     150AC_CHECK_PROG(HAVE_LAUNCHD, [launchd], [yes], [], [/sbin])
    150151
    151152# Define some precious variables allowing user to override PATH for some programs
Note: See TracChangeset for help on using the changeset viewer.