Makefile targets

181 views
Skip to first unread message

Luiz Henrique de Figueiredo

unread,
Aug 28, 2025, 7:12:42 AM (11 days ago) Aug 28
to lu...@googlegroups.com
We are considering removing the targets below from the Lua Makefile:
aix bsd freebsd mingw solaris

The motivation is that we have no access to these platforms and so no
way to test these targets and their recipes.

Does anyone use those targets?
All feedback welcome.
--lhf

Sainan

unread,
Aug 28, 2025, 7:26:17 AM (11 days ago) Aug 28
to lu...@googlegroups.com
This seems like really strange reasoning given the existence of macros like LUA_USE_IOS. Do you have access to an iOS development kit but not a Windows machine to test mingw?

-- Sainan

Sewbacca

unread,
Aug 28, 2025, 7:32:17 AM (11 days ago) Aug 28
to lu...@googlegroups.com

Occasionally I compile Lua on MinGW. Guessing the platform does not work (it deduces MINGW64_NT-10.0-19045), but directly specifying make mingw works like a charm. Also the MINGW-packages repo[1] packages Lua using the mingw target (see PKGFILE[2]).

[1] https://github.com/msys2/MINGW-packages
[2] https://github.com/msys2/MINGW-packages/blob/d1308c0531036be406bcbe924085492950ebd920/mingw-w64-lua/PKGBUILD#L55-L60

Luau Project

unread,
Aug 28, 2025, 8:55:53 AM (11 days ago) Aug 28
to lua-l
Currently, ZeroBraneStudio IDE seems to use `mingw` as a Makefile target to build their builtin Lua interpreters for Windows: https://github.com/pkulchenko/ZeroBraneStudio/blob/8142e639510b777a97c0da861731e3c13fb605b4/build/build-win32.sh#L214-L227

I guess that freebsd people use bsd-related targets to build different Lua versions too:
    * https://github.com/freebsd/freebsd-ports/blob/d0cafeefa85f639bebe0c21ca7f459f9bf6d07d6/lang/lua54/Makefile#L20
    * https://svnweb.freebsd.org/ports/head/lang/lua/Makefile?revision=343323&view=markup&pathrev=355359#l22

Marvin Scholz

unread,
Aug 28, 2025, 8:56:33 AM (11 days ago) Aug 28
to lu...@googlegroups.com


On 28 Aug 2025, at 13:12, Luiz Henrique de Figueiredo wrote:

> We are considering removing the targets below from the Lua Makefile:
> aix bsd freebsd mingw solaris
>
> The motivation is that we have no access to these platforms and so no
> way to test these targets and their recipes.
>
> Does anyone use those targets?

We use the mingw target in VLC without issues
https://code.videolan.org/videolan/vlc/-/blob/master/contrib/src/lua/rules.mak?ref_type=heads#L22

So if it were to be removed we would need to carry patches to keep it.

> All feedback welcome.
> --lhf
>
> --
> You received this message because you are subscribed to the Google Groups "lua-l" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to lua-l+un...@googlegroups.com.
> To view this discussion visit https://groups.google.com/d/msgid/lua-l/CAD55k3oV%2BYoyK9D7ir%3D6%2BdEZT1tO0vUW%3DC8gioJfkX5q5cLJpA%40mail.gmail.com.

Warner Losh

unread,
Aug 28, 2025, 9:04:42 AM (11 days ago) Aug 28
to lu...@googlegroups.com
make freebsd works. Just confirmed with both 5.5.0 beta and 5.4.8 on FreeBSD 14.3-RELEASE. Reading the Makefile, the targets FreeBSD, NetBSD and OpenBSD will also work (all the BSDs have the same libedit). Make bsd also works, but, as expected, produces a lua w/o readline integration.

What kind of access would you need or want? FreeBSD produces several CI-friendly VMs that can easily be downloaded for testing. Is there a CI environment that we could integrate into?

Warner 

Warner Losh

unread,
Aug 28, 2025, 9:07:35 AM (11 days ago) Aug 28
to lu...@googlegroups.com
FreeBSD has lua integrated into the base system. We use it for boot loader scripting, pkg scripting and a few other things. While that integration means we don't directly use the 'freebsd' target to build Lua in that integrated environment, I use that target to do A/B testing with lua when I integrate new versions.

Warner 

Augusto Goulart

