Skip to content

Commit

Permalink
Build: Promote gnutls to a required build dependency.
Browse files Browse the repository at this point in the history
This is necessary because we are going to use it for its hashing
functions.  With this done, a lot of the complication in configure.ac
can also go away because we can just require the header file and check
pkgconfig for the library.

And then with that done, there's no real advantage to having
BUILD_REMOTE anymore - we always have gnutls, so we don't need to
conditionalize that build feature.
  • Loading branch information
clumens committed May 28, 2024
1 parent 09672d4 commit 56c9051
Show file tree
Hide file tree
Showing 7 changed files with 9 additions and 41 deletions.
2 changes: 1 addition & 1 deletion INSTALL.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
| 3.4 or later | python3 | python3 | python3 |
| 0.18 or later | gettext-devel | gettext-tools | gettext |
| 0.18 or later | | | autopoint |
| 2.12.0 or later | gnutls-devel | libgnutls-devel | libgnutls-dev |

Also:
* make must be GNU (or compatible) (setting MAKE=gmake might also work but is
Expand All @@ -41,7 +42,6 @@ Also:

| Feature Enabled | Version | Fedora-based | Suse-based | Debian-based |
|:-----------------------------------------------:|:--------------:|:-----------------------:|:-----------------------:|:-----------------------:|
| Pacemaker Remote and encrypted remote CIB admin | 2.12.0 or later| gnutls-devel | libgnutls-devel | libgnutls-dev |
| encrypted remote CIB admin | | pam-devel | pam-devel | libpam0g-dev |
| interactive crm_mon | | ncurses-devel | ncurses-devel | ncurses-dev |
| systemd support | | systemd-devel | systemd-devel | libsystemd-dev |
Expand Down
31 changes: 3 additions & 28 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -329,13 +329,6 @@ AC_ARG_WITH([cibsecrets],
yes_no_try "$with_cibsecrets" "no"
with_cibsecrets=$?

AC_ARG_WITH([gnutls],
[AS_HELP_STRING([--with-gnutls],
[support Pacemaker Remote and remote-tls-port using GnuTLS @<:@try@:>@])]
)
yes_no_try "$with_gnutls" "try"
with_gnutls=$?

PCMK_GNUTLS_PRIORITIES="NORMAL"
AC_ARG_WITH([gnutls-priorities],
[AS_HELP_STRING([--with-gnutls-priorities],
Expand Down Expand Up @@ -1678,27 +1671,9 @@ dnl ========================================================================
dnl GnuTLS
dnl ========================================================================

dnl Require GnuTLS >=2.12.0 (2011-03) for Pacemaker Remote support
PC_NAME_GNUTLS=""
AS_CASE([$with_gnutls],
[$REQUIRED], [
REQUIRE_LIB([gnutls], [gnutls_sec_param_to_pk_bits])
REQUIRE_HEADER([gnutls/gnutls.h])
],
[$OPTIONAL], [
AC_CHECK_LIB([gnutls], [gnutls_sec_param_to_pk_bits],
[], [with_gnutls=$DISABLED])
AC_CHECK_HEADERS([gnutls/gnutls.h], [], [with_gnutls=$DISABLED])
]
)
AS_IF([test $with_gnutls -ne $DISABLED],
[
PC_NAME_GNUTLS="gnutls"
PCMK_FEATURES="$PCMK_FEATURES remote"
]
)
AC_SUBST([PC_NAME_GNUTLS])
AM_CONDITIONAL([BUILD_REMOTE], [test $with_gnutls -ne $DISABLED])
PKG_CHECK_MODULES(GNUTLS, [gnutls >= 2.12.0],
[CPPFLAGS="${CPPFLAGS} ${GNUTLS_CFLAGS}"
LIBS="${LIBS} ${GNUTLS_LIBS}"])

# --- ASAN/UBSAN/TSAN (see man gcc) ---
# when using SANitizers, we need to pass the -fsanitize..
Expand Down
8 changes: 1 addition & 7 deletions daemons/execd/Makefile.am
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#
# Copyright 2012-2023 the Pacemaker project contributors
# Copyright 2012-2024 the Pacemaker project contributors
#
# The version control history for this file may have further details.
#
Expand Down Expand Up @@ -27,7 +27,6 @@ pacemaker_execd_SOURCES = pacemaker-execd.c \
execd_commands.c \
execd_alerts.c

if BUILD_REMOTE
sbin_PROGRAMS = pacemaker-remoted
if BUILD_SYSTEMD
systemdsystemunit_DATA = pacemaker_remote.service
Expand All @@ -52,7 +51,6 @@ pacemaker_remoted_SOURCES = $(pacemaker_execd_SOURCES) \
remoted_pidone.c \
remoted_proxy.c \
remoted_schemas.c
endif

cts_exec_helper_LDADD = $(top_builddir)/lib/pengine/libpe_status.la
cts_exec_helper_LDADD += $(top_builddir)/lib/cib/libcib.la
Expand All @@ -73,15 +71,11 @@ install-exec-hook:
if BUILD_LEGACY_LINKS
cd $(DESTDIR)$(CRM_DAEMON_DIR) && rm -f lrmd && $(LN_S) pacemaker-execd lrmd
endif
if BUILD_REMOTE
cd $(DESTDIR)$(sbindir) && rm -f pacemaker_remoted && $(LN_S) pacemaker-remoted pacemaker_remoted
endif

.PHONY: uninstall-hook
uninstall-hook:
if BUILD_LEGACY_LINKS
cd $(DESTDIR)$(CRM_DAEMON_DIR) && rm -f lrmd
endif
if BUILD_REMOTE
cd $(DESTDIR)$(sbindir) && rm -f pacemaker_remoted
endif
2 changes: 1 addition & 1 deletion lib/pacemaker-cib.pc.in
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ URL: @PACKAGE_URL@
Version: @PACKAGE_VERSION@
Description: Configuration Information Base (CIB) APIs for Pacemaker
Requires: pacemaker-pe_rules pacemaker
Requires.private: glib-2.0 libxml-2.0 @PC_NAME_GNUTLS@
Requires.private: glib-2.0 libxml-2.0 gnutls
Conflicts:
Cflags: -I${includedir}
Libs: -L${libdir} -l${sub}
Expand Down
2 changes: 1 addition & 1 deletion lib/pacemaker-lrmd.pc.in
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ URL: @PACKAGE_URL@
Version: @PACKAGE_VERSION@
Description: Executor APIs for Pacemaker
Requires: pacemaker-fencing pacemaker-service pacemaker
Requires.private: glib-2.0 libxml-2.0 @PC_NAME_GNUTLS@
Requires.private: glib-2.0 libxml-2.0 gnutls
Conflicts:
Cflags: -I${includedir}
Libs: -L${libdir} -l${sub}
Expand Down
2 changes: 1 addition & 1 deletion lib/pacemaker.pc.in
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ Version: @PACKAGE_VERSION@
Description: Low-level common APIs for Pacemaker
# Some pacemaker APIs are extensions to libqb APIs
Requires: libqb
Requires.private: glib-2.0 libxslt libxml-2.0 uuid @PC_NAME_GNUTLS@
Requires.private: glib-2.0 libxslt libxml-2.0 uuid gnutls
Conflicts:
Cflags: -I${includedir}
Libs: -L${libdir} -l${sub}
Expand Down
3 changes: 1 addition & 2 deletions python/pacemaker/buildoptions.py.in
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,7 @@ class BuildOptions:
RSC_TMP_DIR = "@CRM_RSCTMP_DIR@"
"""Where resource agents should keep state files."""

# pylint: disable=comparison-of-constants
REMOTE_ENABLED = "@PC_NAME_GNUTLS@" != ""
REMOTE_ENABLED = True
"""True if Pacemaker Remote support is enabled."""

SBIN_DIR = "@sbindir@"
Expand Down

0 comments on commit 56c9051

Please sign in to comment.