Blame m4/00gnulib.m4

Packit 437b5e
# 00gnulib.m4 serial 3
Packit 437b5e
dnl Copyright (C) 2009-2015 Free Software Foundation, Inc.
Packit 437b5e
dnl This file is free software; the Free Software Foundation
Packit 437b5e
dnl gives unlimited permission to copy and/or distribute it,
Packit 437b5e
dnl with or without modifications, as long as this notice is preserved.
Packit 437b5e
Packit 437b5e
dnl This file must be named something that sorts before all other
Packit 437b5e
dnl gnulib-provided .m4 files.  It is needed until such time as we can
Packit 437b5e
dnl assume Autoconf 2.64, with its improved AC_DEFUN_ONCE and
Packit 437b5e
dnl m4_divert semantics.
Packit 437b5e
Packit 437b5e
# Until autoconf 2.63, handling of the diversion stack required m4_init
Packit 437b5e
# to be called first; but this does not happen with aclocal.  Wrapping
Packit 437b5e
# the entire execution in another layer of the diversion stack fixes this.
Packit 437b5e
# Worse, prior to autoconf 2.62, m4_wrap depended on the underlying m4
Packit 437b5e
# for whether it was FIFO or LIFO; in order to properly balance with
Packit 437b5e
# m4_init, we need to undo our push just before anything wrapped within
Packit 437b5e
# the m4_init body.  The way to ensure this is to wrap both sides of
Packit 437b5e
# m4_init with a one-shot macro that does the pop at the right time.
Packit 437b5e
m4_ifndef([_m4_divert_diversion],
Packit 437b5e
[m4_divert_push([KILL])
Packit 437b5e
m4_define([gl_divert_fixup], [m4_divert_pop()m4_define([$0])])
Packit 437b5e
m4_define([m4_init],
Packit 437b5e
  [gl_divert_fixup()]m4_defn([m4_init])[gl_divert_fixup()])])
Packit 437b5e
Packit 437b5e
Packit 437b5e
# AC_DEFUN_ONCE([NAME], VALUE)
Packit 437b5e
# ----------------------------
Packit 437b5e
# Define NAME to expand to VALUE on the first use (whether by direct
Packit 437b5e
# expansion, or by AC_REQUIRE), and to nothing on all subsequent uses.
Packit 437b5e
# Avoid bugs in AC_REQUIRE in Autoconf 2.63 and earlier.  This
Packit 437b5e
# definition is slower than the version in Autoconf 2.64, because it
Packit 437b5e
# can only use interfaces that existed since 2.59; but it achieves the
Packit 437b5e
# same effect.  Quoting is necessary to avoid confusing Automake.
Packit 437b5e
m4_version_prereq([2.63.263], [],
Packit 437b5e
[m4_define([AC][_DEFUN_ONCE],
Packit 437b5e
  [AC][_DEFUN([$1],
Packit 437b5e
    [AC_REQUIRE([_gl_DEFUN_ONCE([$1])],
Packit 437b5e
      [m4_indir([_gl_DEFUN_ONCE([$1])])])])]dnl
Packit 437b5e
[AC][_DEFUN([_gl_DEFUN_ONCE([$1])], [$2])])])
Packit 437b5e
Packit 437b5e
# gl_00GNULIB
Packit 437b5e
# -----------
Packit 437b5e
# Witness macro that this file has been included.  Needed to force
Packit 437b5e
# Automake to include this file prior to all other gnulib .m4 files.
Packit 437b5e
AC_DEFUN([gl_00GNULIB])