浏览代码

Update instructions for cross-compilation with MinGW-w64

(cherry picked from commit 690aa9f58c830c69bcd2294bb15e2a4beb023579)
Rémi Verschelde 7 年之前
父节点
当前提交
3cc7e89aa0
共有 2 个文件被更改,包括 47 次插入21 次删除
  1. 38 17
      development/compiling/compiling_for_windows.rst
  2. 9 4
      development/compiling/compiling_for_x11.rst

+ 38 - 17
development/compiling/compiling_for_windows.rst

@@ -345,36 +345,57 @@ architectures (Win32/x64). They are equivalent.
 Cross-compiling for Windows from other operating systems
 ---------------
 
-If you are a Linux or Mac user, you need to install mingw32 and
-mingw-w64. Under Ubuntu or Debian, just run the following commands:
+If you are a Linux or Mac user, you need to install `MinGW-w64 <https://mingw-w64.org>`_,
+which typically comes in 32-bit and 64-bit variants. The package names
+may differ based on your distro, here are some known ones:
+
++---------------+--------------------------------------------------------+
+| **Arch**      | ::                                                     |
+|               |                                                        |
+|               |     pacman -S scons mingw-w64-gcc                      |
++---------------+--------------------------------------------------------+
+| **Debian** /  | ::                                                     |
+| **Ubuntu**    |                                                        |
+|               |     apt-get install scons mingw-w64                    |
++---------------+--------------------------------------------------------+
+| **Fedora**    | ::                                                     |
+|               |                                                        |
+|               |     dnf install scons mingw32-gcc-c++ mingw64-gcc-c++  |
++---------------+--------------------------------------------------------+
+| **macOS**     | ::                                                     |
+|               |                                                        |
+|               |     brew install scons mingw-w64                       |
++---------------+--------------------------------------------------------+
+| **Mageia**    | ::                                                     |
+|               |                                                        |
+|               |     urpmi scons mingw32-gcc-c++ mingw64-gcc-c++        |
++---------------+--------------------------------------------------------+
+
+Before allowing you to attempt the compilation, SCons will check for
+the following binaries in your ``$PATH``:
 
 ::
 
-    apt-get install mingw32 mingw-w64
-
-If you are using another distro, SCons will check for the following
-binaries:
-
-::
-
-    i586-mingw32msvc-gcc
     i686-w64-mingw32-gcc
+    x86_64-w64-mingw32-gcc
 
-If the binaries are named or located somewhere else, export the
-following env variables:
+If the binaries are not located in the ``$PATH`` (e.g. ``/usr/bin``),
+you can define the following environment variables to give a hint to
+the buildsystem:
 
 ::
 
-    export MINGW32_PREFIX="/path/to/i586-mingw32msvc-"
-    export MINGW64_PREFIX="/path/to/i686-w64-mingw32-"
+    export MINGW32_PREFIX="/path/to/i686-w64-mingw32-"
+    export MINGW64_PREFIX="/path/to/x86_64-w64-mingw32-"
 
 To make sure you are doing things correctly, executing the following in
-the shell should result in a working compiler:
+the shell should result in a working compiler (the version output may
+differ based on your system):
 
 ::
 
-    user@host:~$ ${MINGW32_PREFIX}gcc
-    gcc: fatal error: no input files
+    user@host:~$ ${MINGW32_PREFIX}gcc --version
+    i686-w64-mingw32-gcc (GCC) 6.1.0 20160427 (Mageia MinGW 6.1.0-1.mga6)
 
 Creating Windows export templates
 ---------------------------------

+ 9 - 4
development/compiling/compiling_for_x11.rst

@@ -37,6 +37,12 @@ Distro-specific oneliners
 |               |                                                                                                            |
 |               |     pacman -S scons libxcursor libxinerama libxrandr mesa glu alsa-lib pulseaudio freetype2                |
 +---------------+------------------------------------------------------------------------------------------------------------+
+| **Debian** /  | ::                                                                                                         |
+| **Ubuntu**    |                                                                                                            |
+|               |     sudo apt-get install build-essential scons pkg-config libx11-dev libxcursor-dev libxinerama-dev \      |
+|               |         libgl1-mesa-dev libglu-dev libasound2-dev libpulse-dev libfreetype6-dev libssl-dev libudev-dev \   |
+|               |         libxrandr-dev                                                                                      |
++---------------+------------------------------------------------------------------------------------------------------------+
 | **Fedora**    | ::                                                                                                         |
 |               |                                                                                                            |
 |               |     sudo dnf install scons pkgconfig libX11-devel libXcursor-devel libXrandr-devel libXinerama-devel \     |
@@ -69,11 +75,10 @@ Distro-specific oneliners
 |               |             Mesa-libGL-devel alsa-devel libpulse-devel freetype-devel openssl-devel libudev-devel \        |
 |               |             libGLU1                                                                                        | 
 +---------------+------------------------------------------------------------------------------------------------------------+
-| **Ubuntu**    | ::                                                                                                         |
+| **Solus**     | ::                                                                                                         |
 |               |                                                                                                            |
-|               |     sudo apt-get install build-essential scons pkg-config libx11-dev libxcursor-dev libxinerama-dev \      |
-|               |         libgl1-mesa-dev libglu-dev libasound2-dev libpulse-dev libfreetype6-dev libssl-dev libudev-dev \   |
-|               |         libxrandr-dev                                                                                      |
+|               |     sudo eopkg install -c system.devel scons libxcursor-devel libxinerama-devel libxrandr-devel \          |
+|               |         mesalib-devel libglu alsa-lib pulseaudio freetype2-devel                                           |
 +---------------+------------------------------------------------------------------------------------------------------------+
 
 Compiling