Package: paps
Version: 0.6.8-4
Severity: wishlist
Tags: patch
Forwarded: 
https://sourceforge.net/tracker/?func=detail&aid=3347031&group_id=153049&atid=786239
User: [email protected]
Usertags: origin-ubuntu oneiric ubuntu-patch

the package paps fails to build when using the linker flag --as-needed
This is caused by the libraries being placed before the objects which
need the symbols on the command line. So the library symbols are not registered
as needed and one gets an undefined reference error.

Attached patch fixes this issue by placing the libraries in the automake 
variable
LDADD instead of LDFLAGS
To do this the use of PKG_CHECK_MODULES is required in configure.in.
(Direct usage of pkg-config in Makefile.am causes following wrong error message:
linker flags such as `--libs' belong in `test_libpaps_LDFLAGS)
Description: fix build with ld --as-needed
 use autoconf PKG_CHECK_MODULES to get the pango libraries
 direct usage of "pkg-config --libs pangoft2" is not accepted in LDADD
 by automake
Bug-Ubuntu: https://bugs.launchpad.net/ubuntu/+source/paps/+bug/771131
Forwarded: https://sourceforge.net/tracker/?func=detail&aid=3347031&group_id=153049&atid=786239
Author: Julian Taylor <[email protected]>
Index: paps-0.6.8/configure.in
===================================================================
--- paps-0.6.8.orig/configure.in	2007-01-19 12:06:10.000000000 +0100
+++ paps-0.6.8/configure.in	2011-06-30 17:45:22.090626351 +0200
@@ -18,4 +18,6 @@
 
 DX_INIT_DOXYGEN(libpaps, doxygen.cfg, doxygen-doc)
 
+PKG_CHECK_MODULES([PANGO], [pangoft2])
+
 AC_OUTPUT(Makefile src/Makefile)
Index: paps-0.6.8/src/Makefile.am
===================================================================
--- paps-0.6.8.orig/src/Makefile.am	2011-06-30 17:45:21.310626351 +0200
+++ paps-0.6.8/src/Makefile.am	2011-06-30 17:45:22.090626351 +0200
@@ -7,21 +7,19 @@
 bin_PROGRAMS = paps
 paps_CFLAGS  = -Wall 
 paps_SOURCES = paps.c
-paps_LDADD = $(lib_LTLIBRARIES) $(all_libraries)
-paps_LDFLAGS = `pkg-config --libs pangoft2`
+paps_LDADD = $(lib_LTLIBRARIES) $(all_libraries) $(PANGO_LIBS)
 paps_DEPENDENCIES = $(lib_LTLIBRARIES)
 
 EXTRA_DIST = test_libpaps.c paps.1
 
 # set the include path found by configure
-INCLUDES= $(all_includes) `pkg-config --cflags pangoft2`
+INCLUDES= $(all_includes) $(PANGO_CFLAGS)
 
 # Test program
 noinst_PROGRAMS = test_libpaps
 
 
 test_libpaps_SOURCES = test_libpaps.c
-test_libpaps_LDADD = $(lib_LTLIBRARIES) $(all_libraries)
-test_libpaps_LDFLAGS = `pkg-config --libs pangoft2`
+test_libpaps_LDADD = $(lib_LTLIBRARIES) $(all_libraries) $(PANGO_LIBS)
 test_libpaps_DEPENDENCIES = $(lib_LTLIBRARIES) 
 

Attachment: signature.asc
Description: OpenPGP digital signature

Reply via email to