Silence -Wunused-const-variable warnings in Gnulib code.
[gnulib.git] / m4 / sysexits.m4
blobf3e7c2afdadadd174ba8cae18c78ba190d2129e7
1 # sysexits.m4
2 # serial 7
3 dnl Copyright (C) 2003, 2005, 2007, 2009-2024 Free Software Foundation, Inc.
4 dnl This file is free software; the Free Software Foundation
5 dnl gives unlimited permission to copy and/or distribute it,
6 dnl with or without modifications, as long as this notice is preserved.
8 AC_DEFUN([gl_SYSEXITS],
10   AC_CHECK_HEADERS_ONCE([sysexits.h])
11   if test $ac_cv_header_sysexits_h = yes; then
12     HAVE_SYSEXITS_H=1
13     gl_CHECK_NEXT_HEADERS([sysexits.h])
14     AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <sysexits.h>]],
15         [[switch (0)
16           {
17           case EX_OK:
18           case EX_USAGE:
19           case EX_DATAERR:
20           case EX_NOINPUT:
21           case EX_NOUSER:
22           case EX_NOHOST:
23           case EX_UNAVAILABLE:
24           case EX_SOFTWARE:
25           case EX_OSERR:
26           case EX_OSFILE:
27           case EX_CANTCREAT:
28           case EX_IOERR:
29           case EX_TEMPFAIL:
30           case EX_PROTOCOL:
31           case EX_NOPERM:
32           case EX_CONFIG:
33             break;
34           }
35         ]])],
36       [GL_GENERATE_SYSEXITS_H=false],
37       [GL_GENERATE_SYSEXITS_H=true])
38   else
39     HAVE_SYSEXITS_H=0
40     GL_GENERATE_SYSEXITS_H=true
41   fi
42   AC_SUBST([HAVE_SYSEXITS_H])