From b6dad02ff83db897a4e4bf568c3cd11fc35a055a Mon Sep 17 00:00:00 2001 From: Claude Date: Mon, 7 Sep 2026 13:46:10 +0000 Subject: [PATCH 1/2] Migrate the build system from GNU autotools to CMake Replace configure.ac, acinclude.m4, the three Makefile.am files, autogen.sh and version.c.SH with a CMake build. Every configure switch keeps an equivalent, the generated config.h is the same set of macros, and the six unit tests now run under CTest. Layout: CMakeLists.txt project version, build type, config.h, summary cmake/IrcuVersion.cmake BASE_VERSION/RELEASE/PATCHLEVEL from project() cmake/ConfigureChecks.cmake headers, functions, type sizes, va_copy, non-blocking sockets, signals, socklen_t cmake/IrcuOptions.cmake the --enable/--with switches as IRCU_* cache variables, plus event engine selection cmake/IrcuTLS.cmake openssl/gnutls/libtls/none backend detection cmake/IrcuPaths.cmake DPATH/CPATH/LPATH/SPATH with chroot rewriting cmake/config.h.cmake.in config.h template cmake/GenerateVersion.cmake the version.c.SH port cmake/*InstallHooks.cmake.in the install-exec-hook port ircd/CMakeLists.txt server, umkpasswd, convert-conf, table_gen ircd/test/CMakeLists.txt unit tests registered with CTest The build is out-of-tree only, exports compile_commands.json, and ships CMakePresets.json with default/dev/asan/release/no-tls configurations. CI now builds a matrix over the TLS backends and a debug configuration. Behaviour differences worth calling out: - Non-blocking sockets are detected by compiling the call instead of running it, so POSIX fcntl(O_NONBLOCK) is now selected where it is supported. The obsolete autoconf test depended on AC_TYPE_SIGNAL, which autoconf 2.71 removed, and had been silently falling back to ioctl(FIONBIO). - version.c is generated with file(MD5) rather than by running umkpasswd, so it no longer needs umkpasswd linked first, and is regenerated when a source changes rather than on every invocation. - The fallback include/patchlist.h is written into the build tree instead of the source tree; one written by ircd-patch still takes precedence. - -DNDEBUG is stripped from the Release build types so that assertions stay governed solely by IRCU_ENABLE_ASSERTS, as they were under configure. - Re-installing no longer risks clobbering the installed binary: a stale symlink from a previous install is removed before the new binary lands. INSTALL documents every option and carries a configure-to-cmake table. --- .dockerignore | 12 +- .github/workflows/build.yml | 37 +- .gitignore | 36 +- CMakeLists.txt | 149 ++++ CMakePresets.json | 80 ++ Dockerfile | 24 +- INSTALL | 193 ++++- INSTALL_FR | 52 +- Makefile.am | 42 - RELEASE.NOTES | 11 +- acinclude.m4 | 292 ------- autogen.sh | 6 - cmake/ConfigureChecks.cmake | 341 ++++++++ cmake/GenerateVersion.cmake | 147 ++++ cmake/InstallHooks.cmake.in | 89 ++ cmake/IrcuOptions.cmake | 213 +++++ cmake/IrcuPaths.cmake | 87 ++ cmake/IrcuTLS.cmake | 130 +++ cmake/IrcuVersion.cmake | 22 + cmake/PreInstallHooks.cmake.in | 27 + cmake/RunAndCapture.cmake | 26 + cmake/config.h.cmake.in | 262 ++++++ configure.ac | 788 ------------------ doc/example.conf | 2 +- doc/readme.chroot | 21 +- doc/readme.features | 2 +- include/patchlevel.h | 4 +- ircd/.gitignore | 13 +- ircd/CMakeLists.txt | 299 +++++++ ircd/Makefile.am | 233 ------ ircd/ircd.c | 6 +- ircd/test/CMakeLists.txt | 61 ++ ircd/test/Makefile.am | 26 - ircd/version.c.SH | 102 --- m4/ax_check_openssl.m4 | 124 --- .../pr_msgtags_compat/test_large_tag_relay.py | 2 +- 36 files changed, 2208 insertions(+), 1753 deletions(-) create mode 100644 CMakeLists.txt create mode 100644 CMakePresets.json delete mode 100644 Makefile.am delete mode 100644 acinclude.m4 delete mode 100755 autogen.sh create mode 100644 cmake/ConfigureChecks.cmake create mode 100644 cmake/GenerateVersion.cmake create mode 100644 cmake/InstallHooks.cmake.in create mode 100644 cmake/IrcuOptions.cmake create mode 100644 cmake/IrcuPaths.cmake create mode 100644 cmake/IrcuTLS.cmake create mode 100644 cmake/IrcuVersion.cmake create mode 100644 cmake/PreInstallHooks.cmake.in create mode 100644 cmake/RunAndCapture.cmake create mode 100644 cmake/config.h.cmake.in delete mode 100644 configure.ac create mode 100644 ircd/CMakeLists.txt delete mode 100644 ircd/Makefile.am create mode 100644 ircd/test/CMakeLists.txt delete mode 100644 ircd/test/Makefile.am delete mode 100644 ircd/version.c.SH delete mode 100644 m4/ax_check_openssl.m4 diff --git a/.dockerignore b/.dockerignore index 02b1819de..f5feeb416 100644 --- a/.dockerignore +++ b/.dockerignore @@ -1,9 +1,13 @@ .git +build/ +build-*/ +CMakeCache.txt +CMakeFiles/ +cmake_install.cmake +CTestTestfile.cmake +Testing/ +install_manifest.txt *.o -config.cache -config.status -config.log -stamp-h specs/ tests/__pycache__/ .claude/ diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index a33ea0a48..9f4c45efe 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -18,23 +18,46 @@ on: jobs: build: + name: ${{ matrix.tls }} / ${{ matrix.build_type }} runs-on: ubuntu-latest + + strategy: + fail-fast: false + matrix: + tls: [openssl, gnutls, none] + build_type: [RelWithDebInfo] + include: + # One debug configuration to keep DEBUGMODE compiling. + - tls: openssl + build_type: Debug + steps: - uses: actions/checkout@v4 - name: Install dependencies run: | sudo apt-get update - sudo apt-get install -y autoconf automake bison flex - - - name: Generate configure - run: ./autogen.sh + sudo apt-get install -y cmake ninja-build bison pkg-config + if [ "${{ matrix.tls }}" = "openssl" ]; then + sudo apt-get install -y libssl-dev + elif [ "${{ matrix.tls }}" = "gnutls" ]; then + sudo apt-get install -y libgnutls28-dev + fi - name: Configure - run: ./configure + run: > + cmake -B build -G Ninja + -DCMAKE_BUILD_TYPE=${{ matrix.build_type }} + -DIRCU_TLS=${{ matrix.tls }} + -DIRCU_DOMAIN=example.com + -DIRCU_ENABLE_WARNINGS=ON + ${{ matrix.build_type == 'Debug' && '-DIRCU_ENABLE_DEBUG=ON' || '' }} - name: Build - run: make -j$(nproc) + run: cmake --build build -j$(nproc) - name: Run unit tests - run: make check + run: ctest --test-dir build --output-on-failure + + - name: Smoke-test the server binary + run: ./build/ircd/ircd -v diff --git a/.gitignore b/.gitignore index e5b2ae5cf..c1615415b 100644 --- a/.gitignore +++ b/.gitignore @@ -1,33 +1,19 @@ -# Autotools generated files -/configure -/aclocal.m4 -/config.h.in -/config.guess -/config.sub -/install-sh -/missing -/depcomp -/compile -/ylwrap -/test-driver -/stamp-h.in -/autom4te.cache/ -/config.h -/config.log -/config.status -/config.cache -/stamp-h -/stamp-h1 - -# Generated Makefile.in (automake output) and Makefile (configure output) -Makefile.in -Makefile +# CMake build trees +/build/ +/build-*/ +CMakeCache.txt +CMakeFiles/ +CMakeUserPresets.json +cmake_install.cmake +CTestTestfile.cmake +Testing/ +compile_commands.json +install_manifest.txt # Editor/tool backup files *~ # Build artifacts -.deps/ .project ircu.tags **/__pycache__ diff --git a/CMakeLists.txt b/CMakeLists.txt new file mode 100644 index 000000000..526429427 --- /dev/null +++ b/CMakeLists.txt @@ -0,0 +1,149 @@ +# +# IRC - Internet Relay Chat, CMakeLists.txt +# +# Top-level build definition for ircu2. This replaces the historical +# GNU autotools (configure.ac / Makefile.am) build. +# +# Quick start: +# cmake -B build -DIRCU_DOMAIN=example.com +# cmake --build build -j +# ctest --test-dir build +# cmake --install build +# +# Every historical `configure` switch has an IRCU_* cache variable +# counterpart; see cmake/IrcuOptions.cmake and INSTALL. +# + +cmake_minimum_required(VERSION 3.16) + +# The version here is the single source of truth for the whole tree; the +# BASE_VERSION / MAJOR_PROTOCOL / RELEASE / PATCHLEVEL macros consumed by the +# server are derived from it in cmake/IrcuVersion.cmake. +project(ircu2 + VERSION 10.12.19 + DESCRIPTION "Undernet IRC server (ircu)" + HOMEPAGE_URL "https://github.com/UndernetIRC/ircu2" + LANGUAGES C) + +list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake") + +# --------------------------------------------------------------------------- +# Guard against in-source builds. The autotools build tolerated them, but a +# stray CMakeCache.txt in the source tree breaks every later out-of-tree build. +# --------------------------------------------------------------------------- +if(CMAKE_SOURCE_DIR STREQUAL CMAKE_BINARY_DIR) + message(FATAL_ERROR + "In-source builds are not supported. Run cmake from a separate directory, " + "e.g. `cmake -B build`. Remove the CMakeCache.txt and CMakeFiles/ that " + "this attempt just created in the source tree.") +endif() + +# --------------------------------------------------------------------------- +# Language level and default build type +# --------------------------------------------------------------------------- +set(CMAKE_C_STANDARD 99) +set(CMAKE_C_STANDARD_REQUIRED ON) +set(CMAKE_C_EXTENSIONS ON) + +# Match `configure`'s default of -g -O2 when the user picks nothing. +if(NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES) + set(CMAKE_BUILD_TYPE RelWithDebInfo CACHE STRING + "Build type (Debug, Release, RelWithDebInfo, MinSizeRel)" FORCE) + set_property(CACHE CMAKE_BUILD_TYPE PROPERTY STRINGS + Debug Release RelWithDebInfo MinSizeRel) +endif() + +# ircu decides assertions itself, through IRCU_ENABLE_ASSERTS -> NDEBUG in +# config.h. CMake's Release-flavoured build types add -DNDEBUG of their own, +# which would silently override that switch (and strip the assertions out of +# the unit tests, which never include config.h), so take it back out. +foreach(_cfg RELEASE RELWITHDEBINFO MINSIZEREL) + string(REPLACE "-DNDEBUG" "" CMAKE_C_FLAGS_${_cfg} "${CMAKE_C_FLAGS_${_cfg}}") + string(STRIP "${CMAKE_C_FLAGS_${_cfg}}" CMAKE_C_FLAGS_${_cfg}) +endforeach() + +# ircu historically installs under $HOME, not /usr/local. Honour that when +# the user has not asked for a prefix of their own. +if(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT) + if(DEFINED ENV{HOME} AND NOT "$ENV{HOME}" STREQUAL "") + set(CMAKE_INSTALL_PREFIX "$ENV{HOME}" CACHE PATH + "Installation prefix" FORCE) + endif() +endif() + +# Emit compile_commands.json so clangd, ccls and the editors built on them +# work in this tree without extra setup. +set(CMAKE_EXPORT_COMPILE_COMMANDS ON) + +include(GNUInstallDirs) + +include(IrcuVersion) +include(ConfigureChecks) # probe the system: headers, types, functions +include(IrcuOptions) # user-facing knobs (the old --enable/--with flags) +include(IrcuTLS) # pick and locate the TLS backend +include(IrcuPaths) # DPATH/CPATH/LPATH/SPATH, honouring --with-chroot + +# --------------------------------------------------------------------------- +# config.h +# --------------------------------------------------------------------------- +configure_file(cmake/config.h.cmake.in "${PROJECT_BINARY_DIR}/config.h" @ONLY) + +# Everything compiled here sees the generated config.h and the public headers. +add_library(ircu_config INTERFACE) +target_include_directories(ircu_config INTERFACE + "${PROJECT_BINARY_DIR}" + "${PROJECT_SOURCE_DIR}/include") +target_compile_definitions(ircu_config INTERFACE IRCU2_BUILD) + +if(IRCU_ENABLE_WARNINGS) + target_compile_options(ircu_config INTERFACE -Wall) +endif() +if(IRCU_ENABLE_PEDANTIC) + target_compile_options(ircu_config INTERFACE -pedantic) +endif() +if(IRCU_ENABLE_PROFILE) + target_compile_options(ircu_config INTERFACE -pg) + target_link_options(ircu_config INTERFACE -pg) +endif() +if(IRCU_LEAK_DETECT) + target_compile_definitions(ircu_config INTERFACE MDEBUG) + target_link_libraries(ircu_config INTERFACE gc) + if(NOT IRCU_LEAK_DETECT STREQUAL "yes") + target_link_directories(ircu_config INTERFACE "${IRCU_LEAK_DETECT}") + endif() +endif() + +enable_testing() + +add_subdirectory(ircd) +add_subdirectory(ircd/test) + +# --------------------------------------------------------------------------- +# Configuration summary +# --------------------------------------------------------------------------- +message(STATUS "") +message(STATUS "ircu is now hopefully configured for your system.") +message(STATUS "") +message(STATUS " Host system: ${CMAKE_SYSTEM_NAME} ${CMAKE_SYSTEM_PROCESSOR}") +message(STATUS " Prefix: ${CMAKE_INSTALL_PREFIX}") +message(STATUS " Build type: ${CMAKE_BUILD_TYPE}") +message(STATUS " Asserts: ${IRCU_ENABLE_ASSERTS}") +message(STATUS " Warnings: ${IRCU_ENABLE_WARNINGS}") +message(STATUS " Debug: ${IRCU_ENABLE_DEBUG}") +message(STATUS " Profile: ${IRCU_ENABLE_PROFILE}") +message(STATUS " Owner/mode: ${IRCU_OWNER}.${IRCU_GROUP} (${IRCU_MODE})") +message(STATUS " Chroot: ${IRCU_CHROOT}") +message(STATUS "") +message(STATUS " Domain: ${IRCU_DOMAIN}") +message(STATUS " DPath: ${IRCU_DPATH}") +message(STATUS " CPath: ${IRCU_CPATH}") +message(STATUS " LPath: ${IRCU_LPATH}") +message(STATUS " Maximum connections: ${IRCU_MAXCON}") +message(STATUS " TLS implementation: ${IRCU_TLS}") +message(STATUS " IPv6: ${IRCU_ENABLE_IPV6}") +message(STATUS "") +message(STATUS " poll() engine: ${IRCU_ENABLE_POLL}") +message(STATUS " kqueue() engine: ${IRCU_ENABLE_KQUEUE}") +message(STATUS " /dev/poll engine: ${IRCU_ENABLE_DEVPOLL}") +message(STATUS " epoll() engine: ${IRCU_ENABLE_EPOLL}") +message(STATUS "") diff --git a/CMakePresets.json b/CMakePresets.json new file mode 100644 index 000000000..485dafd88 --- /dev/null +++ b/CMakePresets.json @@ -0,0 +1,80 @@ +{ + "version": 3, + "cmakeMinimumRequired": { "major": 3, "minor": 21, "patch": 0 }, + "configurePresets": [ + { + "name": "base", + "hidden": true, + "binaryDir": "${sourceDir}/build/${presetName}", + "cacheVariables": { + "CMAKE_EXPORT_COMPILE_COMMANDS": "ON" + } + }, + { + "name": "default", + "inherits": "base", + "displayName": "Default (RelWithDebInfo, autodetected TLS)", + "description": "What you get from a plain `cmake -B build`.", + "cacheVariables": { + "CMAKE_BUILD_TYPE": "RelWithDebInfo" + } + }, + { + "name": "dev", + "inherits": "base", + "displayName": "Development (debug build, warnings on)", + "description": "Unoptimised, DEBUGMODE compiled in, -Wall.", + "cacheVariables": { + "CMAKE_BUILD_TYPE": "Debug", + "IRCU_ENABLE_DEBUG": "ON", + "IRCU_ENABLE_WARNINGS": "ON" + } + }, + { + "name": "asan", + "inherits": "dev", + "displayName": "Development with AddressSanitizer", + "cacheVariables": { + "CMAKE_C_FLAGS": "-fsanitize=address,undefined -fno-omit-frame-pointer", + "CMAKE_EXE_LINKER_FLAGS": "-fsanitize=address,undefined" + } + }, + { + "name": "release", + "inherits": "base", + "displayName": "Release (optimised, assertions off)", + "cacheVariables": { + "CMAKE_BUILD_TYPE": "Release", + "IRCU_ENABLE_ASSERTS": "OFF" + } + }, + { + "name": "no-tls", + "inherits": "base", + "displayName": "No TLS backend", + "cacheVariables": { + "CMAKE_BUILD_TYPE": "RelWithDebInfo", + "IRCU_TLS": "none" + } + } + ], + "buildPresets": [ + { "name": "default", "configurePreset": "default" }, + { "name": "dev", "configurePreset": "dev" }, + { "name": "asan", "configurePreset": "asan" }, + { "name": "release", "configurePreset": "release" }, + { "name": "no-tls", "configurePreset": "no-tls" } + ], + "testPresets": [ + { + "name": "base", + "hidden": true, + "output": { "outputOnFailure": true } + }, + { "name": "default", "inherits": "base", "configurePreset": "default" }, + { "name": "dev", "inherits": "base", "configurePreset": "dev" }, + { "name": "asan", "inherits": "base", "configurePreset": "asan" }, + { "name": "release", "inherits": "base", "configurePreset": "release" }, + { "name": "no-tls", "inherits": "base", "configurePreset": "no-tls" } + ] +} diff --git a/Dockerfile b/Dockerfile index e1f6105e6..dc9dcfed4 100644 --- a/Dockerfile +++ b/Dockerfile @@ -20,11 +20,8 @@ ARG SANITIZE= RUN apt-get update && apt-get install -y --no-install-recommends \ gcc \ make \ + cmake \ bison \ - flex \ - autoconf \ - automake \ - autoconf-archive \ libc6-dev \ pkg-config \ $(if [ "$TLS_BACKEND" = "openssl" ]; then echo libssl-dev; \ @@ -36,16 +33,21 @@ RUN apt-get update && apt-get install -y --no-install-recommends \ WORKDIR /build/ircu2 COPY . . -# Remove any host-compiled binaries (e.g., macOS Mach-O) so make rebuilds for Linux -RUN find . -name '*.o' -delete && rm -f ircd/ircd +# Drop any host-compiled leftovers (e.g. a macOS build tree) so the build here +# starts from scratch for Linux. +RUN rm -rf build && find . -name '*.o' -delete -RUN ./autogen.sh \ - && if [ -n "$SANITIZE" ]; then \ +RUN if [ -n "$SANITIZE" ]; then \ export CFLAGS="-fsanitize=$SANITIZE -fno-omit-frame-pointer -g -O1"; \ export LDFLAGS="-fsanitize=$SANITIZE"; \ fi; \ - ./configure --prefix=/opt/ircu --with-maxcon=256 --enable-debug --with-tls=${TLS_BACKEND} \ - && make + cmake -B build \ + -DCMAKE_INSTALL_PREFIX=/opt/ircu \ + -DIRCU_MAXCON=256 \ + -DIRCU_ENABLE_DEBUG=ON \ + -DIRCU_TLS=${TLS_BACKEND} \ + -DIRCU_DOMAIN=example.com \ + && cmake --build build -j"$(nproc)" # --------------------------------------------------------------------------- # Stage: build the current Undernet production release from GitHub @@ -134,5 +136,5 @@ RUN chown ircu:ircu /opt/ircu/bin/ircd # Final: working-tree binary (default target — must stay last) # --------------------------------------------------------------------------- FROM runtime-base AS runtime-tree -COPY --from=builder-tree /build/ircu2/ircd/ircd /opt/ircu/bin/ircd +COPY --from=builder-tree /build/ircu2/build/ircd/ircd /opt/ircu/bin/ircd RUN chown ircu:ircu /opt/ircu/bin/ircd diff --git a/INSTALL b/INSTALL index 41b6e815f..9a59b38a8 100644 --- a/INSTALL +++ b/INSTALL @@ -2,60 +2,171 @@ ircu - INSTALL Original by Run , Isomer , and Kev - Rewritten by Sengaia + Rewritten by Sengaia Updated by Entrope -Compiling and installing ircu should be a fairly straightforward process, -if you have obtained this software as a (.tar.gz) package, please consider -using CVS (described below). Using CVS will make updating your installation -much easier. +ircu is built with CMake. If you are used to the old "./configure && make" +sequence, see the "Coming from autotools" section at the end for the option +names that replaced each configure switch. -After obtaining the latest version of the ircu source code, change into the -source directory (ircu2.10.xx.yy), and run "./configure". To see the various -ways in which you can customize your installation, run "./configure --help". -The configure process will check your environment and prepare itself for -compiling the source code. If one or more of the prerequisites cannot be -found, configure will terminate with an error. You will need to resolve -this and run configure again. +REQUIREMENTS -If configure runs without error(s), you are ready to compile. To compile ircu, -run "make". Please use GNU make and gcc. If the source code does not compile, -make sure your environment is setup correctly. If you are convinced the source -of the failure is ircu, gather all relevant information about your system such -as the Architecture, OS version, the configure statement you used, etc. and -contact coder-com@undernet.org. + - CMake 3.16 or newer + - A C99 compiler (gcc or clang) + - GNU make or Ninja + - bison (or a yacc that understands -d), for the configuration file parser + - Optionally, development headers for one TLS library: OpenSSL, GnuTLS or + LibreSSL's libtls -Once ircu is compiled, install it by running "make install". + On Debian or Ubuntu: + apt-get install cmake bison pkg-config libssl-dev -Next, you will have to configure your IRC server by setting up your ircd.conf -file. Use the included doc/example.conf as a starting point; it is installed -in $HOME/lib/example.conf by default. -Setting up ircd.conf can be a bit tricky, so if this is your first time doing -it, begin with a bare-bones configuration and extend it as you go. + On Red Hat or Fedora: + dnf install cmake bison pkgconf openssl-devel -If you are upgrading from ircu2.10.11, use the ircd/convert-conf -program to convert your existing configuration file(s). It is -compiled during "make" and installed to $PREFIX/bin/convert-conf. + On FreeBSD: + pkg install cmake bison -Good Luck! -RETRIEVING IRCU VIA CVS +BUILDING + +Configure a build directory, build it, and run the unit tests: + + cmake -B build + cmake --build build -j + ctest --test-dir build + +CMake never writes into the source tree, so the build directory can be thrown +away and recreated at any time, and several of them can coexist: + + cmake -B build-debug -DCMAKE_BUILD_TYPE=Debug -DIRCU_ENABLE_DEBUG=ON + cmake -B build-gnutls -DIRCU_TLS=gnutls + +To see every option with its current value: + + cmake -B build -LH + +CMakePresets.json ships a few ready-made configurations (CMake 3.21+): + + cmake --list-presets + cmake --preset dev # debug build, DEBUGMODE, -Wall + cmake --build --preset dev + ctest --preset dev + +Then install: + + cmake --install build -The recommended way to get the ircu package now is to use CVS. CVS makes -upgrades a lot less painful and lets you get the latest package. +The default installation prefix is your home directory, as it has always been +for ircu; pass -DCMAKE_INSTALL_PREFIX=/some/where to change it. -The first thing you need to do is login to the cvs server: -# cvs -d :pserver:anonymous@cvs.undernet.org:/cvsroot/undernet-ircu login -(we recommend that you cut and paste the above line to use it :) -When it prompts you for a password hit enter since there isn't one. +CONFIGURATION OPTIONS -To check out the the last development version of ircu, use: -# cvs -d :pserver:anonymous@cvs.undernet.org:/cvsroot/undernet-ircu co -P ircu2.10 -The latest stable version has a tag name that depends on the version -number; see doc/readme.cvs for details. +Pass these to the first `cmake -B build` invocation as -DNAME=VALUE. They are +remembered in the build directory, so later builds do not need to repeat them. + + Paths and identity + CMAKE_INSTALL_PREFIX Installation prefix (default: $HOME) + IRCU_DOMAIN Domain name used in local statistics gathering. + Guessed from /etc/resolv.conf; required if that + fails. + IRCU_DPATH Directory for all server data files + (default: /lib) + IRCU_CPATH Default configuration file (default: ircd.conf) + IRCU_LPATH Default debugging log file (default: ircd.log) + IRCU_CHROOT Directory the server will be chrooted into; every + compiled-in path is rewritten relative to it. + See doc/readme.chroot. + + Installed binary + IRCU_SYMLINK Name of the symlink placed next to the timestamped + binary; "no" installs a plain `ircd` instead + (default: ircd) + IRCU_MODE Octal permissions for the binary (default: 711) + IRCU_OWNER Owner of the installed binary (default: you) + IRCU_GROUP Group of the installed binary (default: your group) + + Features + IRCU_TLS TLS backend: auto, none, openssl, gnutls or libtls + (default: auto, which prefers OpenSSL) + IRCU_ENABLE_IPV6 IPv6 support (default: on where available) + IRCU_MAXCON Maximum number of connections (default: 16384) + IRCU_ENABLE_DEBUG Compile the debugging code (default: off) + IRCU_ENABLE_ASSERTS Assertion checking (default: on) + IRCU_ENABLE_INLINES Inline a few critical functions (default: on) + IRCU_ENABLE_WARNINGS Compile with -Wall (default: off) + IRCU_ENABLE_PEDANTIC Compile with -pedantic (default: off) + IRCU_ENABLE_PROFILE Build for gprof, with -pg (default: off) + IRCU_LEAK_DETECT Link against a patched Boehm GC: "yes", or the + directory holding it (default: off) + + Event engines + IRCU_ENABLE_POLL poll() engine (default: on where it is a real + system call) + IRCU_ENABLE_EPOLL epoll() engine, Linux (default: on if available) + IRCU_ENABLE_KQUEUE kqueue() engine, BSD (default: on if available) + IRCU_ENABLE_DEVPOLL /dev/poll engine, Solaris (default: on if + available) + + CMAKE_BUILD_TYPE selects the optimisation level: Debug (-g), Release (-O3), + RelWithDebInfo (-O2 -g, the default) or MinSizeRel. It does not affect + assertions; use IRCU_ENABLE_ASSERTS for those. + + +AFTER INSTALLING + +Configure your server by setting up its ircd.conf. doc/example.conf is a +starting point and gets installed into the data directory for you. Setting up +ircd.conf can be a bit tricky, so if this is your first time doing it, begin +with a bare-bones configuration and extend it as you go. + +If you are upgrading from ircu2.10.11, use the convert-conf program to convert +your existing configuration file(s). It is built alongside the server and +installed next to it. + +Good Luck! -To update your source tree to the latest version, run "cvs update -dP" from within the -ircu2.10 directory. For more information, see http://coder-com.undernet.org. +COMING FROM AUTOTOOLS + + ./configure --enable-poll -DIRCU_ENABLE_POLL=ON + ./configure --enable-debug -DIRCU_ENABLE_DEBUG=ON + ./configure --disable-asserts -DIRCU_ENABLE_ASSERTS=OFF + ./configure --enable-profile -DIRCU_ENABLE_PROFILE=ON + ./configure --enable-pedantic -DIRCU_ENABLE_PEDANTIC=ON + ./configure --enable-warnings -DIRCU_ENABLE_WARNINGS=ON + ./configure --disable-inlines -DIRCU_ENABLE_INLINES=OFF + ./configure --disable-devpoll -DIRCU_ENABLE_DEVPOLL=OFF + ./configure --disable-kqueue -DIRCU_ENABLE_KQUEUE=OFF + ./configure --disable-epoll -DIRCU_ENABLE_EPOLL=OFF + ./configure --without-ipv6 -DIRCU_ENABLE_IPV6=OFF + ./configure --with-leak-detect[=dir] -DIRCU_LEAK_DETECT=yes (or =dir) + ./configure --with-symlink=name -DIRCU_SYMLINK=name + ./configure --with-mode=711 -DIRCU_MODE=711 + ./configure --with-owner=user -DIRCU_OWNER=user + ./configure --with-group=group -DIRCU_GROUP=group + ./configure --with-domain=example.com -DIRCU_DOMAIN=example.com + ./configure --with-chroot=/chroot -DIRCU_CHROOT=/chroot + ./configure --with-dpath=dir -DIRCU_DPATH=dir + ./configure --with-cpath=ircd.conf -DIRCU_CPATH=ircd.conf + ./configure --with-lpath=ircd.log -DIRCU_LPATH=ircd.log + ./configure --with-maxcon=16384 -DIRCU_MAXCON=16384 + ./configure --with-tls=openssl -DIRCU_TLS=openssl + ./configure --prefix=/some/where -DCMAKE_INSTALL_PREFIX=/some/where + + make cmake --build build + make check ctest --test-dir build + make install cmake --install build + make clean cmake --build build --target clean + ./autogen.sh (no longer needed) + +Two build steps changed shape in the move: + + - ircd/version.c is generated by cmake/GenerateVersion.cmake instead of + ircd/version.c.SH, and no longer needs umkpasswd to be linked first. + - Non-blocking sockets are now detected by compiling the call rather than by + running it, so this build correctly selects the POSIX flavour + (fcntl(O_NONBLOCK)) on systems that support it. The obsolete autoconf + test had silently fallen back to the SysV flavour (ioctl(FIONBIO)). diff --git a/INSTALL_FR b/INSTALL_FR index d29054c09..d8e5189e9 100644 --- a/INSTALL_FR +++ b/INSTALL_FR @@ -9,9 +9,9 @@ voici: 1) Déballer le module. 2) cd dans le répertoire. -3) `./configure' -4) `make config' -5) `make install' +3) `cmake -B build' +4) `cmake --build build' +5) `cmake --install build' 1) Déballer le module. ==================== @@ -101,25 +101,31 @@ ou ircu2.10 si vous utilis Là où "ircu2.x.y.z" est le nom du répertoire dézippé. -3) "./configure" -================= +3) "cmake -B build" +=================== -Ceci produira le 'config/setup.h', votre configuration dépend du -système d'exploitation. +Ceci examine votre système d'exploitation et produit le 'config.h' ainsi +que les fichiers de compilation, le tout dans le répertoire "build". Le +répertoire des sources n'est jamais modifié: vous pouvez effacer "build" +et recommencer à tout moment, ou garder plusieurs répertoires de +compilation en parallèle. + +Il vous faut CMake 3.16 ou plus récent, un compilateur C99, et bison. + +Les options se passent avec -DNOM=VALEUR, par exemple: -Si ceci produit un message une erreur tel que "Permission Denied", -alors essai avec "chmod a+x ./configure" pour avoir la permission -d'excuter le fichier. +cmake -B build -DIRCU_TLS=openssl -DIRCU_ENABLE_DEBUG=ON -Pour plus d'information sur la commande configure, tapez "./configure ---help". +Pour voir toutes les options avec leur valeur actuelle, tapez "cmake -B +build -LH". La liste complète, et la correspondance avec les anciennes +options de "./configure", se trouvent dans le fichier INSTALL. -4) "make" -========= +4) "cmake --build build" +======================== Tapez: -make +cmake --build build dans le répertoire de base. Il devrait compiler sans erreurs ou avertissements. Veuillez expédier n'importe quel problème aux @@ -128,12 +134,16 @@ pas une erreur de vous-m d'exploitation soit supporté dans de futures versions, faite une connexion qui fixe réellement le problème. -5) "make install" -================= +Pour exécuter les tests unitaires: -Type: +ctest --test-dir build + +5) "cmake --install build" +========================== + +Tapez: -make install +cmake --install build Ceci devrait installer l'ircd et la dir man. Veuillez revérifier les permissions du binaire. @@ -154,8 +164,8 @@ un cerveau-mort /bin/sh pose le probl d'installer le "bash" et de l'utiliser comme (as sh - > bash). En conclusion, tout autre problèmes de compilent devrait être résolu quand vous installez le GCC. Si vous avez des problemes avec le -startage du ircd, executer "./configure" encore et mettez la commande -"--enable-debug". Recompiler l'ircd, et executer-le avec: +startage du ircd, executer "cmake -B build -DIRCU_ENABLE_DEBUG=ON" +encore. Recompiler l'ircd, et executer-le avec: ircd -t -x9 diff --git a/Makefile.am b/Makefile.am deleted file mode 100644 index 9806255fd..000000000 --- a/Makefile.am +++ /dev/null @@ -1,42 +0,0 @@ -SUBDIRS = ircd ircd/test - -ACLOCAL_AMFLAGS = -I m4 - -distdir = $(PACKAGE).$(VERSION) - -MAINTAINERCLEANFILES = \ - configure \ - aclocal.m4 \ - config.h.in \ - config.h.in~ \ - config.guess \ - config.sub \ - configure~ \ - install-sh \ - missing \ - depcomp \ - compile \ - ylwrap \ - test-driver \ - Makefile.in \ - ircd/Makefile.in \ - ircd/test/Makefile.in - -EXTRA_DIST = \ - acinclude.m4 \ - doc \ - include \ - patches \ - tests \ - tools \ - ircd-patch \ - INSTALL \ - INSTALL_FR \ - LICENSE \ - RELEASE.NOTES \ - ChangeLog.11 \ - ChangeLog.12 \ - Doxyfile - -dist-hook: - rm -rf `find $(distdir) -name __pycache__ -o -name .pytest_cache` diff --git a/RELEASE.NOTES b/RELEASE.NOTES index 47106bd16..38ee52015 100644 --- a/RELEASE.NOTES +++ b/RELEASE.NOTES @@ -128,9 +128,9 @@ Deleted feature since it no longer applies: HIS_STATS_h. Compile Time Options: A listing of supported compile-time options may be seen by running -"./configure --help". The defaults should be sane. In particular, -you should NOT compile with --enable-debug or with --disable-symbols -on a production network. +"cmake -B build -LH", and is documented in INSTALL. The defaults +should be sane. In particular, you should NOT compile with +-DIRCU_ENABLE_DEBUG=ON on a production network. Otherwise Undocumented Features: @@ -138,8 +138,9 @@ Despite our preferences to keep these undocumented, they are occasionally useful, and are described here for users who may need them. -To enable these, you need to add them to CFLAGS prior to running -./configure, usually as in: CFLAGS="-O2 -D