Moved building perl binding lib and running test suite to EU::MM Makefile

This commit is contained in:
Dan Hirsch 2013-12-05 09:45:26 +01:00
parent 58412ed005
commit 9d0cb859d8
2 changed files with 7 additions and 10 deletions

View file

@ -114,7 +114,6 @@ else:
lib = env.SConscript(["src/SConscript"])
env.Alias(env.SConscript(["examples/SConscript"]))
print testruns
for testrun in testruns:
env.Alias("test", testrun)

View file

@ -18,23 +18,21 @@ if 'PERL_MM_OPT' in os.environ:
if 'PERL5LIB' in os.environ:
perlenv['ENV']['PERL5LIB'] = os.environ['PERL5LIB']
perlenv.ParseConfig("perl -MConfig -e'print(qq[-I$$Config{archlib}/CORE\n]);'")
perlenv.ParseConfig("perl -MConfig -e'print($$Config{ccflags} . \"\n\");'")
swig = ['hammer.i']
libhammer_perl = perlenv.SharedLibrary('hammer', swig, SHLIBPREFIX='')
perlenv.Command(['Makefile'], ['Makefile.PL'] + libhammer_perl, "perl $SOURCE")
hammer_wrap = perlenv.Command(['hammer_wrap.c', 'hammer.pm'], swig, "swig $SWIGFLAGS $SOURCE")
makefile = perlenv.Command(['Makefile'], ['Makefile.PL'], "perl $SOURCE")
targetdir = os.path.dirname(str(hammer_wrap[0].path))
libhammer_perl = perlenv.Command(['hammer.so'], makefile + hammer_wrap, "make -C " + targetdir)
Default(libhammer_perl)
perltestenv = perlenv.Clone()
perltestenv['ENV']['LD_LIBRARY_PATH'] = os.path.dirname(str(libhammer_shared[0]))
perltests = ['t/hammer.t']
perltestexec = perltestenv.Command(None, perltests + libhammer_perl + libhammer_shared, "pwd && prove -I%(perldir)s %(perldir)s/t" % dict(perldir=os.path.dirname(str(libhammer_perl[0].path))))
perltestexec = perltestenv.Command(None, perltests + libhammer_perl + libhammer_shared, "make test -C " + targetdir)
perltest = Alias("testperl", [perltestexec], perltestexec)
AlwaysBuild(perltestexec)
testruns.append(perltest)
print "Reading perl sconscript"