summaryrefslogtreecommitdiffstats
path: root/doc/build.dox
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-27 04:20:26 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-27 04:20:26 +0000
commit044203039cebe3c05161f8f104a039d4744ca6d0 (patch)
tree1073c2308492e6aea4c66cb7436ee92db2abfd42 /doc/build.dox
parentInitial commit. (diff)
downloadlibyang2-044203039cebe3c05161f8f104a039d4744ca6d0.tar.xz
libyang2-044203039cebe3c05161f8f104a039d4744ca6d0.zip
Adding upstream version 2.1.30.upstream/2.1.30
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'doc/build.dox')
-rw-r--r--doc/build.dox139
1 files changed, 139 insertions, 0 deletions
diff --git a/doc/build.dox b/doc/build.dox
new file mode 100644
index 0000000..77fd165
--- /dev/null
+++ b/doc/build.dox
@@ -0,0 +1,139 @@
+/**
+ * @page build Building libyang
+ *
+ * [TOC]
+ *
+ * libyang utilizes CMake build system to detect necessary dependencies, checkout the build environment and prepare Makefiles
+ * for the compilation of the library and acompanied tools.
+ *
+ * @section buildRequirements Requirements
+ *
+ * @subsection buildRequirementsCompile Building Requirements
+ *
+ * - C compiler (gcc, clang, ...)
+ * - CMake >= 2.8.12
+ * - libpcre2 (including headers - devel package) >= 10.30
+ *
+ * @subsubsection buildRequirementsCompileOptional Optional Requirements
+ *
+ * - doxygen (for generating documentation)
+ * - cmocka >= 1.0.0 (for tests)
+ * - valgrind (for enhanced testing)
+ * - gcov (for code coverage)
+ * - lcov (for code coverage)
+ * - genhtml (for code coverage)
+ *
+ * @subsection buildRequirementsRun Runtime Requirements
+ *
+ * - libpcre2 (runtime package) >= 10.30
+ *
+ * @section buildCommands Building
+ *
+ * To simply build libyang library and the accompanied tools with the default settings, follow these steps (the `#` character
+ * indicates command(s) to run with `root` privileges):
+ *
+ * $ mkdir build; cd build
+ * $ cmake ..
+ * $ make
+ * # make install
+ *
+ * The default settings can be changed with various CMake variables set via command line or using e.g. `ccmake(1)` tool.
+ * The following sections introduces those variables and explain their meaning.
+ *
+ * @section buildTypes Build Types
+ *
+ * There are several build types according to the primary goal of using the built binaries.
+ *
+ * @subsection buildTypesRelese Release
+ *
+ * Build type to produce final binaries for production use without any debug option. The compiler flags are set as follows:
+ *
+ * -Wall -Wextra -Wno-missing-field-initializers -std=c99 -O3 -DNDEBUG
+ *
+ * Here is the list of the selected additional options available in the *Release* build type.
+ *
+ * Option | Description | Default
+ * ----------------------|------------------------------------------------------------------------------------|--------
+ * ENABLE_BUILD_TESTS | Build tests. | OFF
+ * ENABLE_VALGRIND_TESTS | Build tests with valgrind. | OFF
+ * ENABLE_COVERAGE | Build code coverage report from tests. | OFF
+ * ENABLE_FUZZ_TARGETS | Build target programs suitable for fuzzing with AFL. | OFF
+ * ENABLE_STATIC | Build static (.a) library | OFF
+ * INTERNAL_DOCS | Include developers notes and internal API description into generated Documentation | OFF
+ *
+ * Here is the list of available important targets for the `make(1)` tool:
+ *
+ * Target | Description
+ * -------|------------------------------------------------------------------------------------------------------------
+ * all | Default target, builds libyang library (.so), `yanglint(1)` and `yangre(1)`.
+ * clean | Removes files generated by the make process.
+ * cclean | Extends the `clean` target by removing all the cmake generated files.
+ * doc | Generate HTML documentation. Requires `doxygen(1)`.
+ *
+ * @subsection buildTypesDebug Debug
+ *
+ * `Debug` is the default build type, the produced binaries include additional debug information and the prepared tests are
+ * also built. The compiler flags are set as follows:
+ *
+ * -Wall -Wextra -Wno-missing-field-initializers -std=c99 -g3 -O0
+ *
+ * Here is the list of the selected additional options available in the *Debug* build type.
+ *
+ * Option | Description | Default
+ * ----------------------|------------------------------------------------------------------------------------|--------
+ * ENABLE_BUILD_TESTS | Build tests. | ON
+ * ENABLE_VALGRIND_TESTS | Build tests with valgrind. | ON
+ * ENABLE_COVERAGE | Build code coverage report from tests. | OFF
+ * ENABLE_FUZZ_TARGETS | Build target programs suitable for fuzzing with AFL. | OFF
+ * ENABLE_STATIC | Build static (.a) library | OFF
+ * INTERNAL_DOCS | Include developers notes and internal API description into generated Documentation | OFF
+ *
+ * Here is the list of available important targets for the `make(1)` tool:
+ *
+ * Target | Description
+ * -------------|------------------------------------------------------------------------------------------------------
+ * all | Default target, builds libyang library (.so), `yanglint(1)` and `yangre(1)`.
+ * clean | Removes files generated by the make process.
+ * cclean | Extends the `clean` target by removing all the cmake generated files.
+ * doc | Generate HTML documentation. Requires `doxygen(1)`.
+ * test | Run implementation tests. Requires `cmocka` (and `valgrind(1)` for part of the tests).
+ * format | Reformat source codes using `uncrustify(1)`.
+ * format-check | Dry-run of the `format` target.
+ *
+ * @subsection buildTypesABICheck ABICheck
+ *
+ * Special build type to perform check of the ABI/API compatibility and generate reports. In addition to the basic
+ * requirements, the build type requires some of the <a href="https://abi-laboratory.pro/">ABI Laboratory tools</a>:
+ * `abi-dumper(1)` and `abi-compliance-checker(1)`.
+ *
+ * The compiler flags are set as follows:
+ *
+ * -Wall -Wextra -Wno-missing-field-initializers -std=c99 -g -Og
+ *
+ * All the additional options are switched OFF and the settings should not be changed.
+ *
+ * Here is the list of available important targets for the `make(1)` tool:
+ *
+ * Target | Description
+ * -------------|------------------------------------------------------------------------------------------------------
+ * all | Default target, builds libyang library (.so), `yanglint(1)` and `yangre(1)`.
+ * clean | Removes files generated by the make process.
+ * cclean | Extends the `clean` target by removing all the cmake generated files.
+ * doc | Generate HTML documentation. Requires `doxygen(1)`.
+ * abi-check | Check the backward compatibility of the API/ABI changes. Requires `abi-compliance-checker(1)` and `abi-dump(1)`.
+ * abi-dump | Helper target for `abi-check` generating API/ABI reports. Requires `abi-dump(1)`.
+
+ * @subsection buildTypesDocOnly DocOnly
+ *
+ * Special build type to avoid any requirements except those for building documentation. There are no compiler flags set
+ * since the build type does not allow building any binary output. The settings of the additional options should not be
+ * changed.
+ *
+ * Here is the list of available important targets for the `make(1)` tool:
+ *
+ * Target | Description
+ * -------------|------------------------------------------------------------------------------------------------------
+ * all | Default target, does nothing.
+ * doc | Generate HTML documentation. Requires `doxygen(1)`.
+ *
+ */