r3dfox build guide (Unofficial)
There is now an official guide available
https://board.eclipse.cx/viewtopic.php?t=812
Original unofficial guide:
UNDER CONSTRUCTION
r3dfox is a fully open-source web browser by @K4sum1 based on Firefox, but compatible with Windows Vista, 7, 8.0, 8.1 with additional features such as support for Aero Glass, no telemetry/spyware, per-site useragent overrides, custom browser css styling, however it tries to remain as close to stock Firefox as possible.The building process was tested with the following configuration:
• Windows 10 Redstone 5 (aka version 1809) x64 Vmware virtual machine on Windows 8.0 host
• Intel Core I5-12600. 6 cores 12 threads total, 6 threads allocated to the virtual machine
• 16GB RAM total, 8GB allocated to the virtual machine
Preparing the build enviroment
1. Get Windows 10 or 11 preferably as a virtual machine (vmware, virtualbox etc)
2. Disable any antivirus protections you may have, you don’t want it to scan almost a million files from the source or break something. https://firefox-source-docs.mozilla.org/setup/windows_build.html#ensure-antivirus-exclusions
3. Follow the steps for building standard firefox:
- Install MozillaBuild https://firefox-source-docs.mozilla.org/setup/windows_build.html#install-mozillabuild
Download https://hg.mozilla.org/mozilla-central/raw-file/default/python/mozboot/bin/bootstrap.py
Run start-shell.bat in "C:\mozilla-build" (default location) and in the command line shell that opens run bootstrap.py (internet connection is required here unfortunately) https://firefox-source-docs.mozilla.org/setup/windows_build.html#bootstrap-a-copy-of-the-firefox-source-code
Choose "2. Firefox for Desktop" https://firefox-source-docs.mozilla.org/setup/windows_build.html#choosing-a-build-type
5. Get eRust – a custom Rust with improved support for Windows Vista https://github.com/Eclipse-Community/eRust/releases/tag/e1.77.2
6. Extract it somewhere, for example “C:\mozilla-build\erust” (after extracting this folder should contain “lib”, “bin” and “share” folders)
7. Open cmd or powershell and run
Code: Select all rustup toolchain link erust ’C:\mozilla-build\erust' |
8. And “rustup toolchain list” to see your toolchains
9. Assuming that you don’t want to build other Rust other than r3dfox on your current system you can set eRust as the default toolchin, run
Code: Select all rustup default erust |
10. Download https://github.com/Eclipse-Community/r3dfox/releases/download/v128.0.2-2/r3dfox-7-RTM-fix.7z and extract to "C:\VC++"
Building
1. Download .zip source code of the release that you want to build https://github.com/Eclipse-Community/r3dfox/releases
2. Clear source code of standard Firefox which (assuming you bootstrapped with the default settings) resides in “C:\mozilla-source\mozilla-unified”
3. Extract zipped r3dfox to “C:\mozilla-source\mozilla-unified” After extracting mozilla-unified should contain many folders (including “browser”, “build”, “cap”) not a single folder that contains them
4. Go to “C:\mozilla-source\mozilla-unified\mozconfigs” and copy one of the mozconfig files to “C:\mozilla-source\mozilla-unified”, either “mozconfig-win-x64” or “mozconfig-win-x86” depending on whether you want to build x64 or 32-bit version.
5. Rename the new copy of “mozconfig-win-x64” or “ mozconfig-win-x86” to plain “mozconfig”
6. Open the new mozconfig file in notepad, x64 is assumed here, it will look like this (this is the original file but you will need to make changes):
Code: Select all ## mozconfig for compiling r3dfox Browser for Windows natively ##Uncomment PGO for release build # x64 build ac_add_options --target=x86_64 # Please do not redistribute this build with official branding if you are not part of Eclipse Community. ac_add_options --with-app-name=r3dfox ac_add_options --with-app-basename=r3dfox # For ESR enable the below and disable the above #ac_add_options --with-branding=browser/branding/esr #ac_add_options --with-app-name=r3dfox_esr #ac_add_options --with-app-basename="r3dfox ESR" # For potential nightly experimentation enable the below and disable the above. #ac_add_options --with-branding=browser/branding/nightly #ac_add_options --with-app-name=plasmafox #ac_add_options --with-app-basename=Plasmafox ac_add_options --enable-official-branding # Updater stuffs ac_add_options --disable-update-agent ac_add_options --disable-updater # Enable if update server and signatures are figured out #ac_add_options --enable-nss-mar # 16 jobs for 16 cores mk_add_options MOZ_MAKE_FLAGS="-j16" # Build only r3dfox ac_add_options --enable-application=browser ac_add_options --disable-artifact-builds export MOZ_INCLUDE_SOURCE_INFO=1 export MOZ_SOURCE_CHANGESET=iloveneedingtobodgechangesetfornoreason # Package VC++ DLLs export WIN32_REDIST_DIR="C:/VC++/x64" export WIN_UCRT_REDIST_DIR="C:/VC++/x64" # Optimization settings ac_add_options --disable-debug ac_add_options --disable-debug-js-modules ac_add_options --disable-debug-symbols ac_add_options --disable-tests ac_add_options --enable-clang-plugin ac_add_options --enable-hardening ac_add_options --enable-install-strip ac_add_options --enable-jemalloc ac_add_options --enable-lto ac_add_options --enable-optimize="-Qunused-arguments -O2 -msse2 -Xclang -O3" ac_add_options --enable-release ac_add_options --enable-rust-simd ac_add_options --enable-strip MOZ_OPTIMIZE=1 export MOZ_OPTIMIZE=1 mk_add_options MOZ_OPTIMIZE=1 export MOZILLA_OFFICIAL=1 export STRIP_FLAGS="--strip-debug --strip-unneeded" # Media settings ac_add_options --disable-eme ac_add_options --enable-av1 ac_add_options --enable-jxl ac_add_options --enable-raw ac_add_options --enable-webrtc # Add-ons ac_add_options --allow-addon-sideload ac_add_options --with-unsigned-addon-scopes=app,system # Client settings ac_add_options --disable-backgroundtasks ac_add_options --disable-bits-download ac_add_options --disable-crashreporter ac_add_options --disable-default-browser-agent ac_add_options --disable-maintenance-service ac_add_options --disable-notification-server ac_add_options --disable-parental-controls ac_add_options --without-wasm-sandboxed-libraries mk_add_options MOZ_CRASHREPORTER=0 mk_add_options MOZ_DATA_REPORTING=0 mk_add_options MOZ_SERVICES_HEALTHREPORT=0 mk_add_options MOZ_TELEMETRY_REPORTING= export MOZ_CRASHREPORTER=0 export MOZ_DATA_REPORTING=0 export MOZ_REQUIRE_SIGNING= export MOZ_TELEMETRY_REPORTING= # Set -Copt-level=3 export OPT_LEVEL="3" ac_add_options OPT_LEVEL="3" export RUSTC_OPT_LEVEL="3" ac_add_options RUSTC_OPT_LEVEL="3" # Enable LTO export MOZ_LTO=1 ac_add_options MOZ_LTO=1 export MOZ_PGO=1 ac_add_options MOZ_PGO=1 if test "$GEN_PGO"; then ac_add_options --enable-profile-generate elif test "$USE_PGO"; then ac_add_options --enable-profile-use=cross fi # Compiler, Linker, and Rust flags export CFLAGS="-Qunused-arguments -O2 -msse2 /clang:-O3" export CPPFLAGS="-Qunused-arguments -O2 -msse2 /clang:-O3" export CXXFLAGS="-Qunused-arguments -O2 -msse2 /clang:-O3" export LDFLAGS="-Wl,-O3 -msse2" POLLY="-mllvm -polly -mllvm -polly-2nd-level-tiling -mllvm -polly-loopfusion-greedy -mllvm -polly-pattern-matching-based-opts -mllvm -polly-position=before-vectorizer -mllvm -polly-vectorizer=stripmine" export RUSTFLAGS="-C target-cpu=athlon64 -C target-feature=+sse2 -C codegen-units=1 -Z tune-cpu=athlon64" export VERBOSE=1 |
Comment out official branding with #
Code: Select all #ac_add_options --with-app-name=r3dfox #ac_add_options --with-app-basename=r3dfox |
Code: Select all ac_add_options --with-branding=browser/branding/nightly ac_add_options --with-app-name=Nightly ac_add_options --with-app-basename=Nightly |
Code: Select all mk_add_options MOZ_MAKE_FLAGS="-j16" |
Code: Select all mk_add_options MOZ_MAKE_FLAGS="-j6" |
12. Run start-shell.bat in "C:\mozilla-build" (default location) to open MozillaBuild shell and in the command line shell that opens run the following:
Code: Select all cd c:/mozilla-source/mozilla-unified |
Code: Select all ./mach clobber |
Code: Select all ./mach bootstrap |
Code: Select all ./mach build |
16. If you want to get zip package run
Code: Select all ./mach package |