364
edits
Line 131: | Line 131: | ||
To check the binary for other occurances of this problem, type the command below. | To check the binary for other occurances of this problem, type the command below. | ||
<nowiki>otool -L Octave-3.7.0+</nowiki> | <nowiki>otool -L Octave-3.7.0+</nowiki> | ||
The | Some m-file functions has been written to automate the application of the {{Codeline|otool}} utility toward making the binary executable and dynamically loadable libraries included in the App bundle relocatable. The four m-file functions to accomplish this are itemized below. | ||
* [[dylibs_fix.m]] | |||
<nowiki> -- Function File: fix_dylibs (EXEBIN, LIBDIR, DRYRUN) | |||
Make the executable and dynamic libraries relocatable. The inputs | |||
are; | |||
EXEBIN | |||
The full file name of the executable binary for the App | |||
bundle. The default is `bin/Octave-3.7.0+'; | |||
LIBDIR | |||
The full path to the directory containing the App bundle's | |||
dynamic libraries. The default is `lib'. | |||
DRYRUN | |||
If TRUE, the `install_name_tool' commands are printed to the | |||
command line and are not executed (i.e. the install names and | |||
paths to the dependent libraries are not changed). The | |||
default is TRUE. | |||
Using `install_name_tool' the portion of the built in dynamic | |||
library paths external to the App bundles are replaced with the | |||
token `@executable_path'. Ths will modify the paths in both the | |||
EXEBIN and the the dynamic libraries and allow the application to | |||
be relocated with no risk that the binary executable and libraries | |||
are unable to locate the dynamic libraries they depend upon. | |||
In addition to correcting the location information for the | |||
dependent's of EXEBIN, the LIBDIR is searched recursively to | |||
locate all dynamic libraries present in the App bundle. Both | |||
their install names and the locations of their dependents will | |||
also be fixed. | |||
Using the default, this script expects to find a `bin' and `lib' | |||
directory in the current working directory.</nowiki> | |||
* [[dylibs_find.m]] | |||
<nowiki>-- Function File: dylibs = dylibs_find (DIRECTORY) | |||
Recursively finds all dylibs in DIRECTORY, and returns a structure | |||
with fields `name', `location', and `dependents'. | |||
`name' | |||
Is the name of a dynamic library. | |||
`location' | |||
Is the path to the named dynamic library. | |||
`dependents' | |||
Is a cellstr array listing the dynamic libraries the named | |||
library depends upon.</nowiki> | |||
* [[dylibs_get_deps.m]] | |||
<nowiki> -- Function File: dylibs = dylibs_get_deps (NAME) | |||
-- Function File: = dylibs_get_deps (NAME, ROOT) | |||
Extracts the dependent libary names from the named binary, NAME. | |||
If ROOT is specified, the only libraries returned have a path | |||
which begins with that specified by ROOT.</nowiki> | |||
* [[dylibs_isdylib.m]] | |||
<nowiki> -- Function File: result = dylibs_isdylib (FILENAME) | |||
Determines if the filename qualifies as a dynamically loaded | |||
library. The RESULT is TRUE for dylib-files, oct-files, and | |||
mex-files. The result is FALSE for all other files. | |||
This function isn't sophisticated. It only examines the file | |||
extension.</nowiki> | |||
==Testing== | ==Testing== |
edits