Description: When building with -Wl,--as-needed, libraries that are passed
 in LDFLAGS are not considered for symbol resolving, they should go into
 LDADD instead. Also, use pkg-config in configure rather than in Makefile.
Author: Andreas Moog <amoog@ubuntu.com>
Bug-Debian: http://bugs.debian.org/632562
Forwarded: http://sourceforge.net/support/tracker.php?aid=3351840
Last-Update: <2011-07-03>

--- trophy-1.1.7.orig/configure.ac
+++ trophy-1.1.7/configure.ac
@@ -14,10 +14,12 @@ AC_MSG_CHECKING(ClanLib version)
 	if test "$have_clan_10" = "yes"; then
 	    AC_MSG_RESULT(ClanLib 1.0)
 	    AC_SUBST(CLANLIB_MODULES, ["clanSignals-1.0 clanGL-1.0 clanCore-1.0 clanSound-1.0 clanDisplay-1.0 clanApp-1.0"])
+	    PKG_CHECK_MODULES([CLANLIB], ["clanSignals-1.0 clanGL-1.0 clanCore-1.0 clanSound-1.0 clanDisplay-1.0 clanApp-1.0"])
 	else
         if test "$have_clan_08" = "yes"; then
 	    AC_MSG_RESULT(ClanLib 0.8)
 	    AC_SUBST(CLANLIB_MODULES, ["clanSignals-0.8 clanGL-0.8 clanCore-0.8 clanSound-0.8 clanDisplay-0.8 clanApp-0.8"])
+	    PKG_CHECK_MODULES([CLANLIB], ["clanSignals-0.8 clanGL-0.8 clanCore-0.8 clanSound-0.8 clanDisplay-0.8 clanApp-0.8"])
 	else
 	   AC_MSG_RESULT(no)
 	   AC_MSG_ERROR([Unable to find a compatible version of ClanLib. Check for ClanLib 0.8 or ClanLib 1.0])
--- trophy-1.1.7.orig/src/Makefile.am
+++ trophy-1.1.7/src/Makefile.am
@@ -12,6 +12,6 @@ trophy_SOURCES = cagoody.cpp cainfodialo
 		 caslotselectiondialog.cpp cafogbomb.h caimageview.h camenu.cpp canetclient.h capositiontable.cpp \
 		 caslotselectiondialog.h
 
-AM_LDFLAGS = `pkg-config --libs $(CLANLIB_MODULES)`
-INCLUDES = `pkg-config --cflags $(CLANLIB_MODULES)`
+trophy_LDADD = $(CLANLIB_LIBS)
+INCLUDES = $(CLANLIB_CFLAGS)
 AM_CPPFLAGS = -DPKGDATADIR=\"$(pkgdatadir)\"
