lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


Am 20.05.2014 18:55 schröbte Thijs Schreijer:

It can be minimized;
Clone the lua52 modified code ( https://github.com/Tieske/lua52/tree/windows_friendly ) then do

make mingw
make install INSTALL_TOP="c:/program files/lua/"
set PATH=c:\program files\lua\bin;%PATH%

That’s all for Lua to be up and running. All that is left to do is to
persist the change to the path after a reboot. It won't get much
simpler than this.


```
C:\Users\siffiejoe\Sources\temp\lua52>make mingw
cd src && make mingw V=5.2
make[1]: Entering directory `C:/Users/siffiejoe/Sources/temp/lua52/src'
make "LUA_A=lua52.dll" "LUA_T=lua.exe" \
"AR=gcc -shared -o" "RANLIB=strip --strip-unneeded" \
"SYSCFLAGS=-DLUA_BUILD_AS_DLL" "SYSLIBS=" "SYSLDFLAGS=-s" lua.exe
make[2]: Entering directory `C:/Users/siffiejoe/Sources/temp/lua52/src'
gcc -O2 -Wall -DLUA_COMPAT_ALL -DLUA_BUILD_AS_DLL    -c -o lua.o lua.c
<command-line>:0:0: warning: "__GNUC__" redefined [enabled by default]
lua.c:1:0: note: this is the location of the previous definition
 /*
 ^
<command-line>:0:0: warning: "__GNUC_MINOR__" redefined [enabled by default]
lua.c:1:0: note: this is the location of the previous definition
 /*
 ^
<command-line>:0:0: warning: "__MINGW32__" redefined [enabled by default]
lua.c:1:0: note: this is the location of the previous definition
 /*
 ^
<command-line>:0:0: warning: "__STDC__" redefined [enabled by default]
lua.c:1:0: note: this is the location of the previous definition
 /*
 ^
<command-line>:0:0: warning: "__STDC__" redefined [enabled by default]
<command-line>:0:0: note: this is the location of the previous definition
<command-line>:0:13: warning: "system" re-asserted [enabled by default]
<command-line>:0:9: warning: "cpu" re-asserted [enabled by default]
<command-line>:0:13: warning: "machine" re-asserted [enabled by default]
<command-line>:0:9: warning: "cpu" re-asserted [enabled by default]
<command-line>:0:13: warning: "machine" re-asserted [enabled by default]
In file included from c:\lr4win\mingw\include\signal.h:27:0,
                 from lua.c:8:
c:\lr4win\mingw\include\_mingw.h:55:2: error: #error ERROR: You must use a GNU Compiler version >= 3.4.5.
 #error ERROR: You must use a GNU Compiler version >= 3.4.5.
  ^
make[2]: *** [lua.o] Error 1
make[2]: Leaving directory `C:/Users/siffiejoe/Sources/temp/lua52/src'
make[1]: *** [mingw] Error 2
make[1]: Leaving directory `C:/Users/siffiejoe/Sources/temp/lua52/src'
make: *** [mingw] Error 2

C:\Users\siffiejoe\Sources\temp\lua52>mingw32-make mingw
cd src && mingw32-make mingw V=5.2
mingw32-make[1]: Entering directory 'C:/Users/siffiejoe/Sources/temp/lua52/src'
mingw32-make "LUA_A=lua52.dll" "LUA_T=lua.exe" \
"AR=gcc -shared -o" "RANLIB=strip --strip-unneeded" \
"SYSCFLAGS=-DLUA_BUILD_AS_DLL" "SYSLIBS=" "SYSLDFLAGS=-s" lua.exe
mingw32-make[2]: Entering directory 'C:/Users/siffiejoe/Sources/temp/lua52/src'
gcc -O2 -Wall -DLUA_COMPAT_ALL -DLUA_BUILD_AS_DLL    -c -o lua.o lua.c
gcc -O2 -Wall -DLUA_COMPAT_ALL -DLUA_BUILD_AS_DLL    -c -o lapi.o lapi.c
  ...
  ...
  ...
gcc -o luac.exe   luac.o liblua.a -lm
mingw32-make[2]: Leaving directory 'C:/Users/siffiejoe/Sources/temp/lua52/src' mingw32-make[1]: Leaving directory 'C:/Users/siffiejoe/Sources/temp/lua52/src'

C:\Users\siffiejoe\Sources\temp\lua52>mingw32-make install INSTALL_TOP="c:/program files/lua/" cd src && mkdir -p c:/program files/lua//bin c:/program files/lua//include c:/program files/lua//lib c:/program files/lua//man/man1 c:/program files/lua//share/lua/5.2 c:/program files/lua//lib/lua/5.2
Syntaxfehler.
Makefile:64: recipe for target 'install' failed
mingw32-make: *** [install] Error 1

C:\Users\siffiejoe\Sources\temp\lua52>install
Der Befehl "install" ist entweder falsch geschrieben oder
konnte nicht gefunden werden.

C:\Users\siffiejoe\Sources\temp\lua52>
```

So to sum this up:
*   `make` in MinGW is broken, you have to use `mingw32-make`.
*   Windows `mkdir` cannot handle `-p` and/or multiple arguments
*   there is no `install` command on Windows
* I *do* however have an `rm` in my PATH. I don't know where it comes from, but it's not in the MinGW directories ...

And btw.:
```
siffiejoe@pcbsd-2834:~/src/temp/lua52 :) uname -a
FreeBSD pcbsd-2834 9.1-RELEASE-p13 FreeBSD 9.1-RELEASE-p13 #0: Tue May 13 11:15:38 UTC 2014 root@amd64-builder.daemonology.net:/usr/obj/usr/src/sys/GENERIC amd64
siffiejoe@pcbsd-2834:~/src/temp/lua52 :) make freebsd
"Makefile", line 41: Missing dependency operator
"Makefile", line 43: Need an operator
"Makefile", line 45: Need an operator
make: fatal errors encountered -- cannot continue
siffiejoe@pcbsd-2834:~/src/temp/lua52 :(
```

That's why you probably shouldn't use GNU make features in a portable Makefile ...


Philipp