]> git.ipfire.org Git - thirdparty/openvpn.git/commitdiff
Changes to Windows build system: added GENOUT_PREBUILT mode
authorjames <james@e7ae566f-a301-0410-adde-c780ea21d3b5>
Fri, 1 Feb 2008 19:44:53 +0000 (19:44 +0000)
committerjames <james@e7ae566f-a301-0410-adde-c780ea21d3b5>
Fri, 1 Feb 2008 19:44:53 +0000 (19:44 +0000)
to allow building an OpenVPN installer with a reduced set
of prerequisites.  See comments in domake-win for more info.

git-svn-id: http://svn.openvpn.net/projects/openvpn/branches/BETA21/openvpn@2711 e7ae566f-a301-0410-adde-c780ea21d3b5

domake-win
install-win32/getgui
install-win32/getprebuilt [new file with mode: 0644]
install-win32/makeopenvpn
install-win32/settings.in

index f27d6e77d52d2653e0a2d45d1a6f90d0bec9a8c9..ca71f25d03a4ffc65ecc6d2f61fef2da0544283b 100644 (file)
@@ -4,17 +4,25 @@
 # This script will build OpenVPN, the TAP driver, and
 # the installer from source, targeting x86 on Windows
 # 2000 and higher, and x64 on Windows 2003 and higher.
+# For quick start options, see pre-built notes below.
 #
-# See top-level build configuration in install-win32/settings.in
+# See top-level build configuration and settings in:
 #
-# Prerequisite installs:
+#   install-win32/settings.in
+#
+# Mandatory prerequisites:
 #
 # MinGW     -- for GNU C compiler
 # MSYS      -- for bash
 # msysDTK   -- for perl
 # NSIS      -- for building installer
+#
+# The following additional prerequisites may be omitted
+# when building in pre-built mode (see note below). 
+
 # svn       -- for checking out source code (or TortoiseSVN)
-# Windows Driver Kit (6001_17121_HyperV_WDK.iso) -- for building TAP driver + tapinstall
+# Windows Driver Kit (6001_17121_HyperV_WDK.iso) -- for building
+#    TAP driver + tapinstall
 #
 # Required libraries (must be prebuilt)
 #
 # ../svc-template -- This directory should contain service.[ch]
 #                    from the MS Platform SDK.
 
-# Note that all variables referenced here such as GENOUT and CLEAN
-# are defined in install-win32/settings.in
+# Note that all variables referenced here such as GENOUT,
+# GENOUT_PREBUILT, and CLEAN are defined in install-win32/settings.in
 
-# First build the autodefs directory, with C, sh, and NSIS versions
+# SPECIAL NOTES ON PRE-BUILT MODE
+#   Setting up a complete tool chain to build OpenVPN and all
+#   dependencies on Windows can be an onerous task, so the capability
+#   is provided to reference a directory of pre-built components during
+#   the build process.  This would allow you, for example, to build an
+#   OpenVPN installer with custom edits to install-win32/settings.in,
+#   but then avoid needing to build all other components (such as OpenSSL,
+#   LZO, Pkcs11-helper, TAP driver windows service, etc.).  The procedure
+#   is as follows. First Download and expand the pre-built binaries from:
+#
+#     http://openvpn.net/beta/windows-devel/ (choose the most recent .tbz file)
+#
+#   After expanding the .tbz file, cd to the top level directory and
+#   expand an OpenVPN source distribution taken from either the subversion
+#   repository or a source .tar.gz file.  It's best to use an OpenVPN source
+#   version that is the same or slightly later than the pre-built binaries
+#   file.  So now you have a directory containing something that looks like
+#   this:
+#
+#   gen-prebuilt     -> from prebuilt .tbz file
+#   lzo-2.02         -> from prebuilt .tbz file
+#   openssl-0.9.7m   -> from prebuilt .tbz file
+#   pkcs11-helper    -> from prebuilt .tbz file
+#   openvpn-2.1_rc7a.tar.gz  -> downloaded from openvpn.net
+#   openvpn-2.1_rc7a -> directory expanded from above file
+#
+#   Now cd to your expanded source tree (openvpn-2.1_rc7a in the
+#   example above), make edits to install-win32/settings.in (or even
+#   patch the OpenVPN source code directly), and run this script:
+#
+#       ./domake-win
+#
+#   If everything runs correctly, you should have a custom installer
+#   written to ./gen/install
+
+
+
+# First build the autodefs directory, containing C, sh, and NSIS versions
 # of global settings, using install-win32/settings.in as source.
 # These settings will then drive the rest of the build process. 
 install-win32/winconfig
