[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-core-devel
Subject:    [PATCH] More --as-needed usage in kdelibs
From:       Szombathelyi "György" <gyurco () freemail ! hu>
Date:       2004-11-07 17:35:36
Message-ID: 200411071835.36445.gyurco () freemail ! hu
[Download RAW message or body]

Hello!

The attached patch makes use of LDFLAGS_AS_NEEDED (hopefully) everywhere in 
kdelibs. The kinit stuff is a bit tricky, since kinit.cpp and kioslave.cpp 
should import at least one symbol from libs which should be linked to them. 
Is it acceptable?

P.S.: It would be good to add to kdetestscripts a check which tells if a 
PROGRAMS or LTLIBRARIES (except noinst) target doesn't have $(all_libraries) 
in its LDFLAGS (or doesn't have LDFLAGS_AS_NEEDED in the Makefile.am's 
AM_LDFLAGS).

Bye,
György

____________________________________________________________________
Miert fizetsz az internetert? Korlatlan, ingyenes internet hozzaferes a FreeStarttol.
Probald ki most! http://www.freestart.hu

["kdelibs-alllibs.diff" (text/x-diff)]

Index: arts/message/Makefile.am
===================================================================
RCS file: /home/kde/kdelibs/arts/message/Makefile.am,v
retrieving revision 1.3
diff -u -p -u -r1.3 Makefile.am
--- arts/message/Makefile.am	25 Sep 2001 16:17:06 -0000	1.3
+++ arts/message/Makefile.am	7 Nov 2004 17:27:22 -0000
@@ -5,4 +5,4 @@ bin_PROGRAMS = artsmessage
 artsmessage_SOURCES = artsmessage.cc
 
 artsmessage_LDADD = ../../kdeui/libkdeui.la
-artsmessage_LDFLAGS = $(KDE_RPATH) $(KDE_MT_LDFLAGS)
+artsmessage_LDFLAGS = $(all_libraries) $(KDE_RPATH) $(KDE_MT_LDFLAGS)
Index: kabc/vcard/Makefile.am
===================================================================
RCS file: /home/kde/kdelibs/kabc/vcard/Makefile.am,v
retrieving revision 1.13
diff -u -p -u -r1.13 Makefile.am
--- kabc/vcard/Makefile.am	5 Jan 2004 09:03:45 -0000	1.13
+++ kabc/vcard/Makefile.am	7 Nov 2004 17:27:24 -0000
@@ -4,6 +4,8 @@ INCLUDES = \
 	$(all_includes)
 
 ### KDE 4.0: either make noinst or rename to something like libkvcard
+AM_LDFLAGS = $(LDFLAGS_AS_NEEDED)
+
 lib_LTLIBRARIES = libvcard.la
 
 libvcard_la_SOURCES = vCard-all.cpp
Index: kdeui/Makefile.am
===================================================================
RCS file: /home/kde/kdelibs/kdeui/Makefile.am,v
retrieving revision 1.333
diff -u -p -u -r1.333 Makefile.am
--- kdeui/Makefile.am	1 Sep 2004 19:06:08 -0000	1.333
+++ kdeui/Makefile.am	7 Nov 2004 17:27:36 -0000
@@ -22,11 +22,13 @@ SUBDIRS = . kdetrayproxy tests
 
 INCLUDES= -I$(top_srcdir)/kdefx -I$(top_srcdir)/interfaces $(all_includes)
 
+AM_LDFLAGS = $(LDFLAGS_AS_NEEDED)
+
 lib_LTLIBRARIES = libkdeui.la libkspell.la
 libkdeui_la_LDFLAGS = $(KDE_MT_LDFLAGS) -no-undefined -version-info 6:0:2
 libkdeui_la_LIBADD = ../kdecore/libkdecore.la
 
-libkspell_la_LDFLAGS = $(KDE_MT_LDFLAGS) -version-info 6:0:2 -no-undefined
+libkspell_la_LDFLAGS =$(KDE_MT_LDFLAGS) -version-info 6:0:2 -no-undefined
 libkspell_la_LIBADD = libkdeui.la
 libkspell_la_SOURCES = dummy.cpp
 
Index: kinit/Makefile.am
===================================================================
RCS file: /home/kde/kdelibs/kinit/Makefile.am,v
retrieving revision 1.33
diff -u -p -u -r1.33 Makefile.am
--- kinit/Makefile.am	1 Jul 2004 16:05:11 -0000	1.33
+++ kinit/Makefile.am	7 Nov 2004 17:27:43 -0000
@@ -26,6 +26,8 @@ kdeinit_LTLIBRARIES = klauncher.la
 kdeinit_SOURCES = kinit.cpp setproctitle.cpp
 
 # NOTE: We link against all common libraries even if we don't need them ourselves.
+AM_LDFLAGS = $(LDFLAGS_AS_NEEDED)
+
 kdeinit_LDFLAGS = $(KDE_MT_LDFLAGS) $(QT_LDFLAGS) $(X_LDFLAGS) $(USER_LDFLAGS) \
                   $(KDE_RPATH)
 kdeinit_LDADD = $(LIB_KPARTS) 
Index: kinit/kinit.cpp
===================================================================
RCS file: /home/kde/kdelibs/kinit/kinit.cpp,v
retrieving revision 1.143
diff -u -p -u -r1.143 kinit.cpp
--- kinit/kinit.cpp	26 Sep 2004 01:09:39 -0000	1.143
+++ kinit/kinit.cpp	7 Nov 2004 17:27:49 -0000
@@ -163,6 +163,13 @@ int kdeinit_x_errhandler( Display *, XEr
 }
 #endif
 
+/* These are to link libkparts even if 'smart' linker is used */
+#include <kparts/plugin.h>
+extern "C" KParts::Plugin* _kinit_init_kparts() { return new KParts::Plugin(); }
+/* These are to link libkio even if 'smart' linker is used */
+#include <kio/authinfo.h>
+extern "C" KIO::AuthInfo* _kioslave_init_kio() { return new KIO::AuthInfo(); }
+
 /*
  * Close fd's which are only useful for the parent process.
  * Restore default signal handlers.
Index: kinit/kioslave.cpp
===================================================================
RCS file: /home/kde/kdelibs/kinit/kioslave.cpp,v
retrieving revision 1.1
diff -u -p -u -r1.1 kioslave.cpp
--- kinit/kioslave.cpp	23 Jan 2002 06:28:28 -0000	1.1
+++ kinit/kioslave.cpp	7 Nov 2004 17:27:49 -0000
@@ -47,6 +47,10 @@
 # endif
 #endif
 
+/* These are to link libkio even if 'smart' linker is used */
+#include <kio/authinfo.h>
+extern "C" KIO::AuthInfo* _kioslave_init_kio() { return new KIO::AuthInfo(); }
+
 int main(int argc, char **argv)
 {
      if (argc < 5)
Index: kioslave/file/Makefile.am
===================================================================
RCS file: /home/kde/kdelibs/kioslave/file/Makefile.am,v
retrieving revision 1.24
diff -u -p -u -r1.24 Makefile.am
--- kioslave/file/Makefile.am	25 May 2002 18:00:10 -0000	1.24
+++ kioslave/file/Makefile.am	7 Nov 2004 17:28:03 -0000
@@ -9,8 +9,8 @@ INCLUDES = $(all_includes)
 kde_module_LTLIBRARIES = kio_file.la
 
 kio_file_la_SOURCES = file.cc
-kio_file_la_LIBADD = $(LIB_KIO)
-kio_file_la_LDFLAGS = -module $(KDE_PLUGIN)
+kio_file_la_LIBADD = $(LIB_KIO) $(ACL_LIBS)
+kio_file_la_LDFLAGS = $(all_libraries) -module $(KDE_PLUGIN) 
 noinst_HEADERS = file.h
 
 fileinclude_HEADERS = file.h
Index: kioslave/ftp/Makefile.am
===================================================================
RCS file: /home/kde/kdelibs/kioslave/ftp/Makefile.am,v
retrieving revision 1.20
diff -u -p -u -r1.20 Makefile.am
--- kioslave/ftp/Makefile.am	25 May 2002 18:00:10 -0000	1.20
+++ kioslave/ftp/Makefile.am	7 Nov 2004 17:28:10 -0000
@@ -6,7 +6,7 @@ kde_module_LTLIBRARIES = kio_ftp.la
 
 kio_ftp_la_SOURCES = ftp.cc
 kio_ftp_la_LIBADD  = $(LIB_KIO)
-kio_ftp_la_LDFLAGS = -module $(KDE_PLUGIN)
+kio_ftp_la_LDFLAGS = $(all_libraries) -module $(KDE_PLUGIN) 
 
 noinst_HEADERS = ftp.h
 
Index: kparts/Makefile.am
===================================================================
RCS file: /home/kde/kdelibs/kparts/Makefile.am,v
retrieving revision 1.49
diff -u -p -u -r1.49 Makefile.am
--- kparts/Makefile.am	20 Aug 2003 09:19:41 -0000	1.49
+++ kparts/Makefile.am	7 Nov 2004 17:28:11 -0000
@@ -1,5 +1,7 @@
 ####### General stuff
 
+AM_LDFLAGS = $(LDFLAGS_AS_NEEDED)
+
 INCLUDES= -I$(srcdir)/../ -I$(top_srcdir)/kio/ -I$(top_srcdir)/libltdl \
 	-I$(top_srcdir)/kfile $(all_includes)
 libkparts_la_LDFLAGS = $(KDE_MT_LDFLAGS) -version-info 3:0:1 -no-undefined
Index: kspell2/plugins/aspell/Makefile.am
===================================================================
RCS file: /home/kde/kdelibs/kspell2/plugins/aspell/Makefile.am,v
retrieving revision 1.2
diff -u -p -u -r1.2 Makefile.am
--- kspell2/plugins/aspell/Makefile.am	18 Sep 2004 18:07:05 -0000	1.2
+++ kspell2/plugins/aspell/Makefile.am	7 Nov 2004 17:28:11 -0000
@@ -2,6 +2,8 @@ METASOURCES = AUTO
 
 AM_CPPFLAGS = -I$(top_srcdir)/kspell2 -I$(top_srcdir) $(all_includes)
 
+AM_LDFLAGS = $(LDFLAGS_AS_NEEDED)
+
 kde_module_LTLIBRARIES = kspell_aspell.la
 
 kspell_aspell_la_SOURCES = kspell_aspellclient.cpp kspell_aspelldict.cpp
Index: kspell2/plugins/ispell/Makefile.am
===================================================================
RCS file: /home/kde/kdelibs/kspell2/plugins/ispell/Makefile.am,v
retrieving revision 1.2
diff -u -p -u -r1.2 Makefile.am
--- kspell2/plugins/ispell/Makefile.am	18 Sep 2004 18:07:06 -0000	1.2
+++ kspell2/plugins/ispell/Makefile.am	7 Nov 2004 17:28:11 -0000
@@ -2,6 +2,8 @@ METASOURCES = AUTO
 
 AM_CPPFLAGS = -I$(top_srcdir)/kspell2 -I$(top_srcdir) $(all_includes)
 
+AM_LDFLAGS = $(LDFLAGS_AS_NEEDED)
+
 kde_module_LTLIBRARIES = kspell_ispell.la
 
 kspell_ispell_la_SOURCES = kspell_ispellclient.cpp kspell_ispelldict.cpp \
Index: libkmid/Makefile.am
===================================================================
RCS file: /home/kde/kdelibs/libkmid/Makefile.am,v
retrieving revision 1.22
diff -u -p -u -r1.22 Makefile.am
--- libkmid/Makefile.am	31 Jul 2002 10:08:01 -0000	1.22
+++ libkmid/Makefile.am	7 Nov 2004 17:28:13 -0000
@@ -1,6 +1,8 @@
 
 INCLUDES =  -I$(srcdir)/.. $(all_includes)
 
+AM_LDFLAGS = $(LDFLAGS_AS_NEEDED)
+
 libkmidincludedir = $(includedir)/libkmid
 libkmidinclude_HEADERS = midiout.h player.h track.h midimapper.h \
 	midfile.h dattypes.h midistat.h deviceman.h synthout.h \


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic