From a5a117fd33f856117e9be84b308541243b72422f Mon Sep 17 00:00:00 2001 From: Laurent Carlier Date: Tue, 12 Jun 2018 16:27:31 +0200 Subject: [PATCH] Add a way to track configuration failures with CI Disable it for main as it's expected. => GAMBAS_CONFIG_FAILURE=1 ./configure ..... checking for gb.db.postgresql headers... no configure: WARNING: Unable to find file: postgres.h configure: WARNING: Unable to find file: pg_type.h checking for gb.db.postgresql libraries... /usr/lib64/ configure: error: Failed to configure gb.db.postgresql configure: error: ./configure failed for gb.db.postgresql --- acinclude.m4 | 12 ++++++++++-- main/configure.ac | 10 ++++++++++ 2 files changed, 20 insertions(+), 2 deletions(-) diff --git a/acinclude.m4 b/acinclude.m4 index f654e0f26..7f2513a91 100644 --- a/acinclude.m4 +++ b/acinclude.m4 @@ -938,7 +938,11 @@ AC_DEFUN([GB_COMPONENT_PKG_CONFIG], done - else + if test "$gb_enable_$1" = "yes" && test "x${GAMBAS_CONFIG_FAILURE}" != "x" && test "$gb_in_component_search" != "yes"; then + AC_MSG_ERROR([Failed to configure $3]) + fi + +else AC_DEFINE(HAVE_$2_COMPONENT, 1, [Have $3 component]) @@ -1111,7 +1115,11 @@ AC_DEFUN([GB_COMPONENT], touch DISABLED touch DISABLED.$3 - fi + if test "$gb_enable_$1" = "yes" && test "x${GAMBAS_CONFIG_FAILURE}" != "x"; then + AC_MSG_ERROR([Failed to configure $3]) + fi + + fi if test "$have_$1" = "no"; then diff --git a/main/configure.ac b/main/configure.ac index 988885874..9ece247be 100644 --- a/main/configure.ac +++ b/main/configure.ac @@ -9,6 +9,11 @@ GB_MATH_FUNC LT_INIT AM_PROG_CC_C_O +if test "x${GAMBAS_CONFIG_FAILURE}" != "x"; then + SAVE_GAMBAS_CONFIG_FAILURE=${GAMBAS_CONFIG_FAILURE} + GAMBAS_CONFIG_FAILURE='' +fi + dnl ---- Check for internationalization library GB_COMPONENT( @@ -76,6 +81,11 @@ dnl ---- Remove DISABLED file that could have been generated before rm -f DISABLED DISABLED.* +if test "x${SAVE_GAMBAS_CONFIG_FAILURE}" != "x"; then + GAMBAS_CONFIG_FAILURE=${SAVE_GAMBAS_CONFIG_FAILURE} + SAVE_GAMBAS_CONFIG_FAILURE='' +fi + dnl ---- Check for the Linux inotify headers GB_COMPONENT(