From b795a67c570e021ea5e092c878c02996ed67f732 Mon Sep 17 00:00:00 2001 From: Elliott Sales de Andrade Date: Mon, 22 Feb 2021 20:29:40 -0500 Subject: [PATCH 2/2] configure: Ensure --with-geos/sfcgal fail if unavailable. Signed-off-by: Elliott Sales de Andrade --- gdal/m4/geos.m4 | 19 +++++++++++++++++-- gdal/m4/sfcgal.m4 | 18 ++++++++++++++++-- 2 files changed, 33 insertions(+), 4 deletions(-) diff --git gdal/m4/geos.m4 gdal/m4/geos.m4 index dc31e7466d..1c68503974 100644 --- gdal/m4/geos.m4 +++ gdal/m4/geos.m4 @@ -59,7 +59,9 @@ AC_DEFUN([GEOS_INIT],[ elif test x"$with_geos" = x"yes" -o x"$with_geos" = x"" ; then AC_PATH_PROG(GEOS_CONFIG, geos-config, no) - ac_geos_config_auto=yes + if test x"$with_geos" = x"" ; then + ac_geos_config_auto=yes + fi else @@ -140,7 +142,14 @@ AC_DEFUN([GEOS_INIT],[ ) if test x"$HAVE_GEOS" = "xno"; then - GEOS_CFLAGS="" + if test $ac_geos_config_auto = "yes" ; then + AC_MSG_WARN([GEOS was found on your system, but the library could not be linked. GEOS support disabled.]) + else + AC_MSG_ERROR([GEOS library could not be linked]) + fi + + GEOS_CFLAGS="" + fi CFLAGS="${ax_save_CFLAGS}" @@ -149,6 +158,12 @@ AC_DEFUN([GEOS_INIT],[ fi + else + + if test $ac_geos_config_auto = "no" ; then + AC_MSG_ERROR([GEOS support explicitly enabled, but geos-config could not be found]) + fi + fi ]) diff --git gdal/m4/sfcgal.m4 gdal/m4/sfcgal.m4 index 993b7521d6..2384f0f0dc 100644 --- gdal/m4/sfcgal.m4 +++ gdal/m4/sfcgal.m4 @@ -58,7 +58,9 @@ AC_DEFUN([SFCGAL_INIT],[ elif test x"$with_sfcgal" = x"yes" -o x"$with_sfcgal" = x"" ; then AC_PATH_PROG(SFCGAL_CONFIG, sfcgal-config, no) - ac_sfcgal_config_auto=yes + if test x"$with_sfcgal" = x"" ; then + ac_sfcgal_config_auto=yes + fi else @@ -140,7 +142,13 @@ AC_DEFUN([SFCGAL_INIT],[ if test x"$HAVE_SFCGAL" = "xno"; then - SFCGAL_CFLAGS="" + if test $ac_sfcgal_config_auto = "yes" ; then + AC_MSG_WARN([SFCGAL was found on your system, but the library could not be linked. SFCGAL support disabled.]) + else + AC_MSG_ERROR([SFCGAL library could not be linked]) + fi + + SFCGAL_CFLAGS="" fi CFLAGS="${ax_save_CFLAGS}" @@ -149,5 +157,11 @@ AC_DEFUN([SFCGAL_INIT],[ fi + else + + if test $ac_sfcgal_config_auto = "no" ; then + AC_MSG_ERROR([SFCGAL support explicitly enabled, but sfcgal-config could not be found]) + fi + fi ]) -- 2.29.2