2

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?

ycshao
  • 1,768
  • 4
  • 18
  • 32
  • This link http://stackoverflow.com/questions/4513799/how-to-set-the-runtime-path-rpath-of-an-executable-with-gcc-under-mac-osx should be of interest to you, and give you further insight to the problem. Note, how this isn't so much an SCons problem...once you figure what needs to be done on the command-line level, it should be fairly easy to teach SCons the new trick. – dirkbaechle May 18 '15 at 09:49
  • Thank you for your information. Yes I can figure out the command-line option and teach Scons to do that, but I still think RPATH specified should work cross platform. – ycshao May 26 '15 at 02:24
  • Then it would be super-cool if you could post your solution somewhere (especially to the SCons user mailing list at scons-users@scons.org), such that some developer jumps on it and really integrates it to the SCons core system. This way, a lot more people would benefit from your findings... – dirkbaechle May 26 '15 at 11:45
  • Yes I'm going to do so. Thank you @dirkbaechle ! – ycshao May 26 '15 at 15:56

0 Answers0