]>
git.saurik.com Git - wxWidgets.git/blob - wxPython/distrib/create_setup.h.py
1 import sys
, os
, string
, shutil
, re
3 #TODO: copy .make files to build/msw
5 # update setup_h defines to match official wxPython settings
7 'wxDIALOG_UNIT_COMPATIBILITY' :'0',
8 'wxUSE_DEBUG_CONTEXT' :'0',
9 'wxUSE_MEMORY_TRACING' :'0',
10 'wxUSE_DIALUP_MANAGER' :'0',
11 'wxUSE_GLCANVAS' :'1',
12 'wxUSE_POSTSCRIPT' :'1',
13 'wxUSE_AFM_FOR_POSTSCRIPT' :'0',
15 'wxUSE_DEBUGREPORT' :'0'
20 'wxUSE_UNICODE_MSLU' :'1'
24 'wxUSE_DEBUG_CONTEXT' :'1',
25 'wxUSE_MEMORY_TRACING' :'1',
28 if "UNICODE=1" in sys
.argv
:
29 defines
.update(uni_defines
)
31 if "DEBUG=1" in sys
.argv
:
32 defines
.update(debug_defines
)
34 setup_dir
= os
.path
.join("..", "..", "include", "wx", "msw")
36 # copy the file over if it doesn't exist
37 setup_h
= os
.path
.join(setup_dir
, "setup.h")
38 setup0_h
= os
.path
.join(setup_dir
, "setup0.h")
39 if not os
.path
.exists(setup_h
) and os
.path
.exists(setup0_h
):
40 shutil
.copyfile(setup0_h
, setup_h
)
42 setup_file
= open(setup_h
, "rb").read()
44 for define
in defines
:
45 setup_file
, num_subs
= re
.subn("%s\s+\d" % (define
), "%s\t%s" % (define
, defines
[define
]), setup_file
)
46 print "# of subs made for pattern %s: %d" % (define
, num_subs
)
48 output
= open(setup_h
, "wb")
49 output
.write(setup_file
)