Changeset 29127


Ignore:
Timestamp:
Sep 15, 2007, 1:27:36 PM (12 years ago)
Author:
afb@…
Message:

autoconf sed extended regexp flag

Location:
trunk/base
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/base/aclocal.m4

    r26711 r29127  
    777777])
    778778
     779dnl This macro tests for sed support of -E (BSD) or -r (GNU)
     780AC_DEFUN([MP_SED_EXTENDED_REGEXP],[
     781        AC_PATH_PROG(SED, [sed])
     782
     783        if test "x$SED" = "x"; then
     784                AC_MSG_ERROR([cannot find sed. Is sed installed?])
     785        fi
     786
     787        AC_MSG_CHECKING([for which sed flag to use for extended regexp])
     788        [bsd_sed_flag=`echo foo | $SED -E -e s/foo+/OK/ 2>&1 | grep OK`]
     789        [gnu_sed_flag=`echo foo | $SED -r -e s/foo+/OK/ 2>&1 | grep OK`]
     790        [any_sed_flag=`echo foo | $SED    -e s/foo+/OK/ 2>&1 | grep OK`]
     791        if test "x$bsd_sed_flag" = "xOK" ; then
     792                AC_MSG_RESULT([-E (BSD)])
     793                SED_EXT=-E
     794        elif test "x$gnu_sed_flag" = "xOK" ; then
     795                AC_MSG_RESULT([-r (GNU)])
     796                SED_EXT=-r
     797        elif test "x$any_sed_flag" = "xOK" ; then
     798                AC_MSG_RESULT([none])
     799                SED_EXT=
     800        else
     801                AC_MSG_RESULT([no idea])
     802                AC_MSG_ERROR([cannot determine flag to use for $SED])
     803        fi
     804        AC_SUBST(SED_EXT)
     805])
     806
    779807dnl This macro tests for tar support of --no-same-owner
    780808AC_DEFUN([MP_TAR_NO_SAME_OWNER],[
  • trunk/base/configure.ac

    r29126 r29127  
    2727AC_PATH_PROG(SVN, [svn], [])
    2828AC_PATH_PROG(RSYNC, [rsync], [])
     29AC_PATH_PROG(SED, [sed])
    2930AC_PATH_PROG(TAR, [tar])
    3031AC_PATH_PROG(MAKE, [make])
     
    4344AC_ARG_VAR(SVN, [path to svn command])
    4445AC_ARG_VAR(RSYNC, [path to rsync command])
     46AC_ARG_VAR(SED, [path to sed command])
    4547AC_ARG_VAR(TAR, [path to tar command])
    4648AC_ARG_VAR(MAKE, [path to make command])
     
    5153AC_ARG_VAR(OPEN, [path to open command])
    5254
     55MP_SED_EXTENDED_REGEXP
    5356MP_TAR_NO_SAME_OWNER
    5457
  • trunk/base/src/port1.0/port_autoconf.tcl.in

    r24820 r29127  
    3737        variable mtree_path "@MTREE@"
    3838        variable xar_path "@XAR@"
     39        variable sed_command "@SED@"
     40        variable sed_ext_flag "@SED_EXT@"
    3941        variable tar_command "@TAR_CMD@"
    4042        variable have_launchd "@HAVE_LAUNCHD@"
Note: See TracChangeset for help on using the changeset viewer.