Blame tests/statesave.m4

Packit 47b4ca
# statesave.m4 serial 2
Packit 47b4ca
Packit 47b4ca
# Copyright (C) 2000-2012 Free Software Foundation, Inc.
Packit 47b4ca
Packit 47b4ca
# This program is free software: you can redistribute it and/or modify
Packit 47b4ca
# it under the terms of the GNU General Public License as published by
Packit 47b4ca
# the Free Software Foundation, either version 3 of the License, or
Packit 47b4ca
# (at your option) any later version.
Packit 47b4ca
#
Packit 47b4ca
# This program is distributed in the hope that it will be useful,
Packit 47b4ca
# but WITHOUT ANY WARRANTY; without even the implied warranty of
Packit 47b4ca
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
Packit 47b4ca
# GNU General Public License for more details.
Packit 47b4ca
#
Packit 47b4ca
# You should have received a copy of the GNU General Public License
Packit 47b4ca
# along with this program.  If not, see <http://www.gnu.org/licenses/>.
Packit 47b4ca
Packit 47b4ca
# AC_STATE_SAVE(FILE)
Packit 47b4ca
# -------------------
Packit 47b4ca
# Save the shell variables and directory listing.  AT_CHECK_ENV uses these to
Packit 47b4ca
# confirm that no test modifies variables outside the Autoconf namespace or
Packit 47b4ca
# leaves temporary files.  AT_CONFIG_CMP uses the variable dumps to confirm
Packit 47b4ca
# that tests have the same side effects regardless of caching.
Packit 47b4ca
#
Packit 47b4ca
# The sed script duplicates uniq functionality (thanks to 'info sed
Packit 47b4ca
# uniq' for the recipe), in order to avoid a MacOS 10.5 bug where
Packit 47b4ca
# readdir can list a file multiple times in a rapidly changing
Packit 47b4ca
# directory, while avoiding yet another fork.
Packit 47b4ca
m4_defun([AC_STATE_SAVE],
Packit 47b4ca
[(set) 2>&1 | sort >state-env.$1
Packit 47b4ca
ls | sed '/^at-/d;/^state-/d;/^config\./d
Packit 47b4ca
  h
Packit 47b4ca
  :b
Packit 47b4ca
  $b
Packit 47b4ca
  N
Packit 47b4ca
  /^\(.*\)\n\1$/ {
Packit 47b4ca
    g
Packit 47b4ca
    bb
Packit 47b4ca
  }
Packit 47b4ca
  $b
Packit 47b4ca
  P
Packit 47b4ca
  D' >state-ls.$1
Packit 47b4ca
])# AC_STATE_SAVE