lua-users home
lua-l archive

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

On Jul 3, 2009, at 11:17 AM, Hans van der Meer wrote:

Why does one prescribe for the Mach-O Type the choice "bundle" (mh_bundle) instead of "dynamic library" (mh_dylib). Both seem to work when the result is "require"-ed. Does it matter? Or is there a fundamental difference I am overlooking?

As Asko said, bundle was preferred in very early os x versions.

If your Lua is built to use dlopen it can use bundles or dynamic libraries. Lua uses dlopen when built using
but not when built using

Note that if you make the macosx Lua Makefile target you get - DLUA_USE_LINUX and therefore dlopen.

Based on the example of other libraries (thanks, Mike Pall), and my reading of /apple_ref/doc/uid/TP40001908
my Makefiles use:

gcc -fPIC -dynamiclib -single_module -undefined dynamic_lookup -o xxx.o yyy.o

The -single_module option is considered obsolete and is the default since OS X 10.4.0.