summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--bindisttest/checkBinaries.sh20
-rw-r--r--bindisttest/ghc.mk1
2 files changed, 21 insertions, 0 deletions
diff --git a/bindisttest/checkBinaries.sh b/bindisttest/checkBinaries.sh
new file mode 100644
index 0000000000..3c62198311
--- /dev/null
+++ b/bindisttest/checkBinaries.sh
@@ -0,0 +1,20 @@
+#!/bin/sh
+
+echo "1 is $1 done"
+EXPECTED_VERSION="$1"
+
+# Our shared libraries are currently executable (is that a bug?), so
+# we exclude anything that looks like a shared library
+for f in `find bindisttest/a/b/c -type f -executable ! -name '*.so' ! -name '*.dynlib' ! -name '*.dll'`
+do
+ if grep -q '("GHC RTS", "YES")' "$f"
+ then
+ # Looks like a GHC executable. Is it for the right version?
+ THIS_VERSION=`./$f +RTS --info | grep '"GHC version"' | sed -e 's/^ ,("GHC version", "//' -e 's/")$//'`
+ if [ "$THIS_VERSION" != "$EXPECTED_VERSION" ]
+ then
+ echo "Bad GHC version '$THIS_VERSION' for '$f'" >&2
+ exit 1
+ fi
+ fi
+done
diff --git a/bindisttest/ghc.mk b/bindisttest/ghc.mk
index 4be2166217..a3e97b08f1 100644
--- a/bindisttest/ghc.mk
+++ b/bindisttest/ghc.mk
@@ -31,6 +31,7 @@ test_bindist:
# c:/foo is a remote file), so it's safer to bzip and then pipe into
# tar rather than using tar -xjf:
cd bindisttest/a/b/c/ && $(BZIP2_CMD) -cd ../../../../$(BIN_DIST_TEST_TAR_BZ2) | $(TAR_CMD) -xf -
+ $(SHELL) bindisttest/checkBinaries.sh $(ProjectVersion)
ifeq "$(Windows)" "YES"
mv bindisttest/a/b/c/$(BIN_DIST_NAME) $(BIN_DIST_INST_DIR)
else