How to configure scons to link using rpath on mac?

It works on Ubuntu to link my task using RPATH, but on mac, it doesn’t work

env.Program(source = Glob("*.cpp") + Glob("../*.cpp"),
            LIBS = [
                "l_util",
                "boost_system",
                "boost_timer",
            ],
            LIBPATH = libPath,
            RPATH = libPath,
            CPPPATH = includePath)

On Ubuntu, using ldd, I can see shared libs are linked with absolute path. But using otool -L on mac gives me relative path to top dir of my Sconstruct file. Anyone setup RPATH correctly on mac using scons?


Source: gcc

Leave a Reply