tWin32 build should now use GLib2, detected properly via. pkg-config. - vaccinewars - be a doctor and try to vaccinate the world
 (HTM) git clone git://src.adamsgaard.dk/vaccinewars
 (DIR) Log
 (DIR) Files
 (DIR) Refs
 (DIR) README
 (DIR) LICENSE
       ---
 (DIR) commit 43b86358f63cea3b9543c0f4a88cfde890bf7014
 (DIR) parent ca9610ae05202660682458b8ba716860b8d5f7c1
 (HTM) Author: Ben Webb <ben@salilab.org>
       Date:   Mon, 19 Aug 2002 13:02:15 +0000
       
       Win32 build should now use GLib2, detected properly via. pkg-config.
       
       
       Diffstat:
         M TODO                                |       1 +
         M configure.in                        |       9 ++++-----
         M src/gtkport/Makefile.am             |       2 +-
         M src/gui_client/Makefile.am          |       2 +-
         M src/gui_client/gtk_client.c         |       6 +++---
         M src/winmain.c                       |       4 ----
       
       6 files changed, 10 insertions(+), 14 deletions(-)
       ---
 (DIR) diff --git a/TODO b/TODO
       t@@ -1,3 +1,4 @@
       +- Read mangled "Windows UTF-8" config files properly
        - Option to let the cops search/fine you rather than shooting at them
        - Limit rate of server connections to combat DOS attacks / players trying
          to get a good starting day?
 (DIR) diff --git a/configure.in b/configure.in
       t@@ -72,10 +72,6 @@ if test "$CYGWIN" = "yes" ; then
           AC_MSG_RESULT([Configuring for native Win32 binary under Cygwin])
           AC_DEFINE(CYGWIN, 1, [Define if building under the Cygwin environment])
        
       -   dnl We NEED GLib, but glib-config is not usually installed under Cygwin
       -   dnl even when glib-1.3.dll is - so we assume GLib is in place; the worst
       -   dnl that can happen is that "make" fails later on.
       -
           dnl Libraries and flags
           dnl N.B. -mno-cygwin is included in CPPFLAGS so the right headers
           dnl are detected (in /usr/include/mingw/ rather than /usr/include)
       t@@ -83,7 +79,10 @@ if test "$CYGWIN" = "yes" ; then
           CFLAGS="$CFLAGS -mwindows -fnative-struct"
           CPPFLAGS="$CPPFLAGS -mno-cygwin"
           LIBS="$LIBS -lwsock32 -lcomctl32 -lmpr"
       -   LDFLAGS="$LDFLAGS -mno-cygwin -lglib-1.3"
       +   LDFLAGS="$LDFLAGS -mno-cygwin"
       +
       +   AM_PATH_GLIB_2_0(2.0.0, , [AC_MSG_ERROR(GLib is required)])
       +   AC_DEFINE(HAVE_GLIB2, 1, [Do we have GLIB 2.0 ?])
        
           dnl We need to compile and then link in the Windows resources
           WNDRES="dopewars.res"
 (DIR) diff --git a/src/gtkport/Makefile.am b/src/gtkport/Makefile.am
       t@@ -1,4 +1,4 @@
        noinst_LIBRARIES = libgtkport.a
        libgtkport_a_SOURCES = gtkport.c gtkport.h clist.c clist.h gtkenums.h
       -INCLUDES   = -I../../intl -I${srcdir} -I${srcdir}/.. -I../.. @GTK_CFLAGS@
       +INCLUDES   = -I../../intl -I${srcdir} -I${srcdir}/.. -I../.. @GTK_CFLAGS@ @GLIB_CFLAGS@
        DEFS       = @DEFS@
 (DIR) diff --git a/src/gui_client/Makefile.am b/src/gui_client/Makefile.am
       t@@ -2,5 +2,5 @@ noinst_LIBRARIES = libguiclient.a
        libguiclient_a_SOURCES = gtk_client.c gtk_client.h \
                                 optdialog.c optdialog.h \
                                 newgamedia.c newgamedia.h dopewars-pill.xpm
       -INCLUDES   = -I../../intl -I${srcdir} -I${srcdir}/.. -I../.. @GTK_CFLAGS@
       +INCLUDES   = -I../../intl -I${srcdir} -I${srcdir}/.. -I../.. @GTK_CFLAGS@ @GLIB_CFLAGS@
        DEFS       = @DEFS@
 (DIR) diff --git a/src/gui_client/gtk_client.c b/src/gui_client/gtk_client.c
       t@@ -206,7 +206,7 @@ GtkWidget *my_hbbox_new(void)
        {
          GtkWidget *hbbox = gtk_hbutton_box_new();
        
       -#ifdef HAVE_GLIB2
       +#if HAVE_GLIB2 && !CYGWIN
          gtk_box_set_spacing(GTK_BOX(hbbox), 8);
        #endif
          return hbbox;
       t@@ -2144,7 +2144,7 @@ static void SetIcon(GtkWidget *window, gchar **xpmdata)
        
        static void make_tags(GtkTextView *textview)
        {
       -#ifdef HAVE_GLIB2
       +#if HAVE_GLIB2 && !CYGWIN
          GtkTextBuffer *buffer = gtk_text_view_get_buffer(textview);
        
          gtk_text_buffer_create_tag(buffer, "jet", "foreground", "blue", NULL);
       t@@ -2179,7 +2179,7 @@ gboolean GtkLoop(int *argc, char **argv[],
            gtk_init(argc, argv);
        #endif
        
       -#ifdef HAVE_GLIB2
       +#if HAVE_GLIB2 && !CYGWIN
          /* GTK+2 expects all strings to be UTF-8, so we force gettext to return
           * all translations in this encoding here. */
          bind_textdomain_codeset(PACKAGE, "UTF-8");
 (DIR) diff --git a/src/winmain.c b/src/winmain.c
       t@@ -267,11 +267,7 @@ int APIENTRY WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance,
                    "# informative messages resulting from configuration\n"
                    "# file processing and the like.\n\n"));
        
       -#ifdef HAVE_GLIB2
       -  split = g_strsplit(lpszCmdParam, " ", 1);
       -#else
          split = g_strsplit(lpszCmdParam, " ", 0);
       -#endif
          argc = 0;
          while (split[argc] && split[argc][0])
            argc++;