libtool
[Top][All Lists]
Advanced

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

Re: Customizing soname


From: Alon Bar-Lev
Subject: Re: Customizing soname
Date: Fri, 28 Mar 2008 19:39:41 +0200

On 3/28/08, Peter O'Gorman <address@hidden> wrote:
> -rpath is required for proper execution in many environments, the
>  ability to change the soname is, as far as I can tell, not.
>
>  Please present a more convincing argument.

Hello Peter,

I think that infrastructures such as libtool should allow customization
of any attribute that affect the output. Of course there should be defaults
but it should allow overriding to allow customization. This especially true
when the customization is simple to implement and to maintain.

Your example of not using automake simplified rules in order to
workaround the lack of ability to customize the soname attribute
is correct. But it is a workaround that makes build system much
more complex, just because customization is missing.

What you recommend is instead the following automake rules:
lib_LTLIBRARIES=module1.la
module1_la_SOURCES=m1.c m2.c m3.c m4.c
module1_la_LDFLAGS=-module -avoid-version -soname "@MYNAME@"

install-exec-local: install-libLTLIBRARIES
        mv -f "$(DESTDIR)$(libdir)/module1.so" "$(DESTDIR)$(libdir)/@MYNAME@"


Write the following make rules:

LTCOMPILE = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
        --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
        $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
CCLD = $(CC)

my_objects=m1.lo m2.lo m3.lo m4.lo
@MYNAME@: $(my_objects)
        $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \
                $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
                -module -avoid-version $(LDFLAGS) -o $@ \
                -rpath $(libdir) $(my_objects) $(LIBS)

lib_LTLIBRARIES=#create
install-exec-hook: install-libLTLIBRARIES @MYNAME@
        $(LIBTOOL) --mode=install $(INSTALL) "@MYNAME@" \
                $(DESTDIR)$(libdir)

all-local:      @MYNAME@

.c.lo:
if am__fastdepCC
        $(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
        mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo
else
if AMDEP
        source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
        DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
endif
        $(LTCOMPILE) -c -o $@ $<
endif

It is doable... But in what price?

Patching libtool with three lines to add ability to override soname
and use 5 line
simple automake rules.

Or write complex build rules and remove/add parts if automake chooses to
not generate/generate libtool stuff, and maintaining these complex
rules of about
30 lines.

I know what I choose.

As far as I understand the soname is one of the few last attributes that cannot
be overridden, I don't understand who not enable this and not forcing users to
create complex rules if required. It is simple enough to support this... Without
breaking ABI or any other past interface.

Thank you for your time,
Alon Bar-Lev.




reply via email to

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