summaryrefslogtreecommitdiff
path: root/etc
diff options
context:
space:
mode:
authorDavid Wragg <david@rabbitmq.com>2010-10-28 08:12:07 +0100
committerDavid Wragg <david@rabbitmq.com>2010-10-28 08:12:07 +0100
commit7ffc4a3d6f3df4407b8d214d4d79fe48c5f5a398 (patch)
tree61d44199ec86367b14b7bd05004887e18dc48dfc /etc
parent692c9b9cb21ab6ed799f7ae0dc9347f75ae7fe50 (diff)
downloadrabbitmq-c-github-ask-7ffc4a3d6f3df4407b8d214d4d79fe48c5f5a398.tar.gz
Update build instructions for building with the MS compiler
Diffstat (limited to 'etc')
-rwxr-xr-xetc/build-ms.sh62
1 files changed, 62 insertions, 0 deletions
diff --git a/etc/build-ms.sh b/etc/build-ms.sh
new file mode 100755
index 0000000..bac4bb2
--- /dev/null
+++ b/etc/build-ms.sh
@@ -0,0 +1,62 @@
+#!/bin/sh
+
+# Build rabbitmq-c using Microsoft's C compiler
+
+set -e
+
+# Locate the necessary lib and include directories
+
+drive=$(echo "$SYSTEMDRIVE" | sed 's|^\([A-Za-z]\):$|/\1|')
+
+for vsvers in 10.0 9.0 8 ; do
+ vsdir="$drive/Program Files/Microsoft Visual Studio $vsvers"
+ [ -x "$vsdir/VC/bin/cl.exe" ] && break
+
+ vsdir="$drive/Program Files (x86)/Microsoft Visual Studio $vsvers"
+ [ -x "$vsdir/VC/bin/cl.exe" ] && break
+
+ vsdir=
+done
+
+if [ -z "$vsdir" ] ; then
+ echo "Couldn't find suitable Visual Studio installation"
+ exit 1
+fi
+
+echo "Using Visual Studio install at $vsdir"
+
+for sdkvers in v7.0A v6.0A v5.0 ; do
+ sdkdir="$drive/Program Files/Microsoft SDKs/Windows/$sdkvers"
+ [ -d "$sdkdir/lib" -a -d "$sdkdir/include" ] && break
+
+ sdkdir="$drive/Program Files (x86)/Microsoft SDKs/Windows/$sdkvers"
+ [ -d "$sdkdir/lib" -a -d "$sdkdir/include" ] && break
+
+ sdkdir=
+done
+
+if [ -z "$sdkdir" ] ; then
+ echo "Couldn't find suitable Windows SDK installation"
+ exit 1
+fi
+
+echo "Using Windows SDK install at $sdkdir"
+
+PATH="$PATH:$vsdir/VC/bin:$vsdir/Common7/IDE"
+LIB="$vsdir/VC/lib:$sdkdir/lib"
+INCLUDE="$vsdir/VC/include:$sdkdir/include"
+export PATH LIB INCLUDE
+
+# Do the build
+set -x
+autoreconf -i
+./configure CC=cl.exe LD=link.exe CFLAGS='-nologo'
+sed -i -e 's/^fix_srcfile_path=.*$/fix_srcfile_path=""/;s/^deplibs_check_method=.*$/deplibs_check_method=pass_all/;/^archive_cmds=/s/-link -dll/& -implib:\\$libname.\\$libext/' libtool
+make
+
+# Copy the results of the build into one place, as "make install"
+# isn't too useful here.
+mkdir -p build/lib build/include build/bin
+cp -a librabbitmq/.libs/*.dll examples/.libs/*.exe build/bin
+cp -a msinttypes/*.h librabbitmq/amqp.h librabbitmq/amqp_framing.h build/include
+cp -a librabbitmq/*.exp librabbitmq/*.lib build/lib