[Mono-dev] Library path bug in Makefile?

Edward Ned Harvey (mono) edward.harvey.mono at clevertrove.com
Thu Mar 6 03:46:37 UTC 2014

> From: mono-devel-list-bounces at lists.ximian.com [mailto:mono-devel-list-
> bounces at lists.ximian.com] On Behalf Of Edward Ned Harvey (mono)
> So ...  http://blog.tremily.us/posts/rpath/

Actually, the answer is right there - Thank you, Trevor and Emily (tremily).

This works perfectly:
export LDFLAGS=-Wl,-rpath=/usr/local/mono-3.2.8/lib,--enable-new-dtags ; ./configure --prefix=/usr/local/mono-3.2.8

After building & installing with these options:
* The mono binary simply works.  No need to specify the LD_LIBRARY_PATH
* It is overridable.  If need to set the LD_LIBRARY_PATH for some reason, it overrides the paths inside the binary.
* Both the RPATH and RUNPATH have been set inside the binary, which behaves as tremily described.  (Particularly, the binary simply works, and can be overridden with LD_LIBRARY_PATH if desired.)

As far as I'm concerned, this means there is no bug with the configure script or Makefile.  It is only a documentation feature - if you specify the --prefix, --exec-prefix, or --libdir, then the documentation should suggest specifying LDFLAGS=-Wl,-rpath=EPREFIX/lib,--enable-new-dtags

More information about the Mono-devel-list mailing list