1## ----------------------##
2## Prepare for testing.  ##
3## ----------------------##
4
5# The argument (often `../src') says where are the built sources to test,
6# relative to the built test directory.  Empty for a flat distribution, as
7# `.' gets always added in front of the search path by the `atconfig' script.
8
9AC_DEFUN(AT_CONFIG,
10[AT_TESTPATH=$1
11AC_SUBST(AT_TESTPATH)
12fp_PROG_ECHO
13])
14
15## ----------------------------------------- ##
16## Find how to suppress newlines with echo.  ##
17## ----------------------------------------- ##
18
19# Once this macro is called, you may output with no echo in a Makefile or
20# script using:  echo @ECHO_N@ "STRING_TO_OUTPUT@ECHO_C@".
21
22AC_DEFUN(fp_PROG_ECHO,
23[AC_CACHE_CHECK(how to suppress newlines using echo, fp_cv_prog_echo_nonl,
24[if (echo "testing\c"; echo 1,2,3) | grep c >/dev/null; then
25  if (echo -n testing; echo 1,2,3) | sed s/-n/xn/ | grep xn >/dev/null; then
26    fp_cv_prog_echo_nonl=no
27  else
28    fp_cv_prog_echo_nonl=option
29  fi
30else
31  fp_cv_prog_echo_nonl=escape
32fi
33])
34test $fp_cv_prog_echo_nonl = no \
35  && echo 2>&1 "WARNING: \`echo' not powerful enough for \`make check'"
36case $fp_cv_prog_echo_nonl in
37  no) ECHO_N= ECHO_C= ;;
38  option) ECHO_N=-n ECHO_C= ;;
39  escape) ECHO_N= ECHO_C='\c' ;;
40esac
41AC_SUBST(ECHO_N)dnl
42AC_SUBST(ECHO_C)dnl
43])
44