Author: sveinung Date: Thu Oct 29 15:45:12 2015 New Revision: 30300 URL: http://svn.gna.org/viewcvs/freeciv?rev=30300&view=rev Log: New configure option --disable-delta-protocol
A third party project without a working delta protocol implementation may need the ability to communicate with Freeciv. Today this must be done by patching generate_packets.py. Let the build system disable the delta network protocol. Emit a warning if it is disabled. Turning off bool folding when the delta protocol otherwise is supported is still not possible. See patch #6501 Modified: trunk/common/Makefile.am trunk/common/generate_packets.py trunk/configure.ac Modified: trunk/common/Makefile.am URL: http://svn.gna.org/viewcvs/freeciv/trunk/common/Makefile.am?rev=30300&r1=30299&r2=30300&view=diff ============================================================================== --- trunk/common/Makefile.am (original) +++ trunk/common/Makefile.am Thu Oct 29 15:45:12 2015 @@ -159,7 +159,7 @@ packets_gen.h packets_gen.c: packets_generate .INTERMEDIATE: packets_generate packets_generate: packets.def generate_packets.py - cd $(srcdir) && ./generate_packets.py + cd $(srcdir) && ./generate_packets.py ${GENERATE_PACKETS_ARGS} touch packets_generate # These files are not generated to builddir, but to srcdir */ Modified: trunk/common/generate_packets.py URL: http://svn.gna.org/viewcvs/freeciv/trunk/common/generate_packets.py?rev=30300&r1=30299&r2=30300&view=diff ============================================================================== --- trunk/common/generate_packets.py (original) +++ trunk/common/generate_packets.py Thu Oct 29 15:45:12 2015 @@ -27,7 +27,6 @@ ### The following parameters CHANGE the protocol. You have been warned. fold_bool_into_header=1 -disable_delta=0 ################# END OF PARAMETERS #################### @@ -38,6 +37,9 @@ import re, string, os, sys lazy_overwrite=0 + +def is_delta_disabled(): + return "--disable-delta" in sys.argv def verbose(s): if "-v" in sys.argv: @@ -169,7 +171,7 @@ if flaginfo["is_key"]: arr.remove("key") flaginfo["diff"]=("diff" in arr) if flaginfo["diff"]: arr.remove("diff") - if disable_delta: + if is_delta_disabled(): flaginfo["diff"] = 0 adds=[] removes=[] @@ -1340,7 +1342,7 @@ assert len(arr)==0,repr(arr) - if disable_delta: + if is_delta_disabled(): self.delta=0 self.fields=[] Modified: trunk/configure.ac URL: http://svn.gna.org/viewcvs/freeciv/trunk/configure.ac?rev=30300&r1=30299&r2=30300&view=diff ============================================================================== --- trunk/configure.ac (original) +++ trunk/configure.ac Thu Oct 29 15:45:12 2015 @@ -267,6 +267,23 @@ dnl checks for MagickWand mapimg support dnl sets MAPIMG_WAND_CFLAGS, MAPIMG_WAND_LIBS FC_MAPIMG_MAGICKWAND + +dnl set arguments for the packet generator +GENERATE_PACKETS_ARGS="" + +dnl make it possible to disable the delta network protocol +AC_ARG_ENABLE([delta-protocol], + AS_HELP_STRING([--disable-delta-protocol], + [disable the delta network protocol])) + +AS_IF([test "x$enable_delta_protocol" = "xno"], [ + AC_MSG_WARN([delta network protocol is off]) + AC_MSG_WARN([no network compatibility with regular Freeciv]) + AC_MSG_WARN([won't be able to play with regular Freeciv]) + GENERATE_PACKETS_ARGS="$GENERATE_PACKETS_ARGS --disable-delta"]) + +dnl done setting arguments for the packet generator +AC_SUBST([GENERATE_PACKETS_ARGS]) FC_WEB_OPTIONS _______________________________________________ Freeciv-commits mailing list Freeciv-commits@gna.org https://mail.gna.org/listinfo/freeciv-commits