[Freeciv-Dev] (PR#40286) Setup -D defines for luaconf.h?
http://bugs.freeciv.org/Ticket/Display.html?id=40286 > > [EMAIL PROTECTED] - Sat Jun 21 17:13:01 2008]: > > 2008/6/19 Madeline Book <[EMAIL PROTECTED]>: > > > > http://bugs.freeciv.org/Ticket/Display.html?id=40286 > > > > >> [EMAIL PROTECTED] - Wed Jun 18 23:52:44 2008]: > >> > >> 2008/6/16 Madeline Book: > >> > > >> > So would it be possible to use the autoconf tools to > >> > somehow make lua compile with the right defines? E.g. > >> > with -DLUA_USE_LINUX on my linux system. > >> > >> This patch for adds configure checks for functions conditionally > >> used by lua. > > > > I have also found a patch to make lua use autotools here: > > http://lua-users.org/wiki/LuaPowerPatches > > > > Perhaps with that patch all it would take is to somehow > > make freeciv's configure invoke lua's so it can handle all > > the details of setting up luaconf.h. > > Subconfigure would make maintenance easier, if it was part of > standard lua distribution. Sadly, it isn't. > We would need to separately upgrade configure stuff when ever we > upgrade lua - assuming there is up-to-date version of the configure > stuff. After fighting almost an year with lua & tolua/tolua++/toluaxx > upgrade problems, I'm not too eager to count on development of > external dependencies to stay in sync. > > In this situation I think it's wiser to use less complex method of > just one configure, as in my patch. Agreed? Fine by me. -- それかあれのどちらかにしてもいいよ。 ___ Freeciv-dev mailing list Freeciv-dev@gna.org https://mail.gna.org/listinfo/freeciv-dev
Re: [Freeciv-Dev] (PR#40286) Setup -D defines for luaconf.h?
http://bugs.freeciv.org/Ticket/Display.html?id=40286 > 2008/6/19 Madeline Book <[EMAIL PROTECTED]>: > > http://bugs.freeciv.org/Ticket/Display.html?id=40286 > > >> [EMAIL PROTECTED] - Wed Jun 18 23:52:44 2008]: >> >> 2008/6/16 Madeline Book: >> > >> > So would it be possible to use the autoconf tools to >> > somehow make lua compile with the right defines? E.g. >> > with -DLUA_USE_LINUX on my linux system. >> >> This patch for adds configure checks for functions conditionally >> used by lua. > > I have also found a patch to make lua use autotools here: > http://lua-users.org/wiki/LuaPowerPatches > > Perhaps with that patch all it would take is to somehow > make freeciv's configure invoke lua's so it can handle all > the details of setting up luaconf.h. Subconfigure would make maintenance easier, if it was part of standard lua distribution. Sadly, it isn't. We would need to separately upgrade configure stuff when ever we upgrade lua - assuming there is up-to-date version of the configure stuff. After fighting almost an year with lua & tolua/tolua++/toluaxx upgrade problems, I'm not too eager to count on development of external dependencies to stay in sync. In this situation I think it's wiser to use less complex method of just one configure, as in my patch. Agreed? - ML ___ Freeciv-dev mailing list Freeciv-dev@gna.org https://mail.gna.org/listinfo/freeciv-dev
Re: [Freeciv-Dev] (PR#40286) Setup -D defines for luaconf.h?
http://bugs.freeciv.org/Ticket/Display.html?id=40286 > 2008/6/16 Madeline Book: > > So would it be possible to use the autoconf tools to > somehow make lua compile with the right defines? E.g. > with -DLUA_USE_LINUX on my linux system. This patch for adds configure checks for functions conditionally used by lua. - ML diff -Nurd -X.diff_ignore freeciv/autogen.sh freeciv/autogen.sh --- freeciv/autogen.sh 2008-03-19 04:32:56.0 +0200 +++ freeciv/autogen.sh 2008-06-19 02:39:51.0 +0300 @@ -257,7 +257,7 @@ fi echo "+ running $ACLOCAL ..." -$ACLOCAL -I m4 $ACLOCAL_FLAGS || { +$ACLOCAL -I m4 -I dependencies/m4 $ACLOCAL_FLAGS || { echo echo "$ACLOCAL failed - check that all needed development files are present on system" exit 1 diff -Nurd -X.diff_ignore freeciv/configure.ac freeciv/configure.ac --- freeciv/configure.ac 2008-06-18 18:49:41.0 +0300 +++ freeciv/configure.ac 2008-06-19 02:29:52.0 +0300 @@ -690,6 +690,13 @@ fi]) fi +dnl Checks needed for Lua. Get rid of these if system lua is ever used. +gl_FUNC_MKSTEMP +if test x$gl_cv_func_working_mkstemp = xyes ; then + AC_DEFINE([HAVE_MKSTEMP], [1], [Have working mkstemp]) +fi +AC_CHECK_FUNCS([isatty popen _longjmp]) + dnl In the future we probably get rid of our own lua tree and use dnl lua from system. dnl LUA_AS_DEPENDENCY should be empty when using lua outside own our tree. diff -Nurd -X.diff_ignore freeciv/dependencies/lua-5.1/src/localluaconf.h freeciv/dependencies/lua-5.1/src/localluaconf.h --- freeciv/dependencies/lua-5.1/src/localluaconf.h 1970-01-01 02:00:00.0 +0200 +++ freeciv/dependencies/lua-5.1/src/localluaconf.h 2008-06-19 02:37:03.0 +0300 @@ -0,0 +1,33 @@ +/** + Freeciv - Copyright (C) 1996 - A Kjeldberg, L Gregersen, P Unold + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. +***/ +#ifndef FC__LOCALLUACONF_H +#define FC__LOCALLUACONF_H + +#ifdef HAVE_CONFIG_H +#include +#endif + +#ifdef HAVE_MKSTEMP +#define LUA_USE_MKSTEMP +#endif +#ifdef HAVE_ISATTY +#define LUA_USE_ISATTY +#endif +#ifdef HAVE_POPEN +#define LUA_USE_POPEN +#endif +#ifdef HAVE__LONGJMP +#define LUA_USE_ULONGJMP +#endif + +#endif /* FC__LOCALLUACONF_H */ diff -Nurd -X.diff_ignore freeciv/dependencies/lua-5.1/src/luaconf.h freeciv/dependencies/lua-5.1/src/luaconf.h --- freeciv/dependencies/lua-5.1/src/luaconf.h 2008-06-18 18:49:35.0 +0300 +++ freeciv/dependencies/lua-5.1/src/luaconf.h 2008-06-19 01:35:42.0 +0300 @@ -11,6 +11,7 @@ #include #include +#include "localluaconf.h" /* ** == diff -Nurd -X.diff_ignore freeciv/dependencies/m4/mkstemp.m4 freeciv/dependencies/m4/mkstemp.m4 --- freeciv/dependencies/m4/mkstemp.m4 1970-01-01 02:00:00.0 +0200 +++ freeciv/dependencies/m4/mkstemp.m4 2008-06-19 02:07:02.0 +0300 @@ -0,0 +1,56 @@ +#serial 17 + +# Copyright (C) 2001, 2003, 2004, 2005, 2006, 2007 Free Software Foundation, Inc. +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# On some hosts (e.g., HP-UX 10.20, SunOS 4.1.4, Solaris 2.5.1), mkstemp has a +# silly limit that it can create no more than 26 files from a given template. +# Other systems lack mkstemp altogether. +# On OSF1/Tru64 V4.0F, the system-provided mkstemp function can create +# only 32 files per process. +# On systems like the above, arrange to use the replacement function. +AC_DEFUN([gl_FUNC_MKSTEMP], +[ + AC_REQUIRE([gl_STDLIB_H_DEFAULTS]) + AC_REQUIRE([AC_SYS_LARGEFILE]) + + AC_CACHE_CHECK([for working mkstemp], +[gl_cv_func_working_mkstemp], +[ + mkdir conftest.mkstemp + AC_RUN_IFELSE( + [AC_LANG_PROGRAM( + [AC_INCLUDES_DEFAULT], + [[int i; + off_t large = (off_t) 4294967295u; + if (large < 0) + large = 2147483647; + for (i = 0; i < 70; i++) + { + char templ[] = "conftest.mkstemp/coXX"; + int (*mkstemp_function) (char *) = mkstemp; + int fd = mkstemp_function (templ); + if (fd < 0 || lseek (fd, large, SEEK_SET) != large) + return 1; + close (fd); + } + return 0;]])], + [gl_cv_func_working_mkstemp=yes], + [gl_cv_func_working_mkstemp=no], + [gl_cv_func_working_mkstemp=no]) + rm -rf conftest.mkstemp +]) + + if test $gl_cv_func_working_mkstemp != yes; t
[Freeciv-Dev] (PR#40286) Setup -D defines for luaconf.h?
http://bugs.freeciv.org/Ticket/Display.html?id=40286 > > [EMAIL PROTECTED] - Wed Jun 18 23:52:44 2008]: > > 2008/6/16 Madeline Book: > > > > So would it be possible to use the autoconf tools to > > somehow make lua compile with the right defines? E.g. > > with -DLUA_USE_LINUX on my linux system. > > This patch for adds configure checks for functions conditionally > used by lua. I have also found a patch to make lua use autotools here: http://lua-users.org/wiki/LuaPowerPatches Perhaps with that patch all it would take is to somehow make freeciv's configure invoke lua's so it can handle all the details of setting up luaconf.h. -- どう働くかな〜 ___ Freeciv-dev mailing list Freeciv-dev@gna.org https://mail.gna.org/listinfo/freeciv-dev
[Freeciv-Dev] (PR#40286) Setup -D defines for luaconf.h?
http://bugs.freeciv.org/Ticket/Display.html?id=40286 > > [EMAIL PROTECTED] - Wed Jun 18 23:52:44 2008]: > > 2008/6/16 Madeline Book: > > > > So would it be possible to use the autoconf tools to > > somehow make lua compile with the right defines? E.g. > > with -DLUA_USE_LINUX on my linux system. > > This patch for adds configure checks for functions conditionally used > by lua. Anyway, after recompliling with this patch the mkstemp warnings go away. :) -- それはよかったね ___ Freeciv-dev mailing list Freeciv-dev@gna.org https://mail.gna.org/listinfo/freeciv-dev
Re: [Freeciv-Dev] (PR#40286) Setup -D defines for luaconf.h?
http://bugs.freeciv.org/Ticket/Display.html?id=40286 > 2008/6/16 Madeline Book: > > A minor issue, but today when compiling S2_2 I got this > warning when linking: > > ../dependencies/lua-5.1/src/liblua.a(loslib.o): In function > `os_tmpname': > /home/book/src/freeciv/freeciv/git-svn/dependencies/lua-5.1/src/ > loslib.c:60: warning: the use of `tmpnam' is dangerous, better use > `mkstemp' > > Looking into the lua-5.1 sources it would appear that > the use of mkstemp is controlled by successive macros > LUA_USE_MKSTEMP set by LUA_USE_POSIX set by LUA_USE_LINUX > in luaconf.h. Note that included lua is not latest version. It should be updated and patched with lua.org bugfixes. - ML ___ Freeciv-dev mailing list Freeciv-dev@gna.org https://mail.gna.org/listinfo/freeciv-dev
[Freeciv-Dev] (PR#40286) Setup -D defines for luaconf.h?
http://bugs.freeciv.org/Ticket/Display.html?id=40286 > A minor issue, but today when compiling S2_2 I got this warning when linking: ../dependencies/lua-5.1/src/liblua.a(loslib.o): In function `os_tmpname': /home/book/src/freeciv/freeciv/git-svn/dependencies/lua-5.1/src/ loslib.c:60: warning: the use of `tmpnam' is dangerous, better use `mkstemp' Looking into the lua-5.1 sources it would appear that the use of mkstemp is controlled by successive macros LUA_USE_MKSTEMP set by LUA_USE_POSIX set by LUA_USE_LINUX in luaconf.h. So would it be possible to use the autoconf tools to somehow make lua compile with the right defines? E.g. with -DLUA_USE_LINUX on my linux system. -- なるほど。でも、よくなるのはできませんか。 ___ Freeciv-dev mailing list Freeciv-dev@gna.org https://mail.gna.org/listinfo/freeciv-dev