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

autoconf sed extended regexp flag

File:
1 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],[
Note: See TracChangeset for help on using the changeset viewer.