瀏覽代碼

Documented ARIA2_STATIC and how to cross-compile mingw build in README

Tatsuhiro Tsujikawa 13 年之前
父節點
當前提交
d1545949f7
共有 1 個文件被更改,包括 52 次插入1 次删除
  1. 52 1
      README.rst

+ 52 - 1
README.rst

@@ -184,11 +184,21 @@ Also you need `Sphinx <http://sphinx.pocoo.org/>`_ to build man page.
 If you are building aria2 for Mac OS X, take a look at
 If you are building aria2 for Mac OS X, take a look at
 build_osx_release.sh, which builds OSX universal binary DMG.
 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
     $ ./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
     $ make
 
 
+See `Cross-compiling Windows binary`_ to create Windows binary.
+
 The configure script checks available libraries and enables the features
 The configure script checks available libraries and enables the features
 as much as possible because all the features are enabled by default.
 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
     $ 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
 Building documentation
 ----------------------
 ----------------------