]>
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>
8 # Licence: wxWindows licence
9 ################################################################################
20 Usage: $0 [OPTIONS] [--libdir=DIR] [install_path]
22 Change the install name of all wxWidgets libraries in the directory DIR (or
23 current directory if libdir option is not specified) to correspond to the given
24 install_path (defaults to the libraries directory if not specified).
26 -n, --dry-run Don't really do anything, just print the commands
27 -q, --quiet Don't display any non error messages
28 -v, --verbose Just show the commands being executed, don't run them
29 -h, --help Show this help screen and exit
32 * do "$0 --libdir=MyApp.app/Contents/Frameworks @executable_path/../Frameworks"
33 when distributing wxWidgets shared libraries with application MyApp
34 * run "$0" without parameters in the directory containing wxWidgets libraries
35 to use them without installing
42 if [ $quiet != 1 ]; then
49 if [ $verbose = 1 ]; then
59 GiveUsageErrorAndExit
()
67 # only change the libs themselves, not symlinks to them
68 all_libs
=`find "$libdir" -type f -name libwx_\*.dylib`
69 if [ -z "$all_libs" ]; then
70 Error
"No wx libraries found in \"$libdir\"."
74 VerboseMessage
"Processing $all_libs\n"
76 for lib
in $all_libs; do
77 libname
=`basename $lib`
78 oldname
=`otool -D $lib | tail -1`
79 Message
"Updating install name of and references to $libname:"
80 for lib2
in $all_libs; do
81 VerboseMessage
" updating $lib2"
82 eval "$cmd install_name_tool -change "$oldname" $install_path/$libname $lib2"
84 VerboseMessage
" updating $libname id"
85 eval "$cmd install_name_tool -id $install_path/$libname $lib"
89 while [ $# -ge 1 ]; do
108 if [ -n "$libdir" ]; then
109 GiveUsageErrorAndExit
"Multiple --libdir options not allowed."
111 libdir
=`echo $1 | cut -c10-`
115 GiveUsageErrorAndExit
"Unknown option \"$1\"."
119 if [ -n "$install_path" ]; then
120 GiveUsageErrorAndExit
"Too many parameters."
128 if [ -z $libdir ]; then
132 if [ -z $install_path ]; then