Hi developers,

   I just successfully completed an experiment with using libtool to build all 
LyX component libraries as shared libraries and building the lyx executable 
to link with these instead of the static libs. Is this something that might 
be worth submitting? With libtool, by default, both static and shared libs 
get built and one may continue to work with static builds with 
the '--enable-static=yes --enable-shared=no' flags passed to configure.

   I am interested in creating a mini mathematical editor that I can embed in 
my applications and I was interested in using lyx code to supply this 
functionality. The natural first step was to build LyX using shared libraries 
so that I could prototype my code.

   A few issues:

0. Is this change desirable? With this LyX might begin to supply components to 
other open source applications. For example, I have long wished that I could 
annotate my research paper database in kBibTeX with WYSIWY[GM] mathematical 
notes.

1. Libraries like lyxcore and lyxinsets seem to be referencing functions 
defined in .o files for the main lyx application instead of in other 
libraries. Because of static linkage this is hardly a problem but is it 
possible to tidy up the architecture a bit so that this issue is fixed?

2. Because of the above, I had to move all .cpp except main.cpp for the lyx 
program into another library (which I unimaginatively named liblyxcore2) and 
it was only after this that lyxclient could be successfully linked.

3. autogen.sh will need to contain a call to libtoolize so that ltmain.sh is 
written into the config/ directory without which the libtool initialization 
macros in configure.ac will fail. This should still work on older autotools 
versions which automatically call libtoolize (newer versions don't)

4. Very small changes are required in configure.ac and in all the Makefile.am 
to achieve shared libraries. However, build tests must be performed on all 
supported platforms before this change is accepted. If this change is 
desirable, how can the development community go about testing and accepting 
it? Are there folks who have volunteered to test the build on platforms like 
Windows and MacOS?

5. There are now two possible ways to run GDB with LyX: the vanilla way is to 
continue with the static build and run GDB on the executable. With libtool 
shared libraries, the call to GDB must be through libtool - this is easy but 
not everyone may know it. So if the change is accepted, it has to announced 
with some fanfare. Is the developer community up for it?

6. Has someone tried all this before? What was the experience then?

Thanks,
Manoj Rajagopalan

Reply via email to