From: Stephen Blackheath Date: Thu, 1 Oct 2009 05:16:37 +0000 (+0000) Subject: Document the new -dylib-install-name option in the user's guide. X-Git-Tag: 2010-03-16~300 X-Git-Url: http://git.megacz.com/?p=ghc-hetmet.git;a=commitdiff_plain;h=5c2220aa9aac0fefcba5abbfa3059a6ef138655f Document the new -dylib-install-name option in the user's guide. --- diff --git a/docs/users_guide/flags.xml b/docs/users_guide/flags.xml index cd6b5b3..5724850 100644 --- a/docs/users_guide/flags.xml +++ b/docs/users_guide/flags.xml @@ -1866,6 +1866,15 @@ phase n dynamic - + + path + Set the install name (via -install_name passed to Apple's + linker), specifying the full install path of the library file. Any libraries + or executables that link with it later will pick up that path as their + runtime search location for it. (Darwin/MacOS X only) + dynamic + - + diff --git a/docs/users_guide/phases.xml b/docs/users_guide/phases.xml index 22416c7..2b88718 100644 --- a/docs/users_guide/phases.xml +++ b/docs/users_guide/phases.xml @@ -1072,6 +1072,24 @@ $ cat foo.hspp library entirely. + + + + + + + + + On Darwin/MacOS X, dynamic libraries are stamped at build time with an + "install name", which is the ultimate install path of the library file. + Any libraries or executables that subsequently link against it will pick + up that path as their runtime search location for it. By default, ghc sets + the install name to the location where the library is built. This option + allows you to override it with the specified file path. (It passes + -install_name to Apple's linker.) Ignored on other + platforms. + + diff --git a/docs/users_guide/shared_libs.xml b/docs/users_guide/shared_libs.xml index 00f6f67..ea5500b 100644 --- a/docs/users_guide/shared_libs.xml +++ b/docs/users_guide/shared_libs.xml @@ -242,6 +242,19 @@ ghc -dynamic Main.hs -o main -lfoo -L. -optl-Wl,-rpath,'$ORIGIN' Similarly it would be possible to use a subdirectory relative to the executable e.g. -optl-Wl,-rpath,'$ORIGIN/lib'. + + The standard assumption on Darwin/MacOS X is that dynamic libraries will + be stamped at build time with an "install name", which is the full + ultimate install path of the library file. Any libraries or executables + that subsequently link against it (even if it hasn't been installed yet) + will pick up that path as their runtime search location for it. When + compiling with ghc directly, the install name is set by default to the + location where it is built. You can override this with the + -dylib-install-name option (which passes + -install_name to the Apple linker). Cabal does this + for you. It automatically sets the install name for dynamic libraries to + the absolute path of the ultimate install location. +