Complete.Org: Mailing Lists: Archives: freeciv-dev: April 2005:
[Freeciv-Dev] Re: (PR#12706) Events framework
Home

[Freeciv-Dev] Re: (PR#12706) Events framework

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
Subject: [Freeciv-Dev] Re: (PR#12706) Events framework
From: "Per I. Mathisen" <per@xxxxxxxxxxx>
Date: Tue, 5 Apr 2005 04:22:51 -0700
Reply-to: bugs@xxxxxxxxxxx

<URL: http://bugs.freeciv.org/Ticket/Display.html?id=12706 >

On Mon, 4 Apr 2005, Vasco Alexandre da Silva Costa wrote:
> I propose we do ASAP:
>
> * Commit lua to utility/lua/, plus the configure bits to build and link it
> to freeciv.

Attached. I removed all the unnecessary bits.

I am uncertain whether we should go with the default internal number
format of double, or set it to int. Do we need double for anything? (This
is easily changed. It is a compile type switch.)

> TODO:
> How the heck are we going to markup Lua strings and handle I18N?
> Suggestions appreciated.

This might be a problem.  Check out
http://lua-users.org/lists/lua-l/2004-04/msg00086.html

However, I did some testing. It did not seem difficult to coax xgettext
into believing lua is really C code, and extract strings as always.

This program works:

        -- gettext markup
        function _(t)
          return t
        end

        -- defines a factorial function
        function fact (n)
          if n == 0 then
            return 1
          else
            return n * fact(n-1)
          end
        end

        print(_("enter a number:"))
        a = io.read("*number")        -- read a number
        print(fact(a))

with "xgettext --keyword=_ -C --output=- test.lua" it successfully finds
the _() call and extracts the string.

  - Per

? utility/lua
Index: configure.ac
===================================================================
RCS file: /home/freeciv/CVS/freeciv/configure.ac,v
retrieving revision 1.99
diff -u -r1.99 configure.ac
--- configure.ac        25 Mar 2005 21:13:48 -0000      1.99
+++ configure.ac        5 Apr 2005 11:13:19 -0000
@@ -664,6 +664,9 @@
          data/history/Makefile 
          utility/Makefile
          utility/ftwl/Makefile
+         utility/lua/Makefile
+         utility/lua/src/Makefile
+         utility/lua/src/lib/Makefile
          common/Makefile 
          common/aicore/Makefile 
          ai/Makefile 
Index: manual/Makefile.am
===================================================================
RCS file: /home/freeciv/CVS/freeciv/manual/Makefile.am,v
retrieving revision 1.4
diff -u -r1.4 Makefile.am
--- manual/Makefile.am  12 Sep 2004 21:19:36 -0000      1.4
+++ manual/Makefile.am  5 Apr 2005 11:13:20 -0000
@@ -14,6 +14,7 @@
       ../ai/libcivai.a ../utility/libcivutility.a ../server/libcivserver.a \
       ../utility/libcivutility.a ../common/aicore/libaicore.a \
       ../server/userdb/libuserdb.a ../client/helpdata.o \
+      ../utility/lua/src/liblua.a ../utility/lua/src/lib/liblualib.a \
       ../server/generator/libgenerator.a
 civmanual_LDADD        = ../utility/libcivutility.a ../common/libcivcommon.a \
       ../ai/libcivai.a ../utility/libcivutility.a ../server/libcivserver.a \
@@ -22,6 +23,7 @@
       ../utility/libcivutility.a ../server/libcivserver.a \
       ../server/userdb/libuserdb.a \
       ../utility/libcivutility.a \
+      ../utility/lua/src/liblua.a ../utility/lua/src/lib/liblualib.a \
       ../common/aicore/libaicore.a \
       ../server/generator/libgenerator.a \
       $(SERVER_LIBS)
Index: server/Makefile.am
===================================================================
RCS file: /home/freeciv/CVS/freeciv/server/Makefile.am,v
retrieving revision 1.40
diff -u -r1.40 Makefile.am
--- server/Makefile.am  31 Oct 2004 22:32:33 -0000      1.40
+++ server/Makefile.am  5 Apr 2005 11:13:20 -0000
@@ -4,8 +4,7 @@
 
 bin_PROGRAMS = civserver
 noinst_LIBRARIES = libcivserver.a
-AM_CPPFLAGS = -I$(top_srcdir)/utility -I$(srcdir)/../common -I$(srcdir)/../ai 
-I../intl -I$(top_srcdir)/common/aicore -I$(srcdir)/userdb -I$(srcdir)/generator
-
+AM_CPPFLAGS = -I$(top_srcdir)/utility -I$(srcdir)/../common -I$(srcdir)/../ai 
-I../intl -I$(top_srcdir)/common/aicore -I$(srcdir)/userdb 
-I$(srcdir)/generator -I$(top_srcdir)/utility/lua/include
 
 ## Above, note -I../intl instead of -I$(top_srdir/intl) is deliberate.
 
@@ -80,11 +81,15 @@
 civserver_DEPENDENCIES = ../utility/libcivutility.a ../common/libcivcommon.a \
       ../ai/libcivai.a ../utility/libcivutility.a ./libcivserver.a \
       ../utility/libcivutility.a ../common/aicore/libaicore.a \
+      ../utility/lua/src/liblua.a ../utility/lua/src/lib/liblualib.a \
       ./generator/libgenerator.a $(USER_DB_DEP)
 civserver_LDADD        = ../utility/libcivutility.a ../common/libcivcommon.a \
       ../ai/libcivai.a ../utility/libcivutility.a ./libcivserver.a @INTLLIBS@ \
       ../utility/libcivutility.a ../common/libcivcommon.a ../ai/libcivai.a \
       ../utility/libcivutility.a ./libcivserver.a ../utility/libcivutility.a \
       ../common/aicore/libaicore.a ./generator/libgenerator.a \
+      ../utility/lua/src/liblua.a ../utility/lua/src/lib/liblualib.a \
       $(USER_DB_LIB) $(SERVER_LIBS)
 
+
+
Index: utility/Makefile.am
===================================================================
RCS file: /home/freeciv/CVS/freeciv/utility/Makefile.am,v
retrieving revision 1.7
diff -u -r1.7 Makefile.am
--- utility/Makefile.am 6 Sep 2004 17:13:07 -0000       1.7
+++ utility/Makefile.am 5 Apr 2005 11:13:21 -0000
@@ -1,6 +1,6 @@
 ## Process this file with automake to produce Makefile.in
 
-SUBDIRS=        ftwl
+SUBDIRS=        ftwl lua
 
 noinst_LIBRARIES = libcivutility.a
 

Attachment: lualite.tar.gz
Description: application/gunzip


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