]> git.cworth.org Git - tar/blob - m4/error.m4
Imported Upstream version 1.24
[tar] / m4 / error.m4
1 #serial 13
2
3 # Copyright (C) 1996-1998, 2001-2004, 2009-2010 Free Software Foundation, Inc.
4 #
5 # This file is free software; the Free Software Foundation
6 # gives unlimited permission to copy and/or distribute it,
7 # with or without modifications, as long as this notice is preserved.
8
9 AC_DEFUN([gl_ERROR],
10 [
11   AC_FUNC_ERROR_AT_LINE
12   dnl Note: AC_FUNC_ERROR_AT_LINE does AC_LIBSOURCES([error.h, error.c]).
13   gl_PREREQ_ERROR
14 ])
15
16 # Redefine AC_FUNC_ERROR_AT_LINE, because it is no longer maintained in
17 # Autoconf.
18 AC_DEFUN([AC_FUNC_ERROR_AT_LINE],
19 [
20   AC_LIBSOURCES([error.h, error.c])dnl
21   AC_CACHE_CHECK([for error_at_line], [ac_cv_lib_error_at_line],
22     [AC_LINK_IFELSE(
23        [AC_LANG_PROGRAM(
24           [[#include <error.h>]],
25           [[error_at_line (0, 0, "", 0, "an error occurred");]])],
26        [ac_cv_lib_error_at_line=yes],
27        [ac_cv_lib_error_at_line=no])])
28   if test $ac_cv_lib_error_at_line = no; then
29     AC_LIBOBJ([error])
30   fi
31 ])
32
33 # Prerequisites of lib/error.c.
34 AC_DEFUN([gl_PREREQ_ERROR],
35 [
36   AC_REQUIRE([AC_FUNC_STRERROR_R])
37   AC_REQUIRE([AC_C_INLINE])
38   :
39 ])