]> git.cworth.org Git - tar/blob - m4/rpmatch.m4
Imported Upstream version 1.21
[tar] / m4 / rpmatch.m4
1 # rpmatch.m4 serial 7
2 dnl Copyright (C) 2002-2003, 2007-2008 Free Software Foundation, Inc.
3 dnl This file is free software; the Free Software Foundation
4 dnl gives unlimited permission to copy and/or distribute it,
5 dnl with or without modifications, as long as this notice is preserved.
6
7 AC_DEFUN([gl_FUNC_RPMATCH],
8 [
9   dnl Persuade glibc <stdlib.h> to declare rpmatch().
10   AC_REQUIRE([AC_USE_SYSTEM_EXTENSIONS])
11
12   AC_REQUIRE([gl_STDLIB_H_DEFAULTS])
13   AC_REPLACE_FUNCS(rpmatch)
14   if test $ac_cv_func_rpmatch = no; then
15     HAVE_RPMATCH=0
16     gl_PREREQ_RPMATCH
17   fi
18 ])
19
20 # Prerequisites of lib/rpmatch.c.
21 AC_DEFUN([gl_PREREQ_RPMATCH], [
22   AC_CACHE_CHECK([for nl_langinfo and YESEXPR], gl_cv_langinfo_yesexpr,
23     [AC_TRY_LINK([#include <langinfo.h>],
24        [char* cs = nl_langinfo(YESEXPR); return !cs;],
25        [gl_cv_langinfo_yesexpr=yes],
26        [gl_cv_langinfo_yesexpr=no])
27     ])
28   if test $gl_cv_langinfo_yesexpr = yes; then
29     AC_DEFINE([HAVE_LANGINFO_YESEXPR], 1,
30       [Define if you have <langinfo.h> and nl_langinfo(YESEXPR).])
31   fi
32 ])