Create header file the Python way
authorThomas Hood <jdthood@gmail.com>
Tue, 27 Sep 2011 13:53:20 +0000 (15:53 +0200)
committerThomas Hood <jdthood@gmail.com>
Tue, 27 Sep 2011 13:53:20 +0000 (15:53 +0200)
README
source/wscript

diff --git a/README b/README
index 0a066954e67d6f1ce6fe54f3d9d95d4bd3538ac8..e0986ead795c341fee31382b9e6bcecb2afbb02d 100644 (file)
--- 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
index d4d9c51e8e667567d88fae53216945ecaa1a8d7a..36f91e188fbcfb1e68e6fab681ac02d7eb2e68a0 100644 (file)
@@ -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')