本地建立乙個新的資料夾進入檔案在mac終端下面執行:
wget
2.新建指令碼build-faac.sh內容如下
#!/bin/sh
configure_flags="--enable-static --with-pic"
archs="arm64 armv7s armv7"
# directories
source="faac"
fat="fat-faac"
scratch="scratch-faac"
# must be an absolute path
thin=`pwd`/"thin-faac"
compile="y"
lipo="y"
if [ "$*" ]
then
if [ "$*" = "lipo" ]
then
# skip compile
compile=
else
archs="$*"
if [ $# -eq 1 ]
then
# skip lipo
lipo=
fifi
fiif [ "$compile" ]
then
cwd=`pwd`
for arch in $archs
doecho "building $arch..."
mkdir -p "$scratch/$arch"
cd "$scratch/$arch"
if [ "$arch" = "i386" -o "$arch" = "x86_64" ]
then
platform="iphonesimulator"
cpu=
if [ "$arch" = "x86_64" ]
then
simulator="-mios-simulator-version-min=7.0"
host=
else
simulator="-mios-simulator-version-min=5.0"
fielse
platform="iphoneos"
if [ $arch = "armv7s" ]
then
cpu="--cpu=swift"
else
cpu=
fisimulator=
fixcrun_sdk=`echo $platform | tr '[:upper:]' '[:lower:]'`
cc="xcrun -sdk $xcrun_sdk clang -wno-error=unused-command-line-argument-hard-error-in-future"
as="$cwd/$source/extras/gas-preprocessor.pl $cc"
cflags="-arch $arch $simulator"
cxxflags="$cflags"
ldflags="$cflags"
cc=$cc cflags=$cxxflags ldflags=$ldflags cppflags=$cxxflags cxx=$cc cxxflags=$cxxflags $cwd/$source/configure \
$configure_flags \
$host \
--prefix="$thin/$arch" \
--disable-shared \
--without-mp4v2
make clean && make && make install-strip
cd $cwd
done
fiif [ "$lipo" ]
then
echo "building fat binaries..."
mkdir -p $fat/lib
set - $archs
cwd=`pwd`
cd $thin/$1/lib
for lib in *.a
docd $cwd
lipo -create `find $thin -name $lib` -output $fat/lib/$lib
done
cd $cwd
cp -rf $thin/$1/include $fat
fi
直接執行有可能無效的 於是新增許可權chmod +x build-faac.sh
注意指令碼和faac解壓後的資料夾要在同乙個目錄下 然後終端執行 ./build-faac.sh
編譯faac音訊編碼庫
faac是mpeg 4和mpeg 2的aac編碼器,我們將使用它作為音訊的軟編碼庫。faac官網 sudo wgettar zxvf faac 1.29.9.2.tar.gz1.執行cd faac 1.29.9.2開啟資料夾 2.執行sudo vim generate.sh建立編輯指令碼檔案,並編輯...
編譯靜態庫編譯動態庫
編譯靜態庫 cr標誌告訴ar將object檔案封裝 archive 我們可以使用nm s 命令來檢視.a檔案的內容 ar cr libmyhello.a hello.o 或 cvr 編譯動態庫 gcc c fpic test1.c gcc c fpic test2.c fpic告訴gcc將源 編譯成...
Qt編譯生成靜態庫(靜態編譯)
開發環境 vs2008 qt4.8.4原始碼庫 其他環境請自己嘗試,原理應該是差不多的 qt編譯生成靜態庫1.本教程只針對在win32平台,使用vs開發工具 例子以vs2008為例 2.3.解壓qt源 到目標目錄,如 4.開啟 mkspecs 目錄,找到目標平台的資料夾,如 win32 msvc20...