delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/2013/10/19/00:00:21

X-Authentication-Warning: delorie.com: mail set sender to djgpp-bounces using -f
X-Received: by 10.236.56.70 with SMTP id l46mr6333239yhc.2.1382154247046;
Fri, 18 Oct 2013 20:44:07 -0700 (PDT)
X-Received: by 10.49.14.70 with SMTP id n6mr872qec.18.1382154247021; Fri, 18
Oct 2013 20:44:07 -0700 (PDT)
Newsgroups: comp.os.msdos.djgpp
Date: Fri, 18 Oct 2013 20:44:06 -0700 (PDT)
In-Reply-To: <bcd3711d-e2c6-420a-b6c9-bb5973e4870d@googlegroups.com>
Complaints-To: groups-abuse AT google DOT com
Injection-Info: glegroupsg2000goo.googlegroups.com; posting-host=65.13.115.246;
posting-account=p5rsXQoAAAB8KPnVlgg9E_vlm2dvVhfO
NNTP-Posting-Host: 65.13.115.246
References: <f753e67c-d661-4f55-802c-f52e4dabca8b AT googlegroups DOT com>
<6a5bd97a-a320-4b63-b323-ce16243b7d52 AT googlegroups DOT com> <bcd3711d-e2c6-420a-b6c9-bb5973e4870d AT googlegroups DOT com>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <de412c80-0843-4a2d-a54b-92d45c68ae32@googlegroups.com>
Subject: Re: Making a standalone EXE that will work without DJGPP
From: rugxulo AT gmail DOT com
Injection-Date: Sat, 19 Oct 2013 03:44:07 +0000
Bytes: 3189
Lines: 49
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp
Reply-To: djgpp AT delorie DOT com
Errors-To: nobody AT delorie DOT com
X-Mailing-List: djgpp AT delorie DOT com
X-Unsubscribes-To: listserv AT delorie DOT com

Hi,

On Wednesday, October 16, 2013 3:35:09 PM UTC-5, Segadude wrote:
> 
> I compiled regular Lua 5.2.2 (right from Lua.org)
> for DOS because I was looking for a Lua port for
> MS-DOS but couldn't fine one.

http://www.netgull.com/djgpp/beta/v2tk/lua522b.zip
http://www.netgull.com/djgpp/beta/v2tk/lua522s.zip

> So I decided to compile it myself. I have a small
> lua script I want to be able to run on DOS.

AFAIK, the only advantage to Juan's port is that it
supports .so (via /beta/ 2.04 DXE3) and uses readline.
If you don't need that, you can compile it yourself.
IIRC, preferred support is (in order) posix, generic, 
ansi. (Those may or may not work how you expect.)

> For my Lua compilation,
> I want a single EXE that will run in a pure DOS
> environment without the need for anything else to
> be installed. Could you elaborate a bit on how to
> use the cwsdstub? Thanks for all the help you have
> given me thus far.

1). wget http://www.lua.org/ftp/lua-5.2.2.tar.gz
2). enable djgpp (set PATH and DJGPP)
3). djtar -x lua*.tar.gz
4). cd lua-5.2.2\src
5). ren luac.c *.c~
6). gcc -s -Os -ansi -Wpedantic -DLUA_ANSI *.c -o lua.exe
7). exe2coff lua.exe
8). copy /b cwsdstub.exe + lua lua-cws.exe
9). upx --best --lzma --all-filters lua-cws.exe
10). lua-cws -e "print(36+64)"

Now you can use LUA-CWS.EXE on any DOS compatible OS,
whether there is already a DPMI server or not.

P.S. Actually, I almost forgot: Lua uses "double" (FPU)
for all numbers, so you may need an FPU emulation lib,
but that's only for very old computers that (for good
or bad) most people don't care about. If this is a
problem, you can link with "-lemu" or use 3rd-party
WMEMU (slightly more accurate??). You can also let
people optionally use emu387.dxe at runtime in order
to not have to link that in too, but you seem to be
more concerned with everything being self-contained.

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019