From d722230cc8eb3630d8eedd5e7c485ddf59a5f27a Mon Sep 17 00:00:00 2001 From: Thomas Hood Date: Tue, 27 Sep 2011 15:53:20 +0200 Subject: [PATCH] Create header file the Python way --- README | 4 +--- source/wscript | 8 +++++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/README b/README index 0a06695..e0986ea 100644 --- a/README +++ b/README @@ -14,7 +14,7 @@ also obtain the samba tree. Then configure and build. cd source - ./waf configure + ./waf configure --use-samba-tree-headers ./waf build Later, update the samba sources. @@ -41,5 +41,3 @@ Please see the COPYING file for the text of the GNU GPL version 3. TODO ---- * In waf configure, should search for w32 runtime files like windows.h -* A waf option should control whether or not winexe is built against - samba source tree headers or samba public API headers diff --git a/source/wscript b/source/wscript index d4d9c51..36f91e1 100644 --- a/source/wscript +++ b/source/wscript @@ -10,13 +10,15 @@ def options(ctx): ctx.add_option('--use-samba-tree-headers', dest='use_samba_tree_headers', action='store_true', default=False, help='Use header files in ../samba rather than public Samba header files (default=False)') def configure(ctx): - winexe_build_header_filename = out + '/winexe_build.h' + # Create header file to control how winexe gets built + f = open(out + '/winexe_build.h', 'w') if ctx.options.use_samba_tree_headers: print('Using header files in Samba source tree') - os.system('echo "#define USE_SAMBA_TREE_HEADERS" > ' + winexe_build_header_filename) + f.write('#define USE_SAMBA_TREE_HEADERS\n') else: print('Using public Samba header files') - os.system('echo "" > ' + winexe_build_header_filename) + f.write('// Use public Samba header files\n') + f.close() # Configure winexe ctx.find_program([ a + '-' + p + '-gcc' for a in ['i386', 'i586' ] for p in ['mingw32', 'mingw32msvc'] ], var='CC_WIN32') ctx.find_program([ a + '-' + p + '-gcc' for a in ['x86_64', 'amd64'] for p in ['mingw32', 'mingw32msvc'] ], var='CC_WIN64') -- 2.34.1