2 # Copyright (C) 2012 Free Software Foundation, Inc.
4 # This program is free software; you can redistribute it and/or modify
5 # it under the terms of the GNU General Public License as published by
6 # the Free Software Foundation; either version 2, or (at your option)
9 # This program is distributed in the hope that it will be useful,
10 # but WITHOUT ANY WARRANTY; without even the implied warranty of
11 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 # GNU General Public License for more details.
14 # You should have received a copy of the GNU General Public License
15 # along with this program. If not, see <http://www.gnu.org/licenses/>.
17 # Test that two whitespace-separated lists are equal.
18 # Assumes the two lists are passed on the command line separated by
20 # This script is useful to test equality of lists in makefile rules,
21 # in the face of variables defined through line-continuations,
22 # automake rewrites and expansions of empty variables.
27 # Initialize before unsetting, for shells (like older bash or Solaris
28 # ksh) that fail to unset variables that are already unset.
29 exp= got=; unset exp got
31 while test $# -gt 0; do
32 if test x"$1" = x"=="; then
33 if test $seen_eqeq = no; then
36 echo "$0: more than one '==' argument seen on command line" >&2
40 if test $seen_eqeq = no; then
49 if test $seen_eqeq = no; then
50 echo "$0: no '==' argument seen on command line" >&2
54 test x"${exp-}" = x"${got-}"