Author: cazfi
Date: Fri Aug  7 17:31:17 2015
New Revision: 29381

URL: http://svn.gna.org/viewcvs/freeciv?rev=29381&view=rev
Log:
Fix use of configure check results when building included lua-5.3.

See bug #23750

Modified:
    branches/S2_6/configure.ac
    branches/S2_6/dependencies/lua-5.3/freeciv_lua.patch
    branches/S2_6/dependencies/lua-5.3/src/localluaconf.h
    branches/S2_6/dependencies/lua-5.3/src/loslib.c

Modified: branches/S2_6/configure.ac
URL: 
http://svn.gna.org/viewcvs/freeciv/branches/S2_6/configure.ac?rev=29381&r1=29380&r2=29381&view=diff
==============================================================================
--- branches/S2_6/configure.ac  (original)
+++ branches/S2_6/configure.ac  Fri Aug  7 17:31:17 2015
@@ -1245,7 +1245,7 @@
   if test x$gl_cv_func_working_mkstemp = xyes ; then
     AC_DEFINE([HAVE_MKSTEMP], [1], [Have working mkstemp])
   fi
-  AC_CHECK_FUNCS([popen pclose _longjmp _setjmp])
+  AC_CHECK_FUNCS([popen pclose _longjmp _setjmp gmtime_r localtime_r])
 
   LUA_CFLAGS="-I\$(top_srcdir)/dependencies/lua-5.3/src"
   LUA_LIBS="\$(top_builddir)/dependencies/lua-5.3/src/liblua.la"

Modified: branches/S2_6/dependencies/lua-5.3/freeciv_lua.patch
URL: 
http://svn.gna.org/viewcvs/freeciv/branches/S2_6/dependencies/lua-5.3/freeciv_lua.patch?rev=29381&r1=29380&r2=29381&view=diff
==============================================================================
--- branches/S2_6/dependencies/lua-5.3/freeciv_lua.patch        (original)
+++ branches/S2_6/dependencies/lua-5.3/freeciv_lua.patch        Fri Aug  7 
17:31:17 2015
@@ -1,6 +1,6 @@
 diff -Nurd lua-5.3/src/ldo.c lua-5.3/src/ldo.c
---- lua-5.3/src/ldo.c  2015-01-30 22:34:26.329033992 +0200
-+++ lua-5.3/src/ldo.c  2015-02-14 22:51:25.740710930 +0200
+--- lua-5.3/src/ldo.c  2015-08-05 01:16:36.823491105 +0300
++++ lua-5.3/src/ldo.c  2015-08-05 01:02:57.653012740 +0300
 @@ -60,7 +60,7 @@
        try { a } catch(...) { if ((c)->status == 0) (c)->status = -1; }
  #define luai_jmpbuf           int  /* dummy variable */
@@ -11,8 +11,8 @@
  /* in POSIX, try _longjmp/_setjmp (more efficient) */
  #define LUAI_THROW(L,c)               _longjmp((c)->b, 1)
 diff -Nurd lua-5.3/src/liolib.c lua-5.3/src/liolib.c
---- lua-5.3/src/liolib.c       2015-01-30 22:34:26.329033992 +0200
-+++ lua-5.3/src/liolib.c       2015-02-14 22:33:35.100734420 +0200
+--- lua-5.3/src/liolib.c       2015-08-05 01:16:36.823491105 +0300
++++ lua-5.3/src/liolib.c       2015-08-05 01:02:57.653012740 +0300
 @@ -47,7 +47,7 @@
  
  #if !defined(l_popen)         /* { */
@@ -23,20 +23,29 @@
  #define l_popen(L,c,m)                (fflush(NULL), popen(c,m))
  #define l_pclose(L,file)      (pclose(file))
 diff -Nurd lua-5.3/src/loslib.c lua-5.3/src/loslib.c
---- lua-5.3/src/loslib.c       2015-02-14 22:33:05.196735076 +0200
-+++ lua-5.3/src/loslib.c       2015-02-14 22:32:40.800735611 +0200
-@@ -58,7 +58,7 @@
- ** uses mkstemp.
+--- lua-5.3/src/loslib.c       2015-08-05 01:16:36.823491105 +0300
++++ lua-5.3/src/loslib.c       2015-08-05 01:23:04.578681552 +0300
+@@ -65,7 +65,7 @@
+ ** where it uses gmtime_r/localtime_r
  */
  
 -#if defined(LUA_USE_POSIX)    /* { */
