On Mon, Jun 11, 2007 at 08:27:26AM -0500, Paul Elliott wrote: > The sponsor of peless to debian complains that peless > links to too many libraries that it does not strictly > speaking need: > > g++ -g -O2 -o peless -L/usr/lib peless-peless.o peless-gmore.o > +peless-search.o -pthread -L/opt/gnome/lib -lgtkmm-2.4 -lgdkmm-2.4 -latkmm-1.6 > +-lgtk-x11-2.0 -lpangomm-1.4 -lcairomm-1.0 -lgdk-x11-2.0 -latk-1.0 > +-lgdk_pixbuf-2.0 -lpangocairo-1.0 -lpango-1.0 -lcairo -lfreetype -lz > +-lfontconfig -lexpat -lglitz -lpng12 -lXrender -lX11 -lpthread -lXau -lXdmcp > +-lgconfmm-2.6 -lglibmm-2.4 -lgconf-2 -lgobject-2.0 -lsigc-2.0 -lORBit-2 -lm > +-lgmodule-2.0 -ldl -lgthread-2.0 -lglib-2.0 -lboost_filesystem -lboost_regex > > > gtkmm2.4 gconfmm-2.6 and boost* I have specified directly. > > the others are a result of these > configure.ac: > PKG_CHECK_MODULES(DEPS, gtkmm-2.4 >= 2.4.0 gconfmm-2.6 >= 2.6.0) > and this line from Makefile.am > peless_LDADD=$(DEPS_LIBS) $(BOOST_FILESYSTEM_LIB) $(BOOST_REGEX_LIB) > Specificyly $(DEPS_LIBS). > > 16 of the libraries are said to be not really needed. > > It is suggested that peless add --as-needed to LDFLAGS. > > Is this a good idea? The PKG_CHECK_MODULES is the recommended > way to build a program using gtkmm and gconfmm. This question concerns Libtool more than Autoconf, so I copied its mailing list. You can remove autoconf@xxxxxxx from replies. Use Libtool to link this application, and only specify the DEP_LIBS that you use directly. Stock Libtool will add the extra libraries anyway, but Debian patches its Libtool to avoid this. An official GNU Libtool release may perform this optimization, when it can do so portably. You might look at other Debian packages that use gtkmm without incurring excess dependencies, to confirm that they too use this approach. `--as-needed' is not compatible with Libtool[1], and it may not be supported on all architectures[2]. Some C++ code will break with it[3]. [1] http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=347650 [2] http://lists.gnu.org/archive/html/libtool/2005-08/msg00019.html [3] http://ciaranm.org/show_post.pl?post_id=13 _______________________________________________ Autoconf mailing list Autoconf@xxxxxxx http://lists.gnu.org/mailman/listinfo/autoconf