summaryrefslogtreecommitdiffstats
path: root/win/build_ddk.py
diff options
context:
space:
mode:
authorJames Yonan <james@openvpn.net>2010-04-22 12:53:31 +0000
committerJames Yonan <james@openvpn.net>2010-04-22 12:53:31 +0000
commit059739e9341781d9019e07fc5119367c1630b012 (patch)
tree6839d8071558539505991895ef377baee58e960f /win/build_ddk.py
parent7a464e32394f2d072fad2d31ad625b332108300f (diff)
downloadopenvpn-059739e9341781d9019e07fc5119367c1630b012.tar.gz
openvpn-059739e9341781d9019e07fc5119367c1630b012.tar.xz
openvpn-059739e9341781d9019e07fc5119367c1630b012.zip
Added Python-based build system for Windows in
win directory. Fixed minor issue in TAP driver DEBUG builds where non-null-terminated unicode strings were being printed incorrectly. Version 2.1.1g git-svn-id: http://svn.openvpn.net/projects/openvpn/branches/BETA21/openvpn@5577 e7ae566f-a301-0410-adde-c780ea21d3b5
Diffstat (limited to 'win/build_ddk.py')
-rw-r--r--win/build_ddk.py50
1 files changed, 50 insertions, 0 deletions
diff --git a/win/build_ddk.py b/win/build_ddk.py
new file mode 100644
index 0000000..ca68e81
--- /dev/null
+++ b/win/build_ddk.py
@@ -0,0 +1,50 @@
+import os
+from wb import system, home_fn, choose_arch
+
+def build_ddk(config, dir, x64):
+ setenv_bat = os.path.realpath(os.path.join(config['DDK_PATH'], 'bin/setenv.bat'))
+ ddk_major = int(config['DDKVER_MAJOR'])
+ debug = 'PRODUCT_TAP_DEBUG' in config
+ target = 'chk' if debug else 'fre'
+ if x64:
+ target += ' x64'
+ else:
+ target += ' x86'
+ if ddk_major >= 7600:
+ if x64:
+ target += ' wlh' # vista
+ else:
+ target += ' wnet' # server 2003
+ else:
+ if x64:
+ target += ' wnet' # server 2003
+ else:
+ target += ' w2k' # 2000
+
+ system('cmd /c "%s %s %s && cd %s && build -cef"' % (
+ setenv_bat,
+ os.path.realpath(config['DDK_PATH']),
+ target,
+ dir
+ ))
+
+def main(config, proj, arch):
+ if proj == 'tap':
+ dir = home_fn('tap-win32')
+ elif proj == 'tapinstall':
+ dir = home_fn('tapinstall')
+ else:
+ raise ValueError("unknown project: %s" % (proj,))
+
+ for x64 in choose_arch(arch):
+ build_ddk(config, dir, x64)
+
+# if we are run directly, and not loaded as a module
+if __name__ == "__main__":
+ import sys
+ from wb import config
+ if len(sys.argv) >= 3:
+ main(config, sys.argv[1], sys.argv[2])
+ else:
+ print "usage: build <tap|tapinstall> <x64|x86|all>"
+ sys.exit(2)