diff options
author | Frederic Peters <fpeters@entrouvert.com> | 2005-01-02 22:37:25 +0000 |
---|---|---|
committer | Frederic Peters <fpeters@entrouvert.com> | 2005-01-02 22:37:25 +0000 |
commit | dc827ee8a98038716df142cd0cc2876e147b0e12 (patch) | |
tree | 205173faf8ec1f81ff6aa0fff6f23c2376f61cc7 /perl | |
parent | a366436870c767f8f7701dda8d6ee6d2ef65571b (diff) | |
download | lasso-dc827ee8a98038716df142cd0cc2876e147b0e12.tar.gz lasso-dc827ee8a98038716df142cd0cc2876e147b0e12.tar.xz lasso-dc827ee8a98038716df142cd0cc2876e147b0e12.zip |
Perl module builds and links correctly.
Diffstat (limited to 'perl')
-rw-r--r-- | perl/Makefile.PL | 31 | ||||
-rw-r--r-- | perl/Makefile.am | 2 |
2 files changed, 29 insertions, 4 deletions
diff --git a/perl/Makefile.PL b/perl/Makefile.PL index 2135cf2e..2d5a21f8 100644 --- a/perl/Makefile.PL +++ b/perl/Makefile.PL @@ -4,11 +4,36 @@ use ExtUtils::MakeMaker; $CFLAGS=$ENV{CFLAGS} || ""; +my $objects="lasso_wrap.o "; + +if(-r '../lasso-src-config') { + my $lasso_libs=`../lasso-src-config --libs`; + chomp $lasso_libs; + $objects .= $lasso_libs; +} + +my $includes="-I$TOP_SRCDIR/lasso"; +my $version=$ENV{VERSION}; + +# I'm forced to do this since BASEEXT is defined in a non-overridable method. +push(@ExtUtils::MakeMaker::Overridable, "init_main"); + +sub MY::init_main { + my($self)=@_; + package MY; # so that "SUPER" works right + $self->SUPER::init_main(); + + # Stop perl linking with anything in the destination dir, it might + # be entirely the wrong library such as a previous version. + $self->{LDFLAGS} =~ s/-L\S+//; + $self->{LDDLFLAGS} =~ s/-L\S+//; +} + + WriteMakefile( NAME => 'lasso', # Name of package - VERSION => '0.5.9', - LIBS => ['-llasso'], # Name of custom libraries - OBJECT => 'lasso_wrap.o', # Object files + VERSION => $version, + OBJECT => "$objects", AUTHOR => 'Frederic Peters <fpeters@entrouvert.com>', MAKEFILE => 'Makefile.perl', DEFINE => "-DHAVE_CONFIG_H $CFLAGS", diff --git a/perl/Makefile.am b/perl/Makefile.am index 6d463001..ae725870 100644 --- a/perl/Makefile.am +++ b/perl/Makefile.am @@ -18,7 +18,7 @@ lasso_wrap.c lasso.pm: $(top_srcdir)/swig/Lasso.i $(top_srcdir)/swig/Lasso-wsf.i $(SWIG) -v -perl5 -module lasso -o lasso_wrap.c $(top_srcdir)/swig/Lasso.i $(PERL_MAKEFILE): $(srcdir)/Makefile.PL lasso.pm - VERSION=$(VERSION) LASSO_CONFIG=@LASSO_CONFIG@ CFLAGS="$(AM_CPPFLAGS) $(SWIG_OPTS) $(CPPFLAGS) $(AM_STANDARD_CFLAGS)" $(PERL) $(srcdir)/Makefile.PL $(MAKE_PL_OPTS) + VERSION=$(VERSION) CFLAGS="$(AM_CPPFLAGS) $(SWIG_OPTS) $(CPPFLAGS) $(AM_STANDARD_CFLAGS)" $(PERL) $(srcdir)/Makefile.PL $(MAKE_PL_OPTS) -perl install-perl: $(PERL_MAKEFILE) @target=`echo $@ | sed -e 's/-perl//'`; \ |