sysexits.m4 1.2 KB

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