Links

Content Skeleton

This Page

Previous topic

eperl

Next topic

EMBEDDED PERL ON b2mc

EPERL ANT BUILD

This was(is?) called from ~/hh/extensions/modules/build.xml overriding the deploy.dir property

Depends on envvars:

EPERL_HOME PERL_CORE EXIST_HOME JAVA_INCLUDE

TASKS

env
dump variables
info
testing arch detection
init
create directory structure
clean
delete non build directories
java-compile
depends on init
jni-headers
depends on java-compile
perl-place
placing perl modules ready for inclusion in the jar
example
compiles example.java.src
cpp-compile-darwin

depends on jni-headers calls darwin-link

changes made to linux to get working on OSX

  1. change outtype from shared to plugin for osx, creates bundle instead of dylib

    (with shared it creates a dylib)

  2. remove the outfile attribute from cc to stop the link attempt, instead do that in separate task

  3. On OSX, with gcc get .bundle with g++ get the .so , with gcc need to add stdc++

darwin-link
creates libEPerlLib.bundle
cpp-compile-lion
modifications for Lion with macports perl
lion-link
modifications for Lion with macports perl
cpp-compile-linux
depends on jni-headers
cpp-compile
picks the needed cpp-compile-arch
prep-jnilib
depends on cpp-compile renames libEPerlLib.bundle to libEPerlLib.jnilib as OSX java System.loadLibrary(“EPerlLib”) looks for a .jnilib
jar
depends on perl-place, example creates EPerl.jar
ls
list contents of the EPerl.jar
deploy
depends on jar copies Eperl.jar to deploy.dir
deploy-jni-darwin
copies libEPerlLib.jnilib to deploy.dir
deploy-jni-lion
copies libEPerlLib.jnilib to deploy.dir
deploy-jni-linux
copies libEPerlLib.so to deploy.dir
deploy-jni
calls the arch appropriate task
build
empty task depending on jar and prep-jnilib
run-modulecall
testing embedded perl
run-xto
testing embedded perl
perl-tpdflatex
external perlscript run
run-eperlscript
embedded perlscript run

Commandline testing:

cd $EPERL_HOME/build/libs
java -cp EPerl.jar eperl.example.ModuleCall
    java -cp $EPERL_HOME/build/libs/EPerl.jar eperl.example.ModuleCall Image::ExifTooli "print 'hello\n';"
alias jperl "cd $EPERL_HOME/build/libs ; java -cp $EPERL_HOME/build/libs/EPerl.jar -Djava.library.path=$EPERL_HOME/build/libs eperl.example.ModuleCall"
jperl "Data::Dumper" 'my $t = [1..100] ; print Dumper($t);'

Linking issues

Formerly when was trying to compile and link in a single task:

/usr/bin/ld: Undefined symbols: __Unwind_Resume collect2: ld returned 1 exit status

This is due to using gcc rather than g++ to link (see http://lists.apple.com/archives/xcode-users/2005/Nov/msg00707.html)

The cpptasks people are aware of this problem but have not fixed it, they think can just add stdc++

<!--linker name="g++" >
    <linkerarg value="-L/usr/local/lib" />
    <linkerarg value="-L${perl.CORE}"/>
                <libset libs="perl,stdc++" />
    <linkerarg location="end" value="${perl.CORE}/../auto/DynaLoader/DynaLoader.a"/>
</linker-->