Skip to content

Commit

Permalink
build: check for yaml-cpp usability during configure
Browse files Browse the repository at this point in the history
On some distributions, yaml-cpp is packaged without a dependency
on libboost-dev, and therefore may result in compile-time errors
not detected in flux-core configure.

Do a simple preprocessor check to make sure yaml-cpp/yaml.h can
be included when YAMLCPP support is found, and issue a fatal error
if not (with a message to check config.log).

Fixes flux-framework#1280
  • Loading branch information
grondo committed Nov 9, 2017
1 parent cc5cd0a commit 9f570e7
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions config/x_ac_yamlcpp.m4
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,13 @@ AC_DEFUN([X_AC_YAMLCPP], [
CFLAGS="$CFLAGS $YAMLCPP_CFLAGS"
AC_LANG_PUSH([C++])
AC_MSG_CHECKING([whether yaml-cpp/yaml.h is usable])
AC_PREPROC_IFELSE(
[AC_LANG_PROGRAM([#include <yaml-cpp/yaml.h>], [])],
[AC_MSG_RESULT([yes])],
[AC_MSG_FAILURE([yaml-cpp/yaml.h doesn't appear to be usable.])]
)
# YAML::Node::Mark() is only present in yaml-cpp beginning
# with release 0.5.3.
AC_LINK_IFELSE([AC_LANG_PROGRAM([#include <yaml-cpp/yaml.h>],
Expand Down

0 comments on commit 9f570e7

Please sign in to comment.