[Freeciv-Dev] Re: (PR#8635) [PATCH] Correct FREECIV_PATH for binaries fo
[Top] [All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: |
undisclosed-recipients: ; |
Subject: |
[Freeciv-Dev] Re: (PR#8635) [PATCH] Correct FREECIV_PATH for binaries form civ & ser scripts |
From: |
"Marko Lindqvist" <marko.lindqvist@xxxxxxxxxxx> |
Date: |
Mon, 3 May 2004 12:08:25 -0700 |
Reply-to: |
rt@xxxxxxxxxxx |
<URL: http://rt.freeciv.org/Ticket/Display.html?id=8635 >
Jason Short wrote:
> Except in my tests IIRC this didn't work, and it did work as it is now.
Umh, I got opposite results!
And remembering that you had no 'export', your both tests should have
given same result, assuming FREECIV_PATH was preset same way and you run
programs from same directory (and workdir/homedir contents were
consistent so data was consistently either found or not found under them)
So, attached is patch which works for me. And even if it's just a
couple of lines, I can list several things it fixes (and it took over
dozen iterations to make this patch so far...)
1. export FREECIV_PATH to binaries
2. Fix setting of FREECIV_PATH when civ/ser is not built to sourcedir
but to separate builddir and it was run from some other directory.
3. Make user defined FREECIV_PATH components higher priority than path
to sourcedir. This means we have to check if FREECIV_PATH is alredy set
to non-empty value so we don't accidentally start generated FREECIV_PATH
with ':' character.
4. Automatically rebuild civ and ser scripts when ever respective .in
changes. I finally decided that putting it under SCRIPTS was right(tm)
thing to do.
5. Do not distribute generated civ & ser. They have path (from
builddir) to sourcedir hardcoded into them and as such they make no
sense outside their original builddir.
- Caz
diff -Nurd -X freeciv/diff_ignore freeciv/Makefile.am freeciv/Makefile.am
--- freeciv/Makefile.am 2004-05-03 18:39:47.609375000 +0300
+++ freeciv/Makefile.am 2004-05-03 20:44:44.000000000 +0300
@@ -21,14 +21,16 @@
SUBDIRS= $(DSUBDIRS) intl utility common tests $(SSUBDIRS) $(CSUBDIRS)
po doc
+nodist_noinst_SCRIPTS= \
+ civ \
+ ser
+
EXTRA_DIST= acconfig.old \
autogen.sh \
- civ \
config.mac.h \
configure.ac \
configure.in \
diff_ignore \
- ser \
amiga/Freeciv.start \
amiga/amigaclient.c \
amiga/amigaserver.c \
diff -Nurd -X freeciv/diff_ignore freeciv/civ.in freeciv/civ.in
--- freeciv/civ.in 2004-03-27 20:44:16.000000000 +0200
+++ freeciv/civ.in 2004-05-03 21:21:00.515625000 +0300
@@ -14,7 +14,11 @@
#
#***********************************************************************/
DIR=`dirname $0`
-FREECIV_PATH="@top_srcdir@/data:$FREECIV_PATH"
+if [ "x$FREECIV_PATH" == "x" ] ; then
+ export FREECIV_PATH="$(cd $DIR ; cd @top_srcdir@/data ; pwd)"
+else
+ export FREECIV_PATH="$FREECIV_PATH:$(cd $DIR ; cd @top_srcdir@/data ; pwd)"
+fi
[ -x $DIR/client/civclient ] && EXE=$DIR/client/civclient
[ -x $DIR/civclient ] && EXE=$DIR/civclient
diff -Nurd -X freeciv/diff_ignore freeciv/ser.in freeciv/ser.in
--- freeciv/ser.in 2004-03-27 20:44:16.000000000 +0200
+++ freeciv/ser.in 2004-05-03 21:21:22.984375000 +0300
@@ -14,7 +14,11 @@
#
#***********************************************************************/
DIR=`dirname $0`
-FREECIV_PATH="@top_srcdir@/data:$FREECIV_PATH"
+if [ "x$FREECIV_PATH" == "x" ] ; then
+ export FREECIV_PATH="$(cd $DIR ; cd @top_srcdir@/data ; pwd)"
+else
+ export FREECIV_PATH="$FREECIV_PATH:$(cd $DIR ; cd @top_srcdir@/data ; pwd)"
+fi
[ -x $DIR/server/civserver ] && EXE=$DIR/server/civserver
[ -x $DIR/civserver ] && EXE=$DIR/civserver
|
|