]>
git.saurik.com Git - wxWidgets.git/blob - build/bakefiles/wxwin.py
2 # Helper functions for wxWindows bakefiles
9 """Creates wxWindows library identifier from bakefile target ID that
10 follows this convention: DLLs end with 'dll', static libraries
11 end with 'lib'. If withPrefix=1, then _wxid is returned instead
13 if id.endswith('dll') or id.endswith('lib'):
20 # List of library names/ids for categories with different names:
22 LIBS_GUI
= ['core', 'html']
25 """Returns string that can be used as library name, including name
26 suffixes, prefixes, version tags etc. This must be kept in sync
27 with variables defined in common.bkl!"""
29 return '$(WXNAMEPREFIXGUI)$(WXNAMESUFFIX)$(WXVERSIONTAG)'
31 return '$(WXNAMEPREFIX)$(WXNAMESUFFIX)_%s$(WXVERSIONTAG)' % wxid
32 return '$(WXNAMEPREFIXGUI)$(WXNAMESUFFIX)_%s$(WXVERSIONTAG)' % wxid
35 """Returns string that can be used as DLL name, including name
36 suffixes, prefixes, version tags etc. This must be kept in sync
37 with variables defined in common.bkl!"""
39 return '$(WXNAMEPREFIXGUI)$(WXNAMESUFFIX)$(WXCOMPILER)$(WXVERSIONTAG)'
41 return '$(WXNAMEPREFIX)$(WXNAMESUFFIX)_%s$(WXCOMPILER)$(WXVERSIONTAG)' % wxid
42 return '$(WXNAMEPREFIXGUI)$(WXNAMESUFFIX)_%s$(WXCOMPILER)$(WXVERSIONTAG)' % wxid
45 def libToLink(wxlibname
):
46 """Returns string to pass to <sys-lib> when linking against 'wxlibname'.
47 libToLink('foo') returns '$(WXLIB_FOO)' which must be defined in
48 common.bkl as either nothing (in monolithic build) or mkLibName('foo')
50 return '$(WXLIB_%s)' % wxlibname
.upper()
54 VERSION_FILE
= '../../include/wx/version.h'
57 """Returns wxWindows version as a tuple: (major,minor,release)."""
60 f
= open(VERSION_FILE
, 'rt')
63 major
= minor
= release
= None
65 if not l
.startswith('#define'): continue
66 splitted
= l
.strip().split()
67 if splitted
[0] != '#define': continue
68 if len(splitted
) < 3: continue
71 if value
== None: continue
72 if name
== 'wxMAJOR_VERSION': major
= int(value
)
73 if name
== 'wxMINOR_VERSION': minor
= int(value
)
74 if name
== 'wxRELEASE_NUMBER': release
= int(value
)
75 if major
!= None and minor
!= None and release
!= None:
77 wxVersion
= (major
, minor
, release
)
80 def getVersionMajor():
81 return getVersion()[0]
82 def getVersionMinor():
83 return getVersion()[1]
84 def getVersionRelease():
85 return getVersion()[2]