Bruce O. Benson wrote:
> - I still need to create a fake symlink in $(LUA)/bin for a Linux26g4.
> IUP3 wants to see it, but it does not get created when Lua is built
> (from Luaforge). I hope the IUP and Lua sources can be in sync one way
> or the other on this. IUP is also looking for luac5.1, and bin2c5.1
> - Since bin2c is asked for, is there any reason it can't be included in
> the tree? It is in a quirky limbo, where it's no longer in the source
> distribution, but is in the binary one.
I also think the current setup is not perfect. Lua is now available as
a package on many distributions, and IUP should really work with any
correctly installed Lua setup. This currently requires one to look
carefully at the tecmake_compact.mak file, and doesn't really work at
all for the CVS version (because you have to learn about bin2c).
I think IUP deserves wider visibility, and one way to achieve that is to
provide packages for Debian, Ubuntu, etc. More people will try it
out and look at the demos if they can just say 'apt-get libiup3-dev'.
So to increase the visibility of IUP, it would be good to make it easier
to package the library. Lua does this pretty well, all you need is to
say "make linux" and "make install". IUP currently does not do this
well because of the dependence on the paths of the required packages
Lua, CD, and IM. If somebody builds a IUP package for Ubuntu, it really
must work with the Ubuntu Lua package, and not include a new Lua binary!
The problem is that the current computation of the include paths and
library paths in tecmake_compact.mak assumes that these packages live
together (e.g. $(CD)/include and $(CD)/lib), while a Ubuntu package of
CD would put these in /usr/include/cd and /usr/lib). It should
be made simpler to make these settings in tecmake_compact.mak.
So my suggestion: Rearrange the definitions in tecmake_compact.mak.
Move all the interesting definitions to the top, like the example below.
(Note that I've removed the definitions of IUP, CD, IM, LUA, LUA51 -
these are only used to define the include and lib paths, and for
flexibility I think it is better to set those directly.)
# Tecgraf Libraries Location
# (no need to set this if all path definitions below are changed)
TECTOOLS_HOME ?= ../..
# Change these for your setup. For instance, to use the system's
# Lua library on Ubuntu, use
# LUA_INCLUDE = /usr/include/lua5.1
# LUA_LIBDIR =
# LUA_LIB = lua51
# LUABIN = /usr/bin/lua5.1
# LUAC = /usr/bin/luac5.1
IUP_INCLUDE ?= $(TECTOOLS_HOME)/iup/include
IUP_LIBDIR ?= $(TECTOOLS_HOME)/iup/lib
IUP_LIB ?= iup # can be changed to iupgtk to link to GTK driver
CD_INCLUDE ?= $(TECTOOLS_HOME)/cd/include
CD_LIBDIR ?= $(TECTOOLS_HOME)/cd/lib
CD_LIB ?= cd
IM_INCLUDE ?= $(TECTOOLS_HOME)/im/include
IM_LIBDIR ?= $(TECTOOLS_HOME)/im/lib
IM_LIB ?= im
LUA_INCLUDE ?= $(TECTOOLS_HOME)/lua5.1/include
LUA_LIBDIR ?= $(TECTOOLS_HOME)/lua5.1/lib
LUA_LIB ?= lua51
LUABIN ?= $(TECTOOLS_HOME)/lua5.1/bin/lua5.1
LUAC ?= $(TECTOOLS_HOME)/lua5.1/bin/luac5.1
My point is that all the important settings should be together and
explicit, and the small tricks with LUASUFX and USE_LUA<number> should
be removed from the rest of tecmake_compact.mak. If someone wants to
compile for Lua3 or Lua5.0, they should just change the definitions above.
Also it should be made clear that byteorder and wordsize is important
(tecmake_compact.mak doesn't always get it right, for instance my arm
setup is little endian). If it's wrong, the Lua bindings fail to
compile or generate incorrect output.
Finally, bin2c is not included in the Lua standard distribution, and is
not in Ubuntu Lua either. This is usually not a problem, since the
source tarballs contain the .loh files, but this doesn't work for
compiling from CVS, and even for the tarball it sometimes doesn't work
because of wordsize and byteorder (e.g. when you need button_be64.loh).
My suggestion would be to include bin2c.lua in srclua5 and to call it
explicitely like you now do with generator.lua.
Just some ideas,
ps. By the way, srclua5 still doesn't compile for me out of the box -
first, one has to create the loh directory, second, sbox.lua and
cbox.lua refer to include files iupsbox.h and iupcbox.h that do not
exist in IUP3. If one removes the "include" line from sbox.lua and
cbox.lua, they compile fine. Also, even with USE_GTK, it tries to link
to libiup (not libiupgtk), which fails if one doesn't build the Motif