-
Notifications
You must be signed in to change notification settings - Fork 8
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Configure Builds with Lua #114
base: master
Are you sure you want to change the base?
Conversation
I do not see that |
Excellent point. b5eff3f has added this
|
Does it need normal stock Lua 5.x or does it work with LuaJIT too? |
Up until reading this comment this script has been tested using the official Lua 5.4.6 on x86_64 Linux and DOS Real Mode (via this build). I just built and tested the script running under LuaJIT, initial results: looks like it works without issue
|
… to be written into the file
…lobal table instead
…eclaration instead)
…configur.lua wcc -s'
I'm not 100% on what For the time being I've pushed ef743bf which will generate a rough mockup (probably not working) of a Watcom makefile when running |
This is a neat idea, I'm all for it. However, I don't see how it fully solves:
Specifically, generating the error code macros and The solution, I think, is to preprocess this with the target compiler, and then make a native (build-time) binary that generates the headers. This implies that the configure script must distinguish between native and target toolchains, eg via autoconf-style variables such as edit: Also, if your intention is to eventually merge #89 into this, the following may be worth considering beforehand:
|
It's E.g. const char *w32_cflags = "-nologo -Zi -Zo -GS- -I. -I../inc -DWATT32_BUILD -D_CRT_SECURE_NO_WARNINGS -D_CRT_NONSTDC_NO_WARNINGS -D_CRT_OBSOLETE_NO_WARNINGS -D_WIN32_WINNT=0x0601 -D_WINSOCK_DEPRECATED_NO_WARNINGS -DBUILD_WINDOWS -Wno-#pragma-messages -MD -Ox -fms-compatibility";
const char *w32_cc = ""f:\ProgramFiler\LLVM-17.0\win64/bin/clang-cl.exe""; Hence those 3 00000000 63 6F 6E 73 74 20 63 68 61 72 20 2A 77 33 32 5F const char *w32_
00000010 63 66 6C 61 67 73 20 3D 20 22 2D 6E 6F 6C 6F 67 cflags = "-nolog
00000020 6F 20 2D 5A 69 20 2D 5A 6F 20 2D 47 53 2D 20 2D o -Zi -Zo -GS- -
00000030 49 2E 20 2D 49 2E 2E 2F 69 6E 63 20 2D 44 57 41 I. -I../inc -DWA
00000040 54 54 33 32 5F 42 55 49 4C 44 20 2D 44 5F 43 52 TT32_BUILD -D_CR
00000050 54 5F 53 45 43 55 52 45 5F 4E 4F 5F 57 41 52 4E T_SECURE_NO_WARN
00000060 49 4E 47 53 20 2D 44 5F 43 52 54 5F 4E 4F 4E 53 INGS -D_CRT_NONS
00000070 54 44 43 5F 4E 4F 5F 57 41 52 4E 49 4E 47 53 20 TDC_NO_WARNINGS
00000080 2D 44 5F 43 52 54 5F 4F 42 53 4F 4C 45 54 45 5F -D_CRT_OBSOLETE_
00000090 4E 4F 5F 57 41 52 4E 49 4E 47 53 20 2D 44 5F 57 NO_WARNINGS -D_W
000000A0 49 4E 33 32 5F 57 49 4E 4E 54 3D 30 78 30 36 30 IN32_WINNT=0x060
000000B0 31 20 2D 44 5F 57 49 4E 53 4F 43 4B 5F 44 45 50 1 -D_WINSOCK_DEP
000000C0 52 45 43 41 54 45 44 5F 4E 4F 5F 57 41 52 4E 49 RECATED_NO_WARNI
000000D0 4E 47 53 20 2D 44 42 55 49 4C 44 5F 57 49 4E 44 NGS -DBUILD_WIND
000000E0 4F 57 53 20 2D 57 6E 6F 2D 23 70 72 61 67 6D 61 OWS -Wno-#pragma
000000F0 2D 6D 65 73 73 61 67 65 73 20 2D 4D 44 20 2D 4F -messages -MD -O
00000100 78 20 2D 66 6D 73 2D 63 6F 6D 70 61 74 69 62 69 x -fms-compatibi
00000110 6C 69 74 79 22 3B 0A 63 6F 6E 73 74 20 63 68 61 lity";.const cha
00000120 72 20 2A 77 33 32 5F 63 63 20 20 20 20 20 3D 20 r *w32_cc =
00000130 22 22 66 3A 5C 50 72 6F 67 72 61 6D 46 69 6C 65 ""f:\ProgramFile
00000140 72 5C 4C 4C 56 4D 2D 31 37 2E 30 5C 77 69 6E 36 r\LLVM-17.0\win6
00000150 34 2F 62 69 6E 2F 63 6C 61 6E 67 2D 63 6C 2E 65 4/bin/clang-cl.e
00000160 78 65 22 22 3B 0A xe"";. ``` Otherwise the C pre-processor would complain. See |
Indeed! I had not thought of that, that's a tough problem to solve. Worst still The immediate workaround to these cross-compiling problems would be:
Yes, I assumed it was more complex then a direct string conversion. It should be trivial to write a function in the script that converts |
Added A_ARGS Inital rule additions for DOS4GW and Win32 versions of the Watcom makefile
Documented bin2c.lua usage
…un DJGPP binaries)
…r.c' while cross compiling DJGPP from Linux
This reverts commit 7a21b51.
As of 5debd9c Tested successfully
Untested but assumed to work
Now that there's something worth testing I will re-open this PR |
This pull request has been added in a draft state for feedback purposes...
This pull request adds a Lua script that can determine and address the differences between different types of build platforms. The script is inspired by GNU Autotools but thanks to Lua is completely platform agnostic.
The script aims to address in the current build system like:
rm
vsdel
)-fdiagnostics-color=never
)configur.lua
for everyone instead ofconfigur.bat
vsconfigur.sh
)Note: While FreeDOS has shipped Lua for some time on their bonus CD this version uses a DOS extender and could freeze if another DOS extender is started at the same time. https://github.com/Lethja/lua-watcom allows Lua to be built for real mode to avoid this problem. Luas official makefile is excellent at building non-DOS 32-bit targets.