Passing target to source Makefile

Russell Haley russ.haley at
Thu Jul 21 19:25:19 UTC 2016

On Thu, Jul 21, 2016 at 2:55 AM, olli hauer <ohauer at> wrote:
> On 2016-07-21 08:03, Russell Haley wrote:
>> Hi there,
>> I've been able to hack up the Makefile for an update of lua53 but the
>> one thing still missing is the ability to pass a target for the source
>> Makefile (i.e. lua's Makefile, not the ports Makefile). I need to pass
>> in "freebsd" as per the build instructions for lua.
>> Also, I can't seem to get make makeplist to work, but I think that's
>> because the lua makefile is defaulting to install the files (due to
>> the lack of target) and overriding the makeplist output?
>> Thanks,
>> Russell
> Hi Russel,
> it is not clear if you try to hack the lag/lua53 port or a different one.
> There are perhaps two ways, during configure or as make arg
> CONFIGURE_ARGS+= target=freebsd
> or
> MAKE_ARGS+= target=freebsd
> Perhaps you can give the list some more information?
 Yes, of course.

TLDR; I think the Lua port needs some love so I'm trying to update it
to the most recent version.

I am trying to develop a cross platform Lua application that will run
in both FreeBSD and Debian. I have had to abandon the FreeBSD lua53
port for the following reasons:

1) It does not use the recommended "freebsd" target. While the port
overlays many of the same options, the system doesn't seem to respect
the targets and also performs the installation without specifically
calling the "install" target. This is from memory and *could* be
incorrect, but this is my anecdotal experience. In the end, we will
lose the benefit of any changes made upstream (more on that in a bit).
2) There seems to be lost of "stuff" going on in the port file that
seems unnecessary as the Lua Makefile takes care of most of the
3) By forcing all Lua installation to use luaXX naming conventions, it
forces the user to have to create work arounds or links to get the
standard interpreter to work by calling "lua" (which is the expected
use case in my opinion). The current supported version of Lua is 5.3.
While I can see the need to install past versions using explicit
naming, it is my opinion that the current version should be installed
as Lua, not luaXX.
4) The current Makefile applies -fPIC to some of the platforms, but
not armv6. I require that switch for all platforms and it seems to
work fine on my ARM board (Solid-Run Hummingboard, iMX6/cortex A9).
While it's an easy patch, it adds to the list of reasons to build Lua

So with that in mind, I have been building and running Lua from git
with no patches. While I can continue in this manner, I thought I
would try to give back to the community if there is interest. Lua is
now on version 5.3.3. I have been able to hack up the ports Makefile
to run "successfully" but it still only calls the default target that
assumes an installation. So, my goals in terms of a ports upgrade are
as follows:

- Update to the latest Lua revision
- Get ports to call the correct targets (the makeargs above looks promising)
- Remove the Lua53 naming convention. Once Lua move to a new major
version, this can be re-implemented and the new Lua version can become
the standard interpreter.
- Add -fPIC to all platforms in FreeBSD
- Use clang and bmake instead of forcing gcc/gmake.

The last item I think is the most difficult as it will require others
to test. However, I have successfully built and run Lua 5.3.2 (testing
5.3.3) using clang and bmake (as well as other libraries such as
luasys and luaxml).

All input is welcome. Again, if this is not where the community wants
to go, it's no big deal.

Please also note that I have made an upstream request to the Lua
community to consider applying a patch to the freebsd target in their
source/Makefile. The patch can be found here: I don't expect this to happen quickly

Most Sincerely,


More information about the freebsd-ports mailing list