[29127] trunk/base

source_changes at macosforge.org source_changes at macosforge.org
Sat Sep 15 06:27:36 PDT 2007


Revision: 29127
          http://trac.macosforge.org/projects/macports/changeset/29127
Author:   afb at macports.org
Date:     2007-09-15 06:27:36 -0700 (Sat, 15 Sep 2007)

Log Message:
-----------
autoconf sed extended regexp flag

Modified Paths:
--------------
    trunk/base/aclocal.m4
    trunk/base/configure.ac
    trunk/base/src/port1.0/port_autoconf.tcl.in

Modified: trunk/base/aclocal.m4
===================================================================
--- trunk/base/aclocal.m4	2007-09-15 13:21:08 UTC (rev 29126)
+++ trunk/base/aclocal.m4	2007-09-15 13:27:36 UTC (rev 29127)
@@ -776,6 +776,34 @@
 	prefix=$oldprefix
 ])
 
+dnl This macro tests for sed support of -E (BSD) or -r (GNU)
+AC_DEFUN([MP_SED_EXTENDED_REGEXP],[
+	AC_PATH_PROG(SED, [sed])
+
+	if test "x$SED" = "x"; then
+		AC_MSG_ERROR([cannot find sed. Is sed installed?])
+	fi
+
+	AC_MSG_CHECKING([for which sed flag to use for extended regexp])
+	[bsd_sed_flag=`echo foo | $SED -E -e s/foo+/OK/ 2>&1 | grep OK`]
+	[gnu_sed_flag=`echo foo | $SED -r -e s/foo+/OK/ 2>&1 | grep OK`]
+	[any_sed_flag=`echo foo | $SED    -e s/foo+/OK/ 2>&1 | grep OK`]
+	if test "x$bsd_sed_flag" = "xOK" ; then
+		AC_MSG_RESULT([-E (BSD)])
+		SED_EXT=-E
+	elif test "x$gnu_sed_flag" = "xOK" ; then
+		AC_MSG_RESULT([-r (GNU)])
+		SED_EXT=-r
+	elif test "x$any_sed_flag" = "xOK" ; then
+		AC_MSG_RESULT([none])
+		SED_EXT=
+	else
+		AC_MSG_RESULT([no idea])
+		AC_MSG_ERROR([cannot determine flag to use for $SED])
+	fi
+	AC_SUBST(SED_EXT)
+])
+
 dnl This macro tests for tar support of --no-same-owner
 AC_DEFUN([MP_TAR_NO_SAME_OWNER],[
 	AC_PATH_PROG(TAR, [tar])

Modified: trunk/base/configure.ac
===================================================================
--- trunk/base/configure.ac	2007-09-15 13:21:08 UTC (rev 29126)
+++ trunk/base/configure.ac	2007-09-15 13:27:36 UTC (rev 29127)
@@ -26,6 +26,7 @@
 AC_PATH_PROG(CVS, [cvs], [])
 AC_PATH_PROG(SVN, [svn], [])
 AC_PATH_PROG(RSYNC, [rsync], [])
+AC_PATH_PROG(SED, [sed])
 AC_PATH_PROG(TAR, [tar])
 AC_PATH_PROG(MAKE, [make])
 AC_CHECK_PROG(HAVE_LAUNCHD, [launchd], [yes], [])
@@ -42,6 +43,7 @@
 AC_ARG_VAR(CVS, [path to cvs command])
 AC_ARG_VAR(SVN, [path to svn command])
 AC_ARG_VAR(RSYNC, [path to rsync command])
+AC_ARG_VAR(SED, [path to sed command])
 AC_ARG_VAR(TAR, [path to tar command])
 AC_ARG_VAR(MAKE, [path to make command])
 AC_ARG_VAR(GNUTAR, [path to gnutar command])
@@ -50,6 +52,7 @@
 AC_ARG_VAR(XAR, [path to xar command])
 AC_ARG_VAR(OPEN, [path to open command])
 
+MP_SED_EXTENDED_REGEXP
 MP_TAR_NO_SAME_OWNER
 
 # Quiche eaters options.

Modified: trunk/base/src/port1.0/port_autoconf.tcl.in
===================================================================
--- trunk/base/src/port1.0/port_autoconf.tcl.in	2007-09-15 13:21:08 UTC (rev 29126)
+++ trunk/base/src/port1.0/port_autoconf.tcl.in	2007-09-15 13:27:36 UTC (rev 29127)
@@ -36,6 +36,8 @@
 	variable rsync_path "@RSYNC@"
 	variable mtree_path "@MTREE@"
 	variable xar_path "@XAR@"
+	variable sed_command "@SED@"
+	variable sed_ext_flag "@SED_EXT@"
 	variable tar_command "@TAR_CMD@"
 	variable have_launchd "@HAVE_LAUNCHD@"
 	variable launchctl_path "@LAUNCHCTL@"

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.macosforge.org/pipermail/macports-changes/attachments/20070915/f8fb6242/attachment.html


More information about the macports-changes mailing list