unread,
Aug 28, 2025, 11:44:09 AM (11 days ago) Aug 28
to lu...@googlegroups.com
I believe scoop (https://github.com/ScoopInstaller) uses mingw to build Lua from source (which I do use). Also, as an anecdote, anyone using windows to build Lua will want -- and likely is -- using mingw.

Augusto

--
You received this message because you are subscribed to the Google Groups "lua-l" group.
To unsubscribe from this group and stop receiving emails from it, send an email to lua-l+un...@googlegroups.com.

Yan

unread,
Aug 29, 2025, 12:06:39 AM (11 days ago) Aug 29
to lua-l
Mingw helps me compilelua on Windows platform when I first leaned lua.  I still use mingw compiling lua on Windows now. Please dont !!!

云风 Cloud Wu

unread,
Aug 29, 2025, 12:13:53 AM (11 days ago) Aug 29
to lu...@googlegroups.com
Luiz Henrique de Figueiredo <l...@tecgraf.puc-rio.br> 于2025年8月28日周四 19:12写道:
>
> We are considering removing the targets below from the Lua Makefile:
> aix bsd freebsd mingw solaris
>
> The motivation is that we have no access to these platforms and so no
> way to test these targets and their recipes.
>
> Does anyone use those targets?

I only use mingw in Windows (and rarely use msvc). If mingw target is
removed, which target is recommended for Windows?

--
http://blog.codingnow.com

sur-behoffski

unread,
Aug 29, 2025, 1:33:24 AM (11 days ago) Aug 29
to lu...@googlegroups.com, iup-...@lists.sourceforge.net
--

[As well as a lua-l list reply, this message is being cross-posted
to the Tecgraf "iup-users" mailing list.]

--

The Tecgraf IM/CD/IUP projects strive to be portable, and especially
strives to use an all-singing, all-dancing platform tailoring file
*/src/tecmake.mak. For example, in IUP:

https://sourceforge.net/p/iup/iup/HEAD/tree/trunk/iup/tecmake.mak

We see:

# Known Platforms

UNAMES = Linux24 Linux24g3 Linux24g3_64 Linux26 Linux26_64 Linux26g4 Linux26g4_64 Linux26_ia64 FreeBSD54 SunOS57 SunOS58 SunOS510 SunOS510_x86 AIX43 IRIX65 IRIX6465
# [...]

ifneq ($(findstring AIX, $(TEC_UNAME)), ) [...]
endif

-------

There's more platform-specific stuff, in tec_uname. I rewrote
Tecgraf's version for lglicua:

https://sourceforge.net/p/lglicua/code/ci/master/tree/build/support/tec_uname

Here's a terse extract of some of the things it's looking at:

ComputeTecUname() {
# Base Definitions
TEC_SYSNAME=`uname -s`
TEC_SYSVERSION=`uname -r|cut -f1 -d.`
TEC_SYSMINOR=`uname -r|cut -f2 -d.`
TEC_SYSARCH=`uname -m`

# Fixes
case "$TEC_SYSNAME" in
SunOS | IRIX )
TEC_SYSARCH=`uname -p`
;;
AIX ) [...]
Darwin )
TEC_SYSNAME=MacOS
TEC_SYSVERSION=`sw_vers -productVersion|cut -f1 -d.`
TEC_SYSMINOR=`sw_vers -productVersion|cut -f2 -d.`
TEC_SYSARCH=`uname -p`
UNAME_SFX="$TEC_SYSARCH"
;;

FreeBSD ) [...]
GNU/kFreeBSD ) [...]
SunOS ) [...]
esac
}

--------

There may be interest in maintaining portability amongst the wider
set of users who use Lua alongside Tecgraf's toolkits.

cheers, s-b etc

Roger Leigh

unread,
Aug 29, 2025, 6:33:28 AM (10 days ago) Aug 29
to lu...@googlegroups.com
One alternative to look at for Windows is
https://gitlab.com/codelibre/lua/lua-cmake .  I just updated it for Lua
5.4.8.

This is a successor to LuaDist with a number of improvements, and it
provides a CMake build for Lua, which allows you to build for any
platform, including all of the platforms slated for removal here.  It
also provides more portable and more flexible configuration of features,
including:

* Configuration of the build platform (POSIX, Windows or Freestanding);
autodetects by default

* Configuration of static or shared libraries, and also separately
configuration of the dynamic library loader

* Configuration of library features (C++ support, longjmp/exceptions for
errors, C89 support, API check enabling)

* Configuration of lua line editor support, including autodetection of
GNU readline or BSD editline

* Supports running all of the Lua testsuite via CTest

* Installation to standard locations

Example:https://gitlab.com/codelibre/lua/lua-cmake/-/jobs/11184206030


It's tested on Linux, FreeBSD and Windows; MacOS also works but I don't
currently have it in the CI setup.


If there is any interest in having this adopted upstream, I would be
happy for this code to be donated and integrated into the upstream Lua
codebase.  It makes building on Windows a breeze, either with MSVC,
MinGW or Cygwin, and the flexible autodetection of compilers and
features makes it possible to build on a whole host of Unix systems the
static Makefile won't support without manual editing. Additionally, you
also get full support for Readline/Editline on Windows as well as Unix.


Kind regards,
Roger

Luau Project

unread,
Sep 1, 2025, 1:17:56 PM (7 days ago) Sep 1
to lua-l
> The motivation is that we have no access to these platforms and so no
> way to test these targets and their recipes.

lhf,

in the open-source repository https://github.com/luau-project/build-lua-on-wine , I wrote two guides about how to setup x64 machines (Debian 13 stable) to build Lua on Wine (""Windows"") using either the legacy 32-bit MinGW or the recent MinGW-w64 binaries + GNU Make.

I am not sure if this setup-process can be replicated on arm64 machines (I don't have any to test), but I've read in the internet that it is possible to do that on Apple arm64 machines through Rosetta.

PS: On usual (and recent) x64 Linux distributions, it is straightforward to follow the tutorials.
Reply all
Reply to author
Forward
0 new messages