File: atconfig.m4

package info (click to toggle)
recode 3.6-20
  • links: PTS
  • area: main
  • in suites: wheezy
  • size: 11,460 kB
  • sloc: ansic: 89,467; sh: 16,428; python: 1,281; lisp: 1,027; perl: 335; makefile: 307; lex: 171
file content (43 lines) | stat: -rw-r--r-- 1,289 bytes parent folder | download | duplicates (10)
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
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
## ----------------------##
## Prepare for testing.  ##
## ----------------------##

# The argument (often `../src') says where are the built sources to test,
# relative to the built test directory.  Empty for a flat distribution, as
# `.' gets always added in front of the search path by the `atconfig' script.

AC_DEFUN(AT_CONFIG,
[AT_TESTPATH=$1
AC_SUBST(AT_TESTPATH)
fp_PROG_ECHO
])

## ----------------------------------------- ##
## Find how to suppress newlines with echo.  ##
## ----------------------------------------- ##

# Once this macro is called, you may output with no echo in a Makefile or
# script using:  echo @ECHO_N@ "STRING_TO_OUTPUT@ECHO_C@".

AC_DEFUN(fp_PROG_ECHO,
[AC_CACHE_CHECK(how to suppress newlines using echo, fp_cv_prog_echo_nonl,
[if (echo "testing\c"; echo 1,2,3) | grep c >/dev/null; then
  if (echo -n testing; echo 1,2,3) | sed s/-n/xn/ | grep xn >/dev/null; then
    fp_cv_prog_echo_nonl=no
  else
    fp_cv_prog_echo_nonl=option
  fi
else
  fp_cv_prog_echo_nonl=escape
fi
])
test $fp_cv_prog_echo_nonl = no \
  && echo 2>&1 "WARNING: \`echo' not powerful enough for \`make check'"
case $fp_cv_prog_echo_nonl in
  no) ECHO_N= ECHO_C= ;;
  option) ECHO_N=-n ECHO_C= ;;
  escape) ECHO_N= ECHO_C='\c' ;;
esac
AC_SUBST(ECHO_N)dnl
AC_SUBST(ECHO_C)dnl
])