[Switch] iOS lame compilation arm64 armv7s armv7 x86_64 i386 instruction set, arm64armv7s
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 libmp 3lame. a static library used by the app also supports 64-bit simulators (x86_64) and 64-bit real machine (arm64) instruction sets. Need to be re-compiled
After reading the following documents, follow these steps and make some comments and changes.
1. http://sourceforge.net/projects/lame/files/lame/3.99/ to download the latest version of lame decompress to a folder such as lame, the full path is as follows/Users/8wm/Desktop/lame
2. Download the build script, which is shared by a foreign friend.
Https://github.com/kewlbear/lame-ios-build
Download and get the lame-build.sh copy to the folder/Users/8wm/Desktop/lame
3. Use bbedit or another editor to open the script and modify it according to the comment.
4. Enable Terminals,
Input
Cd/Users/8wm/Desktop/lame
Chmod 777 lame-build.sh
Sudo-s #
Enter the system password
/Lame-build.sh
Start compilation. Generate the fat-lame directory and the thin-lame directory, respectively store the static libraries that merge all instruction sets and the static libraries of each instruction set.
Copy the lame. h and libmp 3lame. a files to the project as required.
You can use the command line to view the instruction sets supported by another database.
Lipo-info libmp 3lame.
Ubuntures in the fat file: libmp 3lame. a are: armv7 armv7s i386 x86_64 arm64
The following is a build script. 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 to download the lame SOURCE package, directory after decompression, you can put the sh script in this directory, and change source to "" SOURCE = "" # FAT is the directory output after all instruction sets are built, all static databases are merged into a static library FAT = "fat-lame" # SCRATCH is the directory to download the lame source code package and decompress it, it must be the absolute path SCRATCH = "/Users/8wm/Desktop/lame" # must be an absolute path # directory of the static library output after the build of the THIN instruction set, each instruction set is a static library THIN = 'pwd'/"thin-lame" COMPILE = "y" LIPO = "y" if ["$ *"] then if ["$ * "=" lipo "] then # skip compile COMPILE = else ARCHS =" $ * "if [$ #-eq 1] then # skip lipo LIPO = fi if [" $ COMPILE "] then CWD = 'pwd' echo" $ CWD/$ SOURCE ......... "for ARCH in $ ARCHS do echo" 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-darwin else SIMULATOR = "- mios-simulator-version-min = 5.0 "HOST = i386-apple-darwin fi else PLATFORM =" 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 fi if [" $ LIPO "] then echo "building fat binaries... "mkdir-p $ FAT/lib set-$ archs cwd = 'pwd' cd $ THIN/$1/lib for LIB in *. a do cd $ CWD lipo-create 'Find $ THIN-name $ LIB '-output $ FAT/lib/$ LIB done cd $ CWD cp-rf $ THIN/$1/include $ FAT fi