449. Flag glossary
The same switches recur on page after page of this book. This appendix explains each of them once, so that a package page only has to explain the switches peculiar to its own port: when a page passes one of these without comment, the meaning given here is the one it has.
The list holds the switches that ten or more of the tree’s recipes hand to a build system or add to the compiler flags, counted over every build.sh under ports/core/ and src/, and a few rarer ones that show a rule every recipe follows, such as naming a feature option instead of leaving it to detection. They are grouped by the build system that reads them. For each, the entry says what the switch does and, where the tree records a reason, why KDOS passes it.
Three kinds of option are left out:
- options that only name an output file or a directory to work in;
- the options of ordinary tools such as
install,patchandfind; - the warning, include-path and library switches (
-Wall,-I,-L,-lm) of a compile line a recipe writes out itself, as the recipes of KDOS’s own programs do.
The shapes these switches sit in are set out in Canonical build shapes.
configure (autotools)
These go to a configure script generated by autoconf, or written to accept the same options.
--prefix=/usr-
Install under
/usr. Every package of KDOS does, and the package lint refuses a package with anything underusr/local; see What the package lint refuses. --sysconfdir=/etc-
Read and install configuration in
/etc. autoconf’s default under--prefix=/usris/usr/etc, and the path is compiled into the program as well as used for the install, so a program built without it ignores the file the image ships in/etc. The lint refuses both ausr/etcpath and an executable that names/usr/etc. In the chroot phasesscript/env/config.sitemakes the same correction when the recipe names nothing. The recipe names it anyway, because the site file is only the chroot’s default and a recipe built anywhere else does not read it. See autotools. --localstatedir=/var-
Keep run-time state under
/varrather than autoconf’s/usr/var, which the lint refuses for the same reason as/usr/etc. --libdir=/usr/lib-
Install libraries in
/usr/lib./usr/lib64in the built root is only a link tolib, and the lint refuses a package that installs through it. --libexecdir=/usr/lib-
Install the helper programs a package runs itself, rather than the ones a person types, under
/usr/libinstead of autoconf’s/usr/libexec. Both directories exist in the built root. --sbindir=/usr/sbin,--mandir=/usr/share/man-
Programs for the administrator in
/usr/sbin(/sbinis a link to it) and manual pages in/usr/share/man. Both are autoconf’s own defaults under--prefix=/usr, so for a configure generated by autoconf naming them changes nothing. --disable-static-
Build only the shared library, with no
.aarchive beside it. kpkg deletes libtool’s.lafiles afterbuild.shbut no archive, so an archive the build installs is in the package. It is part of the canonical autotools shape. --enable-shared- Build shared libraries. It is libtool’s default, so it changes something only in a configure whose own default is a static build.
--disable-nls-
Build no message catalogues. KDOS ships English only, and kpkg removes every other catalogue from the package whether or not the switch is given, so it only saves build time; see Size and language policy. A program built with it needs no
libintl, which makes it the first fix to try for anundefined reference to libintl_gettext; see Gettext on musl. --enable-nls- Turn gettext support on explicitly. In libintl it is what builds the library at all. Elsewhere the catalogues it builds that are not English are removed by kpkg, so the image carries no translation either way.
--disable-rpath-
Link no
RPATHof/usr/libinto the programs./usr/libis on the loader’s default path, so the entry adds only a lookup, and the package lint warns about it; see What the package lint refuses. --disable-werror-
Do not turn compiler warnings into errors where upstream’s build would. No phase adds
-Werror, and a warning that musl’s headers raise and glibc’s do not can stop an upstream-Werrorbuild; see How KDOS differs and An upstream -Werror. --disable-debug- Build the release configuration. A port never ships a debug build; see Every port.
--disable-tests,--disable-examples- Build neither the test suite nor the example programs. Neither is installed.
--disable-gtk-doc,--disable-docs,--disable-doc-
Build no API reference. kpkg removes HTML and PDF only under
/usr/share/doc, and gtk-doc installs its reference under/usr/share/gtk-doc/html, which kpkg keeps, so for a library documented with gtk-doc the switch is what keeps the reference out of the package. Manual pages are kept, so a project’s switch for those stays on. See Size and language policy and Manual pages. --disable-python- Build no Python bindings for the library.
--with-zlib,--with-zstd,--with-openssl,--with-readline,--with-jpeg,--with-png- Build with that library, named rather than left to configure’s detection, so that what the package supports follows the recipe and not whatever happened to be installed when it built; see A graphical application.
--with-system-zlib-
Link the
zlibport instead of the copy of zlib that the source tree carries, as GCC, binutils and the Mozilla programs, among others, are built. --enable-alsa,--enable-dbus-
Build the ALSA sound output and the D-Bus integration, named rather than detected, as for
--with-zlib. The Mozilla programs take the same switches asac_add_optionslines in theirmozconfig. --without-x- Build no X11 client code. The session is Wayland; a port that keeps an X11 path runs it under Xwayland.
--without-selinux,--without-systemd- Leave out SELinux labelling and systemd integration. Neither exists on KDOS; see No systemd and Features whose library has no port.
--without-xmlto,--without-fop,--without-xsltproc-
The X.org libraries’ switches for generating their specifications as HTML, PDF and text with xmlto, Apache FOP and xsltproc. Without them the libraries build no such documents; kpkg would remove the HTML and PDF ones from
/usr/share/docin any case.
meson
--prefix=/usr-
Install under
/usr, as for configure. --libdir=lib-
Install libraries in
/usr/lib. meson picks its default from the machine it runs on:lib64wherever/usr/lib64is a real directory, which the lint refuses, andlibwhere it is a link, as in the chroot. Naming it keeps the package the same whatever root builds it. See meson. --sysconfdir=/etc,--libexecdir=/usr/lib-
Configuration in
/etcand helper programs under/usr/lib, as for configure. --buildtype=release-
Build optimised and without debug information. meson’s default buildtype,
debug, compiles-g -O0, and kpkg strips no debug information, so the package would ship unoptimised code and its DWARF;testing/preflight.shfails ameson setupthat names no buildtype. It does not defineNDEBUG, so a meson port keeps itsassert()checks. --wrap-mode=nodownload-
Never download a subproject. A subproject whose source the recipe does not carry fails the setup with its name, instead of meson trying to clone it with no network. The tree’s
mesonwrapper adds it to every setup that chooses no wrap mode, so a recipe that names it states what would happen anyway. -C build,--no-rebuild-
On
meson compileandmeson install: work in the build directorybuild, and on install, install what the compile step built without running ninja again first. -Dtests=false,-Dtests=disabled-
The project’s own option for its test suite, off. The two spellings are the two types a meson option can have: a boolean takes
trueorfalse, a feature takesenabled,disabledorauto, and meson stops at setup on a value of the wrong kind. The option file in the tarball says which a project uses, andtesting/preflight.shchecks every-Dagainst it. -Ddocs=false,-Ddocs=disabled,-Dgtk_doc=false,-Dbuild-documentation=false-
Build no HTML or API reference. kpkg would remove such HTML from
/usr/share/docin any case, but not a gtk-doc reference under/usr/share/gtk-doc/html, as for--disable-gtk-doc. -Dman=true,-Dman-pages=enabled- Build and install the manual pages. A port installs every manual page upstream ships or can generate; see Manual pages.
-Dexamples=false- Build no example programs.
-Dintrospection=enabled,-Dintrospection=true-
Generate GObject introspection data, the
.girand.typelibfiles through which Python, JavaScript and other languages call a GLib-based library. -Dvapi=true-
Generate the
.vapifile that lets Vala programs use the library. -Djpeg=enabled-
Build JPEG support and stop at setup if the library is missing, where
autowould build without it in silence. A meson recipe sets each feature option explicitly in the same way; see A graphical application. -Dsystemd=disabled,-Dsystemd=false-
The project’s own option for its systemd support, off; which spelling depends on whether the project declares it a feature or a boolean, as for
-Dtests. KDOS has no systemd; see No systemd. -Ddefault_library=shared- Build every library the project defines as a shared library, over a project’s own default of a static or a combined build.
-Dmaintainer-mode=false,-Dwarnings=min,-Dbuild-deprecated-api=true-
The options of the C++ libraries built with mm-common, glibmm, cairomm, pangomm, gtkmm and libsigc++ among them: run none of the maintainer’s steps (in glibmm, regenerating the sources from their
.hgand.ccgtemplates), keep the compiler warnings at the project’s minimum level, and build the deprecated parts of the API, which programs written against an older release still call. The last two are upstream’s own defaults, named in the recipe.
CMake
-DCMAKE_INSTALL_PREFIX=/usr-
Install under
/usr. -DCMAKE_BUILD_TYPE=Release-
Build optimised and without debug information. Release appends
-O3 -DNDEBUGafter the exported flags, so a CMake port builds at-O3with assertions off. The phase exportsCMAKE_BUILD_TYPE=Releasealready, for a project whose recipe names none; the recipe names it so the command line says so. See cmake. -DCMAKE_INSTALL_LIBDIR=lib-
Install libraries in
/usr/lib. The tree’s CMake already defaults tolibthrough a patch to itsGNUInstallDirs, but a project that sets its own default ignores that, andusr/lib64is refused by the lint. -DCMAKE_POLICY_VERSION_MINIMUM=3.5-
Configure a project whose
cmake_minimum_requirednames a version older than 3.5, which the tree’s CMake otherwise refuses, without patching the project. -G Ninja,-S,-B,--build,--install-
Generate a Ninja build rather than makefiles, from the source directory after
-Sinto the build directory after-B; thencmake --buildbuilds it andDESTDIR=$PKG cmake --installinstalls it. Ninja takes the job count from the tree’sninjawrapper, andcmake --buildfromCMAKE_BUILD_PARALLEL_LEVEL. -Wno-dev- Silence CMake’s warnings addressed to a project’s own developers. Other warnings, the one for a misspelt option among them, still print.
-DBUILD_SHARED_LIBS=ON,-DBUILD_STATIC_LIBS=OFF-
Build shared libraries.
BUILD_SHARED_LIBSis CMake’s own variable, and when it is unset a plainadd_librarybuilds a static one.BUILD_STATIC_LIBSis a project’s own option, on by default in capstone among others, for a static library alongside. -DBUILD_TESTING=OFF-
CTest’s own switch, which a project that includes
CTestreads to decide whether to build its tests.-DBUILD_TESTS=OFF,-DENABLE_TESTS=OFFand-DENABLE_TESTING=OFFare projects’ own names for the same choice; ccache’sENABLE_TESTING, for one, defaults to on. -DBUILD_EXAMPLES=OFF,-DQT_BUILD_TESTS=OFF,-DQT_BUILD_EXAMPLES=OFF- Build no examples, and for a Qt module neither its tests nor its examples.
-DLLVM_INCLUDE_TESTS=OFF- Generate no test targets. It is LLVM’s own option, passed by the ports built from the LLVM source tree: llvm, clang, lldb, compiler-rt, libunwind, openmp and libclc, and llvm21, clang21 and lld21, the second version beside them.
-DCMAKE_SKIP_INSTALL_RPATH=ON-
Install the programs without an
RPATH. For a program whose libraries are in/usr/lib, the entry CMake would write is the loader’s default path, which the lint warns about; see What the package lint refuses. -DCMAKE_C_FLAGS_RELEASE="$CFLAGS -DNDEBUG",-DCMAKE_CXX_FLAGS_RELEASE="$CXXFLAGS -DNDEBUG"-
Replace Release’s own
-O3 -DNDEBUGwith the exported flags. A recipe that sets these keeps-DNDEBUGin them, so the build keeps Release’s assertions off at the tree’s level of optimisation. -DKDE_INSTALL_LIBDIR=lib,-DKDE_INSTALL_USE_QT_SYS_PATHS=ON-
Install a KDE project’s libraries in
/usr/lib, and its plugins and QML modules in Qt’s own directories. ECM’sKDEInstallDirswould picklib64by itself, apart from the tree’sGNUInstallDirsdefault. See A graphical application. -DKF_SKIP_PO_PROCESSING=ON- Skip building a KDE project’s translations, which kpkg would remove from the package anyway.
-DCMAKE_REQUIRE_FIND_PACKAGE_KF6DocTools=ON-
Stop the configure if KDocTools, which builds a KDE application’s handbook, is not found, where the project treats it as optional. A recipe pins each optional dependency this way, with
CMAKE_DISABLE_FIND_PACKAGE_<Name>for the ones it must not pick up; see A graphical application. -DBUILD_DOC=ON- Build the project’s documentation. In ark it is the option’s own default, named in the recipe.
-DBUILD_DESIGNERPLUGIN=OFF- Build no plugin for Qt Designer, which a KDE Frameworks library such as kcompletion otherwise builds for its widgets.
-DWITH_X11=ON- Build a KDE library’s X11 integration, the default in kcrash. Each toolkit is built with its X11 backend as well as Wayland, so a program with only an X11 path runs under Xwayland.
-DUSE_CCACHE=OFF-
Turn off a project’s own use of ccache. The tree has its own arrangement for CMake projects, through CMake’s compiler-launcher variables, set in
script/env/chroot.env; see The compiler cache.
cargo
--release-
Build cargo’s release profile. Every
cargo buildtakes it; the phase also exportsCARGO_PROFILE_RELEASE_DEBUG=0, so no crate’s release profile turns debug information back on. --frozen,--offline-
Build exactly what
Cargo.locknames, and never touch the network. Every crate comes from the vendor bundle the recipe unpacks; see rust. RUSTFLAGS="-C target-feature=-crt-static"-
Link the program dynamically against musl. The musl target links statically unless told otherwise, and a crate that binds a system library then fails to link, or carries a private copy of the library that no update of its port reaches.
testing/preflight.shfails a cargo recipe without it. --features-
Turn on cargo features beyond the crate’s defaults, as rust-analyzer’s
jemalloc.
go
-mod=vendor-
Build from the module
vendor/tree the recipe unpacks, never from the module proxy. -ldflags "-s -w"-
Link with no symbol table and no DWARF. The Go linker otherwise writes both, and kpkg does not strip them;
testing/preflight.shfails ago buildwithout both flags. See go. -X <package>.<variable>=<value>-
Set a string variable in the program at link time, which the recipes use to stamp the version a program reports. It goes inside the same
-ldflagsstring as-s -w, because a second-ldflagsreplaces the first.
pip
--no-index,--find-links=vendor-
Never consult the Python package index, and look for distributions only in the
vendordirectory the recipe unpacked its bundle into. --no-deps- Install only the distributions named. Their dependencies are ports of their own, or members of the bundle installed by name; see The three Python keys.
--no-build-isolation- Build with the build backends already installed, as ports, instead of installing them into a temporary environment first. A recipe without it, such as python3-jinja2’s, carries its backend in the vendor bundle, and pip installs it from there.
--ignore-installed-
Write the package into
$PKGwithout looking for an installed copy. Without it, pip finds the copy in the build root whenever a port is rebuilt over its installed version, and uninstalls it from the live tree before writing the new one.testing/preflight.shrefuses apip install --rootwithout it. --root=$PKG,--prefix=/usr-
Install into the staging tree, under
/usrwithin it.
The compiler and linker flags
These are added to the exported CFLAGS, CXXFLAGS or LDFLAGS, never put in their place.
-Wno-error-
Cancel a
-Werrorearlier on the compile line, so a warning stays a warning. See--disable-werrorabove. ${CFLAGS/-O2/-O3}-
Not a switch but a substitution: raise the exported
-O2to-O3for a port whose own default is-O3and spends its time in a hot path. meson needs this form, because it puts the exported flags after its own-O3. See Every port. -g0-
Cancel a
-gthat a build puts ahead of the exported flags. No port ships debug information; see What kpkg does around build.sh. -Wl,--strip-debug-
Drop debug information at the link, for a build that compiles it in where no flag reaches: a makefile that appends its own
-g, or a linked archive that carries it. ${CFLAGS/-std=gnu11/}-
A substitution again: the exported
CFLAGSwithout its-std=gnu11, which is valid only for C. A build that handsCFLAGSto its C++ compiler, or that names its own C standard, takes it this way, and one that still needs GNU C11 for its C files moves the standard intoCCinstead; see C flags handed to the C++ compiler. -D_GNU_SOURCE-
Make the C library’s headers declare the GNU extensions. musl declares a GNU extension such as
exp10only under this macro, and no-std=option defines it; see A source written for C23. Every KDOS root daemon compiles with it, as do several of KDOS’s other programs. -D_LARGEFILE64_SOURCE-
Expose the
*64names, such asstat64andoff64_t, which musl defines only as macros for the plain names and only under this macro. See A glibc-only call on musl. -include <header>-
Compile every file as though it began with an
#includeof that header, most oftencstdint,time.horsys/types.h. It is for a source that uses a declaration without including the header that declares it, and compiles only where another header brings that one in on the way; see A glibc-only call on musl.
make
-j1-
Run one job at a time, overriding the
-j$KDOS_JOBSinMAKEFLAGSfor that one invocation. Most often it is the install of a project whose install rules race under a parallel make, and the compile keeps its parallelism; a project whose build itself races runs that serially too. See A parallel install race.
See also
- Canonical build shapes: where these switches sit
- The release flags: what every recipe gets without asking
- Reading a package page: where a port’s own flag notes appear
- Build troubleshooting: what fails when one is left out