aboutsummaryrefslogtreecommitdiff
blob: bde52c04b531f7bf20b7b16693784f8934f0e1d6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
AC_DEFUN([ES_PROG_GNU_SED],
[AC_MSG_CHECKING([for GNU sed])
AC_CACHE_VAL(es_cv_path_SED,
[# Loop through the user's path and test for sed and gsed.
saved_IFS=$IFS ; IFS=:
for es_dir in $PATH
do
    IFS=$saved_IFS
    if test -x "$es_dir/sed" ; then
	if "$es_dir/sed" --version 2>&1 < /dev/null | grep 'GNU' > /dev/null ; then
	    es_path_sed="$es_dir/sed"
	fi
    fi

    if test -z "$es_path_sed" && test -x "$es_dir/gsed" ; then
	if "$es_dir/gsed" --version 2>&1 < /dev/null | grep 'GNU' > /dev/null ; then
	    es_path_sed="$es_dir/gsed"
	fi
    fi

    es_cv_path_SED=$es_path_sed
done
])
SED=$es_cv_path_SED
AC_MSG_RESULT([$SED])
AC_SUBST(SED)
])