-+#if defined(LUA_USE_MKSTEMP)  /* { */
++#if defined(LUA_USE_GMTIME_R) /* { */
+ 
+ #define l_gmtime(t,r)         gmtime_r(t,r)
+ #define l_localtime(t,r)      localtime_r(t,r)
+@@ -92,7 +92,7 @@
+ */
+ #if !defined(lua_tmpnam)      /* { */
+ 
+-#if defined(LUA_USE_POSIX)    /* { */
++#if defined(LUA_USE_MKSTEMP) /* { */
  
  #include <unistd.h>
  
 diff -Nurd lua-5.3/src/luaconf.h lua-5.3/src/luaconf.h
---- lua-5.3/src/luaconf.h      2015-02-14 22:33:05.196735076 +0200
-+++ lua-5.3/src/luaconf.h      2015-02-14 22:32:40.800735611 +0200
+--- lua-5.3/src/luaconf.h      2015-08-05 01:16:36.823491105 +0300
++++ lua-5.3/src/luaconf.h      2015-08-05 01:02:57.657012735 +0300
 @@ -11,6 +11,7 @@
  #include <limits.h>
  #include <stddef.h>

Modified: branches/S2_6/dependencies/lua-5.3/src/localluaconf.h
URL: 
http://svn.gna.org/viewcvs/freeciv/branches/S2_6/dependencies/lua-5.3/src/localluaconf.h?rev=29381&r1=29380&r2=29381&view=diff
==============================================================================
--- branches/S2_6/dependencies/lua-5.3/src/localluaconf.h       (original)
+++ branches/S2_6/dependencies/lua-5.3/src/localluaconf.h       Fri Aug  7 
17:31:17 2015
@@ -20,7 +20,7 @@
 /* Lua headers want to define VERSION to lua version */
 #undef VERSION
 
-#ifdef HAVE_MKSTEMP
+#if defined(HAVE_MKSTEMP) && defined(HAVE_UNISTD_H)
 #define LUA_USE_MKSTEMP
 #endif
 #if defined(HAVE_POPEN) && defined(HAVE_PCLOSE)
@@ -29,6 +29,9 @@
 #if defined(HAVE__LONGJMP) && defined(HAVE__SETJMP)
 #define LUA_USE_ULONGJMP
 #endif
+#if defined(HAVE_GMTIME_R) && defined(HAVE_LOCALTIME_R)
+#define LUA_USE_GMTIME_R
+#endif
 
 #ifdef HAVE_LIBREADLINE
 #define LUA_USE_READLINE

Modified: branches/S2_6/dependencies/lua-5.3/src/loslib.c
URL: 
http://svn.gna.org/viewcvs/freeciv/branches/S2_6/dependencies/lua-5.3/src/loslib.c?rev=29381&r1=29380&r2=29381&view=diff
==============================================================================
--- branches/S2_6/dependencies/lua-5.3/src/loslib.c     (original)
+++ branches/S2_6/dependencies/lua-5.3/src/loslib.c     Fri Aug  7 17:31:17 2015
@@ -65,7 +65,7 @@
 ** where it uses gmtime_r/localtime_r
 */
 
-#if defined(LUA_USE_MKSTEMP)   /* { */
+#if defined(LUA_USE_GMTIME_R) /* { */
 
 #define l_gmtime(t,r)          gmtime_r(t,r)
 #define l_localtime(t,r)       localtime_r(t,r)
@@ -92,7 +92,7 @@
 */
 #if !defined(lua_tmpnam)       /* { */
 
-#if defined(LUA_USE_POSIX)     /* { */
+#if defined(LUA_USE_MKSTEMP) /* { */
 
 #include <unistd.h>
 


_______________________________________________
Freeciv-commits mailing list
Freeciv-commits@gna.org
https://mail.gna.org/listinfo/freeciv-commits

Reply via email to