Complete.Org: Mailing Lists: Archives: freeciv-dev: November 2002:
[Freeciv-Dev] Re: (PR#2450) SDL client
Home

[Freeciv-Dev] Re: (PR#2450) SDL client

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
Cc: freeciv-dev@xxxxxxxxxxx
Subject: [Freeciv-Dev] Re: (PR#2450) SDL client
From: "Jason Short via RT" <rt@xxxxxxxxxxxxxx>
Date: Sat, 30 Nov 2002 00:34:52 -0800
Reply-to: rt@xxxxxxxxxxxxxx

On Fri, 2002-11-29 at 07:13, Per I. Mathisen via RT wrote:
> 
> On Thu, 28 Nov 2002, Jason Short via RT wrote:
> > TODO: configure.in support.
> 
> You could/should put this in a macro file which you include from both,
> rather than duplicate the code.

OK.  sdl-client.m4 provides FC_SDL_CLIENT to do this work.

> Also,
> 
> +             AC_MSG_ERROR(" specified client 'sdl' not configurable [ 
> SDL_ttf is needed ] ")
> +         AC_MSG_ERROR(" specified client 'sdl' not configurable [ SDL_image 
> is needed ] ")
> +      AC_MSG_ERROR(" specified client 'sdl' not configurable [ SDL >=1.1.4 
> is needed ] ")
> 
> Have you tested that these errors are displayed as you would expect? IIRC
> '[' and ']' won't show up unless escaped correctly.

Good point.  Fixed.

Also it now checks for the header files as well as the libraries.

jason


Index: Makefile.am
===================================================================
RCS file: /home/freeciv/CVS/freeciv/Makefile.am,v
retrieving revision 1.25
diff -u -r1.25 Makefile.am
--- Makefile.am 2002/10/31 11:19:44     1.25
+++ Makefile.am 2002/11/30 08:21:05
@@ -83,6 +83,7 @@
                m4/progtest.m4                  \
                m4/readline.m4                  \
                m4/sdl.m4                       \
+               m4/sdl-client.m4                \
                m4/sound.m4                     \
                m4/vsnprintf.m4                 \
                m4/x.213                        \
Index: configure.ac
===================================================================
RCS file: /home/freeciv/CVS/freeciv/configure.ac,v
retrieving revision 1.26
diff -u -r1.26 configure.ac
--- configure.ac        2002/11/14 19:06:32     1.26
+++ configure.ac        2002/11/30 08:21:05
@@ -346,6 +346,9 @@
     fi
   fi
 
+  dnl SDL-specific overrides
+  FC_SDL_CLIENT
+
   dnl Xaw-specific overrides
   if test "$client" = xaw || test "$client" = yes ; then
     dnl Checks for X:
@@ -498,6 +501,7 @@
 AM_CONDITIONAL(ESD, test "x$ESD" = "xyes")
 AM_CONDITIONAL(SDL, test "x$SDL_mixer" = "xyes")
 AM_CONDITIONAL(WINMM, test "x$WINMM" = "xyes")
+AM_CONDITIONAL(CLIENT_GUI_SDL, test "$gui_sources" = "gui-sdl")
 AM_CONDITIONAL(CLIENT_GUI_GTK, test "$gui_sources" = "gui-gtk")
 AM_CONDITIONAL(CLIENT_GUI_GTK_2_0, test "$gui_sources" = "gui-gtk-2.0")
 AM_CONDITIONAL(CLIENT_GUI_XAW, test "$gui_sources" = "gui-xaw")
@@ -717,6 +721,7 @@
          client/Makefile 
          client/agents/Makefile
          client/include/Makefile 
+         client/gui-sdl/Makefile 
          client/gui-gtk/Makefile 
          client/gui-gtk-2.0/Makefile
          client/gui-xaw/Makefile 
Index: configure.in
===================================================================
RCS file: /home/freeciv/CVS/freeciv/configure.in,v
retrieving revision 1.204
diff -u -r1.204 configure.in
--- configure.in        2002/11/14 09:28:31     1.204
+++ configure.in        2002/11/30 08:21:05
@@ -340,6 +340,9 @@
     fi
   fi
 
+  dnl SDL-specific overrides
+  FC_SDL_CLIENT
+
   dnl Xaw-specific overrides
   if test "$client" = xaw || test "$client" = yes ; then
     dnl Checks for X:
Index: client/Makefile.am
===================================================================
RCS file: /home/freeciv/CVS/freeciv/client/Makefile.am,v
retrieving revision 1.44
diff -u -r1.44 Makefile.am
--- client/Makefile.am  2002/08/24 14:37:32     1.44
+++ client/Makefile.am  2002/11/30 08:21:05
@@ -4,6 +4,9 @@
 ##    SUBDIRS = @gui_sources@
 ## but that doesn't work properly for "make dist"
 
+if CLIENT_GUI_SDL
+GUI_SUBDIR = gui-sdl
+endif
 if CLIENT_GUI_GTK
 GUI_SUBDIR = gui-gtk
 endif
# Try to configure the SDL client (gui-sdl)

dnl FC_SDL_CLIENT
dnl Test for SDL and needed libraries for gui-sdl

AC_DEFUN(FC_SDL_CLIENT,
[
  if test "$client" = sdl || test "$client" = yes ; then
    AM_PATH_SDL([1.1.4], [sdl_found="yes"], [sdl_found="no"])
    if test "$sdl_found" = yes; then
      LIBS="$SDL_LIBS"
      AC_CHECK_LIB([SDL_image], [IMG_Load],
                   [sdl_image_found="yes"], [sdl_image_found="no"])
      if test "$sdl_image_found" = "yes"; then
        AC_CHECK_HEADER([SDL/SDL_image.h],
                        [sdl_image_h_found="yes"], [sdl_image_h_found="no"])
        if test "$sdl_image_h_found" = yes; then
          AC_CHECK_LIB([SDL_ttf], [TTF_OpenFont],
                       [sdl_ttf_found="yes"], [sdl_ttf_found="no"])
          if test "$sdl_ttf_found" = yes; then
            AC_CHECK_HEADER([SDL/SDL_ttf.h],
                            [sdl_ttf_h_found="yes"], [sdl_ttf_h_found="no"])
            if test "$sdl_ttf_h_found" = yes; then
              LIBS=""
              CLIENT_CFLAGS="$SDL_CFLAGS"
              CLIENT_LIBS="$SDL_LIBS -lSDL_image -lSDL_ttf"
              found_client=yes
            elif test "$client" = "sdl"; then
              AC_MSG_ERROR([specified client 'sdl' not configurable 
(SDL_ttf-devel is needed)])
            fi
          elif test "$client" = "sdl"; then
            AC_MSG_ERROR([specified client 'sdl' not configurable (SDL_ttf is 
needed)])
          fi
        elif test "$client" = "sdl"; then
            AC_MSG_ERROR([specified client 'sdl' not configurable 
(SDL_image-devel is needed)])
        fi
      elif test "$client" = "sdl"; then
        AC_MSG_ERROR([specified client 'sdl' not configurable (SDL_image is 
needed)])
      fi
    fi

    if test "$found_client" = yes; then
      client=sdl
    elif test "$client" = "sdl"; then
      AC_MSG_ERROR([specified client 'sdl' not configurable (SDL >= 1.1.4 is 
needed)])
    fi
  fi
])

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