#! /usr/bin/env python # encoding: utf-8 # WARNING! Do not edit! http://waf.googlecode.com/git/docs/wafbook/single.html#_obtaining_the_waf_file import os from waflib import Task,Options,Utils from waflib.Configure import conf from waflib.TaskGen import extension,feature,before_method @before_method('apply_incpaths','apply_link','propagate_uselib_vars') @feature('perlext') def init_perlext(self): self.uselib=self.to_list(getattr(self,'uselib',[])) if not'PERLEXT'in self.uselib:self.uselib.append('PERLEXT') self.env['cshlib_PATTERN']=self.env['cxxshlib_PATTERN']=self.env['perlext_PATTERN'] @extension('.xs') def xsubpp_file(self,node): outnode=node.change_ext('.c') self.create_task('xsubpp',node,outnode) self.source.append(outnode) class xsubpp(Task.Task): run_str='${PERL} ${XSUBPP} -noprototypes -typemap ${EXTUTILS_TYPEMAP} ${SRC} > ${TGT}' color='BLUE' ext_out=['.h'] @conf def check_perl_version(self,minver=None): res=True if minver: cver='.'.join(map(str,minver)) else: cver='' self.start_msg('Checking for minimum perl version %s'%cver) perl=getattr(Options.options,'perlbinary',None) if not perl: perl=self.find_program('perl',var='PERL') if not perl: self.end_msg("Perl not found",color="YELLOW") return False self.env['PERL']=perl version=self.cmd_and_log([perl,"-e",'printf \"%vd\", $^V']) if not version: res=False version="Unknown" elif not minver is None: ver=tuple(map(int,version.split("."))) if ver