1) After Google, find this https://github.com/z24/pitv/tree/master/cross script,
Feel very good. And ready to be compiled.
2) Install cross compiler
sudo Install gcc-arm-linux-gnueabihfsudoinstall G++-ARM-LINUX-GNUEABIHF
In particular, it is important to note that g++ must be installed. Before the installation, there have been a variety of puzzling errors, almost gave up
For example, obviously expat compiled good, but in configure aria2 time, just can't find.
Also, in the last link stage, a undefined reference error occurred
3) http://c-ares.haxx.se/download/c-ares-1.10.0.tar.gz because there is a wall, automatic download can not, need another FQ download.
4) The last modified compilation script.
#!/bin/SH# This script downloads and builds a static aria2 binary forRaspberry pi.# Copyright theYoujie Zhou <[email protected]># All rights reserved. CWD=$(pwd) Export ARCH=Armexport njob=4Export CPP="/usr/bin/arm-linux-gnueabihf-cpp"Export CC="/USR/BIN/ARM-LINUX-GNUEABIHF-GCC"Export CXX="/usr/bin/arm-linux-gnueabihf-g++"Export TOOL_CC=${cc}export LD="/usr/bin/arm-linux-gnueabihf-ld"Export AR="/usr/bin/arm-linux-gnueabihf-ar"Export as="/usr/bin/arm-linux-gnueabihf-as"Export Ranlib="/usr/bin/arm-linux-gnueabihf-ranlib"# Local folder where weInstallbuilt binaries and libraries. Local_dir=$(Readlink-F./local)mkdir-p ${local_dir}# Cross-compiler tools. Latest version can be downloaded at:# github.com/raspberrypi/Toolstool_dir=/Usrtool_bin_dir=${tool_dir}/BinPath=${tool_bin_dir}: $PATH # zlibRM-RF zlib-1.2.8#wgethttp//zlib.net/zlib-1.2.8.tar.gz./TarXzf zlib*.Tar. GZCD zlib*/prefix=${local_dir} CC=${TOOL_CC} cflags="-o4"./configure--Static Make-J${njob} Make InstallCD ${cwd}# ExpatRM-RF expat-2.1.0#wgethttp//downloads.sourceforge.net/expat/2.1.0/expat-2.1.0.tar.gz./TarXzf expat*.Tar. GZCD Expat*/./Configure--host=arm-linux-GNUEABIHF--build=${arch}-Linux--enable-shared=No--enable-static=Yes--prefix=${local_dir} Make-J${njob} Make InstallCD ${cwd}# C-AresRM-RF c-ares-1.10.0#wgethttp//c-ares.haxx.se/download/c-ares-1.10.0.tar.gz./TarXzf c-ares*.Tar. GZCD C-ares*/./Configure--host=arm-linux-GNUEABIHF--build=${arch}-Linux--enable-shared=No--enable-static=Yes--prefix=${local_dir} Make-J${njob} Make InstallCD ${cwd}# aria2RM-RF aria2-1.18.Ten#wgethttp//downloads.sourceforge.net/aria2/aria2-1.18.10.tar.xz./TarXJF aria2*.Tar. XZCD aria2*/./Configure--host=arm-linux-GNUEABIHF--build=${arch}-Linux--disable-NLS--disable-SSL--disable-Epoll--without-GnuTLS--without-OpenSSL--without-Sqlite3--without-LIBXML2--with-libz--with-libz-prefix=${local_dir}--with-libexpat--with-libexpat-prefix=${local_dir}--with-libcares--with-libcares-prefix=${local_dir}--prefix=${local_dir} cxxflags="-os-g"CFLAGS="-os-g"Ldflags="-l${local_dir}/lib"Pkg_config_libdir="${local_dir}/lib/pkgconfig"aria2_static=Yes Make-J${njob} Make Install
ubuntu10.04 Cross-Compiling ARIA2 summary