+ try:
+ wx_config = 'wx-config-3.0-gtk2'
+ conf.check_cfg(msg='Checking for wxWidgets using wx-config-3.0-gtk2',
+ package='',
+ path=wx_config,
+ args='--cppflags --cxxflags --libs std,richtext',
+ uselib_store='WXWIDGETS',
+ mandatory=True)
+ except:
+ wx_config = 'wx-config'
+ conf.check_cfg(msg='Checking for wxWidgets using wx-config',
+ package='',
+ path=wx_config,
+ args='--cppflags --cxxflags --libs std,richtext',
+ uselib_store='WXWIDGETS',
+ mandatory=True)
+
+ if conf.options.static_wxwidgets:
+ # wx-config returns its static libraries as full paths, without -l prefixes, which confuses
+ # check_cfg(). It puts the static libraries into LINKFLAGS_WXWIDGETS, so fish them out.
+ stlibs = []
+ new_linkflags = []
+ stlib_paths = []
+ for f in conf.env.LINKFLAGS_WXWIDGETS:
+ if f.startswith('/'):
+ d = os.path.dirname(f)
+ if not d in stlib_paths:
+ stlib_paths.append(d)
+ stlibs.append(os.path.basename(f)[3:-2])
+ else:
+ new_linkflags.append(f)
+
+ conf.env.STLIB_WXWIDGETS = stlibs
+ conf.env.LINKFLAGS_WXWIDGETS = new_linkflags
+ conf.env.STLIBPATH_WXWIDGETS = stlib_paths
+
+ conf.in_msg = 1
+ wx_version = conf.check_cfg(package='', path=wx_config, args='--version').strip()
+ conf.im_msg = 0
+ if not wx_version.startswith('3.0.'):
+ conf.fatal('wxwidgets version 3.0.x is required; %s found' % wx_version)