<URL: http://bugs.freeciv.org/Ticket/Display.html?id=40555 >

There's a problem report on the forums about broken libpng detection
with the trunk win32 client:

http://forum.freeciv.org/viewtopic.php?p=21951#21951

The solution for the problem is mentioned in a comment in pkg.m4:

# PKG_CHECK_MODULES(VARIABLE-PREFIX, MODULES, [ACTION-IF-FOUND],
# [ACTION-IF-NOT-FOUND])
#
#
# Note that if there is a possibility the first call to
# PKG_CHECK_MODULES might not happen, you should be sure to include an
# explicit call to PKG_PROG_PKG_CONFIG in your configure.ac
#
#
# --------------------------------------------------------------

The first call to PKG_CHECK_MODULES is in the Cairo check for the ftwl
GUI in configure.ac which is not executed for the other GUIs. This has
the effect that no check for pkg-config is performed with some of these
GUIs and PKG_CHECK_MODULES doesn't work at the following places (in this
case for detecting the PNG library in win32-client.m4).

The attached patch adds a call to PKG_PROG_PKG_CONFIG once for every
GUI-specific configuration part that calls PKG_CHECK_MODULES. We could
alternatively add a call somewhere globally in configure.ac as suggested
by the comment, but then there would be one superfluous check with the
GTK+ GUI, since glib-2.0.m4 and gtk-2.0.m4 also check for
pkg-config theirselves.

Index: configure.ac
===================================================================
--- configure.ac        (revision 15302)
+++ configure.ac        (working copy)
@@ -136,7 +136,9 @@
 if test "$ftwl" = no && test "$client" = ftwl ; then
   AC_MSG_ERROR(You must use --enable-ftwl to use the ftwl client)
 fi
+
 if test "$ftwl" != no ; then
+  PKG_PROG_PKG_CONFIG
   PKG_CHECK_MODULES([CAIRO], [cairo],,
     [AC_MSG_ERROR([--enable-ftwl requires cairo])])
   FTWL_CFLAGS="$FTWL_CFLAGS $CAIRO_CFLAGS"
Index: m4/win32-client.m4
===================================================================
--- m4/win32-client.m4  (revision 15302)
+++ m4/win32-client.m4  (working copy)
@@ -7,6 +7,10 @@
 [
   if test "$client" = "win32" || test "$client" = "yes" ; then
     if test "$MINGW32" = "yes"; then
+    
+      PKG_PROG_PKG_CONFIG
+      
+      dnl Check for libpng
       PKG_CHECK_MODULES([PNG], [libpng],
       [
         CLIENT_LIBS="-lwsock32 -lcomctl32 -mwindows $PNG_LIBS"
Index: m4/xaw-client.m4
===================================================================
--- m4/xaw-client.m4    (revision 15302)
+++ m4/xaw-client.m4    (working copy)
@@ -21,6 +21,8 @@
       AC_DEFINE_UNQUOTED(NARROWPROTO, $fc_x_proto_value, [Narrowproto])
     fi
 
+    PKG_PROG_PKG_CONFIG
+
     dnl Check for libpng
     PKG_CHECK_MODULES([PNG], [libpng],
     [
Index: m4/win32-client.m4
===================================================================
--- m4/win32-client.m4  (revision 15302)
+++ m4/win32-client.m4  (working copy)
@@ -7,6 +7,10 @@
 [
   if test "$client" = "win32" || test "$client" = "yes" ; then
     if test "$MINGW32" = "yes"; then
+    
+      PKG_PROG_PKG_CONFIG
+      
+      dnl Check for libpng
       PKG_CHECK_MODULES([PNG], [libpng],
       [
         CLIENT_LIBS="-lwsock32 -lcomctl32 -mwindows $PNG_LIBS"
Index: m4/xaw-client.m4
===================================================================
--- m4/xaw-client.m4    (revision 15302)
+++ m4/xaw-client.m4    (working copy)
@@ -21,6 +21,8 @@
       AC_DEFINE_UNQUOTED(NARROWPROTO, $fc_x_proto_value, [Narrowproto])
     fi
 
+    PKG_PROG_PKG_CONFIG
+
     dnl Check for libpng
     PKG_CHECK_MODULES([PNG], [libpng],
     [
_______________________________________________
Freeciv-dev mailing list
Freeciv-dev@gna.org
https://mail.gna.org/listinfo/freeciv-dev

Reply via email to