You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
74 lines
1.8 KiB
Plaintext
74 lines
1.8 KiB
Plaintext
15 years ago
|
#!/bin/bash
|
||
|
|
||
15 years ago
|
##
|
||
|
# buildForMac <configure-options>
|
||
|
# example: contrib/buildForMac --disable-shared
|
||
|
|
||
|
# b=`basename "${PWD}"`
|
||
|
|
||
|
if [ ! -d contrib ]; then
|
||
|
echo "you are in the wrong directory - please run $0 in the main directory (which includes contrib and src)"
|
||
|
exit 1
|
||
|
fi
|
||
|
|
||
15 years ago
|
TARGET="MACOSX_DEPLOYMENT_TARGET=10.4"
|
||
|
|
||
15 years ago
|
lib=libexiv2.10.dylib
|
||
|
app=exiv2
|
||
15 years ago
|
LIB=./src/.libs/$lib
|
||
|
APP=./src/.libs/$app
|
||
|
|
||
15 years ago
|
for option in "$@" ; do
|
||
|
if [ "$option" == --disable-shared ]; then
|
||
|
lib=libexiv2.a
|
||
|
LIB=./src/.libs/$lib
|
||
|
APP=./src/$app
|
||
|
fi
|
||
|
done
|
||
|
|
||
15 years ago
|
props() {
|
||
|
ls -alt $*
|
||
|
lipo -info $*
|
||
|
otool -L $*
|
||
|
echo ----------------------
|
||
|
}
|
||
|
|
||
|
build() {
|
||
|
make clean
|
||
15 years ago
|
./configure CFLAGS="$arch" CXXFLAGS="$arch" CPPFLAGS="$arch" LDFLAGS="$arch -L${PWD}/xmpsdk/src" OBJCFLAGS="$arch" OBJCXXFLAGS="$arch" $TARGET "$@"
|
||
15 years ago
|
env CFLAGS="$arch" CXXFLAGS="$arch" CPPFLAGS="$arch" LDFLAGS="$arch -L${PWD}/xmpsdk/src" OBJCFLAGS="$arch" OBJCXXFLAGS="$arch" $TARGET make $TARGET
|
||
|
props $APP
|
||
|
props $LIB
|
||
|
}
|
||
|
|
||
|
for arch in '-arch i386' '-arch x86_64' '-arch ppc'; do
|
||
15 years ago
|
if [ "$arch" == "-arch i386" ]; then
|
||
|
build "$@"
|
||
15 years ago
|
rm -rf app.i386 lib.i386
|
||
|
cp $APP app.i386
|
||
|
cp $LIB lib.i386
|
||
15 years ago
|
elif [ "$arch" == "-arch x86_64" ]; then
|
||
|
build "$@"
|
||
15 years ago
|
rm -rf app.x86_64 lib.x86_64
|
||
|
cp $APP app.x86_64
|
||
|
cp $LIB lib.x86_64
|
||
15 years ago
|
elif [ "$arch" == "-arch ppc" ]; then
|
||
|
build "$@"
|
||
15 years ago
|
rm -rf app.ppc lib.ppc
|
||
|
cp $APP app.ppc
|
||
|
cp $LIB lib.ppc
|
||
|
fi
|
||
|
done
|
||
|
|
||
15 years ago
|
LIB=./src/.libs/$lib
|
||
|
APP=./src/.libs/$app
|
||
|
|
||
|
env $TARGET lipo -arch i386 lib.i386 -arch x86_64 lib.x86_64 -arch ppc lib.ppc -create -output $LIB
|
||
|
env $TARGET lipo -arch i386 app.i386 -arch x86_64 app.x86_64 -arch ppc app.ppc -create -output $APP
|
||
|
|
||
|
props $LIB
|
||
|
props $APP
|
||
15 years ago
|
|
||
15 years ago
|
# That's all Folks!
|
||
|
##
|