Avoid "warning: The macro `AC_HELP_STRING' is obsolete".
[gnulib.git] / m4 / sysexits.m4
blob2509b3f3f94c87b99768857bd7b35a27866cd11f
1 # sysexits.m4 serial 6
2 dnl Copyright (C) 2003, 2005, 2007, 2009-2020 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.
7 AC_DEFUN([gl_SYSEXITS],
9   AC_CHECK_HEADERS_ONCE([sysexits.h])
10   if test $ac_cv_header_sysexits_h = yes; then
11     HAVE_SYSEXITS_H=1
12     gl_CHECK_NEXT_HEADERS([sysexits.h])
13     AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <sysexits.h>]],
14         [[switch (0)
15           {
16           case EX_OK:
17           case EX_USAGE:
18           case EX_DATAERR:
19           case EX_NOINPUT:
20           case EX_NOUSER:
21           case EX_NOHOST:
22           case EX_UNAVAILABLE:
23           case EX_SOFTWARE:
24           case EX_OSERR:
25           case EX_OSFILE:
26           case EX_CANTCREAT:
27           case EX_IOERR:
28           case EX_TEMPFAIL:
29           case EX_PROTOCOL:
30           case EX_NOPERM:
31           case EX_CONFIG:
32             break;
33           }
34         ]])],
35       [SYSEXITS_H=],
36       [SYSEXITS_H=sysexits.h])
37   else
38     HAVE_SYSEXITS_H=0
39     SYSEXITS_H=sysexits.h
40   fi
41   AC_SUBST([HAVE_SYSEXITS_H])
42   AC_SUBST([SYSEXITS_H])
43   AM_CONDITIONAL([GL_GENERATE_SYSEXITS_H], [test -n "$SYSEXITS_H"])