Complete.Org: Mailing Lists: Archives: freeciv-dev: March 2004:
[Freeciv-Dev] (PR#8164) building out of a builddir: generate_packets.py
Home

[Freeciv-Dev] (PR#8164) building out of a builddir: generate_packets.py

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: undisclosed-recipients: ;
Subject: [Freeciv-Dev] (PR#8164) building out of a builddir: generate_packets.py
From: "Jason Short" <jdorje@xxxxxxxxxxxxxxxxxxxxx>
Date: Thu, 25 Mar 2004 14:51:33 -0800
Reply-to: rt@xxxxxxxxxxx

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

Here's an updated version of the patch.  I changed generate_packets.py
and its caller as Raimar suggested.

packets_gen.h and packhand_gen.h are only included from one file each. 
However hand_gen.h is included from many files.  Should these be unified
so that it's included from just one header?  sernet.h and civserver.h
are the only two options, and neither is particularly good.

jason

? Womoks
? client/packhand_gen.[ch]
? common/packets_gen.[ch]
? common/stAdu1MH
? server/hand_gen.[ch]
Index: ai/Makefile.am
===================================================================
RCS file: /home/freeciv/CVS/freeciv/ai/Makefile.am,v
retrieving revision 1.15
diff -u -r1.15 Makefile.am
--- ai/Makefile.am      21 Sep 2003 14:02:14 -0000      1.15
+++ ai/Makefile.am      25 Mar 2004 22:14:17 -0000
@@ -2,7 +2,7 @@
 
 noinst_LIBRARIES = libcivai.a
 
-INCLUDES = -I$(srcdir)/../common -I$(srcdir)/../server -I../intl 
-I$(top_srcdir)/common/aicore
+INCLUDES = -I../common -I../server -I$(srcdir)/../common -I$(srcdir)/../server 
-I../intl -I$(top_srcdir)/common/aicore
 
 ## Above, note -I../intl instead of -I$(top_srdir/intl) is deliberate.
 
Index: client/Makefile.am
===================================================================
RCS file: /home/freeciv/CVS/freeciv/client/Makefile.am,v
retrieving revision 1.53
diff -u -r1.53 Makefile.am
--- client/Makefile.am  6 Dec 2003 19:23:50 -0000       1.53
+++ client/Makefile.am  25 Mar 2004 22:14:18 -0000
@@ -129,7 +129,7 @@
 
 bin_PROGRAMS = civclient
 
-INCLUDES = -I$(srcdir)/include -I$(top_srcdir)/common 
-I$(top_srcdir)/common/aicore -I../intl -I$(srcdir)/agents @SOUND_CFLAGS@
+INCLUDES = -I../common -I$(srcdir)/include -I$(top_srcdir)/common 
-I$(top_srcdir)/common/aicore -I../intl -I$(srcdir)/agents @SOUND_CFLAGS@
 
 ## Above, note -I../intl instead of -I$(top_srdir/intl) is deliberate.
 
Index: client/packhand.h
===================================================================
RCS file: /home/freeciv/CVS/freeciv/client/packhand.h,v
retrieving revision 1.37
diff -u -r1.37 packhand.h
--- client/packhand.h   28 Nov 2003 17:37:19 -0000      1.37
+++ client/packhand.h   25 Mar 2004 22:14:18 -0000
@@ -15,7 +15,7 @@
 
 #include "map.h"
 
-#include "packhand_gen.h"
+#include <packhand_gen.h>
 
 void notify_about_incoming_packet(struct connection *pc,
                                   int packet_type, int size);
Index: client/agents/Makefile.am
===================================================================
RCS file: /home/freeciv/CVS/freeciv/client/agents/Makefile.am,v
retrieving revision 1.2
diff -u -r1.2 Makefile.am
--- client/agents/Makefile.am   21 Dec 2002 14:19:05 -0000      1.2
+++ client/agents/Makefile.am   25 Mar 2004 22:14:18 -0000
@@ -2,7 +2,7 @@
 
 noinst_LIBRARIES = libagents.a
 
-INCLUDES = -I. -I$(srcdir)/.. -I$(top_srcdir)/common/aicore 
-I$(srcdir)/../include -I$(top_srcdir)/common -I../../intl 
-I$(srcdir)/../gui-gtk @CLIENT_CFLAGS@
+INCLUDES = -I../../common -I.. -I$(srcdir)/.. -I$(top_srcdir)/common/aicore 
-I$(srcdir)/../include -I$(top_srcdir)/common -I../../intl 
-I$(srcdir)/../gui-gtk @CLIENT_CFLAGS@
 
 libagents_a_SOURCES =          \
        agents.c                \
Index: client/gui-gtk/Makefile.am
===================================================================
RCS file: /home/freeciv/CVS/freeciv/client/gui-gtk/Makefile.am,v
retrieving revision 1.17
diff -u -r1.17 Makefile.am
--- client/gui-gtk/Makefile.am  23 Feb 2003 14:11:14 -0000      1.17
+++ client/gui-gtk/Makefile.am  25 Mar 2004 22:14:18 -0000
@@ -1,7 +1,7 @@
 ## Process this file with automake to produce Makefile.in
 
 noinst_LIBRARIES = libguiclient.a
-INCLUDES = -I. -I$(srcdir)/.. -I$(srcdir)/../include -I$(top_srcdir)/common 
-I$(top_srcdir)/common/aicore -I../../intl -I$(srcdir)/../agents @CLIENT_CFLAGS@
+INCLUDES = -I.. -I../../common -I$(srcdir)/.. -I$(srcdir)/../include 
-I$(top_srcdir)/common -I$(top_srcdir)/common/aicore -I../../intl 
-I$(srcdir)/../agents @CLIENT_CFLAGS@
 
 ## Above, note -I../../intl instead of -I$(top_srdir/intl) is deliberate.
 # The INCLUDES "-I." is so resources.c includes the locally generated 
Index: client/gui-gtk-2.0/Makefile.am
===================================================================
RCS file: /home/freeciv/CVS/freeciv/client/gui-gtk-2.0/Makefile.am,v
retrieving revision 1.4
diff -u -r1.4 Makefile.am
--- client/gui-gtk-2.0/Makefile.am      23 Feb 2003 14:11:14 -0000      1.4
+++ client/gui-gtk-2.0/Makefile.am      25 Mar 2004 22:14:18 -0000
@@ -1,7 +1,7 @@
 ## Process this file with automake to produce Makefile.in
 
 noinst_LIBRARIES = libguiclient.a
-INCLUDES = -I. -I$(srcdir)/.. -I$(srcdir)/../include -I$(top_srcdir)/common 
-I$(top_srcdir)/common/aicore -I../../intl -I$(srcdir)/../agents @CLIENT_CFLAGS@
+INCLUDES = -I.. -I../../common -I$(srcdir)/.. -I$(srcdir)/../include 
-I$(top_srcdir)/common -I$(top_srcdir)/common/aicore -I../../intl 
-I$(srcdir)/../agents @CLIENT_CFLAGS@
 
 ## Above, note -I../../intl instead of -I$(top_srdir/intl) is deliberate.
 # The INCLUDES "-I." is so resources.c includes the locally generated 
Index: client/gui-sdl/Makefile.am
===================================================================
RCS file: /home/freeciv/CVS/freeciv/client/gui-sdl/Makefile.am,v
retrieving revision 1.6
diff -u -r1.6 Makefile.am
--- client/gui-sdl/Makefile.am  8 May 2003 03:24:44 -0000       1.6
+++ client/gui-sdl/Makefile.am  25 Mar 2004 22:14:18 -0000
@@ -1,7 +1,7 @@
 ## Process this file with automake to produce Makefile.in
 
 noinst_LIBRARIES = libguiclient.a
-INCLUDES = -I. -I$(srcdir)/.. -I$(srcdir)/../include -I$(top_srcdir)/common 
-I$(top_srcdir)/common/aicore -I../../intl -I$(srcdir)/../agents @CLIENT_CFLAGS@
+INCLUDES = -I.. -I../../common -I$(srcdir)/.. -I$(srcdir)/../include 
-I$(top_srcdir)/common -I$(top_srcdir)/common/aicore -I../../intl 
-I$(srcdir)/../agents @CLIENT_CFLAGS@
 
 ## Above, note -I../../intl instead of -I$(top_srdir/intl) is deliberate.
 # The INCLUDES "-I." is so resources.c includes the locally generated 
Index: client/gui-stub/Makefile.am
===================================================================
RCS file: /home/freeciv/CVS/freeciv/client/gui-stub/Makefile.am,v
retrieving revision 1.3
diff -u -r1.3 Makefile.am
--- client/gui-stub/Makefile.am 23 Feb 2003 14:11:14 -0000      1.3
+++ client/gui-stub/Makefile.am 25 Mar 2004 22:14:18 -0000
@@ -1,7 +1,7 @@
 ## Process this file with automake to produce Makefile.in
 
 noinst_LIBRARIES = libguiclient.a
-INCLUDES = -I. -I$(srcdir)/.. -I$(srcdir)/../include -I$(top_srcdir)/common 
-I../../intl @CLIENT_CFLAGS@
+INCLUDES = -I.. -I../../common -I$(srcdir)/.. -I$(srcdir)/../include 
-I$(top_srcdir)/common -I../../intl @CLIENT_CFLAGS@
 
 ## Above, note -I../../intl instead of -I$(top_srdir)/intl is deliberate.
 
Index: client/gui-win32/Makefile.am
===================================================================
RCS file: /home/freeciv/CVS/freeciv/client/gui-win32/Makefile.am,v
retrieving revision 1.8
diff -u -r1.8 Makefile.am
--- client/gui-win32/Makefile.am        9 Nov 2003 16:45:01 -0000       1.8
+++ client/gui-win32/Makefile.am        25 Mar 2004 22:14:18 -0000
@@ -2,7 +2,7 @@
 
 noinst_LIBRARIES = libguiclient.a
 
-INCLUDES = -I. -I$(srcdir)/.. -I$(srcdir)/../include 
-I$(top_srcdir)/common/aicore -I$(top_srcdir)/common -I../../intl 
@CLIENT_CFLAGS@
+INCLUDES = -I.. -I../../common -I$(srcdir)/.. -I$(srcdir)/../include 
-I$(top_srcdir)/common/aicore -I$(top_srcdir)/common -I../../intl 
@CLIENT_CFLAGS@
 
 ## Above, note -I../../intl instead of -I$(top_srdir)/intl is deliberate.
 
Index: client/gui-xaw/Makefile.am
===================================================================
RCS file: /home/freeciv/CVS/freeciv/client/gui-xaw/Makefile.am,v
retrieving revision 1.14
diff -u -r1.14 Makefile.am
--- client/gui-xaw/Makefile.am  28 Jul 2003 01:11:48 -0000      1.14
+++ client/gui-xaw/Makefile.am  25 Mar 2004 22:14:18 -0000
@@ -1,7 +1,7 @@
 ## Process this file with automake to produce Makefile.in
 
 noinst_LIBRARIES = libguiclient.a
-INCLUDES = -I. -I$(srcdir)/.. -I$(srcdir)/../include -I$(top_srcdir)/common 
-I../../intl -I$(top_srcdir)/common/aicore -I../../intl -I$(srcdir)/../agents 
@CLIENT_CFLAGS@
+INCLUDES = -I.. -I../../common -I$(srcdir)/.. -I$(srcdir)/../include 
-I$(top_srcdir)/common -I../../intl -I$(top_srcdir)/common/aicore -I../../intl 
-I$(srcdir)/../agents @CLIENT_CFLAGS@
 
 ## Above, note -I../../intl instead of -I$(top_srdir/intl) is deliberate.
 # The INCLUDES "-I." is so resources.c includes the locally generated 
Index: common/Makefile.am
===================================================================
RCS file: /home/freeciv/CVS/freeciv/common/Makefile.am,v
retrieving revision 1.49
diff -u -r1.49 Makefile.am
--- common/Makefile.am  13 Feb 2004 07:57:58 -0000      1.49
+++ common/Makefile.am  25 Mar 2004 22:14:18 -0000
@@ -99,4 +99,4 @@
 
 BUILT_SOURCES = packets_gen.c packets_gen.h
 packets_gen.h packets_gen.c: packets.def generate_packets.py
-       ./generate_packets.py
+       $(top_srcdir)/common/generate_packets.py 
$(top_srcdir)/common/packets.def
Index: common/generate_packets.py
===================================================================
RCS file: /home/freeciv/CVS/freeciv/common/generate_packets.py,v
retrieving revision 1.8
diff -u -r1.8 generate_packets.py
--- common/generate_packets.py  19 Mar 2004 18:47:22 -0000      1.8
+++ common/generate_packets.py  25 Mar 2004 22:14:18 -0000
@@ -1315,7 +1315,10 @@
 # various files.
 def main():
     ### parsing input
-    input_name="packets.def"
+    if len(sys.argv) < 2:
+        input_name="packets.def"
+    else:
+        input_name=sys.argv[1]
     content=open(input_name).read()
     content=strip_c_comment(content)
     lines=string.split(content,"\n")
@@ -1508,7 +1511,7 @@
 
 #include "packets.h"
 
-#include "hand_gen.h"
+#include <hand_gen.h>
     
 bool server_handle_packet(enum packet_type type, void *packet,
                          struct player *pplayer, struct connection *pconn)
@@ -1559,7 +1562,7 @@
 
 #include "packets.h"
 
-#include "packhand_gen.h"
+#include <packhand_gen.h>
     
 bool client_handle_packet(enum packet_type type, void *packet)
 {
Index: common/packets.h
===================================================================
RCS file: /home/freeciv/CVS/freeciv/common/packets.h,v
retrieving revision 1.162
diff -u -r1.162 packets.h
--- common/packets.h    14 Jan 2004 11:58:12 -0000      1.162
+++ common/packets.h    25 Mar 2004 22:14:18 -0000
@@ -65,7 +65,7 @@
   AUTH_NEWUSER_RETRY  /* inform the client to try a different [new] password */
 };
 
-#include "packets_gen.h"
+#include <packets_gen.h>
 
 void *get_packet_from_connection(struct connection *pc, enum packet_type 
*ptype, bool *presult);
 void remove_packet_from_buffer(struct socket_packet_buffer *buffer);
Index: server/Makefile.am
===================================================================
RCS file: /home/freeciv/CVS/freeciv/server/Makefile.am,v
retrieving revision 1.32
diff -u -r1.32 Makefile.am
--- server/Makefile.am  6 Dec 2003 19:23:51 -0000       1.32
+++ server/Makefile.am  25 Mar 2004 22:14:20 -0000
@@ -4,7 +4,7 @@
 
 bin_PROGRAMS = civserver
 noinst_LIBRARIES = libcivserver.a
-INCLUDES = -I$(srcdir)/../common -I$(srcdir)/../ai -I../intl 
-I$(top_srcdir)/common/aicore -I$(srcdir)/userdb
+INCLUDES = -I../common -I$(srcdir)/../common -I$(srcdir)/../ai -I../intl 
-I$(top_srcdir)/common/aicore -I$(srcdir)/userdb
 
 ## Above, note -I../intl instead of -I$(top_srdir/intl) is deliberate.
 
Index: server/cityhand.h
===================================================================
RCS file: /home/freeciv/CVS/freeciv/server/cityhand.h,v
retrieving revision 1.29
diff -u -r1.29 cityhand.h
--- server/cityhand.h   14 Feb 2004 02:21:25 -0000      1.29
+++ server/cityhand.h   25 Mar 2004 22:14:20 -0000
@@ -18,7 +18,7 @@
 struct connection;
 struct conn_list;
 
-#include "hand_gen.h"
+#include <hand_gen.h>
 
 void really_handle_city_sell(struct player *pplayer, struct city *pcity,
                             Impr_Type_id id);
Index: server/diplhand.h
===================================================================
RCS file: /home/freeciv/CVS/freeciv/server/diplhand.h,v
retrieving revision 1.8
diff -u -r1.8 diplhand.h
--- server/diplhand.h   19 Feb 2004 21:06:42 -0000      1.8
+++ server/diplhand.h   25 Mar 2004 22:14:20 -0000
@@ -18,7 +18,7 @@
 struct packet_diplomacy_info;
 struct connection;
 
-#include "hand_gen.h"
+#include <hand_gen.h>
 
 void establish_embassy(struct player *pplayer, struct player *aplayer);
 
Index: server/maphand.h
===================================================================
RCS file: /home/freeciv/CVS/freeciv/server/maphand.h,v
retrieving revision 1.39
diff -u -r1.39 maphand.h
--- server/maphand.h    28 Nov 2003 17:37:22 -0000      1.39
+++ server/maphand.h    25 Mar 2004 22:14:20 -0000
@@ -17,7 +17,7 @@
 #include "packets.h"
 #include "terrain.h"
 
-#include "hand_gen.h"
+#include <hand_gen.h>
 
 enum ocean_land_change { OLC_NONE, OLC_OCEAN_TO_LAND, OLC_LAND_TO_OCEAN };
 
Index: server/plrhand.h
===================================================================
RCS file: /home/freeciv/CVS/freeciv/server/plrhand.h,v
retrieving revision 1.62
diff -u -r1.62 plrhand.h
--- server/plrhand.h    31 Jan 2004 17:52:42 -0000      1.62
+++ server/plrhand.h    25 Mar 2004 22:14:20 -0000
@@ -19,7 +19,7 @@
 #include "packets.h"
 #include "shared.h"            /* fc__attribute */
 
-#include "hand_gen.h"
+#include <hand_gen.h>
 
 struct player;
 struct section_file;
Index: server/unithand.h
===================================================================
RCS file: /home/freeciv/CVS/freeciv/server/unithand.h,v
retrieving revision 1.36
diff -u -r1.36 unithand.h
--- server/unithand.h   28 Nov 2003 17:37:22 -0000      1.36
+++ server/unithand.h   25 Mar 2004 22:14:20 -0000
@@ -16,7 +16,7 @@
 #include "packets.h"
 #include "unit.h"
 
-#include "hand_gen.h"
+#include <hand_gen.h>
 
 bool handle_unit_move_request(struct unit *punit, int dest_x, int dest_y,
                             bool igzoc, bool move_diplomat_city);

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