



REM Environment variables:
set TT_MOZ_SRC_DIR=%BUILDDIR%
set TT_PATCH_DIR=E:\Mozilla\tete009_patch\tete\Fx138.0




REM build with custom LLVM:
patch --binary --dry-run -N %TT_MOZ_SRC_DIR%\build\moz.configure\toolchain.configure %TT_PATCH_DIR%\toolchain.configure.patch




REM force link tmemutil.dll:
patch --binary --dry-run -N %TT_MOZ_SRC_DIR%\toolkit\xre\nsWindowsWMain.cpp %TT_PATCH_DIR%\nsWindowsWMain.cpp.patch




REM enable passing flags to Cargo using CARGOFLAGS:
patch --binary --dry-run -N %TT_MOZ_SRC_DIR%\build\moz.configure\rust.configure %TT_PATCH_DIR%\rust.configure.patch




REM add the PROFILE_GEN_SCRIPT environment variable to allow running the custom profile script for collecting profile data,
REM and add CSIR PGO support:
patch --binary --dry-run -N %TT_MOZ_SRC_DIR%\moz.configure %TT_PATCH_DIR%\moz.configure.patch
patch --binary --dry-run -N %TT_MOZ_SRC_DIR%\build\moz.configure\lto-pgo.configure %TT_PATCH_DIR%\lto-pgo.configure.patch
patch --binary --dry-run -N %TT_MOZ_SRC_DIR%\python\mozbuild\mozbuild\build_commands.py %TT_PATCH_DIR%\build_commands.py.patch
patch --binary --dry-run -N %TT_MOZ_SRC_DIR%\build\pgo\profileserver.py %TT_PATCH_DIR%\profileserver.py.patch
patch --binary --dry-run -N %TT_MOZ_SRC_DIR%\testing\mozbase\mozhttpd\mozhttpd\mozhttpd.py %TT_PATCH_DIR%\mozhttpd.py.patch

patch --binary --dry-run -N %TT_MOZ_SRC_DIR%\security\sandbox\common\SandboxSettings.h %TT_PATCH_DIR%\SandboxSettings.h.patch
patch --binary --dry-run -N %TT_MOZ_SRC_DIR%\security\sandbox\common\SandboxSettings.cpp %TT_PATCH_DIR%\SandboxSettings.cpp.patch
patch --binary --dry-run -N %TT_MOZ_SRC_DIR%\security\sandbox\win\src\sandboxbroker\sandboxBroker.cpp %TT_PATCH_DIR%\sandboxBroker.cpp.patch

patch --binary --dry-run -N %TT_MOZ_SRC_DIR%\python\mozbuild\mozbuild\mozconfig.py %TT_PATCH_DIR%\mozconfig.py.patch
patch --binary --dry-run -N %TT_MOZ_SRC_DIR%\config\config.mk %TT_PATCH_DIR%\config.mk.patch
patch --binary --dry-run -N %TT_MOZ_SRC_DIR%\xpcom\base\nscore.h %TT_PATCH_DIR%\nscore.h.patch
patch --binary --dry-run -N %TT_MOZ_SRC_DIR%\modules\libpref\init\StaticPrefList.yaml %TT_PATCH_DIR%\StaticPrefList.yaml.patch
patch --binary --dry-run -N %TT_MOZ_SRC_DIR%\build\pure_virtual\moz.build %TT_PATCH_DIR%\pure_virtual_moz.build.patch
patch --binary --dry-run -N %TT_MOZ_SRC_DIR%\config\makefiles\rust.mk %TT_PATCH_DIR%\rust.mk.patch
patch --binary --dry-run -N %TT_MOZ_SRC_DIR%\config\rules.mk %TT_PATCH_DIR%\rules.mk.patch

patch --binary --dry-run -N %TT_MOZ_SRC_DIR%\third_party\rust\cc\src\flags.rs %TT_PATCH_DIR%\cc_flags.rs.patch
patch --binary --dry-run -N %TT_MOZ_SRC_DIR%\third_party\rust\cc\.cargo-checksum.json %TT_PATCH_DIR%\cc_cargo-checksum.json.patch




REM add the TT_FORCE_DISABLE_E10S environment variable to tete009 build to allow the forced disabling of e10s for debugging purposes:
patch --binary --dry-run -N %TT_MOZ_SRC_DIR%\toolkit\xre\nsAppRunner.cpp %TT_PATCH_DIR%\nsAppRunner.cpp.patch




REM generate the Visual Studio project files based on target CPU:
patch --binary --dry-run -N %TT_MOZ_SRC_DIR%\python\mozbuild\mozbuild\backend\visualstudio.py %TT_PATCH_DIR%\visualstudio.py.patch




