]> granicus.if.org Git - libjpeg-turbo/commitdiff
Infrastructure for producing a universal x86-64/i386/ARM version of libjpeg.a and...
authorDRC <dcommander@users.sourceforge.net>
Fri, 10 Feb 2012 01:30:37 +0000 (01:30 +0000)
committerDRC <dcommander@users.sourceforge.net>
Fri, 10 Feb 2012 01:30:37 +0000 (01:30 +0000)
git-svn-id: svn+ssh://svn.code.sf.net/p/libjpeg-turbo/code/branches/1.2.x@793 632fc199-4ca6-4c93-a231-07263d6284db

BUILDING.txt
ChangeLog.txt
Makefile.am
release/makemacpkg.in

index 0b3e055f8d09faf1ca2971cdb6301999b6491121..fc583ee349aef1071234a24623aa22c330d7a1f9 100644 (file)
@@ -644,13 +644,32 @@ make dmg
 
 make udmg [BUILDDIR32={32-bit build directory}]
 
-  On 64-bit OS X systems, this creates a version of the Macintosh package and
-  disk image that contains universal i386/x86-64 binaries.  You should first
-  configure a 32-bit out-of-tree build of libjpeg-turbo, then configure a
-  64-bit out-of-tree build, then run 'make udmg' from the 64-bit build
-  directory.  The build system will look for the 32-bit build under
-  {source_directory}/osxx86 by default, but you can override this by setting
-  the BUILDDIR32 variable on the make command line as shown above.
+  On 64-bit OS X systems, this creates a Macintosh package and disk image that
+  contains universal i386/x86-64 binaries.  You should first configure a 32-bit
+  out-of-tree build of libjpeg-turbo, then configure a 64-bit out-of-tree
+  build, then run 'make udmg' from the 64-bit build directory.  The build
+  system will look for the 32-bit build under {source_directory}/osxx86 by
+  default, but you can override this by setting the BUILDDIR32 variable on the
+  make command line as shown above.
+
+make iosdmg [BUILDDIR32={32-bit build directory}] \
+  [BUILDDIRARMV6={ARM v6 build directory}] \
+  [BUILDDIRARMV7={ARM v7 build directory}] \
+
+  On OS X systems, this creates a Macintosh package and disk image in which the
+  libjpeg-turbo static libraries contain ARM architectures necessary to build
+  iOS applications.  If building on an x86-64 system, the binaries will also
+  contain the i386 architecture, as with 'make udmg' above.  You should first
+  configure ARM v6 and ARM v7 out-of-tree builds of libjpeg-turbo (see
+  "Building libjpeg-turbo for iOS" above.)  If you are building an x86-64
+  version of libjpeg-turbo, you should configure a 32-bit out-of-tree build as
+  well.  Next, build libjpeg-turbo as you would normally, using an out-of-tree
+  build.  When it is built, run 'make iosdmg' from the build directory.  The
+  build system will look for the ARM v6 build under {source_directory}/iosarmv6
+  by default, the ARM v7 build under {source_directory}/iosarmv7 by default,
+  and (if applicable) the 32-bit build under {source_directory}/osxx86 by
+  default, but you can override this by setting the BUILDDIR32, BUILDDIRARMV6,
+  and/or BUILDDIRARMV7 variables on the make command line as shown above.
 
 make sunpkg
 
index f6b38d7b1b804fefa290f52cb1f2bf163b6f0bd5..529bd7e91917549596bf0066f137d1d60d475523 100644 (file)
@@ -29,6 +29,11 @@ K component is assigned a component ID of 1 instead of 4.  Although these files
 are in violation of the spec, other JPEG implementations handle them
 correctly.
 
+[7] Added ARM v6 and ARM v7 architectures to libjpeg.a and libturbojpeg.a in
+the official OS X distribution package, so that those libraries can be used to
+build both OS X and iOS applications.
+
+
 
 1.1.90 (1.2 beta1)
 ==================
index 791fdd2e4de9b6f9029925924a0535601522358f..ffd5bb2f215e0fb276bd9fbc97c21c7eba1e2025 100644 (file)
@@ -299,10 +299,22 @@ srpm: dist-gzip
 deb: all
        sh pkgscripts/makedpkg
 
+BUILDDIR32=@abs_top_srcdir@/osxx86
+BUILDDIRARMV6=@abs_top_srcdir@/iosarmv6
+BUILDDIRARMV7=@abs_top_srcdir@/iosarmv7
+
 if X86_64
 
 udmg: all
-       sh pkgscripts/makemacpkg universal ${BUILDDIR32}
+       sh pkgscripts/makemacpkg -builddir32 ${BUILDDIR32}
+
+iosdmg: all
+       sh pkgscripts/makemacpkg -builddir32 ${BUILDDIR32} -builddirarmv6 ${BUILDDIRARMV6} -builddirarmv7 ${BUILDDIRARMV7}
+
+else
+
+iosdmg: all
+       sh pkgscripts/makemacpkg -builddirarmv6 ${BUILDDIRARMV6} -builddirarmv7 ${BUILDDIRARMV7}
 
 endif
 
