Convert Figma logo to code with AI

mxe logomxe

MXE (M cross environment)

1,192
514
1,192
225

Top Related Projects

Package scripts for MinGW-w64 targets to build under MSYS2.

A package build system for Termux.

The Void source packages collection

2,057

[MIRROR] Official Gentoo ebuild repository

17,805

Nix Packages collection & NixOS

Quick Overview

MXE (M cross environment) is a Makefile-based build system that compiles a cross-compiler and cross-compiled binary packages for Windows. It provides a convenient way to build and distribute Windows software from any Unix-like system, including Linux, macOS, and BSD.

Pros

  • Cross-platform: MXE allows developers to build Windows software from various Unix-like operating systems, making it a versatile tool.
  • Comprehensive: MXE supports a wide range of libraries and tools, including Qt, OpenSSL, FFmpeg, and many others, making it a one-stop solution for Windows development.
  • Automated: The Makefile-based build system simplifies the process of compiling and packaging Windows software, reducing the time and effort required.
  • Community-driven: MXE has a active community of contributors who maintain and expand the project, ensuring its continued development and support.

Cons

  • Complexity: Setting up MXE and configuring the build environment can be a bit complex, especially for beginners.
  • Dependency management: Managing the dependencies between different packages and libraries can be challenging, especially as the project grows.
  • Limited support for newer Windows versions: MXE primarily targets older versions of Windows, and its support for newer versions may be limited.
  • Performance: The cross-compilation process can be slower than native Windows development, which may be a concern for some projects.

Getting Started

To get started with MXE, follow these steps:

  1. Clone the MXE repository:
git clone https://github.com/mxe/mxe.git
  1. Change to the MXE directory:
cd mxe
  1. Build the desired packages:
make qt5

This will build the Qt5 package for Windows. You can replace qt5 with the name of the package you want to build, such as openssl or ffmpeg.

  1. Once the build is complete, you can find the compiled binaries in the dist directory.

  2. To use the compiled binaries in your project, you can add the dist directory to your project's include and library paths.

For more detailed instructions and information on using MXE, please refer to the MXE documentation.

Competitor Comparisons

Package scripts for MinGW-w64 targets to build under MSYS2.

Pros of MINGW-packages

  • Native Windows environment, easier for Windows developers
  • More up-to-date package versions
  • Supports both 32-bit and 64-bit builds

Cons of MINGW-packages

  • Less cross-platform compatibility
  • Requires more manual setup and configuration
  • Smaller community and fewer pre-built packages

Code Comparison

MINGW-packages (PKGBUILD example):

pkgname=example
pkgver=1.0
pkgrel=1
pkgdesc="Example package"
arch=('i686' 'x86_64')
url="https://example.com"
license=('GPL')
source=("$pkgname-$pkgver.tar.gz")
md5sums=('SKIP')

build() {
  cd "$srcdir/$pkgname-$pkgver"
  ./configure --prefix=/mingw64
  make
}

MXE (Makefile example):

PKG             := example
$(PKG)_VERSION  := 1.0
$(PKG)_CHECKSUM := 0123456789abcdef
$(PKG)_URL      := https://example.com/$(PKG)-$($(PKG)_VERSION).tar.gz
$(PKG)_DEPS     := cc zlib libpng

define $(PKG)_BUILD
    cd '$(BUILD_DIR)' && $(SOURCE_DIR)/configure \
        $(MXE_CONFIGURE_OPTS)
    $(MAKE) -C '$(BUILD_DIR)' -j '$(JOBS)'
    $(MAKE) -C '$(BUILD_DIR)' -j 1 install
endef

A package build system for Termux.

Pros of termux-packages

  • Designed specifically for Android, offering a wide range of packages optimized for mobile devices
  • Regularly updated with new packages and improvements for the Termux ecosystem
  • Supports a broader range of architectures, including ARM and x86 for Android devices

Cons of termux-packages

  • Limited to Android platform, not suitable for cross-compilation to other operating systems
  • May have fewer packages available compared to MXE's extensive Windows-targeted library

Code Comparison

termux-packages build script example:

TERMUX_PKG_HOMEPAGE=https://example.com
TERMUX_PKG_DESCRIPTION="Example package"
TERMUX_PKG_VERSION=1.0.0
TERMUX_PKG_SRCURL=https://example.com/source-${TERMUX_PKG_VERSION}.tar.gz
TERMUX_PKG_SHA256=abcdef1234567890abcdef1234567890abcdef1234567890abcdef1234567890

termux_step_make() {
    make
}

MXE build script example:

PKG             := example
$(PKG)_VERSION  := 1.0.0
$(PKG)_CHECKSUM := abcdef1234567890abcdef1234567890abcdef1234567890abcdef1234567890
$(PKG)_SUBDIR   := $(PKG)-$($(PKG)_VERSION)
$(PKG)_FILE     := $(PKG)-$($(PKG)_VERSION).tar.gz
$(PKG)_URL      := https://example.com/$($(PKG)_FILE)
$(PKG)_DEPS     := cc zlib

define $(PKG)_BUILD
    cd '$(BUILD_DIR)' && $(SOURCE_DIR)/configure \
        $(MXE_CONFIGURE_OPTS)
    $(MAKE) -C '$(BUILD_DIR)' -j '$(JOBS)'
    $(MAKE) -C '$(BUILD_DIR)' -j 1 install
endef

The Void source packages collection

Pros of void-packages

  • Supports a wider range of packages and architectures
  • More actively maintained with frequent updates
  • Offers a more comprehensive package management system

Cons of void-packages

  • Steeper learning curve for newcomers
  • Requires more system resources for package building

Code Comparison

void-packages:

./xbps-src pkg <package_name>
./xbps-src install <package_name>

mxe:

make <package_name>

Summary

void-packages is a more versatile and actively maintained package management system for Void Linux, offering support for a wide range of packages and architectures. It provides a comprehensive solution for building and managing packages, but may require more system resources and have a steeper learning curve compared to mxe.

mxe, on the other hand, is specifically designed for cross-compiling Windows programs on Unix-like systems. It has a simpler build process and is more focused on its specific use case, making it easier to use for beginners but less flexible in terms of package variety and system support.

Both projects serve different purposes and cater to different user needs, with void-packages being more suitable for general package management on Void Linux, while mxe excels in cross-compiling Windows applications on Unix-like systems.

2,057

[MIRROR] Official Gentoo ebuild repository

Pros of Gentoo

  • Offers a complete Linux distribution with a vast package ecosystem
  • Provides fine-grained control over system configuration and optimization
  • Supports multiple architectures and platforms

Cons of Gentoo

  • Requires more time and expertise to set up and maintain
  • Can be resource-intensive during package compilation
  • Has a steeper learning curve for newcomers

Code Comparison

MXE (example Makefile):

include src/mxe-conf.mk

PKG             := example
$(PKG)_VERSION  := 1.0.0
$(PKG)_CHECKSUM := 0123456789abcdef
$(PKG)_URL      := https://example.com/$(PKG)-$($(PKG)_VERSION).tar.gz
$(PKG)_DEPS     := cc zlib libpng

define $(PKG)_BUILD
    $(MAKE) -C '$(BUILD_DIR)' -j '$(JOBS)' CFLAGS='-O2'
    $(MAKE) -C '$(BUILD_DIR)' -j 1 install
endef

Gentoo (example ebuild):

EAPI=7

DESCRIPTION="Example package"
HOMEPAGE="https://example.com"
SRC_URI="https://example.com/${P}.tar.gz"

LICENSE="GPL-2"
SLOT="0"
KEYWORDS="amd64 x86"
IUSE="png"

DEPEND="
    sys-libs/zlib
    png? ( media-libs/libpng )
"
RDEPEND="${DEPEND}"

src_configure() {
    econf $(use_with png)
}
17,805

Nix Packages collection & NixOS

Pros of nixpkgs

  • Broader scope, covering entire operating system packages
  • Declarative and reproducible system configuration
  • Supports multiple versions of packages coexisting

Cons of nixpkgs

  • Steeper learning curve due to Nix language and concepts
  • Larger resource footprint for full system management
  • Less focused on cross-compilation compared to MXE

Code Comparison

MXE (Makefile):

define $(PKG)_BUILD
    cd '$(SOURCE_DIR)' && ./configure \
        --host='$(TARGET)' \
        --disable-shared \
        --prefix='$(PREFIX)/$(TARGET)'
    $(MAKE) -C '$(SOURCE_DIR)' -j '$(JOBS)' install
endef

nixpkgs (Nix expression):

stdenv.mkDerivation rec {
  pname = "example";
  version = "1.0.0";
  src = fetchurl {
    url = "https://example.com/${pname}-${version}.tar.gz";
    sha256 = "0000000000000000000000000000000000000000000000000000";
  };
}

MXE focuses on cross-compilation for Windows using familiar Makefiles, while nixpkgs uses Nix expressions for package definitions across various platforms. MXE's approach is more straightforward for its specific use case, while nixpkgs offers greater flexibility and system-wide integration at the cost of increased complexity.

Convert Figma logo designs to code with AI

Visual Copilot

Introducing Visual Copilot: A new AI model to turn Figma designs to high quality code using your components.

Try Visual Copilot

README

MXE (M cross environment)

License

Async Chat (Trial))

MXE (M cross environment) is a GNU Makefile that compiles a cross compiler and cross compiles many free libraries such as SDL and Qt. Thus, it provides a nice cross compiling environment for various target platforms, which:

  • is designed to run on any Unix system
  • is easy to adapt and to extend
  • builds many free libraries in addition to the cross compiler
  • can also build just a subset of the packages, and automatically builds their dependencies
  • downloads all needed packages and verifies them by their checksums
  • is able to update the version numbers of all packages automatically
  • directly uses source packages, thus ensuring the whole build mechanism is transparent
  • allows inter-package and intra-package parallel builds whenever possible
  • bundles ccache to speed up repeated builds
  • integrates well with autotools, cmake, qmake, and hand-written makefiles.
  • has been in continuous development since 2007 and is used by several projects

Supported Toolchains

  • Runtime: MinGW-w64
  • Host Triplets:
    • i686-w64-mingw32
    • x86_64-w64-mingw32
  • Packages:
    • static
    • shared
  • GCC Threading Libraries (winpthreads is always available):
  • GCC Exception Handling:

Please see mxe.cc for further information and package support matrix.

Build Dependencies

For some packages additional dependencies are required to be installed in order to build:

  • Python 3

Usage

You can use the make command to start the build.

Below an example of cross-compiling the GTK3 project to one statically linked Windows 64-bit library:

make gtk3 -j 8 MXE_TARGETS='x86_64-w64-mingw32.static'

Please see mxe.cc for more information about how-to build the MXE project.

Packages

Within the MXE makefiles we either define $(PKG)_GH_CONF or $(PKG)_URL, which will be used to download the package.
Next the checksum will be validated of the downloaded archive file (sha256 checksum).

Updating a package or updating checksum is all possible using the make commands, see usage for more info.

Shared Library Notes

There are several approaches to recursively finding DLL dependencies (alphabetical list):