Friday, October 30, 2009

How To - svn:externals

Today I had to add webkit as an external directory to my trunk in SVN.

My SVN folder structure is like this.
/SVN/Repos/Trunk
              /Lib1
              /Lib2
              /App


I wanted to add an external directory to trunk folder. As shown below.
/SVN/Repos/Trunk
              /Lib1
              /Lib2
              /webkit
              /App


I tried various ways to set the svn:externals property all in vain. Thanks to the following link I got to know how to do it right.

%cd /SVN/Repos/Trunk
%svn propset svn:externals 'webkit http://svn.webkit.org/repository/webkit/trunk' .


This did the trick.

%svn propget svn:externals
can be used to verify if the externals are properly set.

Wednesday, October 28, 2009

Working with dylibs : Deployment Issues

Working with dylibs can be a troublesome at times. I encountered troubles with it few days back.

Application I was developing links with a custom dylib, I developed. All was working well while running through XCode. However on deployment, the application would not launch. On investigation, I realized that OSX was unable to find a dylib, Hence the application failed to launch.

I was faced with the problem of the OSX not knowing where to find the dylibs required by my application in deployment environment.

otool and install_name_tool came to my rescue.

As per Apple documentation


First I wanted see to all the library install names in my application. In simple terms paths of all the libraries my application is linked with.

On terminal in cd into my app package Contents/Macos.
% otool -L myAppUnixBinay

The output listed all the library install names.

libmycustom.dylib (compatibility version 5.0.0, current version 5.0.0)
/usr/lib/libstdc++.6.dylib (compatibility version 7.0.0, current version 7.4.0)
/usr/lib/libgcc_s.1.dylib (compatibility version 1.0.0, current version 1.0.0)


My application linked against libmycustom.dylib, it failed to load it since no proper path was provided.

Now I used install_name_tool to set the right path to the dylib.
% install_name_tool -change libmycustom.dylib @executable_path/../Frameworks/libmycustom.dylib myAppUnixBinay

The above line tell the OSX to find the library in /Contents/Frameworks of the application package.

Now when I ran the application all worked well.

I automated this process by adding a runscript to XCode target that runs post build process.

Read Part 2 of the post
Read Part 3 of the post

LinkWithin

Related Posts with Thumbnails