Build Rsync for Android

前端 未结 2 944
花落未央
花落未央 2020-12-17 00:46

I have downloaded rsync from http://rsync.samba.org/ anyone knows how to compile the source code to be deployed in an Android Device?

2条回答
  •  孤街浪徒
    2020-12-17 01:01

    You can compile without the NDK assuming you statically link. This works for me on Ubuntu 13.04 Raring Ringtail.

    Install the cross compiler:

    sudo apt-get install gcc-arm-linux-gnueabi
    

    Download 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
    

    Compile with the cross compiler, using static linking:

    ./configure --host=arm-linux-gnueabi CFLAGS="-static"
    make
    

    You'll get some warnings along the lines of Using X in statically linked applications requires at runtime the shared libraries from the glibc version used for linking. But so far, rsync has worked for me.

    And finally, install to your phone (assumes you are using SSHDroid):

    scp -P 2222 rsync root@$PHONE_IP:/data/data/berserker.android.apps.sshdroid/dropbear
    

提交回复
热议问题