Added automated configure.h creation to Python-based build system.
PATCH 1/6 Added automated configure.h creation to Python-based build system.
Hi all,
Here's the first of a set of six patches that fix various issues with the Python-based build system. Also, some clarifying comments have been added to the existing code. After this patchset is merged it's possible to build openvpnserv.exe in addition to openvpn.exe and the TAP drivers. NSI installer integration is still mostly missing, but is coming up.
This patch could be simplified by removing the #ifdef / #ifndef "depth" detection code. That code is a leftover from earlier implementation where all defines - not just #define ENABLE_SOMETHING - were parsed. The idea was to skip any defines inside an #ifdef block as there is no (easy) way to detect if they're enabled or not.
Samuli
From 6a42c8c5aa90296be8d6a383d410414c8d9800c7 Mon Sep 17 00:00:00 2001
From: =?utf-8?q?Samuli=20Sepp=C3=A4nen?= <[email protected]>
Date: Mon, 3 Jan 2011 15:52:59 +0200
Subject: [PATCH 1/6] Added automated configure.h creation to Python-based build system.
The configure.h file is generated from config-win32 and is used to embed build flags into openvpn. These build flags can be viewed with "openvpn --version". Only defines that start with ENABLE are included (e.g. "ENABLE_MANAGEMENT 1").
--- win/config.py | 3 +- win/wb.py | 62 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 64 insertions(+), 1 deletions(-)
win/config.py +2 -1
@@ -1,6 +1,7 @@ -from wb import preprocess, autogen, mod_fn, home_fn, build_autodefs, make_headers_objs, dict_def +from wb import preprocess, autogen, mod_fn, home_fn, build_configure_h, build_autodefs, make_headers_objs, dict_def def main(config): + build_configure_h(config, mod_fn(home_fn('configure.h')), head_comment='/* %s */\n\n' % autogen) build_autodefs(config, mod_fn('autodefs.h.in'), home_fn('autodefs.h')) ho = make_headers_objs(home_fn('Makefile.am'))
win/wb.py +62 -0
92 lines not on this page · raw message
Signature · 1 line
1.6.3.3
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Quoted 8 lines · Samuli Seppänen
Hi all,
Here's the first of a set of six patches that fix various issues with the Python-based build system. Also, some clarifying comments have been added to the existing code. After this patchset is merged it's possible to build openvpnserv.exe in addition to openvpn.exe and the TAP drivers. NSI installer integration is still mostly missing, but is coming up.
Quoted 7 lines
This patch could be simplified by removing the #ifdef / #ifndef "depth" detection code. That code is a leftover from earlier implementation where all defines - not just #define
ENABLE_SOMETHING- were parsed. The idea was to skip any defines inside an #ifdef block as there is no (easy) way to detect if they're enabled or not.Samuli
A few comments ...
+'''Generate a fake configure.h dynamically''' +def build_configure_h(kv, configure_h_out, head_comment):
These two lines should be swapped. Python places the function/method/class documentation as a part of the block it describes.
In addition, it is not a fake configure.h which is generated. This is
the proper creation of configure.h, as that file should only contain configuration information, no matter build system.
So a proper way would be:
def build_configure_h(kv, configure_h_out, head_comment):
'''Generate a fake configure.h dynamically'''
Then you can do pydoc on the python file, or use the help() function in python to get the documentation of a function/method/class/etc.
I suggest cleaning up these comments as a separate patch on top of this patch.
Except of that, PATCH 1/6 gets an ACK from me.
kind regards,
David Sommerseth
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.11 (GNU/Linux)
Comment: Using GnuPG with Fedora - http://enigmail.mozdev.org/
iEYEARECAAYFAk0kT6QACgkQDC186MBRfroVVwCfcn3fsl6q1hCacpFd3rIYGomd BHkAoJDPL6IGoD2k/AFwmoOpGP+TSLdp
=kDXE
-----END PGP SIGNATURE-----