我从https://git.gnome.org/browse/glib/refs/tags下载glib-2.37.4.然后我使用autogen.sh获取配置文件,运行make并安装在mac上.我写了一个shell脚本尝试为iOS构建glib,如下:
export path=/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/usr/llvm-gcc-4.2/bin/:$path export CC=arm-apple-darwin10-llvm-gcc-4.2 export CFLAGS="-arch armv7" export LDFLAGS="-miphoneos-version-min=2.0" export LD="/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/ld--disable-cxx"./configure --prefix=/usr/local/ios/ --host=arm-apple-darwin10 --enable-static=yes --enable-shared=no CC=$CC CFLAGS=$CFLAGS CPP=cpp AR=ar LDFLAGS=$LDFLAGS LD=$LD
当我运行此脚本时,返回为:
checking for arm-apple-darwin10-gcc... arm-apple-darwin10-llvm-gcc-4.2checking whether the C compiler works... noconfigure: error: in `/Users/tinyfool/Downloads/glib-2.34.3':configure: error: C compiler cannot create executables
我能做什么?
解决方法 鉴于您已为iOS构建了 libffi和 proxy-libintl,并将这两者安装到此脚本使用的同一PREFIX中,这将为您构建Glib:#! /bin/bashexport MINVER="5.1" # the minimum supported OS versionexport SDKVER="5.1" # SDK versionexport PREFIX="$HOME/built-for-ios" # where the library goesexport DEVROOT="/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer"export SDKROOT="${DEVROOT}/SDKs/iPhoneOS${SDKVER}.sdk"export PKG_CONfig_liBDIR="${PREFIX}/lib/pkgconfig:${SDKROOT}/usr/lib/pkgconfig"export COMMON_FLAGS="-arch armv7 -isysroot ${SDKROOT}"export CPPFLAGS="-I${PREFIX}/include ${COMMON_FLAGS} -miphoneos-version-min=${MINVER}"export CFLAGS="${CPPFLAGS}"export LDFLAGS="-L${PREFIX}/lib ${COMMON_FLAGS} -Wl,-iphoneos_version_min,${MINVER}"export CC="${DEVROOT}/usr/bin/gcc"export CXX="${DEVROOT}/usr/bin/g++"export OBJC="${CC}"export LD="${CC}"[ ! -d "${PREFIX}" ] && mkdir -p "${PREFIX}"./configure --prefix="${PREFIX}" \--build="x86_64-apple-darwin" \--host="arm-apple-darwin" \--enable-static \--disable-shared \glib_cv_stack_grows=no \glib_cv_uscore=no \ac_cv_func_posix_getgrgID_r=yes \ac_cv_func_posix_getpwuID_r=yes总结
以上是内存溢出为你收集整理的如何为iOS构建GLib全部内容,希望文章能够帮你解决如何为iOS构建GLib所遇到的程序开发问题。
如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)