compiling shared modules (was: Compiling and loading gEDA/gschem plugin)

Felix Salfelder <[email protected]>
Newsgroups gmane.comp.gnu.gnucap.devel
Message-ID <[email protected]>
On Thu, Aug 09, 2012 at 12:13:19PM +0530, [email protected] wrote:
> On Thu, Aug 9, 2012 at 11:59 AM, al davis <[email protected]> wrote:
> > Make has a collection of default rules, so even though
> > lang_geda.o is not explicitly listed in the makefile, make finds
> > a rule to make it.  Since .o is normally not "shared", the
> > "-shared" flag is not used.
>
> Okay, but In order for makefile to compile to a shared object file, we
> need to specifiy that, right?

see the "geda_shared_module" branch (on tool). lines like these should
work for any such module:

plugin_LTLIBRARIES += lang_geda.la
lang_geda_la_SOURCES = lang_geda.cc d_net.cc d_place.cc
lang_geda_la_LDFLAGS = -module -shared
lang_geda_la_CPPFLAGS = $(AM_CPPFLAGS) @GEDA_CFLAGS@

after "make install" to $prefix
LD_LIBRARY_PATH=$prefix/share/gnucap $prefix/bin/gnucap
>load lang_geda.so
works. i havent yet patched gnucap to find it automatically.

regards
felix

PS: please test before merge. also -lgeda must be removed from most
gcc invocations...
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.