Re: dylib name on Mac OS X

  • From: Dimiter 'malkia' Stanev <malkia@xxxxxxxxx>
  • To: luajit@xxxxxxxxxxxxx
  • Date: Thu, 31 May 2012 10:06:06 -0700

On 5/31/2012 7:44 AM, Douglas Creager wrote:
Apologies if this has already been answered on the list before. I'm trying to embed LuaJIT in another application using libluajit as a shared library. But I noticed that the name of the shared library file is different on Mac vs Linux. On Linux, you get libluajit-5.1.so (and its versioned friends). But on Mac, you get libluajit-51.dylib -- i.e., without the dot in the version suffix. The *static* library, on the other hand, is libluajit-5.1.a on both platforms.

I can see exactly in the Makefile where this is done, and I can see the change that would make the filenames consistent. But I was wondering if there's a specific reason for the different filename before I go hacking on anything.

I ask because I'd like to just use the compiler and linker flags from LuaJIT's pkg-config file, without having to hard-code any per-platform logic into my build scripts. But the pkg-config file has -lluajit-5.1 on both platforms. So end result, on Linux, I link with the shared library, while on Mac, I embed the static library.

thanks
--doug

If nothing else works, on OSX you can change the name afterwards with install_name_tool, just man it.

I manually install_name_tool all dylibs myself, and what they link to. Then check with "otool -L thelib.dylib"

Other related posts: