1Upstream-Status: Pending
2
3diff -rupN --no-dereference libspatialite-5.0.1/configure.ac libspatialite-5.0.1-new/configure.ac
4--- libspatialite-5.0.1/configure.ac	2021-03-08 08:57:19.015858195 +0100
5+++ libspatialite-5.0.1-new/configure.ac	2021-03-08 08:57:19.017858195 +0100
6@@ -312,35 +312,10 @@ AC_ARG_ENABLE(geos, [AS_HELP_STRING(
7   [], [enable_geos=yes])
8 if test x"$enable_geos" != "xno"; then
9   #-----------------------------------------------------------------------
10-  #   --with-geosconfig
11-  #
12-  AC_ARG_WITH([geosconfig],
13-        [AS_HELP_STRING([--with-geosconfig=FILE], [specify an alternative geos-config file])],
14-	[GEOSCONFIG="$withval"], [GEOSCONFIG=""])
15-  if test "x$GEOSCONFIG" = "x"; then
16-        # GEOSCONFIG was not specified, so search within the current path
17-        AC_PATH_PROG([GEOSCONFIG], [geos-config])
18-        # If we couldn't find geos-config, display an error
19-        if test "x$GEOSCONFIG" = "x"; then
20-                AC_MSG_ERROR([could not find geos-config within the current path. You may need to try re-running configure with a --with-geosconfig parameter.])
21-        fi
22-  else
23-        # GEOSCONFIG was specified; display a message to the user
24-        if test "x$GEOSCONFIG" = "xyes"; then
25-                AC_MSG_ERROR([you must specify a parameter to --with-geosconfig, e.g. --with-geosconfig=/path/to/geos-config])
26-        else
27-                if test -f $GEOSCONFIG; then
28-                        AC_MSG_RESULT([Using user-specified geos-config file: $GEOSCONFIG])
29-                else
30-                        AC_MSG_ERROR([the user-specified geos-config file $GEOSCONFIG does not exist])
31-                fi
32-        fi
33-  fi
34-  # Extract the linker and include flags
35-  GEOS_LDFLAGS=`$GEOSCONFIG --ldflags`
36-  GEOS_CFLAGS=-I`$GEOSCONFIG --includes`
37-  AC_SUBST([GEOS_LDFLAGS])
38-  AC_SUBST([GEOS_CFLAGS])
39+  PKG_CHECK_MODULES([GEOS], [geos], , AC_MSG_ERROR(['geos' is required but it doesn't seem to be installed on this system.]))
40+  GEOS_LDFLAGS="$GEOS_LIBS"
41+  AC_SUBST(GEOS_CFLAGS)
42+  AC_SUBST(GEOS_LDFLAGS)
43   # Ensure that we can parse geos_c.h
44   CPPFLAGS_SAVE="$CPPFLAGS"
45   CPPFLAGS="$GEOS_CFLAGS"
46