Menu

Compile Windows binary using Windows Subsystem for Linux (WSL) Log in to Edit

Building the Windows binary and installer using WSL

This document describes how to easily build Fldigi binaries and installer on Windows 10 by using the setupmxe.sh and buildmxe.sh scripts within a Windows Subsystem for Linux (WSL) environment.
Fldigi developers prefer to use a toolchain that runs on Linux and compiles for Windows, and so this is the approach shown here.

While the WSL method is a fast and simple for compiling the Fldigi suite of programs for Windows, on Windows 10, but does not provide a full GUI environment useful for development, debugging, or testing Fldigi.
WSL is useful for developing and debugging Fldigi using Windows-based code editors and other tools.

The cross-compiler used here is mingw-gcc and the build instructions have been tested with the version packaged in recent releases of Ubuntu.

This build-procedure has been tested to work only on the following WSL subsystems:
- Ubuntu 20.04
- Ubuntu 18.04

The instructions on this page should be followed from top to bottom.


Enabling WSL

As administrator, open a PowerShell and enter the command:

   dism.exe /online /enable-feature /featurename:Microsoft-Windows-Subsystem-Linux /all /norestart

Then reboot the machine.

This allows the Linux sub-system to run on Windows 10


Installing a Linux Subsystem

From the Start menu, open the Windows store.

In the search bar at the top enter "Linux" then press Enter.
Select a Ubuntu 20.04 or 18.04 WSL image to install.
Click the "Get" button in the upper-right corner.
(Installing may require you to sign-in to a Microsoft account)

Wait for the WSL Image to finish installing.


Setup the Linux Subsystem

In the Windows Store, click the LAUNCH button to start the Linux sub-environment.
the button will be clickable once downloading completes

A window will open saying "Installing, this may take a few minutes..."
Wait for this to finish

Type a Username for the WSL environment and press Enter.
Type a Password for the WSL environment and press Enter
Re-type the previous Password again to verify.
Remember to write down the username and password.

Keep this windows open as you proceed through the next steps...


Setup the Package Manager

Source repositories must be enabled for Fldigi build dependencies (effectively enabling linux's developer-mode)

To open the package-sources text-file run:

   sudo nano /etc/apt/sources.list

For Ubuntu:
Delete the pound-signs and spaces before each deb-src line in the file.
Then type CTRL+X
Press Y to confirm
Press Enter

To update the software list run:

   sudo apt update
   sudo apt -y install git
   sudo apt -y upgrade

this will synchronize the list of all installable software and sourcecode, then upgrade the system

Keep this windows open as you proceed through the next steps...


Getting the Sourcecode

Fldigi

To get the latest Fldigi source-code run the following commands:

   cd ~
   git clone git://git.code.sf.net/p/fldigi/fldigi fldigi

The scripts to auto-bootstrap the MXE environment and auto-build Fldigi
for Windows are contained within the normal Fldigi git-archive .

To enter the directory where the Windows autobuild-scripts live enter the commands:

   cd ~
   cd fldigi/scripts

Keep this windows open as you proceed through the next steps...


Bootstrapping the MXE Environment

NOTE: This MXE environment only needs to be setup once per-user on a Linux system.
The crossbuild environment is installed to the user's $HOME directory, for re-use

Install OS Packages

Automatically install the required OS packages and dependencies for Fldigi and MXE:

   sudo ./setupmxe.sh packages

Build MXE crossbuild environment

Download and bootstrap the MXE environment to the user's $HOME directory

   ./setupmxe.sh setup32

Note: This may take a few hours of downloading and compiling


Building Fldigi for Windows OS

Build the Windows binaries and installer
After setting-up the crossbuild environment, building Fldigi for Windows is as easy as running a single script.
This script automatically uses the MXE environment installed above (if installed).
Run the command:

   ./buildmxe.sh

The executabiles will be in the Fldigi /src directory.

Any commandline options given to buildmxe.sh are passed to the ./configure script.
Useful for compiling --enable-debug and other test-versions.



Post Install Options

Re-Using the MXE Environment

The auto-installed MXE Environment can be re-used across different versions of Fldigi.
No need to re-bootstrap for new Fldigi releases, can simply call: /scripts/buildmxe.sh

Deleting an installed MXE Environment

To delete or cleanup an installed MXE crossbuild environment run:

   ./setupmxe.sh clean

Acknowledgements

The setupmxe.sh script is a combined automated version of the following manual instructions:
- Building with MinGW - Window target
- Build WIN32 Installation Files on Fedora Linux
- https://sourceforge.net/p/fldigi/wiki/mingw_howto_fedora/

Special thanks to David Freese and Robert Shaw for the original manual build-instructions


Related

Wiki: mingw_fedora_howto
Wiki: mingw_howto
Wiki: mingw_howto_fedora