Modify h323 to build against PTLib as well as the older PWLib
[asterisk/asterisk.git] / autoconf / ast_prog_sed.m4
1 # AST_PROG_SED
2 # -----------
3 # Check for a fully functional sed program that truncates
4 # as few characters as possible.  Prefer GNU sed if found.
5 AC_DEFUN([AST_PROG_SED],
6 [AC_CACHE_CHECK([for a sed that does not truncate output], ac_cv_path_SED,
7     [dnl ac_script should not contain more than 99 commands (for HP-UX sed),
8      dnl but more than about 7000 bytes, to catch a limit in Solaris 8 /usr/ucb/sed.
9      ac_script=s/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb/
10      for ac_i in 1 2 3 4 5 6 7; do
11        ac_script="$ac_script$as_nl$ac_script"
12      done
13      echo "$ac_script" | sed 99q >conftest.sed
14      $as_unset ac_script || ac_script=
15      ifdef([_AC_PATH_PROGS_FEATURE_CHECK],[],[define([_AC_PATH_PROGS_FEATURE_CHECK],defn([_AC_PATH_PROG_FEATURE_CHECK]))])
16      _AC_PATH_PROGS_FEATURE_CHECK(SED, [sed gsed],
17         [_AC_FEATURE_CHECK_LENGTH([ac_path_SED], [ac_cv_path_SED],
18                 ["$ac_path_SED" -f conftest.sed])])])
19  SED="$ac_cv_path_SED"
20  AC_SUBST([SED])dnl
21  rm -f conftest.sed
22 ])# AST_PROG_SED