REM separate the video sample data for benchmarking VP9 decoding speed from libxul into a webm-benchmark.bin file:
patch --binary --dry-run -N -p1 < %TT_PATCH_DIR%\gen_webm_benchmark_bin.py.patch
patch --binary --dry-run -N %TT_MOZ_SRC_DIR%\dom\media\moz.build %TT_PATCH_DIR%\dom_media_moz.build.patch
patch --binary --dry-run -N %TT_MOZ_SRC_DIR%\dom\media\Benchmark.h %TT_PATCH_DIR%\Benchmark.h.patch
patch --binary --dry-run -N %TT_MOZ_SRC_DIR%\dom\media\Benchmark.cpp %TT_PATCH_DIR%\Benchmark.cpp.patch
patch --binary --dry-run -N %TT_MOZ_SRC_DIR%\browser\installer\package-manifest.in %TT_PATCH_DIR%\package-manifest.in.patch




REM define restricted pointer attribute:
patch --binary --dry-run -N %TT_MOZ_SRC_DIR%\mfbt\Attributes.h %TT_PATCH_DIR%\Attributes.h.patch




REM nsDeque::Empty():
patch --binary --dry-run -N %TT_MOZ_SRC_DIR%\xpcom\ds\nsDeque.cpp %TT_PATCH_DIR%\nsDeque.cpp.patch




REM js/src/gc/Marking.cpp:
patch --binary --dry-run -N %TT_MOZ_SRC_DIR%\js\src\gc\Marking.cpp %TT_PATCH_DIR%\Marking.cpp.patch




REM gklayout:
patch --binary --dry-run -N %TT_MOZ_SRC_DIR%\layout\generic\ReflowInput.cpp %TT_PATCH_DIR%\ReflowInput.cpp.patch

REM avoid crash at the time of printing when applying PGO:
patch --binary --dry-run -N %TT_MOZ_SRC_DIR%\layout\generic\nsContainerFrame.cpp %TT_PATCH_DIR%\nsContainerFrame.cpp.patch




REM NULL pointer check for entry->GetRequest():
patch --binary --dry-run -N %TT_MOZ_SRC_DIR%\image\imgLoader.cpp %TT_PATCH_DIR%\imgLoader.cpp.patch




REM 2D:
patch --binary --dry-run -N %TT_MOZ_SRC_DIR%\gfx\2d\2D.h %TT_PATCH_DIR%\2D.h.patch
patch --binary --dry-run -N %TT_MOZ_SRC_DIR%\gfx\2d\Factory.cpp %TT_PATCH_DIR%\Factory.cpp.patch

REM convolve horizontally using SSSE3:
patch --binary --dry-run -N %TT_MOZ_SRC_DIR%\gfx\2d\SkConvolver.cpp %TT_PATCH_DIR%\SkConvolver.cpp.patch
patch --binary --dry-run -N %TT_MOZ_SRC_DIR%\gfx\2d\ConvolutionFilterSSE2.cpp %TT_PATCH_DIR%\ConvolutionFilterSSE2.cpp.patch




REM prefetch:
patch --binary --dry-run -N %TT_MOZ_SRC_DIR%\dom\base\AttrArray.h %TT_PATCH_DIR%\AttrArray.h.patch
patch --binary --dry-run -N %TT_MOZ_SRC_DIR%\dom\base\Element.h %TT_PATCH_DIR%\Element.h.patch
patch --binary --dry-run -N %TT_MOZ_SRC_DIR%\layout\generic\nsIFrame.cpp %TT_PATCH_DIR%\nsIFrame.cpp.patch
patch --binary --dry-run -N %TT_MOZ_SRC_DIR%\layout\generic\nsBlockFrame.cpp %TT_PATCH_DIR%\nsBlockFrame.cpp.patch
patch --binary --dry-run -N %TT_MOZ_SRC_DIR%\layout\generic\ViewportFrame.cpp  %TT_PATCH_DIR%\ViewportFrame.cpp.patch

patch --binary --dry-run -N %TT_MOZ_SRC_DIR%\gfx\skia\skia\src\base\SkRectMemcpy.h %TT_PATCH_DIR%\SkRectMemcpy.h.patch
patch --binary --dry-run -N %TT_MOZ_SRC_DIR%\gfx\wr\swgl\src\composite.h %TT_PATCH_DIR%\composite.h.patch
patch --binary --dry-run -N %TT_MOZ_SRC_DIR%\js\src\frontend\BytecodeEmitter.cpp %TT_PATCH_DIR%\BytecodeEmitter.cpp.patch
patch --binary --dry-run -N %TT_MOZ_SRC_DIR%\xpcom\base\nsCycleCollector.cpp %TT_PATCH_DIR%\nsCycleCollector.cpp.patch
patch --binary --dry-run -N %TT_MOZ_SRC_DIR%\xpcom\base\CycleCollectedJSRuntime.cpp %TT_PATCH_DIR%\CycleCollectedJSRuntime.cpp.patch

