Hello Qt/KDE maintainers! Now that KDevelop has moved to the Qt/KDE team''s CDBS infrastructure, the next task I''d like to tackle is updating the libtool scripts used by KDevelop. My problems is that in order to fix the breakage this introduces, I am having to write what is amounting to a truly butcherous patch to fix the Makefile.am files.. Is there any "clever" way to go about this, or do I have to go over every single Makefile.am and add the minimal missing libraries to *_LIBADD? Thanks in advance! Cheers, Jeremy -- http://www.jerryweb.org/ : JerryWeb.org http://sailcut.sourceforge.net/ : Sailcut CAD http://opensource.polytechnique.org/ : Polytechnique.org Free Software
On Tuesday 17 January 2006 19:53, Jeremy Laine wrote:> Hello Qt/KDE maintainers! > > Now that KDevelop has moved to the Qt/KDE team''s CDBS infrastructure, > the next task I''d like to tackle is updating the libtool scripts used > by KDevelop. My problems is that in order to fix the breakage this > introduces, I am having to write what is amounting to a truly > butcherous patch to fix the Makefile.am files..yeah, I was there already and I assume kdevelop is even harder because much bigger.> > Is there any "clever" way to go about this, or do I have to go over > every single Makefile.am and add the minimal missing libraries to > *_LIBADD?clever but lazy is to what until ld only add libs to NEEDED when the ELF binary really uses symbols from it ;) first 33%: There is at least one thing that can make life easier for all KDE relibtoolization and later merges. LIB_QT is currently: LIB_QT = -lqt-mt $(LIBZ) $(LIBPNG) -lXext $(LIB_X11) $(LIBSM) -lpthread what''s badly needed is a patch so is just LIB_QT=-lqt-mt. This would elimiate lots of s/LIB_QT/-lqt-mt/ that will never be accepted upstream. Same is of course true for other LIB defs that use several libs. Digikam has e.g. $ egrep ''LIB.*=.*(-l|\$).*(-l|\$)'' Makefile LIBPNG = -lpng -lz -lm LIBSM = -lSM -lICE LIBTOOL = $(SHELL) $(top_builddir)/libtool --silent LIB_GPHOTO = -L/usr/lib -lgphoto2 -lm -L/usr/lib -lgphoto2_port LIB_IMLIB2 = -L/usr/lib -lImlib2 -lfreetype -lz -lX11 -lXext -ldl -lm LIB_QT = -lqt-mt $(LIBZ) $(LIBPNG) -lXext $(LIB_X11) $(LIBSM) -lpthread LIB_X11 = -lX11 $(LIBSOCKET) All of them should be just -l<libname>. Well LIBSOCKET) I we have a patch to easly make them -l<libname> then the Makefile.am changes are only additions or removal of $(LIB<whatver>) and this should be perfectly fine for upstream to accept. 2nd 33 % is boring: ld will fail is a lib is missing. In my experience this was easy enought to fix recursively a tool is not that useful. For the 3nd 33% finding the mininal set of required libs, there was a lintian check posted on debian-devel that list libs that are in NEEDED but no symbols are used from this lib. I''m would gladly read about more tips and tricks to ease the relibtoolization. And I dance in circles when some one provides the above mention patch for LIB vars! ;) Achim> > Thanks in advance! > > Cheers, > Jeremy > > -- > http://www.jerryweb.org/ : JerryWeb.org > http://sailcut.sourceforge.net/ : Sailcut CAD > http://opensource.polytechnique.org/ : Polytechnique.org Free Software > > > -- > http://lists.alioth.debian.org/mailman/listinfo/pkg-kde-talk > >-- To me vi is Zen. To use vi is to practice zen. Every command is a koan. Profound to the user, unintelligible to the uninitiated. You discover truth everytime you use it. -- reddy@lion.austin.ibm.com
> yeah, I was there already and I assume kdevelop is even harder > because much bigger.You bet, there is a huge number of Makefile.am''s to patch. To make things somewhat easier, I have written a Perl (attached) that parses the errors that occur during a build and looks up symbols to figure out the needed libraries (the rules are specified in the script). I invoke it like this: <yourproject>/obj-i486-linux-gnu$ make -k 2>&1 | ~/find-missing-libs.pl The output looks like this: ------ In directory `/home/sharky/tmp/kdevelop3-3.3.0/obj-i486-linux-gnu/parts/fileselector'': libkdevfileselector.la needs : $(LIB_QT) $(LIB_KDECORE) $(LIB_KDEUI) $(LIB_KPARTS) $(LIB_KIO) -lktexteditor libkdevfileselector.la unknown undefined references : locateLocal(char const*, QString const&, KInstance const*) qInstallMsgHandler(void (*)(QtMsgType, char const*)) <snip> In directory `/home/sharky/tmp/kdevelop3-3.3.0/obj-i486-linux-gnu/languages/perl'': libkdevperlsupport.la needs : $(LIB_QT) $(LIB_KDECORE) $(LIB_KDEUI) $(LIB_KIO) kio_perldoc.la needs : $(LIB_QT) $(LIB_KDECORE) ------ Note : - libraries are listed in the order they are specified in $all_libs. - "unknown undefined references" means that there is no rule in $all_libs to figure out the missing library - this script is work in progress! Cheers, Jeremy -- http://www.jerryweb.org/ : JerryWeb.org http://sailcut.sourceforge.net/ : Sailcut CAD http://opensource.polytechnique.org/ : Polytechnique.org Free Software -------------- next part -------------- A non-text attachment was scrubbed... Name: find-missing-libs.pl Type: text/x-perl Size: 5743 bytes Desc: not available Url : http://lists.alioth.debian.org/pipermail/pkg-kde-talk/attachments/20060118/08467ff3/find-missing-libs.pl
I have written a new version of the script which reads symbols straight from the libraries using "nm" and which fixes the Makefile.am files automatically. To use it you would run: <yourproject>/obj-i486-linux-gnu$ fix-missing-libs.pl ../ It works like this: 1/ try going as far a possible in the build (make -k), and make a note of the missing symbols for each .la target 2/ if there are missing symbols, figure out what libraries are missing, patch the Makefile.am files 3/ if there were no missing symbols or if we were unable to figure out how to patch the Makefile.am files, stop here, otherwise go back to 1/ For KDevelop, the process ends after 4 runs (i.e the Makefile.am''s need to be patched 3 times). For a simpler package (like kdesvn), the process after 2 runs (i.e the Makefile.am''s need to be patched only once). You can get the script from http://dev.jerryweb.org/fixlibs/ Any comments / suggestions are welcome! Cheers, Jeremy -- http://www.jerryweb.org/ : JerryWeb.org http://sailcut.sourceforge.net/ : Sailcut CAD http://opensource.polytechnique.org/ : Polytechnique.org Free Software