Advertisement
quixadhal

fluffos local patches

Jan 12th, 2019
248
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Diff 14.07 KB | None | 0 0
  1. diff -ubra fluffos-fluffos-2.27/src/build.FluffOS fluffos-2.27.3/src/build.FluffOS
  2. --- fluffos-fluffos-2.27/src/build.FluffOS      2013-04-29 06:15:04.000000000 -0700
  3. +++ fluffos-2.27.3/src/build.FluffOS    2019-01-12 14:31:34.145284575 -0800
  4. @@ -324,16 +324,29 @@
  5.  END
  6.  $CC -c comptest.c
  7.  
  8. -ar rcu comptest.a comptest.o
  9. -if test $? -ne 0; then
  10. -    echo "FATAL ERROR: Could not find ar."
  11. +gcc-ar rcu comptest.a comptest.o
  12. +if test $? -eq 0; then
  13. +    AR=gcc-ar
  14. +else
  15. +    ar rcu comptest.a comptest.o
  16. +    if test $? -eq 0; then
  17. +        AR=ar
  18. +    else
  19. +        echo "FATAL ERROR: Could not find gcc-ar."
  20.      exit
  21. +    fi
  22.  fi
  23. -ranlib comptest.a
  24. +gcc-ranlib comptest.a
  25.  if test $? -eq 0; then
  26. -    RANLIB=ranlib
  27. +    RANLIB=gcc-ranlib
  28.  else
  29. -    RANLIB=/bin/true
  30. +    ranlib comptest.a
  31. +    if test $? -eq 0; then
  32. +        RANLIB=ranlib
  33. +    else
  34. +        echo "FATAL ERROR: Could not find gcc-ranlib."
  35. +        exit
  36. +    fi
  37.  fi
  38.  
  39.  #
  40. @@ -429,6 +442,7 @@
  41.  echo CC=$CC >>Makefile.tmp
  42.  echo YACC=$YACC >>Makefile.tmp
  43.  echo RANLIB=$RANLIB >>Makefile.tmp
  44. +echo AR=$AR >>Makefile.tmp
  45.  echo A=a >>Makefile.tmp
  46.  echo O=o >>Makefile.tmp
  47.  echo A_OUT=$A_OUT >>Makefile.tmp
  48. diff -ubra fluffos-fluffos-2.27/src/edit_source.c fluffos-2.27.3/src/edit_source.c
  49. --- fluffos-fluffos-2.27/src/edit_source.c      2013-04-29 06:15:04.000000000 -0700
  50. +++ fluffos-2.27.3/src/edit_source.c    2019-01-12 14:31:34.149284665 -0800
  51. @@ -13,6 +13,7 @@
  52.  #include "hash.h"
  53.  #include <stdlib.h>
  54.  #include <unistd.h>
  55. +#include <stdint.h>
  56.  
  57.  #ifdef WIN32
  58.  #include <process.h>
  59. diff -ubra fluffos-fluffos-2.27/src/eval.c fluffos-2.27.3/src/eval.c
  60. --- fluffos-fluffos-2.27/src/eval.c     2013-04-29 06:15:04.000000000 -0700
  61. +++ fluffos-2.27.3/src/eval.c   2019-01-12 14:31:34.149284665 -0800
  62. @@ -11,7 +11,7 @@
  63.  int lasttime;
  64.  LPC_INT max_cost;
  65.  
  66. -void set_eval(int etime){
  67. +void set_eval(LPC_INT etime){
  68.  #ifndef WIN32
  69.         long diff;
  70.         gettimeofday(&tv, NULL);
  71. diff -ubra fluffos-fluffos-2.27/src/GNUmakefile.in fluffos-2.27.3/src/GNUmakefile.in
  72. --- fluffos-fluffos-2.27/src/GNUmakefile.in     2013-04-29 06:15:04.000000000 -0700
  73. +++ fluffos-2.27.3/src/GNUmakefile.in   2019-01-12 14:31:34.141284487 -0800
  74. @@ -91,7 +91,7 @@
  75.         -mv y.tab.h grammar.tab.h
  76.  
  77.  packages/packages.a: packages/*.c
  78. -       $(MAKE) -C packages 'CC=$(CC)' 'CFLAGS=$(CFLAGS) $(OPTIMIZE)' 'OBJDIR=../$(OBJDIR)' 'RANLIB=$(RANLIB)' 'A=$(A)' 'O=$(O)'
  79. +       $(MAKE) -C packages 'CC=$(CC)' 'CFLAGS=$(CFLAGS) $(OPTIMIZE)' 'OBJDIR=../$(OBJDIR)' 'RANLIB=$(RANLIB)' 'AR=$(AR)' 'A=$(A)' 'O=$(O)'
  80.  
  81.  $(DRIVER_BIN): packages/packages.a $(OBJ) dtrace_compile
  82.         -mv -f $(DRIVER_BIN) $(DRIVER_BIN).old
  83. diff -ubra fluffos-fluffos-2.27/src/make_func.y fluffos-2.27.3/src/make_func.y
  84. --- fluffos-fluffos-2.27/src/make_func.y        2013-04-29 06:15:04.000000000 -0700
  85. +++ fluffos-2.27.3/src/make_func.y      2019-01-12 14:31:34.161284932 -0800
  86. @@ -7,6 +7,7 @@
  87.  #include "preprocess.h"
  88.  #include "edit_source.h"
  89.  #include <stdlib.h>
  90. +#include <stdint.h>
  91.  
  92.  #ifdef WIN32
  93.  #define MSDOS
  94. diff -ubra fluffos-fluffos-2.27/src/options.h fluffos-2.27.3/src/options.h
  95. --- fluffos-fluffos-2.27/src/options.h  2013-04-29 06:15:04.000000000 -0700
  96. +++ fluffos-2.27.3/src/options.h        2019-01-12 14:31:34.161284932 -0800
  97. @@ -57,15 +57,37 @@
  98.   *   * Wodan's malloc, uses system malloc for small allocations and spreads
  99.   *   * large allocations through the 64 bit memory space
  100.   *   * won't work on 32 bit systems.
  101. + *
  102.   * MALLOC32
  103.   *   * fixes realloc by always doing a malloc/memcpy/free instead, try this
  104.   *   * if you use more memory than expected (or MALLOC64 on a 64bit system).
  105. + *
  106. + * SMALLOC:
  107. + *   * Satoria's smalloc.
  108. + *   * Statistics available. (see wrappers and DO_MSTATS)
  109. + *   * Faster than most system mallocs with modest ammount of memory overhead.
  110. + *   * Can fall back onto system malloc if sbrk() not ok.
  111. + *
  112. + * BSDMALLOC:
  113. + *   * BSD (Berkeley Software Distributions) malloc.
  114. + *   * Statistics available. (see wrappers and DO_MSTATS)
  115. + *   * Faster than SMALLOC but more memory overhead.
  116. + *   * Requires sbrk().
  117. + *
  118. + * GCMALLOC:
  119. + *   * Garbage Collecting malloc.
  120. + *   * This malloc automatically frees memory when no longer referenced.
  121. + *   * Performance can be less predictable, as garbage collection happens
  122. + *     automatically, and is not directly controllable for the user.
  123.   */
  124.  #define SYSMALLOC
  125. -#undef MMALLOC
  126.  #undef MALLOC64
  127.  #undef MALLOC32
  128. +#undef MMALLOC
  129. +#undef SMALLOC
  130. +#undef BSDMALLOC
  131.  #undef GCMALLOC /* needs -lgc in system_libs */
  132. +
  133.  /* You may optionally choose one (or none) of these malloc wrappers.  These
  134.   * can be used in conjunction with any of the above malloc packages.
  135.   *
  136. @@ -202,9 +224,6 @@
  137.   */
  138.  #undef NO_SNOOP
  139.  
  140. -/* NO_ADD_ACTION: define this to remove add_action, commands, livings, etc.
  141. -   process_input() then becomes the only way to deal with player input. */
  142. -
  143.  /* NO_ENVIRONMENT: define this to remove the handling of object containment
  144.   * relationships by the driver
  145.   *
  146. @@ -247,7 +266,6 @@
  147.   * when you're not actually using the old range behavior*/
  148.  #undef WARN_OLD_RANGE_BEHAVIOR
  149.  
  150. -
  151.  /* OLD_ED: ed() efun backwards compatible with the old version.  The new
  152.   * version requires/allows a mudlib front end.
  153.   *
  154. @@ -310,14 +328,13 @@
  155.   * Keep statistics about allocated strings, etc.  Which can be viewed with
  156.   * the mud_status() efun.  If this is off, mud_status() and memory_info()
  157.   * ignore allocated strings, but string operations run faster.
  158. + *
  159. + * Similarly for arrays and classes ...
  160.   */
  161.  #define STRING_STATS
  162. -
  163. -/*
  164. - * Similarly for arrays ...
  165. - */
  166.  #define ARRAY_STATS
  167.  #define CLASS_STATS
  168. +
  169.  /* LOG_CATCHES: define this to cause errors that are catch()'d to be
  170.   *   sent to the debug log anyway.
  171.   *
  172. @@ -368,7 +385,7 @@
  173.   *   config files by default.  If you don't wish to use this define, you may
  174.   *   always specify a full path to the config file when starting the driver.
  175.   */
  176. -#define CONFIG_FILE_DIR "/home/atuin/bin"
  177. +#define CONFIG_FILE_DIR "."
  178.  
  179.  /* DEFAULT_PRAGMAS:  This should be a sum of pragmas you want to always
  180.   * be on, i.e.
  181. @@ -391,8 +408,12 @@
  182.   * PRAGMA_SAVE_TYPES:   save the types of function arguments for checking
  183.   *                      calls to functions in this object by objects that
  184.   *                      inherit it.
  185. + * PRAGMA_SAVE_BINARY:  save a compiled binary version of this file for
  186. + *                      faster loading next time it is needed.
  187. + *                      (This is almost certainly broken.)
  188.   * PRAGMA_OPTIMIZE:     make a second pass over the generated code to
  189. - *                      optimize it further.  Currently maybe broken.
  190. + *                      optimize it further.  Used to do jump threading.
  191. + *                      (This is probably broken.)
  192.   * PRAGMA_ERROR_CONTEXT:include some text telling where on the line a
  193.   *                      compilation error occured.
  194.   */
  195. @@ -404,6 +425,25 @@
  196.   */
  197.  #define SUPPRESS_ARGUMENT_WARNINGS
  198.  
  199. +/* BINARIES: define this to enable the 'save_binary' pragma.
  200. + *   This pragma, when set in a program, will cause it to save a
  201. + *   binary image when loaded, so that subsequent loadings will
  202. + *   be much faster.  The binaries are saved in the directory
  203. + *   specified in the configuration file.  The binaries will not
  204. + *   load if the LPC source or any of the inherited or included
  205. + *   files are out of date, in which case the file is compiled
  206. + *   normally (and may save a new binary).
  207. + *
  208. + *   In order to save the binary, valid_save_binary() is called
  209. + *   in master.c, and is passed the name of the source file.  If
  210. + *   this returns a non-zero value, the binary is allowed to be
  211. + *   saved.  Allowing any file by any wizard to be saved as a
  212. + *   binary is convenient, but may take up a lot of disk space.
  213. + *
  214. + *   (This is almost certainly broken.)
  215. + */
  216. +#undef BINARIES
  217. +
  218.  /* NO_RESETS: completely disable the periodic calling of reset() */
  219.  #undef NO_RESETS
  220.  
  221. @@ -443,6 +483,11 @@
  222.  #define NO_ANSI
  223.  #define STRIP_BEFORE_PROCESS_INPUT
  224.  
  225. +/* ANSI_SUBSTITUTE:  This replaces the ESC character (ASCII 27) with the
  226. + * "record separator" non-printable character (ASCII 30).
  227. + */
  228. +#define ANSI_SUBSTITUTE 0x1e
  229. +
  230.  /* OPCPROF: define this if you wish to enable OPC profiling. Allows a dump
  231.   *   of the # of times each efun is invoked (via the opcprof() efun).
  232.   */
  233. @@ -461,6 +506,19 @@
  234.   */
  235.  #define TRAP_CRASHES
  236.  
  237. +/* DROP_CORE: define this if you want the driver to attempt to create
  238. + *   a core file when it crashes via the crash_MudOS() function.  This
  239. + *   define only has an affect if -DDEBUG isn't defined in the makefile
  240. + *   (except for the SIGINT and SIGTERM signals which are always trapped).
  241. + *
  242. + * [NOTE: keep this undefined for now since it seems to hang some machines
  243. + *  upon crashing (some DECstations apparently).  If you want to get a core
  244. + *  file, undef'ing TRAP_CRASHES should work.]
  245. + *
  246. + * This is almost certainly broken.
  247. + */
  248. +#undef DROP_CORE
  249. +
  250.  /* THIS_PLAYER_IN_CALL_OUT: define this if you wish this_player() to be
  251.   *   usable from within call_out() callbacks.
  252.   */
  253. @@ -615,7 +673,10 @@
  254.  /* PACKAGE_PARSER: Natural language parsing efuns for interactive fiction
  255.   *   type applications
  256.   */
  257. -#undef PACKAGE_PARSER
  258. +#define PACKAGE_PARSER
  259. +
  260. +/* Allows for some extended parser debugging? */
  261. +#define PARSE_DEBUG
  262.  
  263.  /* PACKAGE_EXTERNAL: Allows the driver to exec() commands specified in the
  264.   * config file.
  265. @@ -639,6 +700,15 @@
  266.  #undef USE_POSTGRES
  267.  #endif
  268.  
  269. +/*PACKAGE DWLIB: some discworld mudlib simuls coded in C (well just one right now) */
  270. +#define PACKAGE_DWLIB
  271. +
  272. +/* Some specific code for the Dead Souls mudlib */
  273. +#undef PACKAGE_DSLIB
  274. +
  275. +/* Allow the use of perl compatible regular expressions */
  276. +#define PACKAGE_PCRE
  277. +
  278.  /****************************************************************************
  279.   *                            UID PACKAGE                                   *
  280.   *                            -----------                                   *
  281. @@ -658,11 +728,6 @@
  282.   */
  283.  #define PACKAGE_UIDS
  284.  
  285. -/*PACKAGE DWLIB: some discworld mudlib simuls coded in C (well just one right
  286. -  now) */
  287. -
  288. -#define PACKAGE_DWLIB
  289. -
  290.  /* AUTO_SETEUID: when an object is created it's euid is automatically set to
  291.   *   the equivalent of seteuid(getuid(this_object())).  undef AUTO_SETEUID
  292.   *   if you would rather have the euid of the created object be set to 0.
  293. @@ -694,7 +759,25 @@
  294.   */
  295.  #undef USE_32BIT_ADDRESSES
  296.  
  297. +/* LPC_TO_C: define this to enable LPC->C compilation.
  298. + *
  299. + * [NOTE: BINARIES must also be defined for LPC->C to work.  Actually
  300. + *  using binaries is not required, though.]
  301. + *
  302. + * This is almost certainly broken.
  303. + */
  304. +#undef LPC_TO_C
  305. +
  306.  /* HEARTBEAT_INTERVAL: define heartbeat interval in seconds.
  307. + *   It used to do this in microseconds (us).
  308. + *   1,000,000 us = 1 second.  The value of this macro specifies
  309. + *   the frequency with which the heart_beat method will be called in
  310. + *   those LPC objects which have called set_heart_beat(1).
  311. + *
  312. + * [NOTE: if ualarm() isn't available, alarm() is used instead.  Since
  313. + *  alarm() requires its argument in units of a second, we map 1 - 1,000,000 us
  314. + *  to an actual interval of one (1) second and 1,000,001 - 2,000,000 maps to
  315. + *  an actual interval of two (2) seconds, etc.]
  316.   */
  317.  #define HEARTBEAT_INTERVAL 1
  318.  
  319. @@ -795,8 +878,10 @@
  320.  /* CFG_MAX_GLOBAL_VARIABLES: This value determines the maximum number of
  321.   *   global variables per object.  The maximum value is 65536.  There is
  322.   *   a marginal memory increase for a value over 256.
  323. + *
  324. + * Increasing max global vars beyond 256 is not recommended.
  325.   */
  326. -#define CFG_MAX_GLOBAL_VARIABLES        65536
  327. +#define CFG_MAX_GLOBAL_VARIABLES        256
  328.  
  329.  #define CFG_EVALUATOR_STACK_SIZE        3000
  330.  #define CFG_COMPILER_STACK_SIZE         600
  331. @@ -873,6 +958,7 @@
  332.  
  333.  /* ALLOW_INHERIT_AFTER_FUNCTION: allow inheriting after functions have been defined (this includes prototypes). This caused crashes in v22.2a but it may have been fixed since */
  334.  #undef ALLOW_INHERIT_AFTER_FUNCTION
  335. +#undef ALLOW_INHERIT_AFTER_GLOBAL_VARIABLES
  336.  
  337.  /*PACKAGE_ASYNC: adds some efuns for asyncronous IO */
  338.  #define PACKAGE_ASYNC
  339. @@ -913,5 +999,8 @@
  340.  
  341.  /* use POSIX timers for eval_cost */
  342.  #define POSIX_TIMERS
  343. -#endif
  344.  
  345. +/* Not sure why this is needed, maybe old MudOS -> FluffOS glue code? */
  346. +#define FLUFFOS
  347. +
  348. +#endif
  349. diff -ubra fluffos-fluffos-2.27/src/packages/Makefile.master fluffos-2.27.3/src/packages/Makefile.master
  350. --- fluffos-fluffos-2.27/src/packages/Makefile.master   2013-04-29 06:15:04.000000000 -0700
  351. +++ fluffos-2.27.3/src/packages/Makefile.master 2019-01-12 14:31:34.161284932 -0800
  352. @@ -11,7 +11,7 @@
  353.  %endif
  354.  
  355.  all: $(OBJ)
  356. -       ar rcu packages.$(A) $(OBJ)
  357. +       $(AR) rcu packages.$(A) $(OBJ)
  358.         $(RANLIB) packages.$(A)
  359.  
  360.  %ifdef GNU
  361. diff -ubra fluffos-fluffos-2.27/src/socket_efuns.c fluffos-2.27.3/src/socket_efuns.c
  362. --- fluffos-fluffos-2.27/src/socket_efuns.c     2013-04-29 06:15:04.000000000 -0700
  363. +++ fluffos-2.27.3/src/socket_efuns.c   2019-01-12 14:31:34.169285111 -0800
  364. @@ -1446,7 +1446,8 @@
  365.      ret->item[4].u.string = string_copy(inet_address(&lpc_socks[which].r_addr),
  366.                                          "socket_status");
  367.  
  368. -    if (!(lpc_socks[which].flags & STATE_FLUSHING) && lpc_socks[which].owner_ob && !(lpc_socks[which].owner_ob->flags & O_DESTRUCTED)) {
  369. +    // Fix per Kalinash's suggestion, if (!(lpc_socks[which].flags & STATE_FLUSHING) && ...
  370. +    if (!(lpc_socks[which].flags != STATE_FLUSHING) && lpc_socks[which].owner_ob && !(lpc_socks[which].owner_ob->flags & O_DESTRUCTED)) {
  371.          ret->item[5].type = T_OBJECT;
  372.          ret->item[5].u.ob = lpc_socks[which].owner_ob;
  373.          add_ref(lpc_socks[which].owner_ob, "socket_status");
  374. diff -ubra fluffos-fluffos-2.27/src/std_incl.h fluffos-2.27.3/src/std_incl.h
  375. --- fluffos-fluffos-2.27/src/std_incl.h 2013-04-29 06:15:04.000000000 -0700
  376. +++ fluffos-2.27.3/src/std_incl.h       2019-01-12 14:31:34.169285111 -0800
  377. @@ -8,6 +8,7 @@
  378.  #  include <unistd.h>
  379.  #endif
  380.  
  381. +#include <stdint.h>
  382.  #include <sys/types.h>
  383.  #include <stdio.h>
  384.  #include <setjmp.h>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement