feat: add .mozconfig files for build configurations

This commit is contained in:
Alex Kontos
2025-08-03 18:36:10 +02:00
parent 3712f55fa6
commit 0208447c2c
6 changed files with 305 additions and 2 deletions

2
.gitignore vendored
View File

@@ -49,8 +49,6 @@ ID
# User files that may appear at the root # User files that may appear at the root
/.clang-tidy /.clang-tidy
/.clangd /.clangd
/.mozconfig*
/mozconfig*
/.moz-fast-forward /.moz-fast-forward
/.moz-vendoring /.moz-vendoring
/old-configure /old-configure

70
.mozconfig Normal file
View File

@@ -0,0 +1,70 @@
#!/bin/sh
# For local development builds
case $(uname -s) in
Darwin)
# Any macOS specific settings
# For release builds we should use -march=core2 -mtune=haswell
export CC=$HOME/.mozbuild/clang/bin/clang
export CXX=$HOME/.mozbuild/clang/bin/clang++
;;
MINGW*)
# Any Windows specific settings
ac_add_options --disable-bits-download
ac_add_options --disable-maintenance-service
ac_add_options --disable-parental-controls
;;
Linux)
# Any Linux specific settings
case $(uname -m) in
x86_64)
if test -d "$HOME/.mozbuild/clang/bin"; then
export CC=$HOME/.mozbuild/clang/bin/clang
export CXX=$HOME/.mozbuild/clang/bin/clang++
else
export CC=clang
export CXX=clang++
fi
if test -f "$HOME/.mozbuild/nasm/nasm"; then
export NASM=$HOME/.mozbuild/nasm/nasm
fi
ac_add_options --target=x86_64-pc-linux-gnu
;;
ppc64le)
export CC=gcc
export CXX=g++
ac_add_options --enable-optimize="-w"
ac_add_options --target=powerpc64le-unknown-linux-gnu
;;
esac
;;
esac
ac_add_options --disable-crashreporter
ac_add_options --disable-debug
ac_add_options --disable-dmd
ac_add_options --disable-geckodriver
ac_add_options --disable-jprof
ac_add_options --disable-profiling
ac_add_options --disable-trace-logging
ac_add_options --disable-verify-mar
ac_add_options --disable-updater
ac_add_options --enable-application=browser
ac_add_options --enable-bootstrap
ac_add_options --enable-optimize="-Os -w"
ac_add_options --enable-tests
ac_add_options --with-app-basename=Waterfox
ac_add_options --with-app-name=waterfox
ac_add_options --with-branding=waterfox/browser/branding
ac_add_options --with-distribution-id=net.waterfox
if test -x "$(command -v sccache)"; then
ac_add_options --with-ccache=sccache
elif test -f "$HOME/.mozbuild/sccache/sccache"; then
ac_add_options --with-ccache="$HOME"/.mozbuild/sccache/sccache
fi
mk_add_options AUTOCLOBBER=1
MOZ_REQUIRE_SIGNING=

View File

@@ -0,0 +1,57 @@
# Targetting ARM64 builds. Expected to be run on Linux.
TOOLS=$HOME/macos-cross
CROSS_SYSROOT=${TOOLS}/MacOSX12.3.sdk
export CC=$HOME/.mozbuild/clang/bin/clang
export CXX=$HOME/.mozbuild/clang/bin/clang++
export DMG_TOOL=${TOOLS}/dmg/dmg
export DSYMUTIL=$HOME/.mozbuild/clang/bin/dsymutil
export HFS_TOOL=${TOOLS}/dmg/hfsplus
export HOST_CFLAGS="-g"
export HOST_CXXFLAGS="-g"
export HOST_LDFLAGS="-g"
export MACOS_SDK_DIR=$CROSS_SYSROOT
export MKFSHFS=${TOOLS}/hfsplus-tools/newfs_hfs
mk_add_options "export LD_LIBRARY_PATH=$HOME/.mozbuild/clang/lib"
mk_add_options "export PATH=${TOOLS}/cctools/bin:$HOME/.mozbuild/clang/bin:$PATH"
unset MOZ_STDCXX_COMPAT
if test "$WFX_RELEASE"; then
ac_add_options --enable-lto
ac_add_options --enable-release
fi
ac_add_options --disable-crashreporter
ac_add_options --disable-debug
ac_add_options --disable-dmd
ac_add_options --disable-geckodriver
ac_add_options --disable-jprof
ac_add_options --disable-profiling
ac_add_options --disable-tests
ac_add_options --disable-trace-logging
ac_add_options --disable-verify-mar
ac_add_options --enable-application=browser
ac_add_options --enable-bootstrap
if test -x "$(command -v sccache)"; then
ac_add_options --with-ccache=sccache
elif test -f "$HOME/.mozbuild/sccache/sccache"; then
ac_add_options --with-ccache=$HOME/.mozbuild/sccache/sccache
fi
ac_add_options --enable-install-strip
ac_add_options --enable-optimize="-O3 -mcpu=apple-m1 -w"
ac_add_options --enable-rust-simd
ac_add_options --enable-strip
ac_add_options --enable-updater
ac_add_options --target=aarch64-apple-darwin
ac_add_options --with-app-basename=Waterfox
ac_add_options --with-app-name=waterfox
ac_add_options --with-branding=waterfox/browser/branding
ac_add_options --with-distribution-id=net.waterfox
if test -f "$PWD/browser/locales/l10n"; then
ac_add_options --with-l10n-base=$PWD/browser/locales/l10n
fi
mk_add_options AUTOCLOBBER=1

