Moved building perl binding lib and running test suite to EU::MM Makefile
This commit is contained in:
parent
58412ed005
commit
9d0cb859d8
2 changed files with 7 additions and 10 deletions
|
|
@ -114,7 +114,6 @@ else:
|
||||||
lib = env.SConscript(["src/SConscript"])
|
lib = env.SConscript(["src/SConscript"])
|
||||||
env.Alias(env.SConscript(["examples/SConscript"]))
|
env.Alias(env.SConscript(["examples/SConscript"]))
|
||||||
|
|
||||||
print testruns
|
|
||||||
for testrun in testruns:
|
for testrun in testruns:
|
||||||
env.Alias("test", testrun)
|
env.Alias("test", testrun)
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -18,23 +18,21 @@ if 'PERL_MM_OPT' in os.environ:
|
||||||
if 'PERL5LIB' in os.environ:
|
if 'PERL5LIB' in os.environ:
|
||||||
perlenv['ENV']['PERL5LIB'] = os.environ['PERL5LIB']
|
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']
|
swig = ['hammer.i']
|
||||||
|
|
||||||
libhammer_perl = perlenv.SharedLibrary('hammer', swig, SHLIBPREFIX='')
|
hammer_wrap = perlenv.Command(['hammer_wrap.c', 'hammer.pm'], swig, "swig $SWIGFLAGS $SOURCE")
|
||||||
perlenv.Command(['Makefile'], ['Makefile.PL'] + libhammer_perl, "perl $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)
|
Default(libhammer_perl)
|
||||||
|
|
||||||
perltestenv = perlenv.Clone()
|
perltestenv = perlenv.Clone()
|
||||||
perltestenv['ENV']['LD_LIBRARY_PATH'] = os.path.dirname(str(libhammer_shared[0]))
|
perltestenv['ENV']['LD_LIBRARY_PATH'] = os.path.dirname(str(libhammer_shared[0]))
|
||||||
perltests = ['t/hammer.t']
|
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)
|
perltest = Alias("testperl", [perltestexec], perltestexec)
|
||||||
AlwaysBuild(perltestexec)
|
AlwaysBuild(perltestexec)
|
||||||
testruns.append(perltest)
|
testruns.append(perltest)
|
||||||
|
|
||||||
|
|
||||||
print "Reading perl sconscript"
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue