1#/usr/bin/env sh
2set -e
3
4make="make -C $lz4_root"
5for cmd in install uninstall; do
6  for upper in DUMMY PREFIX EXEC_PREFIX LIBDIR INCLUDEDIR PKGCONFIGDIR BINDIR MANDIR MAN1DIR ; do
7    lower=$(echo $upper | tr '[:upper:]' '[:lower:]')
8    tmp_lower="$(pwd)/tmp-lower-$lower/"
9    tmp_upper="$(pwd)/tmp-upper-$lower/"
10    echo $make $cmd DESTDIR="$tmp_upper" $upper="test"
11    $make $cmd DESTDIR="$tmp_upper" $upper="test" >/dev/null
12    echo $make $cmd DESTDIR="$tmp_lower" $lower="test"
13    $make $cmd DESTDIR="$tmp_lower" $lower="test" >/dev/null
14    command diff -r "$tmp_lower" "$tmp_upper" && echo "SAME!" || false
15    if [ "x$cmd" = "xuninstall" ]; then
16      test -z "$(find "$tmp_lower" -type f)" && echo "EMPTY!" || false
17      rm -rf "$tmp_upper" "$tmp_lower"
18    fi
19  done
20done
21