summaryrefslogtreecommitdiff
path: root/branches
diff options
context:
space:
mode:
authordcommander <dcommander@3789f03b-4d11-0410-bbf8-ca57d06f2519>2012-02-10 01:30:37 +0000
committerdcommander <dcommander@3789f03b-4d11-0410-bbf8-ca57d06f2519>2012-02-10 01:30:37 +0000
commit7f11737460aaabda54e13106a72ba9b671bd3ba0 (patch)
tree29490e52123263219b70fbf98a5e940771dcd590 /branches
parentb5590376eeb10ba3c0bbd14a17a1525459c1ef67 (diff)
Infrastructure for producing a universal x86-64/i386/ARM version of libjpeg.a and libturbojpeg.a on OS X, so that the same library can be used to build OS X and iOS apps
git-svn-id: https://libjpeg-turbo.svn.sourceforge.net/svnroot/libjpeg-turbo@793 3789f03b-4d11-0410-bbf8-ca57d06f2519
Diffstat (limited to 'branches')
-rw-r--r--branches/1.2.x/BUILDING.txt33
-rw-r--r--branches/1.2.x/ChangeLog.txt5
-rw-r--r--branches/1.2.x/Makefile.am14
-rw-r--r--branches/1.2.x/release/makemacpkg.in71
4 files changed, 104 insertions, 19 deletions
diff --git a/branches/1.2.x/BUILDING.txt b/branches/1.2.x/BUILDING.txt
index 0b3e055..fc583ee 100644
--- a/branches/1.2.x/BUILDING.txt
+++ b/branches/1.2.x/BUILDING.txt
@@ -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
diff --git a/branches/1.2.x/ChangeLog.txt b/branches/1.2.x/ChangeLog.txt
index f6b38d7..529bd7e 100644
--- a/branches/1.2.x/ChangeLog.txt
+++ b/branches/1.2.x/ChangeLog.txt
@@ -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)
==================
diff --git a/branches/1.2.x/Makefile.am b/branches/1.2.x/Makefile.am
index 791fdd2..ffd5bb2 100644
--- a/branches/1.2.x/Makefile.am
+++ b/branches/1.2.x/Makefile.am
@@ -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
diff --git a/branches/1.2.x/release/makemacpkg.in b/branches/1.2.x/release/makemacpkg.in
index b0f45ab..89a3fd7 100644
--- a/branches/1.2.x/release/makemacpkg.in
+++ b/branches/1.2.x/release/makemacpkg.in
@@ -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