Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
build: use pkg-config way to detect and use pacemaker header files
If pacemaker is built/installed in non-standard location, the current
checks and includes will fail.

Also, pay the respective attention to .travis.yml.

Signed-off-by: Fabio M. Di Nitto <fdinitto@redhat.com>
Signed-off-by: Jan Pokorný <jpokorny@redhat.com>
Reviewed-by: Jan Pokorný <jpokorny@redhat.com>
Signed-off-by: Jan Pokorný <jpokorny@redhat.com>
  • Loading branch information
fabbione authored and jfriesse committed May 4, 2020
1 parent 5d837d2 commit 4205de0
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 9 deletions.
12 changes: 9 additions & 3 deletions .travis.yml
Expand Up @@ -3,8 +3,8 @@
# https://github.com/travis-ci/apt-package-whitelist/issues/2936
# - libsystemd-daemon-dev (libsystemd-dev)
# https://github.com/travis-ci/apt-package-whitelist/issues/2449
# - no equivalent of "libcrmcluster4-dev" (trusty) for precise,
# but can be worked around with something like (or local dir + CPPFLAGS):
# - likewise, lack of pacemaker packages (sources contain setuid et al.,
# can be worked around with something like (or local dir + CPPFLAGS):
# GHREPO=ClusterLabs/pacemaker INCLFILE=crm/services.h curl --create-dirs \
# -o "/usr/include/pacemaker/${INCLFILE}" \
# "https://raw.githubusercontent.com/${GHREPO}/master/include/${INCLFILE}"
Expand All @@ -29,7 +29,13 @@ before_install:
# spurious test suite failure) so do that manually as a workaround
- sudo ip addr add 127.0.1.1/8 scope host dev lo
- sudo apt-get update -qq
- sudo apt-get install -qq -y libglib2.0-dev libcrmcluster4-dev
- sudo apt-get install -qq -y libglib2.0-dev libcrmservice1-dev
# sadly, the newest supported at the moment Ubuntu is "Trusty"
# that carries backdated 1.1.10+git20130802-1ubuntu2.5 pacemaker,
# moreover with broken split of files on packaging level (or was it
# due to inherently inseparable cross-dependencies between headers?),
# hence the following is needed as well (will go away, eventually)
- sudo apt-get install -qq -y libcrmcluster4-dev
- test "${GLUE}" = 0
|| sudo apt-get install -qq -y cluster-glue-dev
- test "${GLUE}" != 0
Expand Down
8 changes: 5 additions & 3 deletions configure.ac
Expand Up @@ -86,6 +86,8 @@ fi
AC_CHECK_LIB([xml2], xmlReadDoc)
PKG_CHECK_MODULES(XML, [libxml-2.0])
PKG_CHECK_MODULES(GLIB, [glib-2.0])
PKG_CHECK_MODULES([PCMK], [pacemaker-service],,
[PKG_CHECK_MODULES([PCMK], [pcmk-service])])

# Python casing, prefer 3.3+ to 2.{6...}
AM_PATH_PYTHON([3.3], , [PYTHON=:])
Expand All @@ -110,9 +112,9 @@ AC_CHECK_HEADER([zlib.h],
[AC_SUBST(ZLIB_LIBS, ["-lz"])],
[AC_MSG_ERROR([zlib development files required])])
saved_CPPFLAGS="${CPPFLAGS}"
CPPFLAGS="${CPPFLAGS} ${GLIB_CFLAGS}"
AC_CHECK_HEADER([pacemaker/crm/services.h], [],
[AC_MSG_ERROR([pacemaker/crm/services.h header required])])
CPPFLAGS="${CPPFLAGS} ${PCMK_CFLAGS} ${GLIB_CFLAGS}"
AC_CHECK_HEADER([crm/services.h], [],
[AC_MSG_ERROR([crm/services.h header required])])
CPPFLAGS="${saved_CPPFLAGS}"

# Checks for typedefs, structures, and compiler characteristics.
Expand Down
4 changes: 2 additions & 2 deletions src/Makefile.am
Expand Up @@ -22,8 +22,8 @@ boothd_SOURCES += auth.c
endif

boothd_LDFLAGS = $(OS_DYFLAGS) -L./
boothd_LDADD = -lm $(GLIB_LIBS) $(ZLIB_LIBS)
boothd_CFLAGS = $(GLIB_CFLAGS)
boothd_LDADD = -lm $(GLIB_LIBS) $(ZLIB_LIBS) $(PCMK_LIBS)
boothd_CFLAGS = $(GLIB_CFLAGS) $(PCMK_CFLAGS)

if !LOGGING_LIBQB
boothd_LDADD += -lplumb
Expand Down
2 changes: 1 addition & 1 deletion src/main.c
Expand Up @@ -42,7 +42,7 @@
#include <arpa/inet.h>
#include <sys/types.h>

#include <pacemaker/crm/services.h>
#include <crm/services.h>

#include "b_config.h"

Expand Down

0 comments on commit 4205de0

Please sign in to comment.