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.
24 # NOTE: keep this file Bourne-compatible, for the sake of systems with
25 # non-POSIX /bin/sh (like Solaris).
30 # Initialize before unsetting, for shells (like older bash or Solaris
31 # ksh) that fail to unset variables that are already unset.
32 exp
= got
=; unset exp got
34 while test $# -gt 0; do
35 if test x
"$1" = x
"=="; then
36 if test $seen_eqeq = no
; then
39 echo "$0: more than one '==' argument seen on command line" >&2
43 if test $seen_eqeq = no
; then
52 if test $seen_eqeq = no
; then
53 echo "$0: no '==' argument seen on command line" >&2
57 test x
"${exp-}" = x
"${got-}"