summaryrefslogtreecommitdiffstats
path: root/gettext-tools/m4/error.m4
blob: eb97cfb9efffffaa5ca8e08b7e76665da3c6b857 (plain)
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
# error.m4 serial 2 (gettext-0.12)
dnl Copyright (C) 2002-2003 Free Software Foundation, Inc.
dnl This file is free software, distributed under the terms of the GNU
dnl General Public License.  As a special exception to the GNU General
dnl Public License, this file may be distributed as part of a program
dnl that contains a configuration script generated by Autoconf, under
dnl the same distribution terms as the rest of that program.

# A modified version of AM_FUNC_ERROR_AT_LINE that triggers HAVE_ERROR_AT_LINE
# in config.h instead of modifying LIBOBJS.
AC_DEFUN([gt_FUNC_ERROR_AT_LINE],
[
  AC_CACHE_CHECK([for error_at_line], am_cv_lib_error_at_line,
   [AC_TRY_LINK([],[error_at_line(0, 0, "", 0, "");],
                am_cv_lib_error_at_line=yes,
	        am_cv_lib_error_at_line=no)])
  if test $am_cv_lib_error_at_line = yes; then
    AC_DEFINE(HAVE_ERROR_AT_LINE, 1,
      [Define to 1 if you have the functions error() and error_at_line().])
  else
    jm_PREREQ_ERROR
  fi
])

# Prerequisites of lib/error.c.
AC_DEFUN([jm_PREREQ_ERROR],
[
  AC_REQUIRE([AC_HEADER_STDC])
  AC_REQUIRE([AC_FUNC_VPRINTF])
  AC_CHECK_FUNCS(strerror)
  AC_CHECK_DECLS([strerror])
  AC_FUNC_STRERROR_R
])