This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: libtool for shared objects?


Hello All

and a big thanks to David Fang

(I, Basile, asked)
What is the right way to produce a dynamically loadable "library" which would be the most portable?

and David Fang kindly replied to me:
Hi, for starters:

in Makefile.am:

lib_LTLIBRARIES = mymodule.la
mymodule_la_SOURCES = foo.c
mymodule_la_LDFLAGS = -module

This creates a wrapper mymodule.la, whose real shared object will reside in .libs/mymodule.{so,dylib} until it is installed (in this example, $(prefix)/lib).


Thanks, but the gcc/ subdirectory of GCC trunk (or my MELT branch) has only a Makefile.in, no Makefile.am

And the MELT branch is supposed to generate some *.so (or *.la) (from a *.c file which itself can be generated) in cc1 during its execution and then in the same process dlopen it

My impression is that I should execute, a libtool subcommand.

Currently, my MELT branch rev 133113 file gcc/basilys.c function compile_to_dyl near line 3629, I have a function which execute (using pex_run) a script basilys-gcc which I would like to avoid, since I believe libtool --mode=compile might be enough

But I'm not sure to understand the relation between libtool & $(LIBTOOL) (ie @libtool@)

Any clues?

Thanks
--
Basile STARYNKEVITCH         http://starynkevitch.net/Basile/
email: basile<at>starynkevitch<dot>net mobile: +33 6 8501 2359
8, rue de la Faiencerie, 92340 Bourg La Reine, France
*** opinions {are only mines, sont seulement les miennes} ***


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]