Skip to content

Zero Hour rebuilt from EA's source: x64, Direct3D 11, VS2022/CMake, ~60 original bugs fixed, an AI that builds a base. Bring your own game.

build(linux): check for fontconfig, lld and unifdef before building

Andreas Bergere7f0620b9642
diff --git a/GeneralsMD/Code/Tools/build-posix.sh b/GeneralsMD/Code/Tools/build-posix.sh
index 0acee0802..2ee37d4b0 100755
--- a/GeneralsMD/Code/Tools/build-posix.sh
+++ b/GeneralsMD/Code/Tools/build-posix.sh
@@ -98,16 +98,22 @@ if [ "$PLATFORM" = macos ]; then
else
need cc c++ git curl unzip tar xz make ninja pkg-config
[ -n "$CMAKE" ] || need cmake
- # The X11, Wayland, EGL, DRM and Vulkan headers are SDL3's (the list Tools/linux-check.sh builds with).
+ # GNU ld cannot link the engine's cyclic static libraries; CMakeLists.txt picks LLD, else mold.
+ command -v ld.lld >/dev/null 2>&1 || command -v ld.mold >/dev/null 2>&1 || command -v mold >/dev/null 2>&1 \
+ || missing="$missing lld"
+ # Tools/widechar_check.py reads the engine as POSIX compiles it through unifdef.
+ [ -z "$RUNTESTS" ] || need unifdef
+ # The X11, Wayland, EGL, DRM and Vulkan headers are SDL3's (the list Tools/linux-check.sh builds with);
+ # fontconfig is the glyph rasteriser's.
if command -v pkg-config >/dev/null 2>&1; then
- for module in x11 xext xcursor xi xfixes xrandr xscrnsaver xtst wayland-client xkbcommon egl libdrm gbm vulkan; do
+ for module in x11 xext xcursor xi xfixes xrandr xscrnsaver xtst wayland-client xkbcommon egl libdrm gbm vulkan fontconfig; do
pkg-config --exists "$module" || missing="$missing $module"
done
fi
if [ -n "$missing" ]; then
- apt="sudo apt-get install cmake ninja-build g++ git curl unzip xz-utils make pkg-config python3 libx11-dev libxext-dev libxcursor-dev libxi-dev libxfixes-dev libxrandr-dev libxss-dev libxtst-dev libwayland-dev libxkbcommon-dev wayland-protocols libegl-dev libdrm-dev libgbm-dev libvulkan-dev"
- dnf="sudo dnf install cmake ninja-build gcc-c++ git curl unzip xz make pkgconf-pkg-config python3 libX11-devel libXext-devel libXcursor-devel libXi-devel libXfixes-devel libXrandr-devel libXScrnSaver-devel libXtst-devel wayland-devel libxkbcommon-devel wayland-protocols-devel mesa-libEGL-devel libdrm-devel mesa-libgbm-devel vulkan-loader-devel"
- pacman="sudo pacman -S --needed cmake ninja gcc git curl unzip xz make pkgconf python libx11 libxext libxcursor libxi libxfixes libxrandr libxss libxtst wayland libxkbcommon wayland-protocols mesa libdrm vulkan-icd-loader vulkan-headers"
+ apt="sudo apt-get install cmake ninja-build g++ git curl unzip xz-utils make pkg-config python3 libx11-dev libxext-dev libxcursor-dev libxi-dev libxfixes-dev libxrandr-dev libxss-dev libxtst-dev libwayland-dev libxkbcommon-dev wayland-protocols libegl-dev libdrm-dev libgbm-dev libvulkan-dev libfontconfig-dev lld unifdef"
+ dnf="sudo dnf install cmake ninja-build gcc-c++ git curl unzip xz make pkgconf-pkg-config python3 libX11-devel libXext-devel libXcursor-devel libXi-devel libXfixes-devel libXrandr-devel libXScrnSaver-devel libXtst-devel wayland-devel libxkbcommon-devel wayland-protocols-devel mesa-libEGL-devel libdrm-devel mesa-libgbm-devel vulkan-loader-devel fontconfig-devel lld unifdef"
+ pacman="sudo pacman -S --needed cmake ninja gcc git curl unzip xz make pkgconf python libx11 libxext libxcursor libxi libxfixes libxrandr libxss libxtst wayland libxkbcommon wayland-protocols mesa libdrm vulkan-icd-loader vulkan-headers fontconfig lld unifdef"
distro=$( (. /etc/os-release 2>/dev/null && echo "${ID:-} ${ID_LIKE:-}") || true)
case " $distro " in
*" debian "*|*" ubuntu "*) how="$apt" ;;
diff --git a/PORTING.md b/PORTING.md
index 3f8a82edc..85b2ab150 100644
--- a/PORTING.md
+++ b/PORTING.md
@@ -62,7 +62,7 @@ pkg-config, and prints the apt, dnf or pacman command for whatever is missing. O
```sh
sudo apt-get install cmake ninja-build g++ git curl unzip xz-utils make pkg-config python3 libx11-dev \
libxext-dev libxcursor-dev libxi-dev libxfixes-dev libxrandr-dev libxss-dev libxtst-dev libwayland-dev \
- libxkbcommon-dev wayland-protocols libegl-dev libdrm-dev libgbm-dev libvulkan-dev
+ libxkbcommon-dev wayland-protocols libegl-dev libdrm-dev libgbm-dev libvulkan-dev libfontconfig-dev lld unifdef
```
`spirv-tools` is optional: `test_shader_sdl` validates every generated program with `spirv-val` and says
diff --git a/README.md b/README.md
index 6651e8196..85b16df88 100644
--- a/README.md
+++ b/README.md
@@ -297,7 +297,7 @@ On Ubuntu 24.04 the Linux packages are:
```sh
sudo apt-get install cmake ninja-build g++ git curl unzip xz-utils make pkg-config python3 libx11-dev \
libxext-dev libxcursor-dev libxi-dev libxfixes-dev libxrandr-dev libxss-dev libxtst-dev libwayland-dev \
- libxkbcommon-dev wayland-protocols libegl-dev libdrm-dev libgbm-dev libvulkan-dev
+ libxkbcommon-dev wayland-protocols libegl-dev libdrm-dev libgbm-dev libvulkan-dev libfontconfig-dev lld unifdef
```
`GeneralsMD/Code/Tools/linux-portable.sh` builds inside Valve's Steam Runtime 3 "sniper" SDK and makes