From 9f570e7e89c57b0624a0bad5e2758c827beb61b9 Mon Sep 17 00:00:00 2001 From: "Mark A. Grondona" Date: Thu, 9 Nov 2017 10:14:00 -0800 Subject: [PATCH] build: check for yaml-cpp usability during configure 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 #1280 --- config/x_ac_yamlcpp.m4 | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/config/x_ac_yamlcpp.m4 b/config/x_ac_yamlcpp.m4 index f09c5aa7465b..f678e4b82289 100644 --- a/config/x_ac_yamlcpp.m4 +++ b/config/x_ac_yamlcpp.m4 @@ -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 ], [])], + [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 ],