Complete.Org: Mailing Lists: Archives: freeciv-dev: December 2002:
[Freeciv-Dev] (PR#2579) autoconf detection of gui-win32
Home

[Freeciv-Dev] (PR#2579) autoconf detection of gui-win32

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: undisclosed-recipients:;
Subject: [Freeciv-Dev] (PR#2579) autoconf detection of gui-win32
From: "Jason Short via RT" <rt@xxxxxxxxxxxxxx>
Date: Sat, 14 Dec 2002 23:40:18 -0800
Reply-to: rt@xxxxxxxxxxxxxx

When I try configure --enable-client=win32, configure fails with no
useful error message.

This patch makes this result better, and makes the code more modular.

jason


Index: Makefile.am
===================================================================
RCS file: /home/freeciv/CVS/freeciv/Makefile.am,v
retrieving revision 1.26
diff -u -r1.26 Makefile.am
--- Makefile.am 2002/11/30 20:42:01     1.26
+++ Makefile.am 2002/12/15 07:37:02
@@ -86,6 +86,7 @@
                m4/sdl-client.m4                \
                m4/sound.m4                     \
                m4/vsnprintf.m4                 \
+               m4/win32-client.m4              \
                m4/x.213                        \
                m4/x.252                        \
                vms/config.h_vms                \
Index: configure.ac
===================================================================
RCS file: /home/freeciv/CVS/freeciv/configure.ac,v
retrieving revision 1.29
diff -u -r1.29 configure.ac
--- configure.ac        2002/12/14 10:26:43     1.29
+++ configure.ac        2002/12/15 07:37:02
@@ -456,21 +456,7 @@
   fi
 
   dnl Win32-specific overrides
-  if test "$client" = win32 || test "$client" = yes ; then
-    if test x"$MINGW32" = "xyes"; then
-      AC_CHECK_HEADER(png.h, ,
-         AC_MSG_ERROR("You have to install libpng"))
-      AC_CHECK_LIB(png, png_read_image,,
-         AC_MSG_ERROR("You have to install libpng"),-lz)
-      found_client=yes
-      CLIENT_LIBS="-lwsock32 -lcomctl32  -lpng -lz -mwindows"
-    fi
-    if test "x$found_client" = "xyes"; then
-      client=win32
-    elif test "$client" = "win32"; then
-      AC_MSG_ERROR(specified client 'win32' not configurable)
-    fi
-  fi
+  FC_WIN32_CLIENT
 
   dnl Stub-specific overrides
   if test "$client" = stub ; then
Index: configure.in
===================================================================
RCS file: /home/freeciv/CVS/freeciv/configure.in,v
retrieving revision 1.207
diff -u -r1.207 configure.in
--- configure.in        2002/12/14 10:26:43     1.207
+++ configure.in        2002/12/15 07:37:02
@@ -450,21 +450,7 @@
   fi
 
   dnl Win32-specific overrides
-  if test "$client" = win32 || test "$client" = yes ; then
-    if test x"$MINGW32" = "xyes"; then
-      AC_CHECK_HEADER(png.h, ,
-         AC_MSG_ERROR("You have to install libpng"))
-      AC_CHECK_LIB(png, png_read_image,,
-         AC_MSG_ERROR("You have to install libpng"),-lz)
-      found_client=yes
-      CLIENT_LIBS="-lwsock32 -lcomctl32  -lpng -lz -mwindows"
-    fi
-    if test "x$found_client" = "xyes"; then
-      client=win32
-    elif test "$client" = "win32"; then
-      AC_MSG_ERROR(specified client 'win32' not configurable)
-    fi
-  fi
+  FC_WIN32_CLIENT
 
   dnl Stub-specific overrides
   if test "$client" = stub ; then
# Try to configure the Win32 client (gui-win32)

dnl FC_WIN32_CLIENT
dnl Test for Win32 and needed libraries for gui-win32

AC_DEFUN(FC_WIN32_CLIENT,
[
  if test "$client" = "win32" || test "$client" = "yes" ; then
    if test "$MINGW32" = "yes"; then
      AC_CHECK_LIB([png], [png_read_image],
                   [libpng_found="yes"], [libpng_found="no"])
      if test "$libpng_found" = "yes"; then
        AC_CHECK_HEADER([png.h], [png_h_found="yes"], [png_h_found="no"])
        if test "$png_h_found" = "yes"; then
          found_client=yes
          CLIENT_LIBS="-lwsock32 -lcomctl32  -lpng -lz -mwindows"
        elif test "$client" = "win32"; then
          AC_MSG_ERROR([specified client 'win32' not configurable (libpng-dev 
is needed)])
        fi
      elif test "$client" = "win32"; then
        AC_MSG_ERROR([specified client 'win32' not configurable (libpng is 
needed)])
      fi
    elif test "$client" = "win32"; then
      AC_MSG_ERROR([specified client 'win32' not configurable (mingw32 is 
needed)])
    fi
    if test "x$found_client" = "xyes"; then
      client=win32
    elif test "$client" = "win32"; then
      AC_MSG_ERROR([specified client 'win32' not configurable])
    fi
  fi
])

[Prev in Thread] Current Thread [Next in Thread]