summaryrefslogtreecommitdiff
path: root/test/windows/mingw/build
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2014-05-16 07:26:08 -0700
committerBoris Kolpackov <boris@codesynthesis.com>2014-05-16 07:26:08 -0700
commit384d384d1b84142a23785c6c423064a29342f532 (patch)
treee23db009c09ba2cea86da8d94d4b12600445b8b2 /test/windows/mingw/build
Add test scripts for Windows (VC++, MinGW)
Diffstat (limited to 'test/windows/mingw/build')
-rwxr-xr-xtest/windows/mingw/build66
1 files changed, 66 insertions, 0 deletions
diff --git a/test/windows/mingw/build b/test/windows/mingw/build
new file mode 100755
index 0000000..f0c09de
--- /dev/null
+++ b/test/windows/mingw/build
@@ -0,0 +1,66 @@
+#! /usr/bin/env bash
+
+# Build libstudxml for MinGW
+#
+# -rebuild
+# -test
+#
+trap 'exit 1' ERR
+
+function error ()
+{
+ echo "$*" 1>&2
+}
+
+function clean ()
+{
+ if [ -f $1/Makefile ]; then
+ make -C $1 distclean
+ fi
+}
+
+LDFLAGS="-Wl,--enable-auto-import"
+
+test=n
+rebuild=n
+
+while [ $# -gt 0 ]; do
+ case $1 in
+ -rebuild)
+ rebuild=y
+ shift
+ ;;
+ -test)
+ test=y
+ shift
+ ;;
+ *)
+ error "unknown option: $1"
+ exit 1
+ ;;
+ esac
+done
+
+# Clean everything up if we are rebuilding.
+#
+if [ $rebuild = y ]; then
+ clean libstudxml
+fi
+
+# Build.
+#
+cd libstudxml
+
+if [ $rebuild = y -o ! -f Makefile ]; then
+ ./configure LDFLAGS="$LDFLAGS" DIFFFLAGS=-ubB
+fi
+
+make
+
+# Test.
+#
+if [ $test = y ]; then
+ make check
+fi
+
+cd ..