]>
git.saurik.com Git - wxWidgets.git/blob - misc/scripts/set_install_name
3 # Name: set_install_name
4 # Purpose: set install_name for wx shared libraries under Mac OS X
5 # Usage: run with --help option to see the instructions
6 # Copyright: (c) 2005 Vadim Zeitlin <vadim@wxwindows.org>
7 # Licence: wxWindows licence
8 ################################################################################
21 Usage: $name [OPTIONS] [--prefix=PFX] [--libdir=DIR] [install_path]
23 Change the install name of all wxWidgets libraries in the directory DIR (or
24 current directory if libdir option is not specified) to correspond to the given
25 install_path (defaults to the libraries directory if not specified).
27 If prefix option is given, its value is prefixed to the tool names used. E.g.
28 to use this script when cross-building, use "--prefix=powerpc-apple-darwin8-".
30 -n, --dry-run Don't really do anything, just print the commands
31 -q, --quiet Don't display any non error messages
32 -v, --verbose Just show the commands being executed, don't run them
33 -h, --help Show this help screen and exit
36 * do "$name --libdir=MyApp.app/Contents/Frameworks @executable_path/../Frameworks"
37 when distributing wxWidgets shared libraries with application MyApp
38 * run "$name" without parameters in the directory containing wxWidgets libraries
39 to use them without installing
46 if [ $quiet != 1 ]; then
53 if [ $verbose = 1 ]; then
63 GiveUsageErrorAndExit
()
71 # only change the libs themselves, not symlinks to them
72 all_libs
=`find "$libdir" -type f -name libwx_\*.dylib`
73 if [ -z "$all_libs" ]; then
74 Error
"No wx libraries found in \"$libdir\"."
78 VerboseMessage
"Processing $all_libs\n"
80 for lib
in $all_libs; do
81 libname
=`basename $lib`
82 oldname
=`${tool_prefix}otool -D $lib | tail -1`
83 Message
"Updating install name of and references to $libname:"
84 for lib2
in $all_libs; do
85 VerboseMessage
" updating $lib2"
86 eval "$cmd ${tool_prefix}install_name_tool -change "$oldname" $install_path/$libname $lib2"
88 VerboseMessage
" updating $libname id"
89 eval "$cmd ${tool_prefix}install_name_tool -id $install_path/$libname $lib"
93 while [ $# -ge 1 ]; do
112 if [ -n "$libdir" ]; then
113 GiveUsageErrorAndExit
"Multiple --libdir options not allowed."
115 libdir
=`echo $1 | cut -c10-`
119 if [ -n "$tool_prefix" ]; then
120 GiveUsageErrorAndExit
"At most one --prefix option can be given."
122 tool_prefix
=`echo $1 | cut -c10-`
126 GiveUsageErrorAndExit
"Unknown option \"$1\"."
130 if [ -n "$install_path" ]; then
131 GiveUsageErrorAndExit
"Too many parameters."
139 if [ -z $libdir ]; then
143 if [ -z $install_path ]; then