【发布时间】:2013-07-14 10:33:22
【问题描述】:
我想在我的 iOS 应用程序中使用 lasem,但是编译 lasem 需要 glib。如何构建它?
我从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.2
checking whether the C compiler works... no
configure: error: in `/Users/tinyfool/Downloads/glib-2.34.3':
configure: error: C compiler cannot create executables
我能做什么?
【问题讨论】:
-
别...认真...
-
顺便说一句,GLib 是在 LGPL 许可下发布的,它与 iOS 存在很多问题,由于静态链接,并且通常在法律上不兼容......
-
GCC - 这个脚本发现它而不是 Clang 作为编译器 - 偶然被弃用为 MacOSX 和 iOS 的编译器 - 至少在 Apple 不再支持或更新版本的情况下他们的开发工具。除非您依靠 MacPorts 或类似工具来获取它,否则它将在下一个版本中消失。
-
一点也不兼容,只是有点复杂。 LGPL 的“精神”是最终用户应该能够修改 LGPL 源代码并因此改进/更改产品。动态链接时,这与替换动态库一样简单,但使用静态链接时,您需要提供使用的 LGPL 源代码、专有目标文件以及编译和重新链接这些文件的方法,这样仍然可以修改生成的产品.