libtool
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Building shared libs as dynamically-loaded perl modules


From: Jeremy Slade
Subject: Building shared libs as dynamically-loaded perl modules
Date: Wed, 14 Feb 2001 10:20:56 -0700 (MST)

I am trying to use libtool (along w/ automake/autoconf) to build a .sl
(on HPUX 10.20) that is a dynamically-loaded perl module, and I'm
running into a few problems.

First, my Makefile.am:
--------------------------------------------------
perllib_DATA = swigShapeUtils.pm
perllibarch_LTLIBRARIES = libswigShapeUtils.la

libswigShapeUtils_la_SOURCES = swigShapeUtils.C
libswigShapeUtils_la_LIBADD = \
        -L../../lib -lShapeUtils \
        -L$(REUSELIB)/lib -lMiscContrib 

INCLUDES = -I$(PERL_ARCHLIBCORE) -I../../lib -I$(REUSELIB)/include

swigShapeUtils.C: ShapeUtils.i
        $(SWIG) $(SWIG_CXXFLAGS) $(SWIG_NORUNTIME) -dnone -o $@ $^

ShapeUtils.i: Shape.i ShapeRegion.i scaled.i
--------------------------------------------------

What I really want to build is 'swigShapeUtils.sl', which corresponds
to the swigShapeUtils.pm module.  But automake complains:

automake: src/perl/swig/Makefile.am: `swigShapeUtils.la' is not a
standard libtool library name

As a temporary hack around that, I called it libswigShapeUtils.
Please tell me there is a way to build swigShapeUtils directly...

Anyway, once I make that little change, it builds a shared lib that
doesn't have a bunch of symbols in it, because they are evidently
expected to be in another shared lib at runtime.  These appear to be
the symbols that I was hoping to get from -lShapeUtils (see the LIBADD
line above).

Before going to libtool/automake, I was building this .sl using something like:

ld -b -E -o swigShapeUtils.sl swigShapeUtils.o -L../../lib
-lShapeUtils

With this line, it was linkning the .sl against the libShapeUtils.a
found at ../../lib, so all the right symbols were getting linked in.
But now with libtools, ../../libShapeUtils.a doesn't exist, but rather
../../libShapeUtils.la plus the .libs/libShapeUtils.a and
.libs/libShapeUtils.sl, etc.  So, how do I get it to build my
swigShapeUtils.sl linked against the libShapeUtils.a archive lib, so
there is not that run-time dependency on libShapeUtils.sl?

Perhaps I'm going about this the wrong way.  Please enlighten me.

Thanks,
Jeremy
-- 
Jeremy Slade
Hewlett-Packard Company  VLSI Technology Center - http://cpus.hp.com/
address@hidden            (970) 898-7881




reply via email to

[Prev in Thread] Current Thread [Next in Thread]