[ 
https://issues.apache.org/jira/browse/LOGCXX-346?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Thorsten Schöning resolved LOGCXX-346.
--------------------------------------

    Resolution: Won't Fix

>From my point of view this looks like a problem of cpptasks because this is 
>generating the project file and I cannot see how we could influence the 
>default installation directory. Therefore I'm closing this issue.

> Mac XCode project doesn't define the Dynamic Library Install Name correctly 
> (nor the installation directory)
> ------------------------------------------------------------------------------------------------------------
>
>                 Key: LOGCXX-346
>                 URL: https://issues.apache.org/jira/browse/LOGCXX-346
>             Project: Log4cxx
>          Issue Type: Bug
>          Components: Build
>    Affects Versions: 0.10.0
>         Environment: Mac OS X 10.6.1, but I see no reason for this problem 
> not to be happening under 10.5.x also
> I use XCode 3.2.1
>            Reporter: Jean-Denis Muys
>            Assignee: Curt Arnold
>            Priority: Minor
>   Original Estimate: 5m
>  Remaining Estimate: 5m
>
> The provided XCode project builds the log4cxx dynamic library to be installed 
> in the ~/bin directory. This means that any client app will not be able to 
> run unless exists on the client computer a user with the same name as the one 
> who built log4xx, in which the bin subdirectory exists, in which 
> log4cxx.dylib has been put, all with read permissions. The likelihood of that 
> is... low.
> The fix is very simple: in the XCode project settings:
> 1- clear the "Installation Directory" setting (under category Deployment) 
> (currently ~/bin). XCode will reset it to the more correct /usr/local/lib. 
> But in any case please note that this setting will not be used if you do step 
> 2.
> 2- essential: change the "Dynamic Library Install Name" (under category 
> Linking). It must now read:
> @rpath/$(EXECUTABLE_PATH)
> That way the same log4cxx.dylib works whether it is installed in a system 
> location such as /usr/lib or inside a client code bundle, in a way that keeps 
> the client code totally independent from its own location in the file system.
> Explanation: the macro $(EXECUTABLE_PATH) will be replaced by XCode to be the 
> name of the dynamic library, "log4cxx.dylib" in our case. the variable @rpath 
> is not a macro, but a run time variable that will be expanded by the loader 
> from the client code to be... whatever the client code has set.
> Typically, the client code will set it (under its XCode project "Runpath 
> Search Paths" setting) to be a search list that include /usr/lib/ and 
> /usr/local/lib, but also, and more importantly, its own bundle directory. 
> Here is what I set it mine to:
> @loader_path/../Libraries
> And then of course, I put log4cxx.dylib in my code bundle at the relative 
> path Contents/Libraries/log4cxx.dylib
>  @loader_path is (another) runtime variable expanded by the loader which 
> represent the directory where the executable is. For a normal app named 
> "sample", this directory will be for example:
> /Applications/sample.app/Contents/MacOS
> So @loader_path/../Libraries expands at runtime to be:
> /Applications/sample.app/Contents/Libraries/log4cxx.dylib
> Regards.
> JDM



--
This message was sent by Atlassian JIRA
(v6.1.5#6160)

Reply via email to