diff -ru freeciv/Makefile.noimake freeciv-gigs/Makefile.noimake
--- freeciv/Makefile.noimake	Mon Mar  9 14:25:47 1998
+++ freeciv-gigs/Makefile.noimake	Sat May 30 14:23:29 1998
@@ -30,9 +30,15 @@
 #XPM_INCLUDE_DIR=-I/users/pjunold/xpm-3.4i/lib
 #XPM_LIB_DIR=-L/users/pjunold/xpm-3.4i/lib
 
+#
+# Should we be using GIGS, <URL:http://www.hungry.com/~pere/gigs/>?
+#
+GIGSC=-I/store/include -DHAVE_GIGS
+GIGSL=-L/store/lib -lgigs
+
 X11_INCLUDE=-I/usr/X11R6/include
-CLI_INCLUDE=-Iclient -Icommon -Iai -Iserver
-SER_INCLUDE=-Iserver -Icommon -Iai
+CLI_INCLUDE=-Iclient -Icommon -Iai -Iserver $(GIGSC)
+SER_INCLUDE=-Iserver -Icommon -Iai $(GIGSC)
 XLIB_DIR=/usr/X11R6/lib
 
 
@@ -41,7 +47,7 @@
 #
 
 # linux
-CFLAGS=-c -g  -Wall $(CLI_INCLUDE) $(X11_INCLUDE) $(XPM_INCLUDE_DIR)
+CFLAGS=-c -g  -Wall $(CLI_INCLUDE) $(X11_INCLUDE) $(XPM_INCLUDE_DIR) $(GIGSC)
 #irix cc compiler
 #CFLAGS=-c -fullwarn -j -woff 835 -g -ansi -I$(INCLUDE_DIR) $(XPM_INCLUDE_DIR)
 #CFLAGS=-c -fullwarn -j -g -ansi -I$(INCLUDE_DIR) $(XPM_INCLUDE_DIR)
@@ -53,7 +59,7 @@
 #
 
 # linux/irix
-CLFLAGS=-g -L$(XLIB_DIR) $(XPM_LIB_DIR) -lXpm -lXmu -lXaw -lXt -lX11
+CLFLAGS=-g -L$(XLIB_DIR) $(XPM_LIB_DIR) -lXpm -lXmu -lXaw -lXt -lX11 $(GIGSL)
 # sunos
 #CLFLAGS=-L/usr/X11/lib $(XPM_LIB_DIR) -lXpm -lXaw -lXt -lXmu -lX11 -lsocket
 #hpux
@@ -64,7 +70,7 @@
 #
 
 # linux/irix
-SLFLAGS=
+SLFLAGS=$(GIGSL)
 # sunos
 #SLFLAGS=-lsocket
 
diff -ru freeciv/client/Freeciv.h freeciv-gigs/client/Freeciv.h
--- freeciv/client/Freeciv.h	Sun Apr 26 16:41:25 1998
+++ freeciv-gigs/client/Freeciv.h	Sat May 30 14:31:18 1998
@@ -40,6 +40,11 @@
 "*connectdialog.*.cconnectc.foreground: white",
 "*connectdialog.*.cquitc.background: blue",
 "*connectdialog.*.cquitc.foreground: white",
+"*connectdialog.*.cqueryc.label: Query GIGS",
+"*connectdialog.*.cqueryc.fromVert: cportl",
+"*connectdialog.*.cqueryc.fromHoriz: cquitc",
+"*connectdialog.*.cqueryc.background: blue",
+"*connectdialog.*.cqueryc.foreground: white",
 "*intelpopup.title:",
 "*intelform.background:                lightblue",
 "*inteltitlelabel.background:          grey",
diff -ru freeciv/client/connectdlg.c freeciv-gigs/client/connectdlg.c
--- freeciv/client/connectdlg.c	Mon Mar  9 14:25:47 1998
+++ freeciv-gigs/client/connectdlg.c	Sat May 30 14:01:59 1998
@@ -10,6 +10,7 @@
 #include <X11/Xaw/Command.h>
 #include <X11/Xaw/AsciiText.h>  
 #include <xstuff.h>
+#include <shared.h>
 #include <clinet.h>
 #include <chatline.h>
 
@@ -27,6 +28,26 @@
 				XtPointer call_data);
 void quit_callback(Widget w, XtPointer client_data, XtPointer call_data);
 void connect_callback(Widget w, XtPointer client_data, XtPointer call_data);
+#ifdef HAVE_GIGS
+#include <gigs.h>
+Widget queryw;
+void query_callback(Widget w, XtPointer client_data, XtPointer call_data) 
+{
+  char *server = NULL;
+  int portnum;
+
+  /* Query gigs */
+  server = GIGS_chooseServer(FREECIV_NAME, &portnum, NULL, GIGS_chooser_X11);
+  if (NULL != server) {
+    char portbuf[10];
+    XtVaSetValues(ihost, XtNstring, server, NULL);
+    sprintf(portbuf, "%d", portnum);
+    XtVaSetValues(iport, XtNstring, portbuf, NULL);
+  } else {
+    printf("No %s server found using GIGS.\n", FREECIV_NAME);
+  }
+}
+#endif
 
 
 
