Complete.Org: Mailing Lists: Archives: freeciv-dev: October 2004:
[Freeciv-Dev] Re: (PR#10738) Installed freeciv-2.0.0-beta2 doesn't start
Home

[Freeciv-Dev] Re: (PR#10738) Installed freeciv-2.0.0-beta2 doesn't start

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: markuslaire@xxxxxxxxxx
Subject: [Freeciv-Dev] Re: (PR#10738) Installed freeciv-2.0.0-beta2 doesn't start or load games
From: "Jason Short" <jdorje@xxxxxxxxxxxxxxxxxxxxx>
Date: Wed, 27 Oct 2004 19:16:25 -0700
Reply-to: rt@xxxxxxxxxxx

<URL: http://rt.freeciv.org/Ticket/Display.html?id=10738 >

Here is a better patch (for the development version only).

A new environment variable FREECIV_SERVER_BINARY is used.  If set, this 
specifies the path to the binary.  If unset the installed binary is used.

This allows running the client outside of the builddir using the ./civ 
script.  It also means you won't use the installed server with an 
uninstalled client, or the uninstalled server with an installed client, 
no matter what directory you run the client out of.

It is consistent with the use of environment variables elsewhere in the 
civ script.

jason


? data/flags/svg
Index: configure.ac
===================================================================
RCS file: /home/freeciv/CVS/freeciv/configure.ac,v
retrieving revision 1.85
diff -u -r1.85 configure.ac
--- configure.ac        22 Oct 2004 15:45:42 -0000      1.85
+++ configure.ac        28 Oct 2004 02:14:03 -0000
@@ -307,11 +307,14 @@
 dnl note this has to match the path installed by po/Makefile
 if test x"$MINGW32" != "xyes"; then
   FC_EXPAND_DIR(LOCALEDIR, "$datadir/locale")
-  AC_DEFINE_UNQUOTED(LOCALEDIR, "$LOCALEDIR", [Locale directory])
 else
   FC_EXPAND_DIR(LOCALEDIR, './share/locale')
-  AC_DEFINE_UNQUOTED(LOCALEDIR, "$LOCALEDIR", [Locale directory])
 fi  
+AC_DEFINE_UNQUOTED(LOCALEDIR, "$LOCALEDIR", [Locale directory])
+
+FC_EXPAND_DIR(BINDIR, "$bindir")
+AC_DEFINE_UNQUOTED([BINDIR], ["$BINDIR"],
+                  [The location where binaries will be installed])
 
 dnl Check for zlib (needed for libpng)
 AC_CHECK_LIB(z, gzgets, , 
Index: bootstrap/civ.in
===================================================================
RCS file: /home/freeciv/CVS/freeciv/bootstrap/civ.in,v
retrieving revision 1.1
diff -u -r1.1 civ.in
--- bootstrap/civ.in    21 Sep 2004 00:58:58 -0000      1.1
+++ bootstrap/civ.in    28 Oct 2004 02:14:03 -0000
@@ -25,6 +25,8 @@
 fi
 export FREECIV_PATH="$FREECIV_PATH:$BUILDDATA:$SRCDATA"
 
+export FREECIV_SERVER_BINARY="$BUILDDIR/ser"
+
 [ -x $BUILDDIR/client/civclient ] && EXE=$BUILDDIR/client/civclient
 [ -x $BUILDDIR/civclient ] && EXE=$BUILDDIR/civclient
 
Index: client/connectdlg_common.c
===================================================================
RCS file: /home/freeciv/CVS/freeciv/client/connectdlg_common.c,v
retrieving revision 1.26
diff -u -r1.26 connectdlg_common.c
--- client/connectdlg_common.c  24 Oct 2004 23:18:07 -0000      1.26
+++ client/connectdlg_common.c  28 Oct 2004 02:14:03 -0000
@@ -254,10 +254,16 @@
       dup2(fd, 0);
     }
 
-    /* these won't return on success */ 
-    execvp("./ser", argv);
-    execvp("./server/civserver", argv);
-    execvp("civserver", argv);
+    {
+      char *server = getenv("FREECIV_SERVER_BINARY");
+
+      if (!server || server[0] == '\0') {
+       server = BINDIR "/civserver";
+      }
+
+      /* this won't return on success */
+      execvp(server, argv);
+    }
     
     /* This line is only reached if civserver cannot be started, 
      * so we kill the forked process.

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