View File

@@ -0,0 +1,57 @@
# Targetting ARM64 builds. Expected to be run on Linux.
TOOLS=$HOME/macos-cross
CROSS_SYSROOT=${TOOLS}/MacOSX12.3.sdk
export CC=$HOME/.mozbuild/clang/bin/clang
export CXX=$HOME/.mozbuild/clang/bin/clang++
export DMG_TOOL=${TOOLS}/dmg/dmg
export DSYMUTIL=$HOME/.mozbuild/clang/bin/dsymutil
export HFS_TOOL=${TOOLS}/dmg/hfsplus
export HOST_CFLAGS="-g"
export HOST_CXXFLAGS="-g"
export HOST_LDFLAGS="-g"
export MACOS_SDK_DIR=$CROSS_SYSROOT
export MKFSHFS=${TOOLS}/hfsplus-tools/newfs_hfs
mk_add_options "export LD_LIBRARY_PATH=$HOME/.mozbuild/clang/lib"
mk_add_options "export PATH=${TOOLS}/cctools/bin:$HOME/.mozbuild/clang/bin:$PATH"
unset MOZ_STDCXX_COMPAT
if test "$WFX_RELEASE"; then
ac_add_options --enable-lto
ac_add_options --enable-release
fi
ac_add_options --disable-crashreporter
ac_add_options --disable-debug
ac_add_options --disable-dmd
ac_add_options --disable-geckodriver
ac_add_options --disable-jprof
ac_add_options --disable-profiling
ac_add_options --disable-tests
ac_add_options --disable-trace-logging
ac_add_options --disable-verify-mar
ac_add_options --enable-application=browser
ac_add_options --enable-bootstrap
if test -x "$(command -v sccache)"; then
ac_add_options --with-ccache=sccache
elif test -f "$HOME/.mozbuild/sccache/sccache"; then
ac_add_options --with-ccache=$HOME/.mozbuild/sccache/sccache
fi
ac_add_options --enable-install-strip
ac_add_options --enable-optimize="-O3 -march=nehalem -mtune=haswell -w"
ac_add_options --enable-rust-simd
ac_add_options --enable-strip
ac_add_options --enable-updater
ac_add_options --target=x86_64-apple-darwin
ac_add_options --with-app-basename=Waterfox
ac_add_options --with-app-name=waterfox
ac_add_options --with-branding=waterfox/browser/branding
ac_add_options --with-distribution-id=net.waterfox
if test -f "$PWD/browser/locales/l10n"; then
ac_add_options --with-l10n-base=$PWD/browser/locales/l10n
fi
mk_add_options AUTOCLOBBER=1

View File

