Static compile for OS X .app distribution
Posted: 2009-10-09T17:19:32-07:00
I'm trying to compile the "convert" executable so that I can distribute as part of my .app. I've followed all the instructions for doing this that I can find, but my users report "dyld: Library not loaded: /opt/local/lib/libtiff.3.dylib" errors, and otool seems to indicate that the executable is linked against the libtiff provided by MacPorts. I'm building on OS X 10.5.8, and would like to support 10.4-6.
This is my build script:
... and here is the output of otool after running this build:
I'll admit I'm not very expert with C compilation, and less so on non-Linux platforms. Any help will be greatly appreciated.
This is my build script:
Code: Select all
$ cat build_imagemagick.bash
#!/bin/bash
target_dir=`pwd`
cd build
im_dir=`ls | grep ImageMagick- | tail -n1`
cd "$im_dir"
delegates=(jpeg png tiff)
for delegate in ${delegates[@]}
do
cd $delegate
make distclean
./configure --disable-shared
make
cd ..
done
make distclean
./configure --disable-shared --enable-delegate-build \
--prefix="$target_dir/ImageMagick.framework" --without-magick-plus-plus \
--without-perl --without-x --without-freetype
make
make install
Code: Select all
$ otool -L ImageMagick.framework/bin/convert
ImageMagick.framework/bin/convert:
/opt/local/lib/libtiff.3.dylib (compatibility version 12.0.0, current version 12.2.0)
/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 111.1.4)
/opt/local/lib/libjasper.1.dylib (compatibility version 2.0.0, current version 2.0.0)
/opt/local/lib/libjpeg.62.dylib (compatibility version 63.0.0, current version 63.0.0)
/opt/local/lib/libpng12.0.dylib (compatibility version 36.0.0, current version 36.0.0)
/opt/local/lib/libbz2.1.0.dylib (compatibility version 1.0.0, current version 1.0.5)
/opt/local/lib/libz.1.dylib (compatibility version 1.0.0, current version 1.2.3)
/usr/lib/libgcc_s.1.dylib (compatibility version 1.0.0, current version 1.0.0)