patch --binary --dry-run -N %TT_MOZ_SRC_DIR%\layout\painting\nsDisplayList.cpp %TT_PATCH_DIR%\nsDisplayList.cpp.patch
patch --binary --dry-run -N %TT_MOZ_SRC_DIR%\layout\painting\nsDisplayList.h %TT_PATCH_DIR%\nsDisplayList.h.patch

patch --binary --dry-run -N %TT_MOZ_SRC_DIR%\dom\base\DOMIntersectionObserver.cpp %TT_PATCH_DIR%\DOMIntersectionObserver.cpp.patch
patch --binary --dry-run -N %TT_MOZ_SRC_DIR%\layout\painting\RetainedDisplayListBuilder.cpp %TT_PATCH_DIR%\RetainedDisplayListBuilder.cpp.patch
patch --binary --dry-run -N %TT_MOZ_SRC_DIR%\layout\generic\nsFlexContainerFrame.cpp %TT_PATCH_DIR%\nsFlexContainerFrame.cpp.patch

patch --binary --dry-run -N %TT_MOZ_SRC_DIR%\layout\forms\nsTextControlFrame.cpp %TT_PATCH_DIR%\nsTextControlFrame.cpp.patch
patch --binary --dry-run -N %TT_MOZ_SRC_DIR%\layout\generic\nsCanvasFrame.cpp %TT_PATCH_DIR%\nsCanvasFrame.cpp.patch
patch --binary --dry-run -N %TT_MOZ_SRC_DIR%\layout\generic\nsColumnSetFrame.cpp %TT_PATCH_DIR%\nsColumnSetFrame.cpp.patch
patch --binary --dry-run -N %TT_MOZ_SRC_DIR%\layout\generic\nsGridContainerFrame.cpp %TT_PATCH_DIR%\nsGridContainerFrame.cpp.patch
patch --binary --dry-run -N %TT_MOZ_SRC_DIR%\layout\tables\nsTableFrame.cpp %TT_PATCH_DIR%\nsTableFrame.cpp.patch
patch --binary --dry-run -N %TT_MOZ_SRC_DIR%\layout\tables\nsTableRowFrame.cpp %TT_PATCH_DIR%\nsTableRowFrame.cpp.patch
patch --binary --dry-run -N %TT_MOZ_SRC_DIR%\layout\tables\nsTableWrapperFrame.cpp %TT_PATCH_DIR%\nsTableWrapperFrame.cpp.patch
patch --binary --dry-run -N %TT_MOZ_SRC_DIR%\layout\base\RestyleManager.cpp %TT_PATCH_DIR%\RestyleManager.cpp.patch




REM jemalloc:
patch --binary --dry-run -N %TT_MOZ_SRC_DIR%\memory\build\mozjemalloc.cpp %TT_PATCH_DIR%\mozjemalloc.cpp.patch




REM avoid compile error for mozilla48:
patch --binary --dry-run -N %TT_MOZ_SRC_DIR%\dom\canvas\WebGLTypes.h %TT_PATCH_DIR%\WebGLTypes.h.patch




REM nsILocalFileWin:
patch --binary --dry-run -N %TT_MOZ_SRC_DIR%\xpcom\io\nsILocalFileWin.idl %TT_PATCH_DIR%\nsILocalFileWin.idl.patch
patch --binary --dry-run -N %TT_MOZ_SRC_DIR%\xpcom\io\nsLocalFileWin.h %TT_PATCH_DIR%\nsLocalFileWin.h.patch
patch --binary --dry-run -N %TT_MOZ_SRC_DIR%\xpcom\io\nsLocalFileWin.cpp %TT_PATCH_DIR%\nsLocalFileWin.cpp.patch




REM avoid build failures in unified build environments post-patch for Bug 1830038.
patch --binary --dry-run -N %TT_MOZ_SRC_DIR%\dom\media\webrtc\transport\third_party\nICEr\src\net\transport_addr.h %TT_PATCH_DIR%\transport_addr.h.patch




REM Maybe a bug. A wait handle cannot be used in CloseHandle:
patch --binary --dry-run -N %TT_MOZ_SRC_DIR%\widget\windows\WinRegistry.cpp %TT_PATCH_DIR%\WinRegistry.cpp.patch




REM avoid compile errors with the new Windows SDK:
patch --binary --dry-run -N %TT_MOZ_SRC_DIR%\gfx\cairo\cairo\src\cairo-compiler-private.h %TT_PATCH_DIR%\cairo-compiler-private.h.patch




