我从http://rsync.samba.org/下载了rsync,有人知道如何编译要部署到安卓设备上的源代码吗?
发布于 2013-08-03 20:24:30
假设你是静态链接,你可以在没有NDK的情况下编译。这对我来说在Ubuntu 13.04 Raring上是有效的。
安装交叉编译器:
sudo apt-get install gcc-arm-linux-gnueabi下载rsync:
wget http://rsync.samba.org/ftp/rsync/rsync-3.0.9.tar.gz
tar -zxv -f rsync-3.0.9.tar.gz
cd rsync-3.0.9使用交叉编译器进行编译,使用静态链接:
./configure --host=arm-linux-gnueabi CFLAGS="-static"
make您将得到一些与Using X in statically linked applications requires at runtime the shared libraries from the glibc version used for linking类似的警告。但到目前为止,rsync对我来说是有效的。
最后,安装到您的手机上(假设您使用的是SSHDroid):
scp -P 2222 rsync root@$PHONE_IP:/data/data/berserker.android.apps.sshdroid/dropbear发布于 2011-11-15 10:50:00
你需要Android NDK找到here,网页上有示例,下载了如何为安卓编译C代码。
从NDK Website:
NDK提供:
一组工具和构建文件,用于从C和C++源生成本机代码库将相应的本机库嵌入到可在安卓设备上部署的应用程序包文件(.apk)中的一组本机系统头文件和库,将在安卓平台的所有未来版本中得到支持,从安卓1.5开始。使用本机活动的应用程序必须在Android 2.3或更高版本上运行。文档、示例和教程
我也找到了this,如果它接近你想要实现的目标。
https://stackoverflow.com/questions/8130889
复制相似问题