2
0
mirror of https://gitlab.com/ita1024/waf.git synced 2024-11-25 11:19:52 +01:00

Find xsubpp in order, privlib, vendorlib and path.

This commit is contained in:
Daniel Svensson 2015-04-11 13:17:21 +02:00
parent ba7295d555
commit c53a6f9e07

View File

@ -135,17 +135,18 @@ def check_perl_ext_devel(self):
return self.cmd_and_log(cmd_perl_config(cfg))
def cfg_lst(cfg):
return Utils.to_list(cfg_str(cfg))
def find_xsubpp():
for var in ('privlib', 'vendorlib'):
xsubpp = cfg_lst('$Config{%s}/ExtUtils/xsubpp$Config{exe_ext}' % var)
if xsubpp and os.path.isfile(xsubpp[0]):
return xsubpp
return self.find_program('xsubpp')
env['LINKFLAGS_PERLEXT'] = cfg_lst('$Config{lddlflags}')
env['INCLUDES_PERLEXT'] = cfg_lst('$Config{archlib}/CORE')
env['CFLAGS_PERLEXT'] = cfg_lst('$Config{ccflags} $Config{cccdlflags}')
env['XSUBPP'] = xsubpp = cfg_lst('$Config{privlib}/ExtUtils/xsubpp$Config{exe_ext}')
env['EXTUTILS_TYPEMAP'] = cfg_lst('$Config{privlib}/ExtUtils/typemap')
if len(xsubpp) == 1 and not os.path.isfile(xsubpp[0]):
# oh Fedora
env.XSUBPP = []
self.find_program('xsubpp')
env['XSUBPP'] = find_xsubpp()
if not getattr(Options.options, 'perlarchdir', None):
env['ARCHDIR_PERL'] = cfg_str('$Config{sitearch}')
@ -160,4 +161,3 @@ def options(opt):
"""
opt.add_option('--with-perl-binary', type='string', dest='perlbinary', help = 'Specify alternate perl binary', default=None)
opt.add_option('--with-perl-archdir', type='string', dest='perlarchdir', help = 'Specify directory where to install arch specific files', default=None)