@@ -47,11 +92,15 @@ install-win32/winconfig
 # Delete the GENOUT directory if CLEAN="yes"
 install-win32/doclean
 
+# Load a pre-built GENOUT directory if GENOUT_PREBUILT is defined
+# and the GENOUT directory is non-existing
+install-win32/getprebuilt
+
 # Each of the scripts below build, get, and/or possibly sign a different
 # OpenVPN component, placing the generated files in GENOUT.  Each of these
 # steps is fully indepedent, and can be executed in any order or omitted.
 # The exception is the last script which gathers together all files from
-# GENOUT and build the installer.
+# GENOUT and builds the installer.
 
 # Make the OpenVPN user-space component (openvpn.exe)
 install-win32/makeopenvpn
index c7fd2bbe7395e86eae062adbffcc281824f83f6a..03f68a8697753c95d24bb19ec9abdabec01cc26d 100644 (file)
@@ -10,10 +10,13 @@ GUI="$OPENVPN_GUI_DIR/$OPENVPN_GUI"
 if [ -e "$GUI" ]; then
     mkdir -p $GENOUT/bin &>/dev/null    
     cp $GUI $GENOUT/bin
-    echo '!define OPENVPN_GUI_DEFINED' >autodefs/guidefs.nsi
     if [ -d "$SIGNTOOL" ]; then
        TARGET_EXE="$GENOUT/bin/$OPENVPN_GUI" $SIGNTOOL/signexe
     fi
+fi
+
+if [ -e "$GENOUT/bin/$OPENVPN_GUI" ]; then
+    echo '!define OPENVPN_GUI_DEFINED' >autodefs/guidefs.nsi
 else
     cat /dev/null >autodefs/guidefs.nsi
 fi
diff --git a/install-win32/getprebuilt b/install-win32/getprebuilt
new file mode 100644 (file)
index 0000000..36c4827
--- /dev/null
@@ -0,0 +1,10 @@
+#!/bin/sh
+
+# get version.nsi definitions
+. autodefs/defs.sh
+
+# Get PKCS11-helper libraries
+if [ -d "$GENOUT_PREBUILT" ] && ! [ -d "$GENOUT" ]; then
+    echo LOADING prebuilt binaries from $GENOUT_PREBUILT
+    cp -a $GENOUT_PREBUILT $GENOUT
+fi
index 31df6046f35cf81ea7f3ab6cc876c1d902b31801..be43fdcfca52a9b2d1aacf1441a43c018ef2c151 100644 (file)
@@ -3,11 +3,15 @@
 # get version.nsi definitions
 . autodefs/defs.sh
 
-# build OpenVPN binary
-[ "$CLEAN" = "yes" ] && make -f makefile.w32 clean
-make -f makefile.w32 -j $MAKE_JOBS
+if [ -d "$OPENSSL_DIR" ] && [ -d "$LZO_DIR" ] && [ -d "$PKCS11_HELPER_DIR" ]; then
+    # build OpenVPN binary
+    [ "$CLEAN" = "yes" ] && make -f makefile.w32 clean
+    make -f makefile.w32 -j $MAKE_JOBS
 
-# copy OpenVPN executable to GENOUT/bin
-mkdir -p $GENOUT/bin &>/dev/null
-cp $PRODUCT_UNIX_NAME.exe $GENOUT/bin
-strip $GENOUT/bin/$PRODUCT_UNIX_NAME.exe
+    # copy OpenVPN executable to GENOUT/bin
+    mkdir -p $GENOUT/bin &>/dev/null
+    cp $PRODUCT_UNIX_NAME.exe $GENOUT/bin
+    strip $GENOUT/bin/$PRODUCT_UNIX_NAME.exe
+else
+    echo DID NOT BUILD openvpn.exe because one or more of OPENSSL_DIR, LZO_DIR, or PKCS11_HELPER_DIR directories were missing
+fi
index ce9ee356cc1a5f8486602f0e243bc4b2f7be8ea3..864cf190a463e1defaf15534882051cc97aac437 100644 (file)
 !define PKCS11_HELPER_DIR "../pkcs11-helper/usr/local"
 !define DMALLOC_DIR      "../dmalloc-5.4.2"
 
+# Optional directory of prebuilt OpenVPN binary components,
+# to be used as a source when build-from-scratch prerequisites
+# are not met.
+!define GENOUT_PREBUILT  "../gen-prebuilt"
+
 # tapinstall.exe source code.
 # Not needed if DRVBINSRC is defined.
 !define TISRC  "../tapinstall"