From ceb552a9c9ffe82508392a0f26e20954473aaea9 Mon Sep 17 00:00:00 2001 From: DRC Date: Fri, 19 Dec 2014 10:44:09 +0000 Subject: [PATCH] Add iOS architectures to the shared libraries generated by the Mac/iOS packaging system. I have no idea how useful this is for "standard" iOS application development, but it is useful in a jailbreak environment, and iOS 8 supposedly allows shared libs in "official" apps as well. git-svn-id: svn+ssh://svn.code.sf.net/p/libjpeg-turbo/code/branches/1.4.x@1447 632fc199-4ca6-4c93-a231-07263d6284db --- BUILDING.txt | 2 +- release/makemacpkg.in | 127 +++++++++++++++++++++++++++++++++++++++++- 2 files changed, 126 insertions(+), 3 deletions(-) diff --git a/BUILDING.txt b/BUILDING.txt index 5b5b7a4..a19d8ce 100644 --- a/BUILDING.txt +++ b/BUILDING.txt @@ -368,7 +368,7 @@ Set the following shell variables for simplicity: Follow the procedure under "Building libjpeg-turbo" above, adding - --host arm-apple-darwin10 --enable-static --disable-shared \ + --host arm-apple-darwin10 \ CC="$IOS_GCC" LD="$IOS_GCC" \ CFLAGS="-mfloat-abi=softfp -isysroot $IOS_SYSROOT -O3 $IOS_CFLAGS" \ LDFLAGS="-mfloat-abi=softfp -isysroot $IOS_SYSROOT $IOS_CFLAGS" diff --git a/release/makemacpkg.in b/release/makemacpkg.in index 16c18de..d0edecb 100644 --- a/release/makemacpkg.in +++ b/release/makemacpkg.in @@ -173,14 +173,55 @@ if [ $BUILDARMV6 = 1 ]; then pushd $BUILDDIRARMV6 make install DESTDIR=$TMPDIR/dist.armv6 popd + if [ ! -h $TMPDIR/dist.armv6/$LIBDIR/libjpeg.@SO_MAJOR_VERSION@.dylib -a \ + ! -h $PKGROOT/$LIBDIR/libjpeg.@SO_MAJOR_VERSION@.dylib ]; then + lipo -create \ + $PKGROOT/$LIBDIR/libjpeg.@SO_MAJOR_VERSION@.dylib \ + -arch arm $TMPDIR/dist.armv6/$LIBDIR/libjpeg.@SO_MAJOR_VERSION@.dylib \ + -output $PKGROOT/$LIBDIR/libjpeg.@SO_MAJOR_VERSION@.dylib + elif [ ! -h $TMPDIR/dist.armv6/$LIBDIR/libjpeg.@SO_MAJOR_VERSION@.0.@SO_MINOR_VERSION@.dylib -a \ + ! -h $PKGROOT/$LIBDIR/libjpeg.@SO_MAJOR_VERSION@.0.@SO_MINOR_VERSION@.dylib ]; then + lipo -create \ + $PKGROOT/$LIBDIR/libjpeg.@SO_MAJOR_VERSION@.0.@SO_MINOR_VERSION@.dylib \ + -arch arm $TMPDIR/dist.armv6/$LIBDIR/libjpeg.@SO_MAJOR_VERSION@.0.@SO_MINOR_VERSION@.dylib \ + -output $PKGROOT/$LIBDIR/libjpeg.@SO_MAJOR_VERSION@.0.@SO_MINOR_VERSION@.dylib + fi lipo -create \ $PKGROOT/$LIBDIR/libjpeg.a \ -arch arm $TMPDIR/dist.armv6/$LIBDIR/libjpeg.a \ -output $PKGROOT/$LIBDIR/libjpeg.a + lipo -create \ + $PKGROOT/$LIBDIR/libturbojpeg.0.dylib \ + -arch arm $TMPDIR/dist.armv6/$LIBDIR/libturbojpeg.0.dylib \ + -output $PKGROOT/$LIBDIR/libturbojpeg.0.dylib lipo -create \ $PKGROOT/$LIBDIR/libturbojpeg.a \ -arch arm $TMPDIR/dist.armv6/$LIBDIR/libturbojpeg.a \ -output $PKGROOT/$LIBDIR/libturbojpeg.a + lipo -create \ + $PKGROOT/$BINDIR/cjpeg \ + -arch arm $TMPDIR/dist.armv6/$BINDIR/cjpeg \ + -output $PKGROOT/$BINDIR/cjpeg + lipo -create \ + $PKGROOT/$BINDIR/djpeg \ + -arch arm $TMPDIR/dist.armv6/$BINDIR/djpeg \ + -output $PKGROOT/$BINDIR/djpeg + lipo -create \ + $PKGROOT/$BINDIR/jpegtran \ + -arch arm $TMPDIR/dist.armv6/$BINDIR/jpegtran \ + -output $PKGROOT/$BINDIR/jpegtran + lipo -create \ + $PKGROOT/$BINDIR/tjbench \ + -arch arm $TMPDIR/dist.armv6/$BINDIR/tjbench \ + -output $PKGROOT/$BINDIR/tjbench + lipo -create \ + $PKGROOT/$BINDIR/rdjpgcom \ + -arch arm $TMPDIR/dist.armv6/$BINDIR/rdjpgcom \ + -output $PKGROOT/$BINDIR/rdjpgcom + lipo -create \ + $PKGROOT/$BINDIR/wrjpgcom \ + -arch arm $TMPDIR/dist.armv6/$BINDIR/wrjpgcom \ + -output $PKGROOT/$BINDIR/wrjpgcom fi if [ $BUILDARMV7 = 1 ]; then @@ -196,14 +237,55 @@ if [ $BUILDARMV7 = 1 ]; then pushd $BUILDDIRARMV7 make install DESTDIR=$TMPDIR/dist.armv7 popd + if [ ! -h $TMPDIR/dist.armv7/$LIBDIR/libjpeg.@SO_MAJOR_VERSION@.dylib -a \ + ! -h $PKGROOT/$LIBDIR/libjpeg.@SO_MAJOR_VERSION@.dylib ]; then + lipo -create \ + $PKGROOT/$LIBDIR/libjpeg.@SO_MAJOR_VERSION@.dylib \ + -arch arm $TMPDIR/dist.armv7/$LIBDIR/libjpeg.@SO_MAJOR_VERSION@.dylib \ + -output $PKGROOT/$LIBDIR/libjpeg.@SO_MAJOR_VERSION@.dylib + elif [ ! -h $TMPDIR/dist.armv7/$LIBDIR/libjpeg.@SO_MAJOR_VERSION@.0.@SO_MINOR_VERSION@.dylib -a \ + ! -h $PKGROOT/$LIBDIR/libjpeg.@SO_MAJOR_VERSION@.0.@SO_MINOR_VERSION@.dylib ]; then + lipo -create \ + $PKGROOT/$LIBDIR/libjpeg.@SO_MAJOR_VERSION@.0.@SO_MINOR_VERSION@.dylib \ + -arch arm $TMPDIR/dist.armv7/$LIBDIR/libjpeg.@SO_MAJOR_VERSION@.0.@SO_MINOR_VERSION@.dylib \ + -output $PKGROOT/$LIBDIR/libjpeg.@SO_MAJOR_VERSION@.0.@SO_MINOR_VERSION@.dylib + fi lipo -create \ $PKGROOT/$LIBDIR/libjpeg.a \ -arch arm $TMPDIR/dist.armv7/$LIBDIR/libjpeg.a \ -output $PKGROOT/$LIBDIR/libjpeg.a + lipo -create \ + $PKGROOT/$LIBDIR/libturbojpeg.0.dylib \ + -arch arm $TMPDIR/dist.armv7/$LIBDIR/libturbojpeg.0.dylib \ + -output $PKGROOT/$LIBDIR/libturbojpeg.0.dylib lipo -create \ $PKGROOT/$LIBDIR/libturbojpeg.a \ -arch arm $TMPDIR/dist.armv7/$LIBDIR/libturbojpeg.a \ -output $PKGROOT/$LIBDIR/libturbojpeg.a + lipo -create \ + $PKGROOT/$BINDIR/cjpeg \ + -arch arm $TMPDIR/dist.armv7/$BINDIR/cjpeg \ + -output $PKGROOT/$BINDIR/cjpeg + lipo -create \ + $PKGROOT/$BINDIR/djpeg \ + -arch arm $TMPDIR/dist.armv7/$BINDIR/djpeg \ + -output $PKGROOT/$BINDIR/djpeg + lipo -create \ + $PKGROOT/$BINDIR/jpegtran \ + -arch arm $TMPDIR/dist.armv7/$BINDIR/jpegtran \ + -output $PKGROOT/$BINDIR/jpegtran + lipo -create \ + $PKGROOT/$BINDIR/tjbench \ + -arch arm $TMPDIR/dist.armv7/$BINDIR/tjbench \ + -output $PKGROOT/$BINDIR/tjbench + lipo -create \ + $PKGROOT/$BINDIR/rdjpgcom \ + -arch arm $TMPDIR/dist.armv7/$BINDIR/rdjpgcom \ + -output $PKGROOT/$BINDIR/rdjpgcom + lipo -create \ + $PKGROOT/$BINDIR/wrjpgcom \ + -arch arm $TMPDIR/dist.armv7/$BINDIR/wrjpgcom \ + -output $PKGROOT/$BINDIR/wrjpgcom fi if [ $BUILDARMV7S = 1 ]; then @@ -219,14 +301,55 @@ if [ $BUILDARMV7S = 1 ]; then pushd $BUILDDIRARMV7S make install DESTDIR=$TMPDIR/dist.armv7s popd + if [ ! -h $TMPDIR/dist.armv7s/$LIBDIR/libjpeg.@SO_MAJOR_VERSION@.dylib -a \ + ! -h $PKGROOT/$LIBDIR/libjpeg.@SO_MAJOR_VERSION@.dylib ]; then + lipo -create \ + $PKGROOT/$LIBDIR/libjpeg.@SO_MAJOR_VERSION@.dylib \ + -arch arm $TMPDIR/dist.armv7s/$LIBDIR/libjpeg.@SO_MAJOR_VERSION@.dylib \ + -output $PKGROOT/$LIBDIR/libjpeg.@SO_MAJOR_VERSION@.dylib + elif [ ! -h $TMPDIR/dist.armv7s/$LIBDIR/libjpeg.@SO_MAJOR_VERSION@.0.@SO_MINOR_VERSION@.dylib -a \ + ! -h $PKGROOT/$LIBDIR/libjpeg.@SO_MAJOR_VERSION@.0.@SO_MINOR_VERSION@.dylib ]; then + lipo -create \ + $PKGROOT/$LIBDIR/libjpeg.@SO_MAJOR_VERSION@.0.@SO_MINOR_VERSION@.dylib \ + -arch arm $TMPDIR/dist.armv7s/$LIBDIR/libjpeg.@SO_MAJOR_VERSION@.0.@SO_MINOR_VERSION@.dylib \ + -output $PKGROOT/$LIBDIR/libjpeg.@SO_MAJOR_VERSION@.0.@SO_MINOR_VERSION@.dylib + fi lipo -create \ $PKGROOT/$LIBDIR/libjpeg.a \ -arch arm $TMPDIR/dist.armv7s/$LIBDIR/libjpeg.a \ -output $PKGROOT/$LIBDIR/libjpeg.a + lipo -create \ + $PKGROOT/$LIBDIR/libturbojpeg.0.dylib \ + -arch arm $TMPDIR/dist.armv7s/$LIBDIR/libturbojpeg.0.dylib \ + -output $PKGROOT/$LIBDIR/libturbojpeg.0.dylib lipo -create \ $PKGROOT/$LIBDIR/libturbojpeg.a \ -arch arm $TMPDIR/dist.armv7s/$LIBDIR/libturbojpeg.a \ -output $PKGROOT/$LIBDIR/libturbojpeg.a + lipo -create \ + $PKGROOT/$BINDIR/cjpeg \ + -arch arm $TMPDIR/dist.armv7s/$BINDIR/cjpeg \ + -output $PKGROOT/$BINDIR/cjpeg + lipo -create \ + $PKGROOT/$BINDIR/djpeg \ + -arch arm $TMPDIR/dist.armv7s/$BINDIR/djpeg \ + -output $PKGROOT/$BINDIR/djpeg + lipo -create \ + $PKGROOT/$BINDIR/jpegtran \ + -arch arm $TMPDIR/dist.armv7s/$BINDIR/jpegtran \ + -output $PKGROOT/$BINDIR/jpegtran + lipo -create \ + $PKGROOT/$BINDIR/tjbench \ + -arch arm $TMPDIR/dist.armv7s/$BINDIR/tjbench \ + -output $PKGROOT/$BINDIR/tjbench + lipo -create \ + $PKGROOT/$BINDIR/rdjpgcom \ + -arch arm $TMPDIR/dist.armv7s/$BINDIR/rdjpgcom \ + -output $PKGROOT/$BINDIR/rdjpgcom + lipo -create \ + $PKGROOT/$BINDIR/wrjpgcom \ + -arch arm $TMPDIR/dist.armv7s/$BINDIR/wrjpgcom \ + -output $PKGROOT/$BINDIR/wrjpgcom fi install_name_tool -id $LIBDIR/libjpeg.@SO_MAJOR_VERSION@.dylib $PKGROOT/$LIBDIR/libjpeg.@SO_MAJOR_VERSION@.dylib @@ -259,7 +382,7 @@ productbuild --distribution $SRCDIR/release/Distribution.xml \ --package-path $TMPDIR/pkg/ --resources $TMPDIR/pkg/ \ $TMPDIR/dmg/$PACKAGE_NAME.pkg hdiutil create -fs HFS+ -volname $PACKAGE_NAME-$VERSION \ - -srcfolder "$TMPDIR/dmg" $TMPDIR/$PACKAGE_NAME-$VERSION.dmg -cp $TMPDIR/$PACKAGE_NAME-$VERSION.dmg . + -srcfolder "$TMPDIR/dmg" $TMPDIR/$PACKAGE_NAME-$VERSION.dmg +cp $TMPDIR/$PACKAGE_NAME-$VERSION.dmg . exit -- 2.40.0