teasame / webp

Automatically exported from code.google.com/p/webp
0 stars 0 forks source link

No armv7s architecture in Mac/iOS build #132

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Link library/framework with iOS 6.0 application with Xcode 4.5.1 (latest 
release versions)
2. Build using default settings for iOS
3. Unable to link - armv7s architecture not supported.

The current Mac/iOS build supports 386, armv6 and armv7 architectures. More 
recent iOS devices however use the armv7s instruction set, and by default Xcode 
will build for 386, armv7 and armv7s when building a library.

To support the latest Xcode and iOS application the library needs to include 
the armv7s architecture. I've build this myself locally using a modified 
version of a build script that I got from the web but it would be handy to get 
armv7s in the official builds.

#!/bin/sh
#
# Note: This build script assumes it can find the archive for libwebp 
# in the current directory. You can download it from the following URL:
#  http://code.google.com/speed/webp/download.html
#
# The resulting framework will can be found in the current directory 
# with the name WebP.framework
#

SDK=6.0
PLATFORMS="iPhoneSimulator iPhoneOS-V7 iPhoneOS-V7s"
DEVELOPER=/Applications/Xcode.app/Contents/Developer
TOPDIR=`pwd`
BUILDDIR="$TOPDIR/tmp"
FINALDIR="$TOPDIR/WebP.framework"
LIBLIST=''

mkdir -p $BUILDDIR
mkdir -p $FINALDIR
mkdir $FINALDIR/Headers/

for PLATFORM in ${PLATFORMS}
do
  if [ "${PLATFORM}" == "iPhoneOS-V7" ]
  then
    PLATFORM="iPhoneOS"
    ARCH="armv7"
  elif [ "${PLATFORM}" == "iPhoneOS-V7s" ]
  then
    PLATFORM="iPhoneOS"
    ARCH="armv7s"
  else
    ARCH="i386"
  fi

  ROOTDIR="${BUILDDIR}/${PLATFORM}-${SDK}-${ARCH}"
  rm -rf "${ROOTDIR}"
  mkdir -p "${ROOTDIR}"

  export DEVROOT="${DEVELOPER}/Platforms/${PLATFORM}.platform/Developer"
  export SDKROOT="${DEVROOT}/SDKs/${PLATFORM}${SDK}.sdk"
  export CC=${DEVROOT}/usr/bin/gcc
  export LD=${DEVROOT}/usr/bin/ld
#  export CPP=${DEVROOT}/usr/bin/cpp
  export CPP=/usr/bin/cpp
  export CXX=${DEVROOT}/usr/bin/g++
  export AR=${DEVROOT}/usr/bin/ar
  export AS=${DEVROOT}/usr/bin/as
  export NM=${DEVROOT}/usr/bin/nm
#  export CXXCPP=$DEVROOT/usr/bin/cpp
  export CXXCPP=/usr/bin/cpp
  export RANLIB=$DEVROOT/usr/bin/ranlib
  export LDFLAGS="-arch ${ARCH} -pipe -no-cpp-precomp -isysroot ${SDKROOT} -L${ROOTDIR}/lib"
  export CFLAGS="-arch ${ARCH} -pipe -no-cpp-precomp -isysroot ${SDKROOT} -I${ROOTDIR}/include"
  export CXXFLAGS="-arch ${ARCH} -pipe -no-cpp-precomp -isysroot ${SDKROOT} -I${ROOTDIR}/include"

  rm -rf libwebp-0.2.1
  tar xzf libwebp-0.2.1.tar.gz
  cd libwebp-0.2.1

  sh autogen.sh

  ./configure --host=${ARCH}-apple-darwin --prefix=${ROOTDIR} --disable-shared --enable-static
  make -f makefile.unix
  make -f makefile.unix install

  LIBLIST="${LIBLIST} ${ROOTDIR}/lib/libwebp.a"
  cp -Rp ${ROOTDIR}/include/webp/* $FINALDIR/Headers/

  cd ..
done

${DEVROOT}/usr/bin/lipo -create $LIBLIST -output $FINALDIR/WebP

rm -rf libwebp-0.1.2
rm -rf ${BUILDDIR}

Original issue reported on code.google.com by cheezont...@googlemail.com on 2 Nov 2012 at 12:15

GoogleCodeExporter commented 9 years ago

Original comment by pascal.m...@gmail.com on 3 Nov 2012 at 3:51

GoogleCodeExporter commented 9 years ago
The following change should address most of this:

 https://gerrit.chromium.org/gerrit/#/c/41965/

Original comment by jz...@google.com on 25 Jan 2013 at 11:16

GoogleCodeExporter commented 9 years ago
This is now available in iosbuild.sh since:

79fe39e Add ios build script for building iOS library.

Original comment by jz...@google.com on 7 Feb 2013 at 8:20

GoogleCodeExporter commented 9 years ago
Any chance of a release so that I can pull-in this fix?

Original comment by cheezont...@googlemail.com on 13 Feb 2013 at 9:39