Building Lua 5.0 on 64-bit Mac

For compatibility / deprecated reasons, I need to build the Lua compiler (luac) from version 5.0 on my 64 bit Intel Mac. (5.1 or later cannot be used.)

Dev tools installed via Xcode 4.6 preferences window.

After typing "cd" into the Lua directory, I issue the command "make".

cd include; make all
make[1]: Nothing to be done for `all'.
cd src; make all
make[1]: Nothing to be done for `all'.
cd src/lib; make all
make[1]: Nothing to be done for `all'.
cd src/luac; make all
gcc -o ../../bin/luac  luac.o print.o lopcodes.o -L../../lib -llua -llualib -lm
Undefined symbols for architecture x86_64:
  "_UNUSED", referenced from:
      _writer in luac.o
ld: symbol(s) not found for architecture x86_64
collect2: ld returned 1 exit status
make[1]: *** [../../bin/luac] Error 1
make: *** [all] Error 2

      

I don't know how to set up a make process for x86_64. Can someone please walk me through this?

Thank.

+3


source to share


1 answer


It works for me, but the result below is different from yours:

...
cd src/luac; make all
gcc -O2 -Wall -I../../include -I..      -c -o luac.o luac.c
gcc -O2 -Wall -I../../include -I..      -c -o print.o print.c
gcc -o lopcodes.o -c -O2 -Wall -I../../include -I..    -DLUA_OPNAMES ../lopcodes.c
gcc -o ../../bin/luac  luac.o print.o lopcodes.o -L../../lib -llua -llualib -lm 
cd src/lua; make all
gcc -O2 -Wall -I../../include      -c -o lua.o lua.c

      



Try make clean all

at the top level first.

+2


source







All Articles