[PATCH, RFC] no LIBADD for convenience libraries

Adeodato Simó asp16 at alu.ua.es
Thu Aug 18 16:01:46 BST 2005


  there is a mild hint in the "convenience libs" hotwo [1] that they
  don't need LIBADD nor LDFLAGS, but it is mentioned that they can be
  used if regarded necessary.

    [1] http://developer.kde.org/documentation/makefile_am_howto/en/_sharing_code_convenience_libs_.html

  I've seen that there have been in the past commits [2] removing the
  use of LIBADD and LDFLAGS for this kind of libraries. I don't know how
  much of a priority are these changes considered, but for Debian
  packages I'm hunting down those and producing patches. The reason for
  this is that libtool (*) is not able to prune dependencies specified
  in LIBADD for convenience libraries, and if the libraries specified
  there are many (e.g., $(LIB_KIO) as opposed to -lz), shared objects
  and binaries end up with 30 odd DT_NEEDED entries when less than 10

    [2] http://websvn.kde.org/trunk/kdelibs/kio/kio/Makefile.am?rev=134452&r1=133604&r2=134452

  So, my plan is to send patches (to this list, or to whatever place I'm
  pointed at) to implement commits like the above whenever I come
  accross one of these uses of LIBADD, unless I'm told you'd prefer not
  to apply such patches -- in which case I'll stick to applying them for
  the Debian packages, unless I determine that is causing me more pain
  than benefits.

  Attached is one such patch, for kdelibs/kdoctools and kdelibs/kspell2.
  I've worked on it for 3.4.2, but I see in websvn that the files are
  the same in trunk/. If I've overlooked and that's not the case, please
  let me know if you want me to rediff.

  Also, if there are some past thread from this list I should've read
  before posting this, please let me know too.


    (*) The libtool in Debian, that is; the pruning-dependency code is
    not integrated upstream yet. I know now exists --enable-new-ldflags,
    which tries to solve the extra dependencies problem using linker
    features rather than libtool ones; but at least in Debian we won't
    be enabling it for now, since this feature is broken in several
    architectures. I hope this breakage gets fixed soon [3], but in the
    meantime, I constantly dream about KDE's libtool gaining this
    prunning support (hey, dreaming is easy), so if there's something I
    could do to make progress in that direction, I'd be more than
    willing to help (FWIW, I'll be in Málaga).

    [3] https://bugzilla.ubuntu.com/12822

Adeodato Simó
    EM: asp16 [ykwim] alu.ua.es | PK: DA6AE621
Proper treatment will cure a cold in seven days, but left to itself, a
cold will hang on for a week.
                -- Darrell Huff
-------------- next part --------------
--- kdelibs-3.4.2/kdoctools/Makefile.am
+++ kdelibs-3.4.2/kdoctools/Makefile.am
@@ -5,18 +5,17 @@
 noinst_LTLIBRARIES = libkbzipfilter_dummy.la
 libkbzipfilter_dummy_la_SOURCES = kbzip2filter.cpp
-libkbzipfilter_dummy_la_LIBADD = $(LIB_KIO) $(LIBBZ2)
 ####### Files
 kde_module_LTLIBRARIES = kio_help.la kio_ghelp.la
 kio_help_la_SOURCES = kio_help.cpp main.cpp xslt.cpp
-kio_help_la_LIBADD = $(LIBXSLT_LIBS) $(LIBXML_LIBS)  libkbzipfilter_dummy.la
+kio_help_la_LIBADD = $(LIBXSLT_LIBS) $(LIBXML_LIBS)  libkbzipfilter_dummy.la $(LIB_KIO) $(LIBBZ2)
 kio_help_la_LDFLAGS = $(all_libraries) -module $(KDE_PLUGIN)
 kio_ghelp_la_SOURCES = kio_help.cpp main_ghelp.cpp xslt.cpp
-kio_ghelp_la_LIBADD = $(LIBXSLT_LIBS) $(LIBXML_LIBS) libkbzipfilter_dummy.la
+kio_ghelp_la_LIBADD = $(LIBXSLT_LIBS) $(LIBXML_LIBS) libkbzipfilter_dummy.la $(LIB_KIO) $(LIBBZ2)
 kio_ghelp_la_LDFLAGS = $(all_libraries) -module $(KDE_PLUGIN)
 noinst_HEADERS = kio_help.h
@@ -25,7 +24,7 @@
 kdelnkdir = $(kde_servicesdir)
 bin_PROGRAMS = meinproc 
-meinproc_LDADD = xslt_pure.o libkbzipfilter_dummy.la $(LIBXSLT_LIBS) $(LIBXML_LIBS) 
+meinproc_LDADD = xslt_pure.o libkbzipfilter_dummy.la $(LIBXSLT_LIBS) $(LIBXML_LIBS) $(LIB_KIO) $(LIBBZ2)
 meinproc_SOURCES = meinproc.cpp
 xslt_pure.o: xslt.cpp
--- kdelibs-3.4.2/kspell2/Makefile.am	2005-05-23 14:16:10.000000000 +0200
+++ kdelibs-3.4.2/kspell2/Makefile.am	2005-08-18 13:13:22.000000000 +0200
@@ -17,7 +17,6 @@
 libkspell2base_la_LDFLAGS = -no-undefined $(all_libraries)
-libkspell2base_la_LIBADD  = $(LIB_KPARTS) ../kutils/libkutils.la 
 servicetype_DATA = kspellclient.desktop
 servicetypedir = $(kde_servicetypesdir)
--- kdelibs-3.4.2/kspell2/ui/Makefile.am	2005-07-20 11:19:24.000000000 +0200
+++ kdelibs-3.4.2/kspell2/ui/Makefile.am	2005-08-18 13:11:02.000000000 +0200
@@ -18,4 +18,4 @@
 libkspell2_la_SOURCES = dialog.cpp
 libkspell2_la_LDFLAGS = -no-undefined -version-info 1:0:0 $(all_libraries)
-libkspell2_la_LIBADD = libkspell2_noinst.la ../libkspell2base.la
+libkspell2_la_LIBADD = libkspell2_noinst.la ../libkspell2base.la $(LIB_KPARTS) ../../kutils/libkutils.la 
--- kdelibs-3.4.2/kspell2/tests/Makefile.am	2005-07-20 11:19:24.000000000 +0200
+++ kdelibs-3.4.2/kspell2/tests/Makefile.am	2005-08-18 13:12:01.000000000 +0200
@@ -18,7 +18,7 @@
 test_dialog_LDADD = ../ui/libkspell2.la $(LIB_KDECORE)
 test_highlighter_SOURCES = test_highlighter.cpp
-test_highlighter_LDADD = ../ui/libkspell2_noinst.la ../libkspell2base.la $(LIB_KDECORE)
+test_highlighter_LDADD = ../ui/libkspell2_noinst.la ../libkspell2base.la $(LIB_KDECORE) $(LIB_KPARTS) ../../kutils/libkutils.la
 test_configdialog_SOURCES = test_configdialog.cpp
-test_configdialog_LDADD = ../ui/libkspell2_noinst.la ../libkspell2base.la $(LIB_KDECORE)
+test_configdialog_LDADD = ../ui/libkspell2_noinst.la ../libkspell2base.la $(LIB_KDECORE) $(LIB_KPARTS) ../../kutils/libkutils.la

More information about the kde-core-devel mailing list