From d3a2e492fb5a9a3e079e6ceaca0b9e2a6f05c5a6 Mon Sep 17 00:00:00 2001 From: Max Wipfli Date: Sun, 20 Jun 2021 15:07:21 +0200 Subject: [PATCH] Documentation: Document the ConfigureComponents utility This adds documentation for the ConfigureComponents utility to the build instructions. --- Documentation/BuildInstructions.md | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/Documentation/BuildInstructions.md b/Documentation/BuildInstructions.md index c14c2982215..c3bd5553878 100644 --- a/Documentation/BuildInstructions.md +++ b/Documentation/BuildInstructions.md @@ -270,7 +270,7 @@ There are some optional features that can be enabled during compilation that are - `PRECOMPILE_COMMON_HEADERS`: precompiles some common headers to speedup compilation. - `ENABLE_KERNEL_LTO`: builds the kernel with link-time optimization. - `INCLUDE_WASM_SPEC_TESTS`: downloads and includes the WebAssembly spec testsuite tests -- `BUILD_`: builds the specified component, e.g. `BUILD_HEARTS` (note: must be all caps). Check the components.ini file in your build directory for a list of available components. Make sure to run `ninja clean` and `rm -rf Build/i686/Root` after disabling components. +- `BUILD_`: builds the specified component, e.g. `BUILD_HEARTS` (note: must be all caps). Check the components.ini file in your build directory for a list of available components. Make sure to run `ninja clean` and `rm -rf Build/i686/Root` after disabling components. These options can be easily configured by using the `ConfigureComponents` utility. See the [Component Configuration](#component-configuration) section below. - `BUILD_EVERYTHING`: builds all optional components, overrides other `BUILD_` flags when enabled Many parts of the SerenityOS codebase have debug functionality, mostly consisting of additional messages printed to the debug console. This is done via the `_DEBUG` macros, which can be enabled individually at build time. They are listed in [this file](../Meta/CMake/all_the_debug_macros.cmake). @@ -283,6 +283,18 @@ $ cmake ../.. -G Ninja -DPROCESS_DEBUG=ON -DENABLE_PCI_IDS_DOWNLOAD=OFF For the changes to take effect, SerenityOS needs to be recompiled and the disk image needs to be rebuilt. +## Component Configuration + +For selecting which components of the system to build and install, a helper program, `ConfigureComponents` is available. + +It requires `whiptail` as a dependency, which is available on most systems in the `newt` or `libnewt` package. To build and run it, run the following commands from the `Build/i686` directory: +```console +$ cmake ../.. -G Ninja # Only required if CMake hasn't been run before. +$ ninja configure-components +``` + +This will prompt you which build type you want to use and allows you to customize it by manually adding or removing certain components. It will then run a CMake command based on the selection as well as `ninja clean` and `rm -rf Root` to remove old build artifacts. + ## Ports To add a package from the ports collection to Serenity, for example curl, go into `Ports/curl/` and run `./package.sh`. The sourcecode for the package will be downloaded and the package will be built. After that, rebuild the disk image. The next time you start Serenity, `curl` will be available.