From d1545949f7a8f6000e78013ca00111cb5a7da209 Mon Sep 17 00:00:00 2001 From: Tatsuhiro Tsujikawa Date: Wed, 27 Jun 2012 00:50:53 +0900 Subject: [PATCH] Documented ARIA2_STATIC and how to cross-compile mingw build in README --- README.rst | 53 ++++++++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 52 insertions(+), 1 deletion(-) diff --git a/README.rst b/README.rst index 4b97ed1d..86ffa343 100644 --- a/README.rst +++ b/README.rst @@ -184,11 +184,21 @@ Also you need `Sphinx `_ to build man page. If you are building aria2 for Mac OS X, take a look at build_osx_release.sh, which builds OSX universal binary DMG. -The quickest way to build aria2 is just type following commands:: +The quickest way to build aria2 is first run configure script:: $ ./configure + +To build statically linked aria2, use ``ARIA2_STATIC=yes`` +command-line option:: + + $ ./configure ARIA2_STATIC=yes + +After configuration is done, run ``make`` to compile the program:: + $ make +See `Cross-compiling Windows binary`_ to create Windows binary. + The configure script checks available libraries and enables the features as much as possible because all the features are enabled by default. @@ -220,6 +230,47 @@ aria2 uses CppUnit for automated unit testing. To run the unit test:: $ make check +Cross-compiling Windows binary +------------------------------ + +In this section, we describe how to build Windows binary using +mingw-w64 cross-compiler on Debian Linux. + +Basically, after compiling and installing depended libraries, you can +do cross-compile just passing appropriate ``--host`` option and +specifying ``CPPFLAGS``, ``LDFLAGS`` and ``PKG_CONFIG_LIBDIR`` +variables to configure. For convenience and lowering our own +development cost, we provide easier way to configure the build +settings. + +``mingw-config`` script is a configure script wrapper for mingw-w64. +We use it to create official Windows build. This script assumes +following libraries have been built for cross-compile: + +* c-ares +* openssl +* expat +* sqlite3 +* zlib +* cppunit + +Some environment variables can be adjusted to change build settings: + +* ``HOST``: cross-compile to build programs to run on ``HOST``. It + defaults to ``i686-w64-mingw32``. To build 64bit binary, + specify ``x86_64-w64-mingw32``. + +* ``PREFIX``: Prefix to the directory where dependent libraries are + installed. It defaults to + ``/usr/local/$HOST``. ``-I$PREFIX/include`` will be added to + ``CPPFLAGS``. ``-L$PREFIX/lib`` will be added to + ``LDFLAGS``. ``$PREFIX/lib/pkgconfig`` will be set to + ``PKG_CONFIG_LIBDIR``. + +For example, to build 64bit binary do this:: + + $ HOST=x86_64-w64-mingw32 ./mingw-config + Building documentation ----------------------