Modify OS X universal binary creation process to give the user more control over the 32-bit fork (necessary for building universal binaries with libjpeg v7/v8b emulation, for instance)

git-svn-id: svn+ssh://svn.code.sf.net/p/libjpeg-turbo/code/trunk@281 632fc199-4ca6-4c93-a231-07263d6284db
This commit is contained in:
DRC
2010-10-18 08:24:42 +00:00
parent 68bf3f2846
commit 9ef93dbbdc
3 changed files with 21 additions and 15 deletions

View File

@@ -530,13 +530,15 @@ make dmg
Create Macintosh package/disk image. This requires the PackageMaker
application, which must be installed in /Developer/Applications/Utilities.
make udmg
make udmg [BUILDDIR32={32-bit build directory}]
On 64-bit OS X systems, this creates a version of the Macintosh package and
disk image which contains universal i386/x86-64 binaries. The 32-bit fork of
these binaries is backward compatible with OS X 10.4 and later. The 64-bit
fork can be made backward compatible as well by using the instructions in
the "Build Recipes" section. OS X 10.4 compatibility SDK required.
disk image which 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 cygwinpkg

View File

@@ -197,9 +197,11 @@ deb: all
if X86_64
BUILDDIR32=${srcdir}/osxx86
udmg: all
sh $(srcdir)/release/makemacpkg ${PACKAGE_NAME} ${VERSION} ${BUILD} \
${srcdir} universal
${srcdir} ${BUILDDIR32}
endif

View File

@@ -17,7 +17,7 @@ onexit()
usage()
{
echo "$0 <package name> <version> <build> <source dir.> [universal]"
echo "$0 <package name> <version> <build> <source dir.> [32-bit build dir]"
exit 1
}
@@ -29,7 +29,8 @@ VERSION=$2
BUILD=$3
SRCDIR=$4
if [ $# -gt 4 ]; then
if [ "$5" = "universal" ]; then UNIVERSAL=1; fi
BUILDDIR32=$5
UNIVERSAL=1
fi
PACKAGEMAKER=/Developer/Applications/Utilities/PackageMaker.app/Contents/MacOS/PackageMaker
@@ -50,15 +51,16 @@ mkdir -p $PKGROOT/usr/include
mv $PKGROOT/opt/$PACKAGE_NAME/include/turbojpeg.h $PKGROOT/usr/include
if [ $UNIVERSAL = 1 ]; then
if [ ! -d $SRCDIR/osxx86 ]; then
mkdir -p $SRCDIR/osxx86
if [ ! -d $BUILDDIR32 ]; then
echo ERROR: 32-bit build directory $BUILDDIR32 does not exist
exit 1
fi
if [ ! -f $BUILDDIR32/Makefile ]; then
echo ERROR: 32-bit build directory $BUILDDIR32 is not configured
exit 1
fi
mkdir -p $TMPDIR/dist.x86
pushd $SRCDIR/osxx86
sh $SRCDIR/configure --with-pic \
CFLAGS='-isysroot /Developer/SDKs/MacOSX10.4u.sdk -mmacosx-version-min=10.4 -O3 -m32' \
CXXFLAGS='-isysroot /Developer/SDKs/MacOSX10.4u.sdk -mmacosx-version-min=10.4 -O3 -m32' \
LDFLAGS='-isysroot /Developer/SDKs/MacOSX10.4u.sdk -mmacosx-version-min=10.4 -m32'
pushd $BUILDDIR32
make install DESTDIR=$TMPDIR/dist.x86
popd
if [ ! -h $TMPDIR/dist.x86/opt/$PACKAGE_NAME/lib/libjpeg.62.dylib -a \