|
| 1 | +## Copyright (c) 2023 Alex313031. |
| 2 | + |
| 3 | +## .mozconfig for compiling Mercury Browser for Windows natively |
| 4 | + |
| 5 | +# Build only Mercury |
| 6 | +ac_add_options --enable-application=browser |
| 7 | +ac_add_options --disable-artifact-builds |
| 8 | + |
| 9 | +# Build for Windows |
| 10 | +ac_add_options --enable-bootstrap |
| 11 | +ac_add_options --disable-update-agent |
| 12 | +# ac_add_options --disable-dmd |
| 13 | +# ac_add_options --disable-signmar |
| 14 | +# ac_add_options --disable-verify-mar |
| 15 | + |
| 16 | +CROSS_COMPILE=0 |
| 17 | +export MOZ_INCLUDE_SOURCE_INFO=1 |
| 18 | + |
| 19 | +# Optimization settings |
| 20 | +ac_add_options --enable-release |
| 21 | +ac_add_options --disable-debug |
| 22 | +ac_add_options --disable-debug-symbols |
| 23 | +ac_add_options --disable-debug-js-modules |
| 24 | +ac_add_options --disable-tests |
| 25 | +ac_add_options --enable-strip |
| 26 | +ac_add_options --enable-install-strip |
| 27 | +ac_add_options --enable-clang-plugin |
| 28 | +ac_add_options --enable-lto |
| 29 | +ac_add_options --enable-wasm-avx |
| 30 | +ac_add_options --enable-optimize="-O2 -O3 -march=x86-64-v3 -Xclang -O3" |
| 31 | +ac_add_options --enable-rust-simd |
| 32 | +ac_add_options --enable-hardening |
| 33 | +# ac_add_options --disable-trace-logging |
| 34 | +mk_add_options MOZ_OPTIMIZE=1 |
| 35 | +MOZ_OPTIMIZE=1 |
| 36 | +export MOZ_OPTIMIZE=1 |
| 37 | +export STRIP_FLAGS="--strip-debug --strip-unneeded" |
| 38 | + |
| 39 | +# Media settings |
| 40 | +ac_add_options --enable-sandbox |
| 41 | +ac_add_options --enable-raw |
| 42 | +ac_add_options --enable-webrtc |
| 43 | +ac_add_options --enable-jxl |
| 44 | +ac_add_options --enable-av1 |
| 45 | +ac_add_options --enable-eme=widevine |
| 46 | + |
| 47 | +# Add-ons |
| 48 | +ac_add_options --allow-addon-sideload |
| 49 | +ac_add_options --with-unsigned-addon-scopes=app,system |
| 50 | + |
| 51 | +# Client settings |
| 52 | +ac_add_options --disable-parental-controls |
| 53 | +ac_add_options --disable-crashreporter |
| 54 | +ac_add_options --disable-updater |
| 55 | +ac_add_options --disable-maintenance-service |
| 56 | +ac_add_options --without-wasm-sandboxed-libraries |
| 57 | +ac_add_options --disable-bits-download |
| 58 | +# ac_add_options --disable-default-browser-agent |
| 59 | +export MOZ_SOURCE_CHANGESET=${changeset} |
| 60 | +mk_add_options MOZ_CRASHREPORTER=0 |
| 61 | +mk_add_options MOZ_DATA_REPORTING=0 |
| 62 | +mk_add_options MOZ_SERVICES_HEALTHREPORT=0 |
| 63 | +mk_add_options MOZ_TELEMETRY_REPORTING=0 |
| 64 | +MOZ_CRASHREPORTER=0 |
| 65 | +MOZ_DATA_REPORTING=0 |
| 66 | +MOZ_REQUIRE_SIGNING= |
| 67 | +export MOZ_CRASHREPORTER=0 |
| 68 | +export MOZ_DATA_REPORTING=0 |
| 69 | +export MOZ_REQUIRE_SIGNING= |
| 70 | + |
| 71 | +# Installer |
| 72 | +export WIN32_REDIST_DIR="/c/Program Files/Microsoft Visual Studio/2022/Community/VC/Redist/MSVC/14.36.32532/x64/Microsoft.VC143.CRT" |
| 73 | + |
| 74 | +# Branding |
| 75 | +ac_add_options --with-app-name=mercury |
| 76 | +ac_add_options --with-app-basename=Mercury |
| 77 | +ac_add_options --with-branding=browser/branding/mercury |
| 78 | +ac_add_options --with-l10n-base="C:\mozilla-source\mozilla-unified\browser\locales\en-US" |
| 79 | +ac_add_options --with-distribution-id=com.alex313031.mercury |
| 80 | +# -app=/home/alex/bin/Mercury/application.ini |
| 81 | + |
| 82 | +# Make flags (set to number of CPU cores) |
| 83 | +mk_add_options MOZ_MAKE_FLAGS="-j16" |
| 84 | +export MOZ_MAKE_FLAGS="-j16" |
| 85 | + |
| 86 | +# Autoclobber |
| 87 | +mk_add_options AUTOCLOBBER=1 |
| 88 | +export AUTOCLOBBER=1 |
| 89 | + |
| 90 | +# Set -Copt-level=3 |
| 91 | +export OPT_LEVEL="3" |
| 92 | +ac_add_options OPT_LEVEL="3" |
| 93 | +export RUSTC_OPT_LEVEL="3" |
| 94 | +ac_add_options RUSTC_OPT_LEVEL="3" |
| 95 | + |
| 96 | +# Enable PGO/LTO |
| 97 | +export MOZ_LTO=1 |
| 98 | +ac_add_options MOZ_LTO=1 |
| 99 | +export MOZ_PGO=1 |
| 100 | +ac_add_options MOZ_PGO=1 |
| 101 | + |
| 102 | +## Compiler, Linker, and Rust flags |
| 103 | +export CFLAGS="-O3 -march=x86-64-v3 /clang:-O3 /arch:AVX2" |
| 104 | +export CPPFLAGS="-O3 -march=x86-64-v3 /clang:-O3 /arch:AVX2" |
| 105 | +export CXXFLAGS="-O3 -march=x86-64-v3 /clang:-O3 /arch:AVX2" |
| 106 | +export LDFLAGS="-Wl,-O3 -march=x86-64-v3" |
| 107 | +# export MOZ_LTO_LDFLAGS="-mllvm:-polly" |
| 108 | +export RUSTFLAGS="-C target-feature=+avx2" |
| 109 | +export VERBOSE=1 |
0 commit comments