extensions.m4 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. # serial 4 -*- Autoconf -*-
  2. # Enable extensions on systems that normally disable them.
  3. # Copyright (C) 2003, 2006 Free Software Foundation, Inc.
  4. # This file is free software; the Free Software Foundation
  5. # gives unlimited permission to copy and/or distribute it,
  6. # with or without modifications, as long as this notice is preserved.
  7. # This definition of AC_USE_SYSTEM_EXTENSIONS is stolen from CVS
  8. # Autoconf. Perhaps we can remove this once we can assume Autoconf
  9. # 2.61 or later everywhere, but since CVS Autoconf mutates rapidly
  10. # enough in this area it's likely we'll need to redefine
  11. # AC_USE_SYSTEM_EXTENSIONS for quite some time.
  12. # AC_USE_SYSTEM_EXTENSIONS
  13. # ------------------------
  14. # Enable extensions on systems that normally disable them,
  15. # typically due to standards-conformance issues.
  16. AC_DEFUN([AC_USE_SYSTEM_EXTENSIONS],
  17. [
  18. AC_BEFORE([$0], [AC_COMPILE_IFELSE])
  19. AC_BEFORE([$0], [AC_RUN_IFELSE])
  20. AC_REQUIRE([AC_GNU_SOURCE])
  21. AC_REQUIRE([AC_AIX])
  22. AC_REQUIRE([AC_MINIX])
  23. AH_VERBATIM([__EXTENSIONS__],
  24. [/* Enable extensions on Solaris. */
  25. #ifndef __EXTENSIONS__
  26. # undef __EXTENSIONS__
  27. #endif
  28. #ifndef _POSIX_PTHREAD_SEMANTICS
  29. # undef _POSIX_PTHREAD_SEMANTICS
  30. #endif
  31. #ifndef _TANDEM_SOURCE
  32. # undef _TANDEM_SOURCE
  33. #endif])
  34. AC_CACHE_CHECK([whether it is safe to define __EXTENSIONS__],
  35. [ac_cv_safe_to_define___extensions__],
  36. [AC_COMPILE_IFELSE(
  37. [AC_LANG_PROGRAM([
  38. # define __EXTENSIONS__ 1
  39. AC_INCLUDES_DEFAULT])],
  40. [ac_cv_safe_to_define___extensions__=yes],
  41. [ac_cv_safe_to_define___extensions__=no])])
  42. test $ac_cv_safe_to_define___extensions__ = yes &&
  43. AC_DEFINE([__EXTENSIONS__])
  44. AC_DEFINE([_POSIX_PTHREAD_SEMANTICS])
  45. AC_DEFINE([_TANDEM_SOURCE])
  46. ])
  47. # gl_USE_SYSTEM_EXTENSIONS
  48. # ------------------------
  49. # Enable extensions on systems that normally disable them,
  50. # typically due to standards-conformance issues.
  51. AC_DEFUN([gl_USE_SYSTEM_EXTENSIONS],
  52. [AC_REQUIRE([AC_USE_SYSTEM_EXTENSIONS])])