Hello,

I've spent some time trying to integrate libtool
(http://www.gnu.org/software/libtool) with Wine, and it seems to work
pretty well so far.  Libtool is a configurable shell script used to
abstract the building and linking of libraries on a wide variety of
platforms.

Enclosed is an experimental patch to show what I have so far.  There are
still a few rough spots that I'd like to iron out before posting this as
an official patch, but I thought I'd mention it here first, to see what
everyone thinks.

A few notes about the patch.  I added the following variables to
Make.rules.in (using the same variable names that automake does):

LIBTOOL = $(SHELL) $(TOPOBJDIR)/libtool
COMPILE   = $(CC)
LTCOMPILE = $(LIBTOOL) --mode=compile $(CC)
LINK      = $(LIBTOOL) --mode=link $(CC)

The rule of thumb is to use libtool to compile and link relocatable
objects (e.g. for .so files), and to use straight gcc for
non-relocatable objects (e.g. for executables).  Thus, we'd use
$(COMPILE) for wineclipsrv.c, but $(LTCOMPILE) for clipboard.c.

To differentiate between relocatable and non-relocatable objects,
libtool creates .lo files for the former and .o files for the latter. 
This is important because libtool can be set up to build both into the
same directory.

My approach for this patch was to use libtool to generate .lo files
wherever I found a -fPIC option in the compile line, but keep the old
compile method for non-fPIC targets.  I use libtool for all linking. 
Since libtool automagically inserts the -fPIC flag (as well as a helpful
-DPIC flag), this makes the @DLLFLAGS@ substitution unnecessary.

To test this patch, you'll have to run 'autoconf' and 'libtoolize'
(after installing the patch!), followed by 'configure'.  At this point,
you should have the following new files:

  aclocal.m4       (from the patch)
  tools/ltconfig   (from libtoolize)
  tools/ltmain.sh  (from libtoolize)
  libtool          (from configure)

The couple rough spots I mentioned refer to the $(LDSHARED) and
$(LDCOMBINE) variables.  In theory, libtool should handle these.  In
practice, it may take a little tinkering to find the best way to
integrate these variables.

Good luck, and let me know what you think....

John
-- 
[EMAIL PROTECTED]                                http://www.gnome.org
[EMAIL PROTECTED]                      http://www.worldforge.org

libtool.patch

Reply via email to