AC_PREREQ([2.12])
AC_DEFUN([AM_CONFIG_HEADER],
[ifdef([AC_FOREACH], [
AC_FOREACH([_AM_File], [$1],
[m4_pushdef([_AM_Dest], m4_patsubst(_AM_File, [:.*]))
AC_CONFIG_HEADERS(_AM_File,
[echo timestamp >"AS_ESCAPE(_AM_DIRNAME(]_AM_Dest[))/stamp-h"
][$2]m4_ifval([$3], [, [$3]])) m4_popdef([_AM_Dest])])],[AC_CONFIG_HEADER([$1])
AC_OUTPUT_COMMANDS(
ifelse(patsubst([$1], [[^ ]], []),
[],
[test -z "$CONFIG_HEADERS" || echo timestamp > patsubst([$1], [^\([^:]*/\)?.*], [\1])stamp-h]),[am_indx=1
for am_file in $1; do
case " \$CONFIG_HEADERS " in
*" \$am_file "*)
am_dir=\`echo \$am_file |sed 's%:.*%%;s%[^/]*\$%%'\`
if test -n "\$am_dir"; then
am_tmpdir=\`echo \$am_dir |sed 's%^\(/*\).*\$%\1%'\`
for am_subdir in \`echo \$am_dir |sed 's%/% %'\`; do
am_tmpdir=\$am_tmpdir\$am_subdir/
if test ! -d \$am_tmpdir; then
mkdir \$am_tmpdir
fi
done
fi
echo timestamp > "\$am_dir"stamp-h\$am_indx
;;
esac
am_indx=\`expr \$am_indx + 1\`
done])
])])
AC_DEFUN([_AM_DIRNAME],
[m4_if(m4_regexp([$1], [^.*[^/]//*[^/][^/]*/*$]), -1,
m4_if(m4_regexp([$1], [^//\([^/]\|$\)]), -1,
m4_if(m4_regexp([$1], [^/.*]), -1,
[.],
m4_patsubst([$1], [^\(/\).*], [\1])),
m4_patsubst([$1], [^\(//\)\([^/].*\|$\)], [\1])),
m4_patsubst([$1], [^\(.*[^/]\)//*[^/][^/]*/*$], [\1]))[]])
AC_PREREQ([2.13])
ifdef([AC_PROVIDE_IFELSE],
[],
[define([AC_PROVIDE_IFELSE],
[ifdef([AC_PROVIDE_$1],
[$2], [$3])])])
AC_DEFUN([AM_INIT_AUTOMAKE],
[AC_REQUIRE([AC_PROG_INSTALL])if test "`CDPATH=:; cd $srcdir && pwd`" != "`pwd`" &&
test -f $srcdir/config.status; then
AC_MSG_ERROR([source directory already configured; run \"make distclean\" there first])
fi
PACKAGE=$1
AC_SUBST(PACKAGE)VERSION=$2
AC_SUBST(VERSION)ifelse([$3],,
[AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package])
AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package])])
ifdef([m4_pattern_allow],
[m4_pattern_allow([^AM_[A-Z]+FLAGS])])
AC_SUBST(EXEEXT)
: ${OBJEXT=o}
AC_SUBST(OBJEXT)
AC_REQUIRE([AM_SANITY_CHECK])AC_REQUIRE([AC_ARG_PROGRAM])AM_MISSING_PROG(ACLOCAL, aclocal)
AM_MISSING_PROG(AUTOCONF, autoconf)
AM_MISSING_PROG(AUTOMAKE, automake)
AM_MISSING_PROG(AUTOHEADER, autoheader)
AM_MISSING_PROG(MAKEINFO, makeinfo)
AM_MISSING_PROG(AMTAR, tar)
AM_PROG_INSTALL_SH
AM_PROG_INSTALL_STRIP
AC_REQUIRE([AC_PROG_AWK])AC_REQUIRE([AC_PROG_MAKE_SET])AC_REQUIRE([AM_DEP_TRACK])AC_REQUIRE([AM_SET_DEPDIR])AC_PROVIDE_IFELSE([AC_PROG_][CC],
[_AM_DEPENDENCIES(CC)],
[define([AC_PROG_][CC],
defn([AC_PROG_][CC])[_AM_DEPENDENCIES(CC)])])AC_PROVIDE_IFELSE([AC_PROG_][CXX],
[_AM_DEPENDENCIES(CXX)],
[define([AC_PROG_][CXX],
defn([AC_PROG_][CXX])[_AM_DEPENDENCIES(CXX)])])])
AC_DEFUN([AM_SANITY_CHECK],
[AC_MSG_CHECKING([whether build environment is sane])
sleep 1
echo timestamp > conftest.file
if (
set X `ls -Lt $srcdir/configure conftest.file 2> /dev/null`
if test "$[*]" = "X"; then
set X `ls -t $srcdir/configure conftest.file`
fi
rm -f conftest.file
if test "$[*]" != "X $srcdir/configure conftest.file" \
&& test "$[*]" != "X conftest.file $srcdir/configure"; then
AC_MSG_ERROR([ls -t appears to fail. Make sure there is not a broken
alias in your environment])
fi
test "$[2]" = conftest.file
)
then
:
else
AC_MSG_ERROR([newly created file is older than distributed files!
Check your system clock])
fi
AC_MSG_RESULT(yes)])
AC_DEFUN([AM_MISSING_PROG],
[AC_REQUIRE([AM_MISSING_HAS_RUN])
$1=${$1-"${am_missing_run}$2"}
AC_SUBST($1)])
AC_DEFUN([AM_MISSING_HAS_RUN],
[AC_REQUIRE([AM_AUX_DIR_EXPAND])test x"${MISSING+set}" = xset || MISSING="\${SHELL} $am_aux_dir/missing"
if eval "$MISSING --run true"; then
am_missing_run="$MISSING --run "
else
am_missing_run=
am_backtick='`'
AC_MSG_WARN([${am_backtick}missing' script is too old or missing])
fi
])
AC_DEFUN([AM_AUX_DIR_EXPAND], [
am_aux_dir=`CDPATH=:; cd $ac_aux_dir && pwd`
])
AC_DEFUN([AM_PROG_INSTALL_SH],
[AC_REQUIRE([AM_AUX_DIR_EXPAND])install_sh=${install_sh-"$am_aux_dir/install-sh"}
AC_SUBST(install_sh)])
AC_DEFUN([AM_PROG_INSTALL_STRIP],
[AC_REQUIRE([AM_PROG_INSTALL_SH])INSTALL_STRIP_PROGRAM="\${SHELL} \$(install_sh) -c -s"
AC_SUBST([INSTALL_STRIP_PROGRAM])])
AC_DEFUN([_AM_DEPENDENCIES],
[AC_REQUIRE([AM_SET_DEPDIR])AC_REQUIRE([AM_OUTPUT_DEPENDENCY_COMMANDS])AC_REQUIRE([AM_MAKE_INCLUDE])AC_REQUIRE([AM_DEP_TRACK])
ifelse([$1], CC, [depcc="$CC" am_compiler_list=],
[$1], CXX, [depcc="$CXX" am_compiler_list=],
[$1], OBJC, [depcc="$OBJC" am_compiler_list='gcc3 gcc']
[$1], GCJ, [depcc="$GCJ" am_compiler_list='gcc3 gcc'],
[depcc="$$1" am_compiler_list=])
AC_CACHE_CHECK([dependency style of $depcc],
[am_cv_$1_dependencies_compiler_type],
[if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then
mkdir conftest.dir
cp "$am_depcomp" conftest.dir
cd conftest.dir
am_cv_$1_dependencies_compiler_type=none
if test "$am_compiler_list" = ""; then
am_compiler_list=`sed -n ['s/^ fi
for depmode in $am_compiler_list; do
echo ' echo 'int i;' > conftest.h
echo "${am__include} ${am__quote}conftest.Po${am__quote}" > confmf
case $depmode in
nosideeffect)
if test "x$enable_dependency_tracking" = xyes; then
continue
else
break
fi
;;
none) break ;;
esac
if depmode=$depmode \
source=conftest.c object=conftest.o \
depfile=conftest.Po tmpdepfile=conftest.TPo \
$SHELL ./depcomp $depcc -c conftest.c -o conftest.o >/dev/null 2>&1 &&
grep conftest.h conftest.Po > /dev/null 2>&1 &&
${MAKE-make} -s -f confmf > /dev/null 2>&1; then
am_cv_$1_dependencies_compiler_type=$depmode
break
fi
done
cd ..
rm -rf conftest.dir
else
am_cv_$1_dependencies_compiler_type=none
fi
])
$1DEPMODE="depmode=$am_cv_$1_dependencies_compiler_type"
AC_SUBST([$1DEPMODE])
])
AC_DEFUN([AM_SET_DEPDIR],
[rm -f .deps 2>/dev/null
mkdir .deps 2>/dev/null
if test -d .deps; then
DEPDIR=.deps
else
DEPDIR=_deps
fi
rmdir .deps 2>/dev/null
AC_SUBST(DEPDIR)
])
AC_DEFUN([AM_DEP_TRACK],
[AC_ARG_ENABLE(dependency-tracking,
[ --disable-dependency-tracking Speeds up one-time builds
--enable-dependency-tracking Do not reject slow dependency extractors])
if test "x$enable_dependency_tracking" != xno; then
am_depcomp="$ac_aux_dir/depcomp"
AMDEPBACKSLASH='\'
fi
AM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno])
pushdef([subst], defn([AC_SUBST]))
subst(AMDEPBACKSLASH)
popdef([subst])
])
AC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS],[
AC_OUTPUT_COMMANDS([
test x"$AMDEP_TRUE" != x"" ||
for mf in $CONFIG_FILES; do
case "$mf" in
Makefile) dirpart=.;;
*/Makefile) dirpart=`echo "$mf" | sed -e 's|/[^/]*$||'`;;
*) continue;;
esac
grep '^DEP_FILES *= *[^ DEPDIR=`sed -n -e '/^DEPDIR = / s///p' < "$mf"`
test -z "$DEPDIR" && continue
U=`sed -n -e '/^U = / s///p' < "$mf"`
test -d "$dirpart/$DEPDIR" || mkdir "$dirpart/$DEPDIR"
for file in `sed -n -e '
/^DEP_FILES = .*\\\\$/ {
s/^DEP_FILES = //
:loop
s/\\\\$//
p
n
/\\\\$/ b loop
p
}
/^DEP_FILES = / s/^DEP_FILES = //p' < "$mf" | \
sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do
test -f "$dirpart/$file" && continue
fdir=`echo "$file" | sed -e 's|/[^/]*$||'`
$ac_aux_dir/mkinstalldirs "$dirpart/$fdir" > /dev/null 2>&1
echo ' done
done
], [AMDEP_TRUE="$AMDEP_TRUE"
ac_aux_dir="$ac_aux_dir"])])
AC_DEFUN([AM_MAKE_INCLUDE],
[am_make=${MAKE-make}
cat > confinc << 'END'
doit:
@echo done
END
AC_MSG_CHECKING([for style of include used by $am_make])
am__include='am__quote=
_am_result=none
echo "include confinc" > confmf
if test "`$am_make -s -f confmf 2> /dev/null | fgrep -v 'ing directory'`" = "done"; then
am__include=include
am__quote=
_am_result=GNU
fi
if test "$am__include" = " echo '.include "confinc"' > confmf
if test "`$am_make -s -f confmf 2> /dev/null`" = "done"; then
am__include=.include
am__quote='"'
_am_result=BSD
fi
fi
AC_SUBST(am__include)
AC_SUBST(am__quote)
AC_MSG_RESULT($_am_result)
rm -f confinc confmf
])
AC_DEFUN([AM_CONDITIONAL],
[ifelse([$1], [TRUE],
[errprint(__file__:__line__: [$0: invalid condition: $1
])m4exit(1)])ifelse([$1], [FALSE],
[errprint(__file__:__line__: [$0: invalid condition: $1
])m4exit(1)])AC_SUBST([$1_TRUE])
AC_SUBST([$1_FALSE])
if $2; then
$1_TRUE=
$1_FALSE='else
$1_TRUE=' $1_FALSE=
fi])
AC_DEFUN([AM_C_PROTOTYPES],
[AC_REQUIRE([AM_PROG_CC_STDC])
AC_REQUIRE([AC_PROG_CPP])
AC_MSG_CHECKING([for function prototypes])
if test "$am_cv_prog_cc_stdc" != no; then
AC_MSG_RESULT(yes)
AC_DEFINE(PROTOTYPES,1,[Define if compiler has function prototypes])
U= ANSI2KNR=
else
AC_MSG_RESULT(no)
U=_ ANSI2KNR=./ansi2knr
fi
AC_HEADER_STDC
AC_CHECK_HEADERS(string.h)
AC_SUBST(U)AC_SUBST(ANSI2KNR)])
AC_DEFUN(AM_PROG_CC_STDC,
[AC_REQUIRE([AC_PROG_CC])
AC_BEFORE([$0], [AC_C_INLINE])
AC_BEFORE([$0], [AC_C_CONST])
AC_MSG_CHECKING(for ${CC-cc} option to accept ANSI C)
AC_CACHE_VAL(am_cv_prog_cc_stdc,
[am_cv_prog_cc_stdc=no
ac_save_CC="$CC"
for ac_arg in "" -qlanglvl=ansi -std1 -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__"
do
CC="$ac_save_CC $ac_arg"
AC_TRY_COMPILE(
[/* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */
struct buf { int x; };
FILE * (*rcsopen) (struct buf *, struct stat *, int);
static char *e (p, i)
char **p;
int i;
{
return p[i];
}
static char *f (char * (*g) (char **, int), char **p, ...)
{
char *s;
va_list v;
va_start (v,p);
s = g (p, va_arg (v,int));
va_end (v);
return s;
}
int test (int i, double x);
struct s1 {int (*f) (int a);};
struct s2 {int (*f) (double a);};
int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int);
int argc;
char **argv;
], [
return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1];
],
[am_cv_prog_cc_stdc="$ac_arg"; break])
done
CC="$ac_save_CC"
])
if test -z "$am_cv_prog_cc_stdc"; then
AC_MSG_RESULT([none needed])
else
AC_MSG_RESULT($am_cv_prog_cc_stdc)
fi
case "x$am_cv_prog_cc_stdc" in
x|xno) ;;
*) CC="$CC $am_cv_prog_cc_stdc" ;;
esac
])
AC_DEFUN([AC_MBSTATE_T],
[
AC_CHECK_HEADERS(stdlib.h)
AC_CACHE_CHECK([for mbstate_t], ac_cv_type_mbstate_t,
[AC_TRY_COMPILE([
[mbstate_t x; return sizeof x;],
ac_cv_type_mbstate_t=yes,
ac_cv_type_mbstate_t=no)])
if test $ac_cv_type_mbstate_t = no; then
AC_DEFINE(mbstate_t, int,
[Define to a type if <wchar.h> does not define.])
fi])
AC_DEFUN(jm_CHECK_DECLARATION,
[
AC_MSG_CHECKING([whether $1 is declared])
AC_CACHE_VAL(jm_cv_func_decl_$1,
[AC_TRY_COMPILE([$2],
[
char *(*pfn) = (char *(*)) $1
],
eval "jm_cv_func_decl_$1=yes",
eval "jm_cv_func_decl_$1=no")])
if eval "test \"`echo '$jm_cv_func_decl_'$1`\" = yes"; then
AC_MSG_RESULT(yes)
ifelse([$3], , :, [$3])
else
AC_MSG_RESULT(no)
ifelse([$4], , , [$4
]) fi
])
AC_DEFUN(jm_CHECK_DECLARATIONS,
[
for jm_func in $2
do
jm_CHECK_DECLARATION($jm_func, [$1],
[
jm_tr_func=HAVE_DECL_`echo $jm_func | tr abcdefghijklmnopqrstuvwxyz ABCDEFGHIJKLMNOPQRSTUVWXYZ`
AC_DEFINE_UNQUOTED($jm_tr_func) $3], [$4]) done
])
AC_DEFUN([jm_CHECK_TYPE_STRUCT_DIRENT_D_INO],
[AC_REQUIRE([AC_HEADER_DIRENT]) AC_CACHE_CHECK([for d_ino member in directory struct],
jm_cv_struct_dirent_d_ino,
[AC_TRY_LINK( [
],
[struct dirent dp; dp.d_ino = 0;],
jm_cv_struct_dirent_d_ino=yes,
jm_cv_struct_dirent_d_ino=no)
]
)
if test $jm_cv_struct_dirent_d_ino = yes; then
AC_DEFINE(D_INO_IN_DIRENT, 1,
[Define if there is a member named d_ino in the struct describing
directory headers.])
fi
]
)
AC_PREREQ(2.52)
AC_DEFUN([jm_AC_TYPE_INTMAX_T],
[
AC_REQUIRE([jm_AC_TYPE_LONG_LONG])
AC_CHECK_TYPE(intmax_t, ,
[test $ac_cv_type_long_long = yes \
&& ac_type='long long' \
|| ac_type='long'
AC_DEFINE_UNQUOTED(intmax_t, $ac_type,
[Define to widest signed type if <inttypes.h> doesn't define.])])
])
AC_DEFUN([jm_AC_TYPE_UINTMAX_T],
[
AC_REQUIRE([jm_AC_TYPE_UNSIGNED_LONG_LONG])
AC_CHECK_TYPE(uintmax_t, ,
[test $ac_cv_type_unsigned_long_long = yes \
&& ac_type='unsigned long long' \
|| ac_type='unsigned long'
AC_DEFINE_UNQUOTED(uintmax_t, $ac_type,
[Define to widest unsigned type if <inttypes.h> doesn't define.])])
])
AC_DEFUN([jm_AC_TYPE_LONG_LONG],
[
AC_CACHE_CHECK([for long long], ac_cv_type_long_long,
[AC_TRY_LINK([long long ll = 1; int i = 63;],
[long long llmax = (long long) -1;
return ll << i | ll >> i | llmax / ll | llmax % ll;],
ac_cv_type_long_long=yes,
ac_cv_type_long_long=no)])
if test $ac_cv_type_long_long = yes; then
AC_DEFINE(HAVE_LONG_LONG, 1,
[Define if you have the long long type.])
fi
])
AC_DEFUN([jm_AC_TYPE_UNSIGNED_LONG_LONG],
[
AC_CACHE_CHECK([for unsigned long long], ac_cv_type_unsigned_long_long,
[AC_TRY_LINK([unsigned long long ull = 1; int i = 63;],
[unsigned long long ullmax = (unsigned long long) -1;
return ull << i | ull >> i | ullmax / ull | ullmax % ull;],
ac_cv_type_unsigned_long_long=yes,
ac_cv_type_unsigned_long_long=no)])
if test $ac_cv_type_unsigned_long_long = yes; then
AC_DEFINE(HAVE_UNSIGNED_LONG_LONG, 1,
[Define if you have the unsigned long long type.])
fi
])
AC_DEFUN([jm_AC_PREREQ_XSTRTOUMAX],
[
AC_REQUIRE([jm_AC_TYPE_INTMAX_T])
AC_REQUIRE([jm_AC_TYPE_UINTMAX_T])
AC_REQUIRE([jm_AC_TYPE_LONG_LONG])
AC_REQUIRE([jm_AC_TYPE_UNSIGNED_LONG_LONG])
AC_CHECK_DECLS([strtoul, strtoull, strtoumax])
AC_CHECK_HEADERS(limits.h stdlib.h inttypes.h)
AC_CACHE_CHECK([whether <inttypes.h> defines strtoumax as a macro],
jm_cv_func_strtoumax_macro,
AC_EGREP_CPP([inttypes_h_defines_strtoumax], [ inttypes_h_defines_strtoumax
jm_cv_func_strtoumax_macro=yes,
jm_cv_func_strtoumax_macro=no))
if test "$jm_cv_func_strtoumax_macro" != yes; then
AC_REPLACE_FUNCS(strtoumax)
fi
case "$jm_cv_func_strtoumax_macro,$ac_cv_func_strtoumax" in
no,no)
AC_REPLACE_FUNCS(strtoul)
if test "$ac_cv_type_unsigned_long_long" = yes; then
AC_REPLACE_FUNCS(strtoull)
fi
;;
esac
])
AC_DEFUN([jm_PREREQ],
[
jm_PREREQ_ADDEXT
jm_PREREQ_CANON_HOST
jm_PREREQ_DIRNAME
jm_PREREQ_ERROR
jm_PREREQ_EXCLUDE
jm_PREREQ_GETPAGESIZE
jm_PREREQ_HASH
jm_PREREQ_HUMAN
jm_PREREQ_MBSWIDTH
jm_PREREQ_MEMCHR
jm_PREREQ_QUOTEARG
jm_PREREQ_READUTMP
jm_PREREQ_REGEX
jm_PREREQ_TEMPNAME jm_PREREQ_XGETCWD
jm_PREREQ_XREADLINK
])
AC_DEFUN([jm_PREREQ_ADDEXT],
[
AC_SYS_LONG_FILE_NAMES
AC_CHECK_FUNCS(pathconf)
AC_CHECK_HEADERS(limits.h string.h unistd.h)
])
AC_DEFUN([jm_PREREQ_CANON_HOST],
[
AC_SEARCH_LIBS(gethostbyname, [inet nsl])
AC_CHECK_FUNCS(gethostbyname gethostbyaddr inet_ntoa)
AC_CHECK_FUNCS(gethostbyname gethostbyaddr inet_ntoa)
AC_CHECK_HEADERS(unistd.h string.h netdb.h sys/socket.h \
netinet/in.h arpa/inet.h)
])
AC_DEFUN([jm_PREREQ_DIRNAME],
[
AC_HEADER_STDC
AC_CHECK_HEADERS(string.h)
])
AC_DEFUN([jm_PREREQ_EXCLUDE],
[
jm_FUNC_FNMATCH
AC_CHECK_HEADERS(stdbool.h)
])
AC_DEFUN([jm_PREREQ_GETPAGESIZE],
[
AC_CHECK_FUNCS(getpagesize)
AC_CHECK_HEADERS(OS.h unistd.h)
])
AC_DEFUN([jm_PREREQ_HASH],
[
AC_CHECK_HEADERS(stdlib.h stdbool.h)
AC_REQUIRE([jm_CHECK_DECLS])
])
AC_DEFUN([jm_PREREQ_HUMAN],
[
AC_CHECK_HEADERS(limits.h stdlib.h string.h)
AC_CHECK_DECLS([getenv])
AC_REQUIRE([jm_AC_TYPE_UINTMAX_T])
])
AC_DEFUN([jm_PREREQ_MEMCHR],
[
AC_CHECK_HEADERS(limits.h stdlib.h bp-sym.h)
])
AC_DEFUN([jm_PREREQ_QUOTEARG],
[
AC_CHECK_FUNCS(isascii iswprint mbsinit)
jm_FUNC_MBRTOWC
AC_CHECK_HEADERS(limits.h stddef.h stdlib.h string.h wchar.h wctype.h)
AC_HEADER_STDC
AC_C_BACKSLASH_A
AC_MBSTATE_T
AM_C_PROTOTYPES
])
AC_DEFUN([jm_PREREQ_READUTMP],
[
AC_HEADER_STDC
AC_CHECK_HEADERS(string.h utmp.h utmpx.h sys/param.h)
AC_CHECK_FUNCS(utmpname)
AC_CHECK_FUNCS(utmpxname)
AM_C_PROTOTYPES
if test $ac_cv_header_utmp_h = yes || test $ac_cv_header_utmpx_h = yes; then
utmp_includes="\
$ac_includes_default
"
AC_CHECK_MEMBERS([struct utmpx.ut_user],,,[$utmp_includes])
AC_CHECK_MEMBERS([struct utmp.ut_user],,,[$utmp_includes])
AC_CHECK_MEMBERS([struct utmpx.ut_name],,,[$utmp_includes])
AC_CHECK_MEMBERS([struct utmp.ut_name],,,[$utmp_includes])
AC_CHECK_MEMBERS([struct utmpx.ut_type],,,[$utmp_includes])
AC_CHECK_MEMBERS([struct utmp.ut_type],,,[$utmp_includes])
AC_LIBOBJ(readutmp)
fi
])
AC_DEFUN([jm_PREREQ_REGEX],
[
AC_CHECK_FUNCS(bzero bcopy isascii btowc)
AC_CHECK_HEADERS(alloca.h libintl.h wctype.h wchar.h)
AC_HEADER_STDC
AC_FUNC_ALLOCA
])
AC_DEFUN([jm_PREREQ_TEMPNAME],
[
AC_HEADER_STDC
AC_HEADER_STAT
AC_CHECK_HEADERS(fcntl.h sys/time.h stdint.h unistd.h)
AC_CHECK_FUNCS(__secure_getenv gettimeofday)
])
AC_DEFUN([jm_PREREQ_XGETCWD],
[
AC_C_PROTOTYPES
AC_CHECK_HEADERS(limits.h stdlib.h sys/param.h unistd.h)
AC_CHECK_FUNCS(getcwd)
AC_FUNC_GETCWD_NULL
])
AC_DEFUN([jm_PREREQ_XREADLINK],
[
AC_C_PROTOTYPES
AC_CHECK_HEADERS(limits.h stdlib.h sys/types.h unistd.h)
])
AC_DEFUN([jm_PREREQ_ERROR],
[
AC_CHECK_FUNCS(strerror strerror_r vprintf doprnt)
AC_FUNC_STRERROR_R
AC_HEADER_STDC
])
undefine([AC_FUNC_STRERROR_R])
AC_DEFUN([AC_FUNC_STRERROR_R],
[AC_CHECK_DECLS([strerror_r])
AC_CHECK_FUNCS([strerror_r])
if test $ac_cv_func_strerror_r = yes; then
AC_CHECK_HEADERS(string.h)
AC_CACHE_CHECK([for working strerror_r],
ac_cv_func_strerror_r_works,
[
AC_TRY_COMPILE(
[
],
[
char buf[100];
char x = *strerror_r (0, buf, sizeof buf);
],
ac_cv_func_strerror_r_works=yes,
ac_cv_func_strerror_r_works=no
)
if test $ac_cv_func_strerror_r_works = no; then
AC_TRY_RUN(
[
extern char *strerror_r ();
int
main ()
{
char buf[100];
char x = *strerror_r (0, buf, sizeof buf);
exit (!isalpha (x));
}
],
ac_cv_func_strerror_r_works=yes,
ac_cv_func_strerror_r_works=no,
ac_cv_func_strerror_r_works=no)
fi
])
if test $ac_cv_func_strerror_r_works = yes; then
AC_DEFINE_UNQUOTED(HAVE_WORKING_STRERROR_R, 1,
[Define to 1 if `strerror_r' returns a string.])
fi
fi
])
AC_DEFUN([jm_FUNC_FNMATCH],
[
AC_FUNC_FNMATCH
if test $ac_cv_func_fnmatch_works = no; then
AC_LIBOBJ(fnmatch)
AC_DEFINE(fnmatch, rpl_fnmatch,
[Define to rpl_fnmatch if the replacement function should be used.])
fi
])
AC_DEFUN([jm_CHECK_DECLS],
[
AC_REQUIRE([_jm_DECL_HEADERS])
AC_REQUIRE([AC_HEADER_TIME])
headers='
'
AC_CHECK_DECLS([
free,
getenv,
geteuid,
getgrgid,
getlogin,
getpwuid,
getuid,
getutent,
lseek,
malloc,
memchr,
memrchr,
nanosleep,
realloc,
stpcpy,
strndup,
strnlen,
strstr,
strtoul,
strtoull,
ttyname], , , $headers)
])
AC_DEFUN([_jm_DECL_HEADERS],
[
AC_REQUIRE([AC_HEADER_STDC])
AC_CHECK_HEADERS(grp.h memory.h pwd.h string.h strings.h stdlib.h \
unistd.h sys/time.h utmp.h utmpx.h)
])
AC_DEFUN([jm_FUNC_MBRTOWC],
[
AC_CACHE_CHECK([whether mbrtowc and mbstate_t are properly declared],
jm_cv_func_mbrtowc,
[AC_TRY_LINK(
[ [mbstate_t state; return ! (sizeof state && mbrtowc);],
jm_cv_func_mbrtowc=yes,
jm_cv_func_mbrtowc=no)])
if test $jm_cv_func_mbrtowc = yes; then
AC_DEFINE(HAVE_MBRTOWC, 1,
[Define to 1 if mbrtowc and mbstate_t are properly declared.])
fi
])
AC_DEFUN([AC_C_BACKSLASH_A],
[
AC_CACHE_CHECK([whether backslash-a works in strings], ac_cv_c_backslash_a,
[AC_TRY_COMPILE([],
[
syntax error;
char buf['\a' == 'a' ? -1 : 1];
buf[0] = '\a';
return buf[0] != "\a"[0];
],
ac_cv_c_backslash_a=yes,
ac_cv_c_backslash_a=no)])
if test $ac_cv_c_backslash_a = yes; then
AC_DEFINE(HAVE_C_BACKSLASH_A, 1,
[Define if backslash-a works in C strings.])
fi
])
AC_DEFUN([AC_FUNC_GETCWD_NULL],
[AC_CHECK_HEADERS(stdlib.h unistd.h)
AC_CACHE_CHECK([whether getcwd (NULL, 0) allocates memory for result],
[ac_cv_func_getcwd_null],
[AC_TRY_RUN(
[
char *getcwd ();
int
main ()
{
if (chdir ("/") != 0)
exit (1);
else
{
char *f = getcwd (NULL, 0);
exit (! (f && f[0] == '/' && !f[1]));
}
}],
[ac_cv_func_getcwd_null=yes],
[ac_cv_func_getcwd_null=no],
[ac_cv_func_getcwd_null=no])])
if test $ac_cv_func_getcwd_null = yes; then
AC_DEFINE(HAVE_GETCWD_NULL, 1,
[Define if getcwd (NULL, 0) allocates memory for result.])
fi])
AC_DEFUN([AM_FUNC_GETLINE],
[ am_getline_needs_run_time_check=no
AC_CHECK_FUNC(getline,
am_getline_needs_run_time_check=yes,
am_cv_func_working_getline=no)
if test $am_getline_needs_run_time_check = yes; then
AC_CACHE_CHECK([for working getline function], am_cv_func_working_getline,
[echo fooN |tr -d '\012'|tr N '\012' > conftest.data
AC_TRY_RUN([
int main ()
{ /* Based on a test program from Karl Heuer. */
char *line = NULL;
size_t siz = 0;
int len;
FILE *in = fopen ("./conftest.data", "r");
if (!in)
return 1;
len = getline (&line, &siz, in);
exit ((len == 4 && line && strcmp (line, "foo\n") == 0) ? 0 : 1);
}
], am_cv_func_working_getline=yes , am_cv_func_working_getline=no , am_cv_func_working_getline=no )])
fi
if test $am_cv_func_working_getline = no; then
AC_LIBOBJ(getline)
fi
])
AC_DEFUN([jm_FUNC_MALLOC],
[
AC_DEFINE_UNQUOTED(HAVE_DONE_WORKING_MALLOC_CHECK, 1,
[Define if the malloc check has been performed. ])
AC_CACHE_CHECK([for working malloc], jm_cv_func_working_malloc,
[AC_TRY_RUN([
char *malloc ();
int
main ()
{
exit (malloc (0) ? 0 : 1);
}
],
jm_cv_func_working_malloc=yes,
jm_cv_func_working_malloc=no,
jm_cv_func_working_malloc=no)
])
if test $jm_cv_func_working_malloc = no; then
AC_LIBOBJ(malloc)
AC_DEFINE_UNQUOTED(malloc, rpl_malloc,
[Define to rpl_malloc if the replacement function should be used.])
fi
])
AC_DEFUN([jm_FUNC_MKTIME],
[AC_REQUIRE([AC_FUNC_MKTIME])
AC_CHECK_FUNCS(localtime_r)
if test $ac_cv_func_working_mktime = no; then
AC_DEFINE_UNQUOTED(mktime, rpl_mktime,
[Define to rpl_mktime if the replacement function should be used.])
fi
])
#serial 5
dnl From Jim Meyering.
dnl Determine whether realloc works when both arguments are 0.
dnl If it doesn't, arrange to use the replacement function.
AC_DEFUN([jm_FUNC_REALLOC],
[
AC_DEFINE_UNQUOTED(HAVE_DONE_WORKING_REALLOC_CHECK, 1,
[Define if the realloc check has been performed. ])
AC_CACHE_CHECK([for working realloc], jm_cv_func_working_realloc,
[AC_TRY_RUN([
char *realloc ();
int
main ()
{
exit (realloc (0, 0) ? 0 : 1);
}
],
jm_cv_func_working_realloc=yes,
jm_cv_func_working_realloc=no,
jm_cv_func_working_realloc=no)
])
if test $jm_cv_func_working_realloc = no; then
AC_LIBOBJ(realloc)
AC_DEFINE_UNQUOTED(realloc, rpl_realloc,
[Define to rpl_realloc if the replacement function should be used.])
fi
])
AC_DEFUN([AM_WITH_NLS],
[AC_MSG_CHECKING([whether NLS is requested])
AC_ARG_ENABLE(nls,
[ --disable-nls do not use Native Language Support],
USE_NLS=$enableval, USE_NLS=yes)
AC_MSG_RESULT($USE_NLS)
AC_SUBST(USE_NLS)
BUILD_INCLUDED_LIBINTL=no
USE_INCLUDED_LIBINTL=no
INTLLIBS=
if test "$USE_NLS" = "yes"; then
AC_DEFINE(ENABLE_NLS, 1,
[Define to 1 if translation of program messages to the user's native language
is requested.])
AC_MSG_CHECKING([whether included gettext is requested])
AC_ARG_WITH(included-gettext,
[ --with-included-gettext use the GNU gettext library included here],
nls_cv_force_use_gnu_gettext=$withval,
nls_cv_force_use_gnu_gettext=no)
AC_MSG_RESULT($nls_cv_force_use_gnu_gettext)
nls_cv_use_gnu_gettext="$nls_cv_force_use_gnu_gettext"
if test "$nls_cv_force_use_gnu_gettext" != "yes"; then
CATOBJEXT=NONE
define(gt_cv_func_gnugettext_libc, [gt_cv_func_gnugettext]ifelse([$2], need-ngettext, 2, 1)[_libc])
define(gt_cv_func_gnugettext_libintl, [gt_cv_func_gnugettext]ifelse([$2], need-ngettext, 2, 1)[_libintl])
AC_CHECK_HEADER(libintl.h,
[AC_CACHE_CHECK([for GNU gettext in libc], gt_cv_func_gnugettext_libc,
[AC_TRY_LINK([extern int _nl_msg_cat_cntr;],
[bindtextdomain ("", "");
return (int) gettext ("")]ifelse([$2], need-ngettext, [ + (int) ngettext ("", "", 0)], [])[ + _nl_msg_cat_cntr],
gt_cv_func_gnugettext_libc=yes,
gt_cv_func_gnugettext_libc=no)])
if test "$gt_cv_func_gnugettext_libc" != "yes"; then
AC_CACHE_CHECK([for GNU gettext in libintl],
gt_cv_func_gnugettext_libintl,
[gt_save_LIBS="$LIBS"
LIBS="$LIBS -lintl $LIBICONV"
AC_TRY_LINK([extern int _nl_msg_cat_cntr;],
[bindtextdomain ("", "");
return (int) gettext ("")]ifelse([$2], need-ngettext, [ + (int) ngettext ("", "", 0)], [])[ + _nl_msg_cat_cntr],
gt_cv_func_gnugettext_libintl=yes,
gt_cv_func_gnugettext_libintl=no)
LIBS="$gt_save_LIBS"])
fi
if test "$gt_cv_func_gnugettext_libc" = "yes" \
|| { test "$gt_cv_func_gnugettext_libintl" = "yes" \
&& test "$PACKAGE" != gettext; }; then
AC_DEFINE(HAVE_GETTEXT, 1,
[Define if the GNU gettext() function is already present or preinstalled.])
if test "$gt_cv_func_gnugettext_libintl" = "yes"; then
INTLLIBS="-lintl $LIBICONV"
fi
gt_save_LIBS="$LIBS"
LIBS="$LIBS $INTLLIBS"
AC_CHECK_FUNCS(dcgettext)
LIBS="$gt_save_LIBS"
AM_PATH_PROG_WITH_TEST(MSGFMT, msgfmt,
[$ac_dir/$ac_word --statistics /dev/null >/dev/null 2>&1], :)
AC_PATH_PROG(GMSGFMT, gmsgfmt, $MSGFMT)
AM_PATH_PROG_WITH_TEST(XGETTEXT, xgettext,
[$ac_dir/$ac_word --omit-header /dev/null >/dev/null 2>&1], :)
CATOBJEXT=.gmo
fi
])
if test "$CATOBJEXT" = "NONE"; then
nls_cv_use_gnu_gettext=yes
fi
fi
if test "$nls_cv_use_gnu_gettext" = "yes"; then
INTLOBJS="\$(GETTOBJS)"
AM_PATH_PROG_WITH_TEST(MSGFMT, msgfmt,
[$ac_dir/$ac_word --statistics /dev/null >/dev/null 2>&1], :)
AC_PATH_PROG(GMSGFMT, gmsgfmt, $MSGFMT)
AM_PATH_PROG_WITH_TEST(XGETTEXT, xgettext,
[$ac_dir/$ac_word --omit-header /dev/null >/dev/null 2>&1], :)
AC_SUBST(MSGFMT)
BUILD_INCLUDED_LIBINTL=yes
USE_INCLUDED_LIBINTL=yes
CATOBJEXT=.gmo
INTLLIBS="ifelse([$3],[],\$(top_builddir)/intl,[$3])/libintl.ifelse([$1], use-libtool, [l], [])a $LIBICONV"
LIBS=`echo " $LIBS " | sed -e 's/ -lintl / /' -e 's/^ //' -e 's/ $//'`
fi
if test "$GMSGFMT" != ":"; then
if $GMSGFMT --statistics /dev/null >/dev/null 2>&1; then
: ;
else
AC_MSG_RESULT(
[found msgfmt program is not GNU msgfmt; ignore it])
GMSGFMT=":"
fi
fi
if test "$XGETTEXT" != ":"; then
if $XGETTEXT --omit-header /dev/null >/dev/null 2>&1; then
: ;
else
AC_MSG_RESULT(
[found xgettext program is not GNU xgettext; ignore it])
XGETTEXT=":"
fi
fi
POSUB=po
fi
AC_OUTPUT_COMMANDS(
[for ac_file in $CONFIG_FILES; do
case "$ac_file" in
*:*) ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;;
esac
case "$ac_file" in */Makefile.in)
ac_dir=`echo "$ac_file"|sed 's%/[^/][^/]*$%%'`
ac_dir_suffix="/`echo "$ac_dir"|sed 's%^\./%%'`"
ac_dots=`echo "$ac_dir_suffix"|sed 's%/[^/]*%../%g'`
test -n "$ac_given_srcdir" || ac_given_srcdir="$srcdir"
case "$ac_given_srcdir" in
.) top_srcdir=`echo $ac_dots|sed 's%/$%%'` ;;
/*) top_srcdir="$ac_given_srcdir" ;;
*) top_srcdir="$ac_dots$ac_given_srcdir" ;;
esac
if test -f "$ac_given_srcdir/$ac_dir/POTFILES.in"; then
rm -f "$ac_dir/POTFILES"
test -n "$as_me" && echo "$as_me: creating $ac_dir/POTFILES" || echo "creating $ac_dir/POTFILES"
sed -e "/^ test -n "$as_me" && echo "$as_me: creating $ac_dir/Makefile" || echo "creating $ac_dir/Makefile"
sed -e "/POTFILES =/r $ac_dir/POTFILES" "$ac_dir/Makefile.in" > "$ac_dir/Makefile"
fi
;;
esac
done])
if test "$PACKAGE" = gettext; then
BUILD_INCLUDED_LIBINTL=yes
fi
AC_CHECK_PROGS([INTLBISON], [bison])
if test -z "$INTLBISON"; then
ac_verc_fail=yes
else
AC_MSG_CHECKING([version of bison])
changequote(<<,>>) ac_prog_version=`$INTLBISON --version 2>&1 | sed -n 's/^.*GNU Bison.* \([0-9]*\.[0-9.]*\).*$/\1/p'`
case $ac_prog_version in
'') ac_prog_version="v. ?.??, bad"; ac_verc_fail=yes;;
1.2[6-9]* | 1.[3-9][0-9]* | [2-9].*)
changequote([,]) ac_prog_version="$ac_prog_version, ok"; ac_verc_fail=no;;
*) ac_prog_version="$ac_prog_version, bad"; ac_verc_fail=yes;;
esac
AC_MSG_RESULT([$ac_prog_version])
fi
if test $ac_verc_fail = yes; then
INTLBISON=:
fi
for lang in $ALL_LINGUAS; do
GMOFILES="$GMOFILES $lang.gmo"
POFILES="$POFILES $lang.po"
done
AC_SUBST(BUILD_INCLUDED_LIBINTL)
AC_SUBST(USE_INCLUDED_LIBINTL)
AC_SUBST(CATALOGS)
AC_SUBST(CATOBJEXT)
AC_SUBST(GMOFILES)
AC_SUBST(INTLLIBS)
AC_SUBST(INTLOBJS)
AC_SUBST(POFILES)
AC_SUBST(POSUB)
nls_cv_header_intl=
nls_cv_header_libgt=
DATADIRNAME=share
AC_SUBST(DATADIRNAME)
INSTOBJEXT=.mo
AC_SUBST(INSTOBJEXT)
GENCAT=gencat
AC_SUBST(GENCAT)
])
AC_DEFUN([AM_GNU_GETTEXT],
[AC_REQUIRE([AC_PROG_MAKE_SET]) AC_REQUIRE([AC_PROG_CC]) AC_REQUIRE([AC_CANONICAL_HOST]) AC_REQUIRE([AC_PROG_RANLIB]) AC_REQUIRE([AC_ISC_POSIX]) AC_REQUIRE([AC_HEADER_STDC]) AC_REQUIRE([AC_C_CONST]) AC_REQUIRE([AC_C_INLINE]) AC_REQUIRE([AC_TYPE_OFF_T]) AC_REQUIRE([AC_TYPE_SIZE_T]) AC_REQUIRE([AC_FUNC_ALLOCA]) AC_REQUIRE([AC_FUNC_MMAP]) AC_REQUIRE([jm_GLIBC21])
AC_CHECK_HEADERS([argz.h limits.h locale.h nl_types.h malloc.h stddef.h \
stdlib.h string.h unistd.h sys/param.h])
AC_CHECK_FUNCS([feof_unlocked fgets_unlocked getcwd getegid geteuid \
getgid getuid mempcpy munmap putenv setenv setlocale stpcpy strchr strcasecmp \
strdup strtoul tsearch __argz_count __argz_stringify __argz_next])
AM_ICONV
AM_LANGINFO_CODESET
AM_LC_MESSAGES
AM_WITH_NLS([$1],[$2],[$3])
if test "x$CATOBJEXT" != "x"; then
if test "x$ALL_LINGUAS" = "x"; then
LINGUAS=
else
AC_MSG_CHECKING(for catalogs to be installed)
NEW_LINGUAS=
for presentlang in $ALL_LINGUAS; do
useit=no
for desiredlang in ${LINGUAS-$ALL_LINGUAS}; do
case "$desiredlang" in
"$presentlang"*) useit=yes;;
esac
done
if test $useit = yes; then
NEW_LINGUAS="$NEW_LINGUAS $presentlang"
fi
done
LINGUAS=$NEW_LINGUAS
AC_MSG_RESULT($LINGUAS)
fi
if test -n "$LINGUAS"; then
for lang in $LINGUAS; do CATALOGS="$CATALOGS $lang$CATOBJEXT"; done
fi
fi
MKINSTALLDIRS=
if test -n "$ac_aux_dir"; then
MKINSTALLDIRS="$ac_aux_dir/mkinstalldirs"
fi
if test -z "$MKINSTALLDIRS"; then
MKINSTALLDIRS="\$(top_srcdir)/mkinstalldirs"
fi
AC_SUBST(MKINSTALLDIRS)
INTL_LIBTOOL_SUFFIX_PREFIX=ifelse([$1], use-libtool, [l], [])
AC_SUBST(INTL_LIBTOOL_SUFFIX_PREFIX)
])
AC_DEFUN([AM_PATH_PROG_WITH_TEST],
[set dummy $2; ac_word=[$]2
AC_MSG_CHECKING([for $ac_word])
AC_CACHE_VAL(ac_cv_path_$1,
[case "[$]$1" in
/*)
ac_cv_path_$1="[$]$1" ;;
*)
IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
for ac_dir in ifelse([$5], , $PATH, [$5]); do
test -z "$ac_dir" && ac_dir=.
if test -f $ac_dir/$ac_word; then
if [$3]; then
ac_cv_path_$1="$ac_dir/$ac_word"
break
fi
fi
done
IFS="$ac_save_ifs"
ifelse([$4], , , [ test -z "[$]ac_cv_path_$1" && ac_cv_path_$1="$4"
]) ;;
esac])$1="$ac_cv_path_$1"
if test ifelse([$4], , [-n "[$]$1"], ["[$]$1" != "$4"]); then
AC_MSG_RESULT([$]$1)
else
AC_MSG_RESULT(no)
fi
AC_SUBST($1)])
AC_DEFUN([jm_GLIBC21],
[
AC_CACHE_CHECK(whether we are using the GNU C Library 2.1 or newer,
ac_cv_gnu_library_2_1,
[AC_EGREP_CPP([Lucky GNU user],
[
Lucky GNU user
],
ac_cv_gnu_library_2_1=yes,
ac_cv_gnu_library_2_1=no)
]
)
AC_SUBST(GLIBC21)
GLIBC21="$ac_cv_gnu_library_2_1"
]
)
AC_DEFUN([AM_ICONV],
[
AC_ARG_WITH([libiconv-prefix],
[ --with-libiconv-prefix=DIR search for libiconv in DIR/include and DIR/lib], [
for dir in `echo "$withval" | tr : ' '`; do
if test -d $dir/include; then CPPFLAGS="$CPPFLAGS -I$dir/include"; fi
if test -d $dir/lib; then LDFLAGS="$LDFLAGS -L$dir/lib"; fi
done
])
AC_CACHE_CHECK(for iconv, am_cv_func_iconv, [
am_cv_func_iconv="no, consider installing GNU libiconv"
am_cv_lib_iconv=no
AC_TRY_LINK([ [iconv_t cd = iconv_open("","");
iconv(cd,NULL,NULL,NULL,NULL);
iconv_close(cd);],
am_cv_func_iconv=yes)
if test "$am_cv_func_iconv" != yes; then
am_save_LIBS="$LIBS"
LIBS="$LIBS -liconv"
AC_TRY_LINK([ [iconv_t cd = iconv_open("","");
iconv(cd,NULL,NULL,NULL,NULL);
iconv_close(cd);],
am_cv_lib_iconv=yes
am_cv_func_iconv=yes)
LIBS="$am_save_LIBS"
fi
])
if test "$am_cv_func_iconv" = yes; then
AC_DEFINE(HAVE_ICONV, 1, [Define if you have the iconv() function.])
AC_MSG_CHECKING([for iconv declaration])
AC_CACHE_VAL(am_cv_proto_iconv, [
AC_TRY_COMPILE([
extern
"C"
size_t iconv (iconv_t cd, char * *inbuf, size_t *inbytesleft, char * *outbuf, size_t *outbytesleft);
size_t iconv();
], [], am_cv_proto_iconv_arg1="", am_cv_proto_iconv_arg1="const")
am_cv_proto_iconv="extern size_t iconv (iconv_t cd, $am_cv_proto_iconv_arg1 char * *inbuf, size_t *inbytesleft, char * *outbuf, size_t *outbytesleft);"])
am_cv_proto_iconv=`echo "[$]am_cv_proto_iconv" | tr -s ' ' | sed -e 's/( /(/'`
AC_MSG_RESULT([$]{ac_t:-
}[$]am_cv_proto_iconv)
AC_DEFINE_UNQUOTED(ICONV_CONST, $am_cv_proto_iconv_arg1,
[Define as const if the declaration of iconv() needs const.])
fi
LIBICONV=
if test "$am_cv_lib_iconv" = yes; then
LIBICONV="-liconv"
fi
AC_SUBST(LIBICONV)
])
AC_DEFUN([AM_LANGINFO_CODESET],
[
AC_CACHE_CHECK([for nl_langinfo and CODESET], am_cv_langinfo_codeset,
[AC_TRY_LINK([ [char* cs = nl_langinfo(CODESET);],
am_cv_langinfo_codeset=yes,
am_cv_langinfo_codeset=no)
])
if test $am_cv_langinfo_codeset = yes; then
AC_DEFINE(HAVE_LANGINFO_CODESET, 1,
[Define if you have <langinfo.h> and nl_langinfo(CODESET).])
fi
])
AC_DEFUN([AM_LC_MESSAGES],
[if test $ac_cv_header_locale_h = yes; then
AC_CACHE_CHECK([for LC_MESSAGES], am_cv_val_LC_MESSAGES,
[AC_TRY_LINK([ am_cv_val_LC_MESSAGES=yes, am_cv_val_LC_MESSAGES=no)])
if test $am_cv_val_LC_MESSAGES = yes; then
AC_DEFINE(HAVE_LC_MESSAGES, 1,
[Define if your <locale.h> file defines LC_MESSAGES.])
fi
fi])