00gnulib.m4 2.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. # 00gnulib.m4 serial 3
  2. dnl Copyright (C) 2009-2017 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. dnl This file must be named something that sorts before all other
  7. dnl gnulib-provided .m4 files. It is needed until such time as we can
  8. dnl assume Autoconf 2.64, with its improved AC_DEFUN_ONCE and
  9. dnl m4_divert semantics.
  10. # Until autoconf 2.63, handling of the diversion stack required m4_init
  11. # to be called first; but this does not happen with aclocal. Wrapping
  12. # the entire execution in another layer of the diversion stack fixes this.
  13. # Worse, prior to autoconf 2.62, m4_wrap depended on the underlying m4
  14. # for whether it was FIFO or LIFO; in order to properly balance with
  15. # m4_init, we need to undo our push just before anything wrapped within
  16. # the m4_init body. The way to ensure this is to wrap both sides of
  17. # m4_init with a one-shot macro that does the pop at the right time.
  18. m4_ifndef([_m4_divert_diversion],
  19. [m4_divert_push([KILL])
  20. m4_define([gl_divert_fixup], [m4_divert_pop()m4_define([$0])])
  21. m4_define([m4_init],
  22. [gl_divert_fixup()]m4_defn([m4_init])[gl_divert_fixup()])])
  23. # AC_DEFUN_ONCE([NAME], VALUE)
  24. # ----------------------------
  25. # Define NAME to expand to VALUE on the first use (whether by direct
  26. # expansion, or by AC_REQUIRE), and to nothing on all subsequent uses.
  27. # Avoid bugs in AC_REQUIRE in Autoconf 2.63 and earlier. This
  28. # definition is slower than the version in Autoconf 2.64, because it
  29. # can only use interfaces that existed since 2.59; but it achieves the
  30. # same effect. Quoting is necessary to avoid confusing Automake.
  31. m4_version_prereq([2.63.263], [],
  32. [m4_define([AC][_DEFUN_ONCE],
  33. [AC][_DEFUN([$1],
  34. [AC_REQUIRE([_gl_DEFUN_ONCE([$1])],
  35. [m4_indir([_gl_DEFUN_ONCE([$1])])])])]dnl
  36. [AC][_DEFUN([_gl_DEFUN_ONCE([$1])], [$2])])])
  37. # gl_00GNULIB
  38. # -----------
  39. # Witness macro that this file has been included. Needed to force
  40. # Automake to include this file prior to all other gnulib .m4 files.
  41. AC_DEFUN([gl_00GNULIB])