index b0f45ab97de7d7a0d68b5a52d1431508ffba851b..89a3fd7d675cfbcc7da75b11f5af5405dce4304b 100644 (file)
@@ -17,24 +17,27 @@ onexit()
 
 usage()
 {
-       echo "$0 [universal [32-bit build dir]]"
+       echo "$0 [-builddir32 [32-bit build dir]] [-builddirarmv6 [ARM v6 build dir]] [-builddirarmv7 [ARM v7 build dir]]"
        exit 1
 }
 
-UNIVERSAL=0
-
 PACKAGE_NAME=@PACKAGE_NAME@
 VERSION=@VERSION@
 BUILD=@BUILD@
 SRCDIR=@abs_top_srcdir@
-BUILDDIR32=@abs_top_srcdir@/osxx86
+BUILDDIR32=
+BUILDDIRARMV6=
+BUILDDIRARMV7=
 WITH_JAVA=@WITH_JAVA@
-if [ $# -gt 0 ]; then
-       if [ "$1" = "universal" ]; then
-               UNIVERSAL=1
-               if [ $# -gt 1 ]; then BUILDDIR32=$2; fi
-       fi
-fi
+while [ $# -gt 0 ]; do
+       case $1 in
+       -h*)             usage 0                   ;;
+       -builddir32)     BUILDDIR32=$2;     shift  ;;
+       -builddirarmv6)  BUILDDIRARMV6=$2;  shift  ;;
+       -builddirarmv7)  BUILDDIRARMV7=$2;  shift  ;;
+       esac
+       shift
+done
 PACKAGEMAKER=/Developer/Applications/Utilities/PackageMaker.app/Contents/MacOS/PackageMaker
 
 if [ -f $PACKAGE_NAME-$VERSION.dmg ]; then
@@ -55,7 +58,7 @@ mv $PKGROOT/opt/$PACKAGE_NAME/lib/libturbojpeg.* $PKGROOT/usr/lib
 mkdir -p $PKGROOT/usr/include
 mv $PKGROOT/opt/$PACKAGE_NAME/include/turbojpeg.h $PKGROOT/usr/include
 
-if [ $UNIVERSAL = 1 ]; then
+if [ ! "$BUILDDIR32" = "" ]; then
        if [ ! -d $BUILDDIR32 ]; then
                echo ERROR: 32-bit build directory $BUILDDIR32 does not exist
                exit 1
@@ -120,6 +123,52 @@ if [ $UNIVERSAL = 1 ]; then
 
 fi
 
+if [ ! "$BUILDDIRARMV6" = "" ]; then
+       if [ ! -d $BUILDDIRARMV6 ]; then
+               echo ERROR: ARM v6 build directory $BUILDDIRARMV6 does not exist
+               exit 1
+       fi
+       if [ ! -f $BUILDDIRARMV6/Makefile ]; then
+               echo ERROR: ARM v6 build directory $BUILDDIRARMV6 is not configured
+               exit 1
+       fi
+       mkdir -p $TMPDIR/dist.armv6
+       pushd $BUILDDIRARMV6
+       make install DESTDIR=$TMPDIR/dist.armv6
+       popd
+       lipo -create \
+               $PKGROOT/opt/$PACKAGE_NAME/lib/libjpeg.a \
+               -arch arm $TMPDIR/dist.armv6/opt/$PACKAGE_NAME/lib/libjpeg.a \
+               -output $PKGROOT/opt/$PACKAGE_NAME/lib/libjpeg.a
+       lipo -create \
+               $PKGROOT/usr/lib/libturbojpeg.a \
+               -arch arm $TMPDIR/dist.armv6/opt/$PACKAGE_NAME/lib/libturbojpeg.a \
+               -output $PKGROOT/usr/lib/libturbojpeg.a
+fi
+
+if [ ! "$BUILDDIRARMV7" = "" ]; then
+       if [ ! -d $BUILDDIRARMV7 ]; then
+               echo ERROR: ARM v7 build directory $BUILDDIRARMV7 does not exist
+               exit 1
+       fi
+       if [ ! -f $BUILDDIRARMV7/Makefile ]; then
+               echo ERROR: ARM v7 build directory $BUILDDIRARMV7 is not configured
+               exit 1
+       fi
+       mkdir -p $TMPDIR/dist.armv7
+       pushd $BUILDDIRARMV7
+       make install DESTDIR=$TMPDIR/dist.armv7
+       popd
+       lipo -create \
+               $PKGROOT/opt/$PACKAGE_NAME/lib/libjpeg.a \
+               -arch arm $TMPDIR/dist.armv7/opt/$PACKAGE_NAME/lib/libjpeg.a \
+               -output $PKGROOT/opt/$PACKAGE_NAME/lib/libjpeg.a
+       lipo -create \
+               $PKGROOT/usr/lib/libturbojpeg.a \
+               -arch arm $TMPDIR/dist.armv7/opt/$PACKAGE_NAME/lib/libturbojpeg.a \
+               -output $PKGROOT/usr/lib/libturbojpeg.a
+fi
+
 install_name_tool -id /opt/$PACKAGE_NAME/lib/libjpeg.@SO_MAJOR_VERSION@.dylib $PKGROOT/opt/$PACKAGE_NAME/lib/libjpeg.@SO_MAJOR_VERSION@.dylib
 install_name_tool -id libturbojpeg.dylib $PKGROOT/usr/lib/libturbojpeg.dylib