Update of /cvsroot/monetdb/buildtools/autogen/autogen
In directory sc8-pr-cvs16.sourceforge.net:/tmp/cvs-serv11656/autogen

Modified Files:
      Tag: MonetDB_1-20
        msc.py 
Log Message:
Implemented conditionals in headers section.
Replaced hack to not compile mprof and Mtimeout on Windows with a more
general, slightly less hacky solution: remove all subtrees which have
a NOT_WIN32 conditional before attempting to create the Windows
makefile.  (Note it is still hacky in that the parse tree is modified,
so presumably you can't do the Windows makefile first and then the
automake makefile, but that's not how it's done anyway.)


Index: msc.py
===================================================================
RCS file: /cvsroot/monetdb/buildtools/autogen/autogen/msc.py,v
retrieving revision 1.35.2.3
retrieving revision 1.35.2.4
diff -u -d -r1.35.2.3 -r1.35.2.4
--- msc.py      22 Oct 2007 12:13:26 -0000      1.35.2.3
+++ msc.py      24 Oct 2007 13:58:04 -0000      1.35.2.4
@@ -468,7 +468,19 @@
 ##                fd.write('\t$(INSTALL) "$(SRCDIR)\\%s" "%s"\n' % (header, 
header))
 ##                fd.write('\tif not exist "%s" if exist "$(SRCDIR)\\%s" 
$(INSTALL) "$(SRCDIR)\\%s" "%s"\n' % (header, header, header, header))
                 fd.write('\t$(INSTALL) "$(SRCDIR)\\%s" "%s"\n' % (header, 
header))
-            msc['INSTALL'][header] = header, '', sd, '', ''
+            if headers.has_key('COND'):
+                condname = 'defined(' + ') && defined('.join(headers['COND']) 
+ ')'
+                mkname = header.replace('.', '_').replace('-', '_')
+                fd.write('!IF %s\n' % condname)
+                fd.write('C_%s = %s\n' % (mkname, header))
+                fd.write('!ELSE\n')
+                fd.write('C_%s =\n' % mkname)
+                fd.write('!ENDIF\n')
+                cheader = '$(C_%s)' % mkname
+            else:
+                cheader = header
+                condname = ''
+            msc['INSTALL'][header] = cheader, '', sd, '', condname
 
 ##    msc_find_ins(msc, headers)
 ##    msc_deps(fd, headers['DEPS'], "\.o", msc)
@@ -1031,12 +1043,11 @@
 
 def output(tree, cwd, topdir):
     # HACKS to keep uncompilable stuff out of Windows makefiles.
-    if tree.has_key('bin_Mtimeout'):
-        tree = tree.copy()
-        del tree['bin_Mtimeout']
-    if tree.has_key('LIB_mprof'):
-        tree = tree.copy()
-        del tree['LIB_mprof']
+    for k, v in tree.items():
+        if type(v) is type({}):
+            if v.has_key('COND'):
+                if 'NOT_WIN32' in v['COND']:
+                    del tree[k]
 
     fd = open(os.path.join(cwd, 'Makefile.msc'), "w")
 


-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >> http://get.splunk.com/
_______________________________________________
Monetdb-checkins mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/monetdb-checkins

Reply via email to