Re: [Freeciv-Dev] trunk lua mess

2007-06-22 Thread Per Inge Mathisen
On Fri, 22 Jun 2007, William Allen Simpson wrote:
 Finally, could somebody explain why lua is important?  It's hardly used!

That is something we hope to change. lua is important for increased 
configurability, and making more advanced modpacks. The tutorial, for 
example, is made in lua. I hope to commit a patch that moves configuration 
of huts into lua files soon.

   - Per

___
Freeciv-dev mailing list
Freeciv-dev@gna.org
https://mail.gna.org/listinfo/freeciv-dev


Re: [Freeciv-Dev] trunk lua mess

2007-06-20 Thread William Allen Simpson
It appears that tolua++ is a dead end.  It hasn't had any fixes for
over a year, and the version 1.0.92 doesn't compile as distributed.

I have no confidence in a coder that accidentally deleted the include
of the primary header file.  Clearly somebody that doesn't compile
before commit (and has lost interest in fixing obvious bugs):

--- dependencies/tolua/tolua_event.c(revision 13006)
+++ dependencies/tolua/tolua_event.c(working copy)

-#include tolua_event.h
-#include tolua.h
+#include tolua++.h

===

I fixed the compilation (there are a couple more errors), but the output
still has another bug, somehow not converting its internal representation
_cstring to char *:

