On 03/02/18 00:21, Antonio Scuri wrote:
   Hi,

   I don't know why make is not behaving as you expect. I never used it in
that way.

   Regarding bin2c, I didn't understand what you are trying to change.
bin2c.lua is included in IUP source code.

Best,
Scuri

[...]

G'day,

[As an aside: In response to my IUP "Footnote 2":  I see that the IUP
Subversion repository seems to be stable, and now is at r4693; a week
ago it was at r4682.]

The build variable BIN2C breaks down into three parts:

    1. Finding a suitable path to a Lua interpreter;
    2. Invoking that interpreter via its name; and
    3. Using the script "bin2c.lua", as provided by the sources.

My problem is with a snippet of code that uses the bin2c.lua script
to convert some binary data into a C header file that encodes the
bytes of the binary.  The file extension is 'lh'; the tecmake.mak
rule that generates commands for this conversion is the static
pattern rule:

--- (cut here) ---

$(LHDIR)/%.lh: $(OBJROOT)/%.lo
        @echo ''; echo Tecmake: generating $(<F)
        $(ECHO)$(BIN2C) $< > $@

--- (end of snippet) ---

Tracking back, the definition of BIN2C happens in the middle of
a definition block "ifdef USE_LUA ... endif".  The code in that
area of tecmake.mak (about line 1036-1046) is:

--- (cut here) ---

  LUA_INC ?= LUA/include
  INCLUDES += $(LUA_INC)

  LUA_BIN ?= $(LUA)/bin/$(TEC_UNAME)
  ifdef USE_BIN2C_LUA
    BIN2C := $(LUA_BIN)/lua$(LUA_SFX) $(BIN2C_PATH)bin2c.lua
  else
    BIN2C := $(LUA_BIN)bin2c$(LUA_SFX)
  endif
  LUAC   := $(LUA_BIN)luac$(LUA_SFX)
  LUABIN := $(LUA_BIN)lua($LUA_SFX)

--- (end of snippet) ---

The problems I have comes from trying to invoke Lua, where my code
perhaps does not line up with the build system expectations:

1. I don't include building Lua in the "tecgraf" build tree, alongside
   IM/CD/IUP; instead, I simply want to invoke the OS-installed
   package for Lua 5.1.5;

2. On Linux Mint (derived from Ubuntu), typing simply "lua", or,
   equally simply, "lua5.1", invokes Lua; tecmake.mak sets LUA_SFX to
   "5.1", so the command to invoke Lua is "lua5.1"; but

3. On Gentoo Linux, things are set up differently, and, while there
   is a Lua interpreter at /usr/bin/lua, there is no /usr/bin/lua5.1.
   Therefore, on Gentoo, tecmake.mak's composes the wrong command to
   invoke Lua, and therefore the build fails.

In addition, I'm also a little confused about similarities or
differences between defining symbols to the shell, versus defining
them on the command line, e.g. (taken from the IM/CD/IUP build
guide, Ubuntu GNU/Linux build section):

    export LUA_SUFFIX=
    export LUA_INC=/usr/include/lua5.1

versus (my own code, a trial that did not work):

    cd /base/im/src
    make LUA_SUFFIX= LUA_INC=/usr/include/lua5.1

(When focussing on CD, I added a symlink in /usr/bin so that both
/usr/bin/lua and /usr/bin/lua5.1 were valid, but I don't want to do
this in all installations, as it cuts across the package manager's
boundaries.)

thanks in advance for any assistance,

s-b etc

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Iup-users mailing list
Iup-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/iup-users

Reply via email to