@@ -0,0 +1,56 @@
if test -d "$HOME/.mozbuild/clang/bin"; then
export CC=$HOME/.mozbuild/clang/bin/clang
export CXX=$HOME/.mozbuild/clang/bin/clang++
else
export CC=clang
export CXX=clang++
fi
if test -f "$HOME/.mozbuild/nasm/nasm"; then
export NASM=$HOME/.mozbuild/nasm/nasm
fi
if test "$WFX_RELEASE"; then
ac_add_options --enable-lto
ac_add_options --enable-release
fi
ac_add_options --disable-crashreporter
ac_add_options --disable-debug
ac_add_options --disable-dmd
ac_add_options --disable-geckodriver
ac_add_options --disable-profiling
ac_add_options --disable-tests
ac_add_options --disable-verify-mar
ac_add_options --enable-alsa
ac_add_options --enable-application=browser
ac_add_options --enable-bootstrap
if test -x "$(command -v sccache)"; then
ac_add_options --with-ccache=sccache
elif test -f "$HOME/.mozbuild/sccache/sccache"; then
ac_add_options --with-ccache=$HOME/.mozbuild/sccache/sccache
fi
ac_add_options --enable-install-strip
ac_add_options --enable-optimize="-O3 -march=core2 -mtune=haswell -w"
ac_add_options --enable-pulseaudio
ac_add_options --enable-rust-simd
ac_add_options --enable-strip
ac_add_options --enable-updater
ac_add_options --target=x86_64-pc-linux-gnu
ac_add_options --with-app-basename=Waterfox
ac_add_options --with-app-name=waterfox
ac_add_options --with-branding=waterfox/browser/branding
ac_add_options --with-distribution-id=net.waterfox
if test -f "$PWD/browser/locales/l10n"; then
ac_add_options --with-l10n-base=$PWD/browser/locales/l10n
fi
if test -f "$PWD/mozilla-api"; then
ac_add_options --with-mozilla-api-keyfile="$PWD"/mozilla-api
fi
export RUSTC_OPT_LEVEL=2
export MOZ_INCLUDE_SOURCE_INFO=1
mk_add_options AUTOCLOBBER=1
MOZ_REQUIRE_SIGNING=

View File

@@ -0,0 +1,65 @@
CROSS_BUILD=1
MSVC="14.32.31326"
WSDK="10.0.22000.0"
TOOLS=$HOME/win-cross
EXTRA_PATH="$HOME/.mozbuild/clang/bin:${TOOLS}/visual-c/tools/msvc/${MSVC}/bin/hostx64/x64:"
export WINDOWSSDKDIR="${TOOLS}/win-sdk"
export CC="$HOME/.mozbuild/clang/bin/clang-cl"
export CXX="$HOME/.mozbuild/clang/bin/clang-cl"
export DIA_SDK_PATH="${TOOLS}/dia-sdk"
export HOST_CC="$HOME/.mozbuild/clang/bin/clang"
export HOST_CXX="$HOME/.mozbuild/clang/bin/clang++"
export MIDL="${TOOLS}/wine/bin/widl"
export MOZ_INCLUDE_SOURCE_INFO=1
export MOZ_STUB_INSTALLER=1
export RUSTC_OPT_LEVEL=2
export WIN32_REDIST_DIR="${TOOLS}/visual-c/redist/msvc/${MSVC}/x64/microsoft.vc143.crt"
export WIN_UCRT_REDIST_DIR="${WINDOWSSDKDIR}/redist/${WSDK}/ucrt/dlls/x64"
export WINE="${TOOLS}/wine/bin/wine64"
export WINEDEBUG=-all
mk_add_options "export LD_PRELOAD=${TOOLS}/liblowercase/liblowercase.so"
mk_add_options "export LOWERCASE_DIRS=${TOOLS}"
mk_add_options "export PATH=$EXTRA_PATH$PATH"
if test "$WFX_RELEASE"; then
ac_add_options --enable-lto
ac_add_options --enable-release
fi
ac_add_options --disable-bits-download
ac_add_options --disable-crashreporter
ac_add_options --disable-debug
ac_add_options --disable-dmd
ac_add_options --disable-geckodriver
ac_add_options --disable-maintenance-service
ac_add_options --disable-parental-controls
ac_add_options --disable-profiling
ac_add_options --disable-tests
ac_add_options --disable-verify-mar
ac_add_options --enable-bootstrap
ac_add_options --enable-default-browser-agent
if test -x "$(command -v sccache)"; then
ac_add_options --with-ccache=sccache
elif test -f "$HOME/.mozbuild/sccache/sccache"; then
ac_add_options --with-ccache=$HOME/.mozbuild/sccache/sccache
fi
ac_add_options --enable-install-strip
ac_add_options --enable-optimize="-O2 -Qvec -w -clang:-ftree-vectorize -clang:-march=core2 -clang:-mtune=haswell"
ac_add_options --enable-rust-simd
ac_add_options --enable-strip
ac_add_options --enable-updater
ac_add_options --target=x86_64-pc-mingw32
ac_add_options --with-app-basename=Waterfox
ac_add_options --with-app-name=waterfox
ac_add_options --with-branding=waterfox/browser/branding
ac_add_options --with-distribution-id=net.waterfox
if test -f "$PWD/browser/locales/l10n"; then
ac_add_options --with-l10n-base=$PWD/browser/locales/l10n
fi
MOZ_REQUIRE_SIGNING=