3

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

Dev tools installed through Xcode 4.6's Preferences window.

After I 'cd' in to 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 do not know how to configure the make process for x86_64. Could someone please step me through it?

Thanks.

Womble
  • 4,607
  • 2
  • 31
  • 45

1 Answers1

2

It works for me, but the output 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.

lhf
  • 70,581
  • 9
  • 108
  • 149
  • Thank you for your help. My output is indeed different from yours, so I went to the Lua site and grabbed the 5.0.3 distribution instead. Using 'make' on the root directory now does everything properly. Hooray! – Womble Feb 22 '13 at 00:35