api_gen.c: In function `tolua_api__00':
api_gen.c:1384: error: `_cstring' undeclared (first use in this function)
api_gen.c:1384: error: (Each undeclared identifier is reported only once
api_gen.c:1384: error: for each function it appears in.)
api_gen.c:1384: error: parse error before const
api_gen.c:1386: error: `tolua_var_1' undeclared (first use in this function)
api_gen.c: In function `tolua_api_N_00':
api_gen.c:1413: error: `_cstring' undeclared (first use in this function)
api_gen.c:1413: error: parse error before const
api_gen.c:1415: error: `tolua_var_2' undeclared (first use in this function)
api_gen.c: In function `tolua_api_Q_00':
api_gen.c:1442: error: `_cstring' undeclared (first use in this function)
api_gen.c:1442: error: parse error before const
api_gen.c:1444: error: `tolua_var_3' undeclared (first use in this function)

===

There is another coder that's been working on a successor called toluaxx,
and has commits as recently as 2 months ago.  I'll try that tomorrow.


___
Freeciv-dev mailing list
Freeciv-dev@gna.org
https://mail.gna.org/listinfo/freeciv-dev


Re: [Freeciv-Dev] trunk lua mess

2007-06-19 Thread Per I. Mathisen
On Mon, 18 Jun 2007, William Allen Simpson wrote:
 Unfortunately, tolua++ doesn't seem to be widely available as an external
 package.

It is in the Fedora 7 repository, at least.

 However, I checked my current favorite platforms (MacPorts, NetBSD pkgsrc,
 debian, Ubuntu), and all of them have lua 5.1.2 as packages.  I'm thinking
 that maybe the way to go with lua is the same as gettext -- change to a
 build option, but allow an up-to-date external library for most folks.

Isn't that the worst of both worlds? You get the hassle of updating your 
internal lua, *and* the problems reported of getting (the right version 
of) external lua to play ball on all kinds of distributions and setups?

BTW, the sources need some changes to work with new lua and tolua 
versions, as you can see in r12995-9, and I am not sure if those changes 
are compatible with older lua versions.

   - Per

___
Freeciv-dev mailing list
Freeciv-dev@gna.org
https://mail.gna.org/listinfo/freeciv-dev


Re: [Freeciv-Dev] trunk lua mess

2007-06-19 Thread William Allen Simpson
Per I. Mathisen wrote:
 BTW, the sources need some changes to work with new lua and tolua 
 versions, as you can see in r12995-9, and I am not sure if those changes 
 are compatible with older lua versions.
 
Well, I expect to find out over the next couple of days :-)

I'm putting the tolua++ in its own subdirectory, so it will compile and
not interfere with the older tolua in my build tree.

___
Freeciv-dev mailing list
Freeciv-dev@gna.org
https://mail.gna.org/listinfo/freeciv-dev


Re: [Freeciv-Dev] trunk lua mess

2007-06-18 Thread William Allen Simpson
William Allen Simpson wrote:
 Per Inge Mathisen wrote:
 Also, while on the topic of api_gen.c|h, I do not see why these 
 automatically generated source files are in the repository? All the 
 tools required to generate them are already in the repository.

 I agree.  And there was a part of a bug report by a translator on another
 list that indicated a problem with keeping them in sync (or something).
 
I've just looked at the trunk/server/scripting/.svn/dir-prop-base

It appears that api_gen.h and .c were already set to be ignored, along with
  Makefile
  Makefile.in
  api_gen.c
  api_gen.h
  .deps
  libscripting.a

AFAIK, all that needs to be done is svn delete them, and they should go
away.  Somebody must have deliberately added them in the past?

svn ci -m delete api_gen.*

Deleting   scripting/api_gen.c
Deleting   scripting/api_gen.h

Committed revision 13004.


___
Freeciv-dev mailing list
Freeciv-dev@gna.org
https://mail.gna.org/listinfo/freeciv-dev


Re: [Freeciv-Dev] trunk lua mess

2007-06-18 Thread William Allen Simpson
William Allen Simpson wrote:
 AFAIK, all that needs to be done is svn delete them, and they should go
 away.  Somebody must have deliberately added them in the past?
 
Yes, for cross compiling from linux to windows in:
   http://bugs.freeciv.org/Ticket/Display.html?id=13571

There is a better way.  Generate your tools into a tools/bin, then
cross compile.  It isn't too hard.  I'll look into it.

(Do we really cross-compile releases?)

___
Freeciv-dev mailing list
Freeciv-dev@gna.org
https://mail.gna.org/listinfo/freeciv-dev


Re: [Freeciv-Dev] trunk lua mess

2007-06-18 Thread William Allen Simpson
Question: is tolua used for anything other than pre-compilation?

That is, AFAICT tolua is only used to build api_gen.*

Therefore, tolua would never be anything other than natively compiled,
and would not be distributed in a binary distribution?

Only lua would be generated for the target distribution?

My suggestion is that we:
1) get tolua++ installed and running in the trunk,
2) then test cross-compilation,
3) then upgrade lua itself afterward.

My observation is that the main problem we experienced was trying to change
from tolua++.h to tolua.h.

Therefore, I also suggest that we not change the header.  It seems to be
too embedded in the tolua++ expectations.

___
Freeciv-dev mailing list
Freeciv-dev@gna.org
https://mail.gna.org/listinfo/freeciv-dev


Re: [Freeciv-Dev] trunk lua mess

2007-06-18 Thread Per I. Mathisen
On Mon, 18 Jun 2007, William Allen Simpson wrote:
 My observation is that the main problem we experienced was trying to change
 from tolua++.h to tolua.h.

No, that was just an amusing side-show. The problem was that tolua++ 
generated a faulty api_gen.c file.

   - Per

___
Freeciv-dev mailing list
Freeciv-dev@gna.org
https://mail.gna.org/listinfo/freeciv-dev


Re: [Freeciv-Dev] trunk lua mess

2007-06-18 Thread Per Inge Mathisen
On 6/18/07, William Allen Simpson [EMAIL PROTECTED] wrote:
 1) install the latest lua.  Make sure it works.  Surely the latest lua will
 still work with the older tolua!

No, tolua 5.0 does not work with lua 5.1, unfortunately. And there is
no more recent version of tolua, hence the use of tolua++, a more up
to date derivative version.

  - Per

___
Freeciv-dev mailing list
Freeciv-dev@gna.org
https://mail.gna.org/listinfo/freeciv-dev


Re: [Freeciv-Dev] trunk lua mess

2007-06-18 Thread William Allen Simpson
Per Inge Mathisen wrote:
 On 6/18/07, William Allen Simpson [EMAIL PROTECTED] wrote:
 1) install the latest lua.  Make sure it works.  Surely the latest lua will
 still work with the older tolua!
 
 No, tolua 5.0 does not work with lua 5.1, unfortunately. And there is
 no more recent version of tolua, hence the use of tolua++, a more up
 to date derivative version.
 
Ah.  So it has to be tolua first.  According to the documentation, tolua++
will work with both lua 5.0 and 5.1.

OK, we have a plan.

===

Unfortunately, tolua++ doesn't seem to be widely available as an external
package.  It has to be in the source tree.

However, I checked my current favorite platforms (MacPorts, NetBSD pkgsrc,
debian, Ubuntu), and all of them have lua 5.1.2 as packages.  I'm thinking
that maybe the way to go with lua is the same as gettext -- change to a
build option, but allow an up-to-date external library for most folks.

___
Freeciv-dev mailing list
Freeciv-dev@gna.org
https://mail.gna.org/listinfo/freeciv-dev


[Freeciv-Dev] trunk lua mess

2007-06-17 Thread Per Inge Mathisen
I tried unsucessfully to update trunk to latest lua and tolua versions. 
For some reasons I could not figure out, tolua generated a bad api_gen.c, 
and the makefile did not regenerate this file for me and thus alert me to 
the problems before I had already committed the changes. Even 'make 
maintainer-clean' did not clean out these files.

So I had to roll back the repository to the state before I started the 
upgrade. This generates some unfortunate svn noise, and William's r13000 
is gone. I am really sorry about that.

Speaking of r1300, I would very much like to see it go in in smaller 
chunks which are easier to manage when debugging using svn.

Also, while on the topic of api_gen.c|h, I do not see why these 
automatically generated source files are in the repository? All the tools 
required to generate them are already in the repository.

   - Per

___
Freeciv-dev mailing list
Freeciv-dev@gna.org
https://mail.gna.org/listinfo/freeciv-dev