• Johannes Truschnigg's avatar
    Auto-detect and link libsystemd at compile-time · 129d14e1
    Johannes Truschnigg authored
    This adds Makefile/build-system support for USE_SYSTEMD=(yes|no|*). This
    variable's value determines whether or not libsystemd will be linked at
    build-time.
    
    If USE_SYSTEMD is set to "yes", make will use PKG_CONFIG to check for
    libsystemd's presence, and fail the build early if it isn't
    installed/detected properly.
    
    If USE_SYSTEM is set to "no", libsystemd will *not* be linked, even if
    support for it is available on the system redis is being built on.
    
    For any other value that USE_SYSTEM might assume (e.g. "auto"),
    PKG_CONFIG will try to determine libsystemd's presence, and set up the
    build process to link against it, if it was indicated as being
    installed/available.
    
    This approach has a number of repercussions of its own, most importantly
    the following: If you build redis on a system that actually has systemd
    support, but no libsystemd-dev package(s) installed, you'll end up
    *without* support for systemd notification/status reporting support in
    redis-server. This changes established runtime behaviour.
    
    I'm not sure if the build system and/or the server binary should
    indicate this. I'm also wondering if not actually having
    systemd-notify-support, but requesting it via the server's config,
    should result in a fatal error now.
    129d14e1
Makefile 10.7 KB