"Go" iOS lame compile arm64 armv7s armv7 x86_64 i386 instruction set

Source: Internet
Author: User

From the original to http://blog.csdn.net/vieri_ch/article/details/40650467

Recently upgraded the system to Mac OS X 10.10 and updated XCode6.1 and iOS 8.1

The Libmp3lame.a static library used in the previous app also supports the 64-bit simulator (x86_64) and the 64-bit true machine (arm64) instruction set. Need to recompile

Review the following information, follow the steps below, and make some comments and changes

1.http://sourceforge.net/projects/lame/files/lame/3.99/download Lame The latest version of the extract into a folder such as lame, the full path is as follows/users/8wm/desktop/lame

2. Download build script, I use a foreign friend's share here

Https://github.com/kewlbear/lame-ios-build

Get lame-build.sh Copy to folder after download/users/8wm/desktop/lame

3. Open the script with BBEdit or another editor and modify it according to the comments

4. Open Terminals,

Input

Cd/users/8wm/desktop/lame

chmod 777 lame-build.sh

sudo-s#

Enter the system password

./lame-build.sh

Start compiling, after compilation is complete. Generate Fat-lame directories and Thin-lame directories, storing static libraries that incorporate all instruction sets, and static libraries for each instruction set.

Copy lame.h and Libmp3lame.a, as requiredfile into project, you can use it normally.

< Span style= "font-family: ' Helvetica Neue ', Helvetica, Stheiti, Microsoft Jas Black, Blackbody, Arial, Tahoma, Sans-serif, serif;" >< Span style= "font-family: ' Helvetica Neue ', Helvetica, Stheiti, Microsoft Jas Black, Blackbody, Arial, Tahoma, Sans-serif, serif;" >< Span style= "font-family: ' Helvetica Neue ', Helvetica, Stheiti, Microsoft Jas Black, Blackbody, Arial, Tahoma, Sans-serif, serif;" > You can use the command line to view the set of instructions supported by a different library.

< Span style= "font-family: ' Helvetica Neue ', Helvetica, Stheiti, Microsoft Jas Black, Blackbody, Arial, Tahoma, Sans-serif, serif;" >< Span style= "font-family: ' Helvetica Neue ', Helvetica, Stheiti, Microsoft Jas Black, Blackbody, Arial, Tahoma, Sans-serif, serif;" >< Span style= "font-family: ' Helvetica Neue ', Helvetica, Stheiti, Microsoft Jas Black, Blackbody, Arial, Tahoma, Sans-serif, serif;" >lipo-info libmp3lame.a

< Span style= "font-family: ' Helvetica Neue ', Helvetica, Stheiti, Microsoft Jas Black, Blackbody, Arial, Tahoma, Sans-serif, serif;" >< Span style= "font-family: ' Helvetica Neue ', Helvetica, Stheiti, Microsoft Jas Black, Blackbody, Arial, Tahoma, Sans-serif, serif;" >architectur Es in the Fat file:libmp3lame.a are:armv7 armv7s i386 x86_64 arm64

here is the script for build, please note the yellow words and comments.

#!/bin/sh make Distclean configure_flags="--disable-shared--disable-frontend"Archs="arm64 armv7s x86_64 i386 armv7"# directories # source is the download lame source package, unzip the directory, you can put the SH script into this directory, the source changed to""SOURCE=""# fat is the output directory after all instruction set build, all static libraries are merged into one static library FAT="Fat-lame"# SCRATCH is the download lame source package, unzip the directory, must be the absolute path SCRATCH="/users/8wm/desktop/lame"# must be a absolute path # THIN the directory where the static libraries are output after the respective instruction set build, each instruction set is a static library THIN= ' pwd '/"Thin-lame"COMPILE="y"LIPO="y"    if["$*"] Thenif["$*"="Lipo"] Then # Skip compile Compile=ElseArchs="$*"          if[$#-eq1] Then # Skip Lipo Lipo=fi fi fiif["$COMPILE"] then CWD=' pwd ' echo"$CWD/$SOURCE ....."       forARCHinch$ARCHS DoEcho"Building $ARCH ..."mkdir-P"$SCRATCH/$ARCH"CD"$SCRATCH/$ARCH"            if["$ARCH"="i386"-O"$ARCH"="x86_64"] then PLATFORM="Iphonesimulator"              if["$ARCH"="x86_64"] then SIMULATOR="-mios-simulator-version-min=7.0"HOST=x86_64-apple-DarwinElseSIMULATOR="-mios-simulator-version-min=5.0"HOST=i386-apple-Darwin FiElsePLATFORM="Iphoneos"SIMULATOR=HOST=arm-apple-Darwin fi xcrun_sdk= ' echo $PLATFORM | Tr'[: Upper:]' '[: Lower:]'' CC="xcrun-sdk $XCRUN _sdk clang-arch $ARCH"#AS="$CWD/$SOURCE/extras/gas-preprocessor.pl $CC"CFLAGS="-arch $ARCH $SIMULATOR"Cxxflags="$CFLAGS"Ldflags="$CFLAGS"CC= $CC $CWD/$SOURCE/configure \ $CONFIGURE _flags \--host=$HOST \--prefix="$THIN/$ARCH"\ CC="$CC"cflags="$CFLAGS"ldflags="$LDFLAGS" Make-J3 Install CD $CWD done fiif["$LIPO"] then echo"building fat binaries ..."mkdir-P $FAT/LibSet-$ARCHS CWD=' pwd ' CD $THIN/$1/Lib forLibinch*. A DoCD $CWD Lipo-create ' Find $THIN-name $LIB '-output $FAT/lib/$LIB done CD $CWD CP-RF $THIN/$1/include $FAT fi

"Go" iOS lame compile arm64 armv7s armv7 x86_64 i386 instruction set

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.