lua-users home
lua-l archive

Re: Mac OS X dynamic loading and Lua5.0.2

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


Hi,
Peter Colson wrote:
> gcc -o lua lua.o -L. -llua -llualib -lm -ldl -Wl,-E
> 
> fails with OS X ld not supporting the '-E' flag.
Just comment out the whole "DL= ..." line in src/Makefile for OSX.
Since Lua 5.1 uses the native dynamic library functions, -ldl is
not required. Symbols are exported by default on OSX. But do not
use 'strip' on the executable ('strip -x' is ok, though).
> >With Lua 5.1 you should use require("xyz") and put the module into the
> >proper path ( /usr/local/lib/lua/5.1/xyz.so ).
> 
> Under OS X is the extension typically ',dylib' or '.so' or doesn't it 
> really matter?
It doesn't matter and Lua uses '.so' for consistency with other
POSIX machines (other ported apps do that, too).
> ld: flag: -undefined dynamic_lookup can't be used with 
> MACOSX_DEPLOYMENT_TARGET environment variable set to: 10.1
MACOSX_DEPLOYMENT_TARGET="10.3"
export MACOSX_DEPLOYMENT_TARGET
gcc -O2 -fno-common -c -o module.o module.c
gcc -bundle -undefined dynamic_lookup -o module.so module.o
Bye,
 Mike

AltStyle によって変換されたページ (->オリジナル) /