mixed bag of doc changes and helper scripts
diff --git a/README.md b/README.md
index e763574..dc16e83 100644
--- a/README.md
+++ b/README.md
@@ -91,7 +91,7 @@
 [isetup]: http://www.jrsoftware.org/download.php/is-unicode.exe
 [7zip]: http://downloads.sourceforge.net/sevenzip/7z465.exe
 
-## wxWidgets
+# wxWidgets
 ################################################################################
 * [wxWidgets] source and the glazier [overlay] are already downloaded
 * start an SDK shell via `setenv.cmd /Release /x86`
@@ -103,7 +103,7 @@
 [wxwidgets]: http://sourceforge.net/projects/wxwindows/files/2.8.11/wxMSW-2.8.11.zip
 [overlay]:   https://raw.github.com/dch/glazier/master/bits/wxMSW-2.8.11_erlang_overlay.zip
 
-## OpenSSL
+# OpenSSL
 ################################################################################
 Erlang requires finding OpenSSL in `c:\OpenSSL` so that's where we build to,
 using mount point to keep things clean=ish under `%relax%`.
@@ -119,7 +119,7 @@
 
 [openssl]: http://www.openssl.org/source/openssl-1.0.0d.tar.gz
 
-## Environment
+# Environment
 ################################################################################
 Our goal is to get the path set up in this order:
 
@@ -186,7 +186,7 @@
 
 [patches]: https://github.com/dch/otp/commit/d1e151a689f8e54cdc2d671e96e00beb86d2b571
 
-## ICU 4.4.2
+# ICU 4.4.2
 ################################################################################
 Ideally ICU would compile with current VC runtime using VC++ directly but
 it doesn't. Instead we use cygwin make tools and VC++ compiler.
@@ -216,7 +216,7 @@
         couchdb_config.sh
         couchdb_build.sh
 
-## LibcURL
+# LibcURL
 ################################################################################
 LibcURL is only required for versions of CouchDB <= 1.10 where it is embedded
 in couchjs.exe. Trunk and future releases will have this as an optional include.
@@ -229,7 +229,7 @@
 
 [libcurl]: http://curl.haxx.se/download/curl-7.21.7.zip
 
-## Javascript
+# Javascript
 ################################################################################
 The Javascript engine used by CouchDB is Mozilla Spidermonkey. Prior to 1.8.5
 [js185] there was no formal release for it, so you can build from anywhere on
@@ -268,3 +268,47 @@
 
 [js185]: http://ftp.mozilla.org/pub/mozilla.org/js/js185-1.0.0.tar.gz
 [js18x]: http://hg.mozilla.org/tracemonkey/archive/57a6ad20eae9.tar.gz
+
+# Building CouchDB
+################################################################################
+
+Finally we are going to build Apache CouchDB... whew! Recapping, we should have:
+
+* erlang in `/relax/otp_src_R14B03/release/win32` with a copy stashed nearby
+* openssl in `/relax/openssl/lib/{lib,ssl}eay32.lib`
+* libcurl in `/relax/curl/lib/libcurl.lib`
+* two js libraries in `/relax/js-1.8.5/js/src/dist/{bin,lib}/mozjs185-1.0.*` and
+ `/relax/tracemonkey-57a6ad20eae9/js/src/dist/{bin,lib}/mozjs.*`
+* icu in `/relax/icu/bin/icu*.dll`
+
+There are three relevant scripts for building CouchDB:
+
+* `couchdb_config_js180.sh` for CouchDB 1.1.0 + js18x with libcurl
+* `couchdb_config_js185.sh` for CouchDB 1.2.0 + js185 without libcurl
+* `couchdb_build.sh` which compiles, and packages, CouchDB
+
+There are still some patches required against both released and trunk versions.
+For CouchDB 1.1.0, the patch from [COUCHDB-1152] is required.
+
+        cd /relax && tar xzf bits/apache-couchdb-1.1.0.tar.gz
+        cd apache-couchdb-1.1.0
+        patch -p0 < ../bits/COUCHDB-1152_move_to_ICU-4_4_2.patch
+        /relax/bin/couchdb_config_js180.sh
+        /relax/bin/couchdb_build.sh
+
+For CouchDB 1.2.x, most patches are already in trunk, apart from 1 patch, and a
+filthy hack. The hack is needed until `configure.ac` is updated to identify
+that curl is not required and that the cygwin library version of it should not
+be pulled into CouchDB by accident.
+
+        cd /relax && svn checkout https://svn.apache.org/repos/asf/couchdb/trunk
+        cd trunk
+        patch -p1 < ../bits/COUCHDB-1197_libtool_sed_hackery.patch
+        mv /usr/bin/curl-config /usr/bin/curl-config.dist
+        ./bootstrap
+        /relax/bin/couchdb_config_js185.sh
+        /relax/bin/couchdb_build.sh
+
+
+[COUCHDB-1152]: https://issues.apache.org/jira/secure/attachment/12481030/COUCHDB-1152_move_to_ICU-4_4_2.patch
+[COUCHDB-1197]: https://issues.apache.org/jira/secure/attachment/12493303/COUCHDB-1197_libtool_sed_hackery.patch
diff --git a/bin/sync_otp.cmd b/bin/sync_otp.cmd
new file mode 100755
index 0000000..b78e24c
--- /dev/null
+++ b/bin/sync_otp.cmd
@@ -0,0 +1 @@
+robocopy c:\relax\release\otp_src_R14B03 c:\relax\otp_src_R14B03 -mir -log:NUL: 

diff --git a/couch.md b/couch.md
new file mode 100644
index 0000000..8182c9f
--- /dev/null
+++ b/couch.md
@@ -0,0 +1,30 @@
+
+## Make & Build ###############################################################
+
+* The generic configure script looks like this:
+
+        ./configure \
+        --with-js-include=/cygdrive/c/path_to_spidermonkey/dist/include \
+        --with-js-lib=/cygdrive/c/path_to_spidermonkey/dist/lib \
+        --with-win32-icu-binaries=/cygdrive/c/path_to_icu_binaries_root \
+        --with-erlang=$ERL_TOP/release/win32/usr/include \
+        --with-win32-curl=/cygdrive/c/path/to/curl/root/directory \
+        --with-openssl-bin-dir=/cygdrive/c/path/to/openssl/bin \
+        --with-msvc-redist-dir=/cygdrive/c/dir/with/vcredist_platform_executable \
+        --prefix=$ERL_TOP/release/win32
+
+## using spidermonkey 1.8.x   ###################################################
+
+* This is the recommended config if you have used the above steps:
+
+        ./configure \
+        --prefix=$ERL_TOP/release/win32 \
+        --with-erlang=$ERL_TOP/release/win32/usr/include \
+        --with-win32-icu-binaries=/relax/icu \
+        --with-win32-curl=/relax/curl-7.21.5 \
+        --with-openssl-bin-dir=/relax/openssl/bin \
+        --with-msvc-redist-dir=/relax \
+        --with-js-lib=/relax/57a6ad20eae9/js/src/dist/lib \
+        --with-js-include=/relax/57a6ad20eae9/js/src/dist/include \
+        2>&1 | tee $COUCH_TOP/build_configure.txt
+