[117520] trunk/base

jmr at macports.org jmr at macports.org
Sun Mar 2 09:32:20 PST 2014


Revision: 117520
          https://trac.macports.org/changeset/117520
Author:   jmr at macports.org
Date:     2014-03-02 09:32:20 -0800 (Sun, 02 Mar 2014)
Log Message:
-----------
revert most of r117518, ability to set a custom PATH is important for custom builds, especially on other platforms
provide a shell script that demonstrates how to run configure for a standard build

Revision Links:
--------------
    https://trac.macports.org/changeset/117518

Modified Paths:
--------------
    trunk/base/aclocal.m4
    trunk/base/configure
    trunk/base/configure.ac

Added Paths:
-----------
    trunk/base/standard_configure.sh

Modified: trunk/base/aclocal.m4
===================================================================
--- trunk/base/aclocal.m4	2014-03-02 16:01:03 UTC (rev 117519)
+++ trunk/base/aclocal.m4	2014-03-02 17:32:20 UTC (rev 117520)
@@ -895,14 +895,32 @@
 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.
-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])
+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 tests for sed support of -E (BSD) or -r (GNU)

Modified: trunk/base/configure
===================================================================
--- trunk/base/configure	2014-03-02 16:01:03 UTC (rev 117519)
+++ trunk/base/configure	2014-03-02 17:32:20 UTC (rev 117520)
@@ -2795,17 +2795,34 @@
 $as_echo "$MACPORTS_VERSION" >&6; }
 
 
-# Reset user PATH to /usr/bin:/bin:/usr/sbin:/sbin to avoid problems (e.g.
-# when /sbin isn't on the PATH)
+# Check user PATH for MP paths, and remove as necessary.
 
-	{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for a clean \$PATH" >&5
-$as_echo_n "checking for a clean \$PATH... " >&6; }
-	PATH="/usr/bin:/bin:/usr/sbin:/sbin"
-	export PATH
-	PATH_CLEANED=$PATH
+	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
+	PATH_CLEANED=$newPATH
 
-	{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $PATH" >&5
-$as_echo "$PATH" >&6; }
+	prefix=$oldprefix
 
 
 # Extract the first word of "sw_vers", so it can be a program name with args.

Modified: trunk/base/configure.ac
===================================================================
--- trunk/base/configure.ac	2014-03-02 16:01:03 UTC (rev 117519)
+++ trunk/base/configure.ac	2014-03-02 17:32:20 UTC (rev 117520)
@@ -14,9 +14,8 @@
 AC_MSG_RESULT([$MACPORTS_VERSION])
 AC_SUBST(MACPORTS_VERSION)
 
-# 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
+# Check user PATH for MP paths, and remove as necessary.
+MP_PATH_SCAN
 
 AC_PATH_PROG(SW_VERS, sw_vers)
 AC_PATH_PROG(DEFAULTS, defaults)
@@ -138,7 +137,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], [], [])
+AC_PATH_PROG(SWIG, [swig], [])
 AC_PATH_PROG(TAR, [tar])
 AC_PATH_PROG(UNZIP, [unzip])
 AC_PATH_PROG(XAR, [xar], [])

Added: trunk/base/standard_configure.sh
===================================================================
--- trunk/base/standard_configure.sh	                        (rev 0)
+++ trunk/base/standard_configure.sh	2014-03-02 17:32:20 UTC (rev 117520)
@@ -0,0 +1,9 @@
+#!/bin/sh
+
+# This is how we run configure when building binary packages (more or less,
+# minus architecture selection). If you don't want a custom build, this
+# is probably how you should run it too.
+env PATH=/usr/bin:/bin:/usr/sbin:/sbin CFLAGS="-pipe -Os" ./configure --enable-readline
+
+# If you want to use a different prefix, add this to the above:
+# --prefix=/some/path --with-applications-dir=/some/path/Applications


Property changes on: trunk/base/standard_configure.sh
___________________________________________________________________
Added: svn:executable
   + *
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.macosforge.org/pipermail/macports-changes/attachments/20140302/3b857fe1/attachment-0001.html>


More information about the macports-changes mailing list