@@ -65,6 +86,10 @@
 
   XtAddCallback(connw, XtNcallback, connect_callback, NULL);
   XtAddCallback(quitw, XtNcallback, quit_callback, NULL);
+#ifdef HAVE_GIGS
+  queryw=XtVaCreateManagedWidget("cqueryc", commandWidgetClass, form, NULL); 
+  XtAddCallback(queryw, XtNcallback, query_callback, NULL);
+#endif
 
   XtPopup(shell, XtGrabNone);
   xaw_set_relative_position(toplevel, shell, 50, 50);
diff -ru freeciv/common/shared.h freeciv-gigs/common/shared.h
--- freeciv/common/shared.h	Thu Apr 23 20:41:48 1998
+++ freeciv-gigs/common/shared.h	Sat May 30 13:35:33 1998
@@ -20,7 +20,8 @@
 #define PATCH_VERSION  4
 #define VERSION_STRING "1.5.4"
 
-#define FREECIV_NAME_VERSION "Freeciv version "##VERSION_STRING
+#define FREECIV_NAME "Freeciv"
+#define FREECIV_NAME_VERSION FREECIV_NAME ## " version "##VERSION_STRING
 
 #define CITY_NAMES_FONT "10x20"
 
diff -ru freeciv/data/Freeciv freeciv-gigs/data/Freeciv
--- freeciv/data/Freeciv	Sun Apr 26 16:41:24 1998
+++ freeciv-gigs/data/Freeciv	Sat May 30 14:30:31 1998
@@ -56,6 +56,11 @@
 *connectdialog.*.cquitc.background: blue
 *connectdialog.*.cquitc.foreground: white
 
+*connectdialog.*.cqueryc.label: Query GIGS
+*connectdialog.*.cqueryc.fromVert: cportl
+*connectdialog.*.cqueryc.fromHoriz: cquitc
+*connectdialog.*.cqueryc.background: blue
+*connectdialog.*.cqueryc.foreground: white
 
 
 !
diff -ru freeciv/server/civserver.c freeciv-gigs/server/civserver.c
--- freeciv/server/civserver.c	Mon Mar  9 14:25:48 1998
+++ freeciv-gigs/server/civserver.c	Sat May 30 14:12:37 1998
@@ -39,6 +39,9 @@
 #include <packets.h>
 #include <stdinhand.h>
 #include <meta.h>
+#ifdef HAVE_GIGS
+#include <gigs.h>
+#endif
 
 void show_ending();
 void end_game();
@@ -189,11 +192,20 @@
   }
 
   send_server_info_to_metaserver(1);
+#ifdef HAVE_GIGS
+  GIGS_init();
+  GIGS_notifySimple(FREECIV_NAME, port, VERSION_STRING, -1);
+#endif
   
   /* accept new players, wait for serverop to start..*/
   server_state=PRE_GAME_STATE;
   while(server_state==PRE_GAME_STATE)
-    sniff_packets();
+    {
+#ifdef HAVE_GIGS
+      GIGS_notifySimple(FREECIV_NAME, port, VERSION_STRING, game.nplayers);
+#endif
+      sniff_packets();
+    }
 
   send_server_info_to_metaserver(1);
   
@@ -264,11 +276,17 @@
     }
     if (game.year>game.end_year || is_game_over()) 
       server_state=GAME_OVER_STATE;
+#ifdef HAVE_GIGS
+    GIGS_notifySimple(FREECIV_NAME, port, VERSION_STRING, game.nplayers);
+#endif
   }
 
   show_ending();
   
   notify_player(0, "Game: The game is over..");
+#ifdef HAVE_GIGS
+  GIGS_serverStopped(FREECIV_NAME, port, VERSION_STRING);
+#endif
 
   while(server_state==GAME_OVER_STATE) {
     force_end_of_sniff=0;
diff -ru freeciv/server/stdinhand.c freeciv-gigs/server/stdinhand.c
--- freeciv/server/stdinhand.c	Mon Mar  9 14:25:48 1998
+++ freeciv-gigs/server/stdinhand.c	Sat May 30 14:19:30 1998
@@ -25,6 +25,11 @@
 #include <mapgen.h>
 #include <registry.h>
 #include <plrhand.h>
+#ifdef HAVE_GIGS
+#include <unistd.h> /* for sleep() */
+#include <gigs.h>
+extern int port; /* from civserver.c */
+#endif
 extern char metaserver_info_line[256];
 
 void cut_player_connection(char *playername);
@@ -444,6 +449,10 @@
     send_packet_generic_message(game.players[i].conn, PACKET_SERVER_SHUTDOWN,
 				&gen_packet);
   close_connections_and_socket();
+#ifdef HAVE_GIGS
+  GIGS_serverStopped(FREECIV_NAME, port, VERSION_STRING);
+  sleep(1);
+#endif
   
   exit(1);
 }
