kumquat-buildroot/package/postgis/0004-Use-pkg-config-to-get-PROJ-version-if-available.patch
Maxim Kochetkov 9bb1034455 package/postgis: new package
PostGIS is a spatial database extender for PostgreSQL object-relational
database. It adds support for geographic objects allowing location
queries to be run in SQL.

On microblazeel with the bootlin toolchain, the build fails with an ICE:

  during RTL pass: reload
  .../bootlin-microblazeel-uclibc/build/libgeos-3.9.0/src/geom/util/Densifier.cpp: In static member function ‘static std::unique_ptr<std::vector<geos::geom::Coordinate> > geos::geom::util::Densifier::densifyPoints(geos::geom::Coordinate::Vect, double, const geos::geom::PrecisionModel*)’:
  .../bootlin-microblazeel-uclibc/build/libgeos-3.9.0/src/geom/util/Densifier.cpp:128:1: internal compiler error: in gen_reg_rtx, at emit-rtl.c:1155
  128 | }
      | ^

Since it's unlikely that postgis will ever be used on a microblaze,
simply disable it.

https://postgis.net/

Signed-off-by: Maxim Kochetkov <fido_max@inbox.ru>
Signed-off-by: Peter Seiderer <ps.report@gmx.net>
Reviewed-by: Peter Seiderer <ps.report@gmx.net>
Signed-off-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be>
[Arnout:
 - Move postgresql dependency to package/Config.in, to satisfy
   alphabetical ordering in the menu while keeping it below postgresql.
 - Add dependency on !microblaze.
 - Add comment for dependencies.
 - Add positive version of --with-raster and --with-protobuf to
   _CONF_OPTS.
 - Expand BSD to BSD-2-Clause.
]
2021-04-12 23:07:54 +02:00

43 lines
1.4 KiB
Diff

From 876a04a795fcb179e0dc802e260353012c4890f9 Mon Sep 17 00:00:00 2001
From: Maxim Kochetkov <adobegitler@gmail.com>
Date: Thu, 28 Jan 2021 08:12:57 +0300
Subject: [PATCH] Use pkg-config to get PROJ version if available
In case of cross-compile AC_PROJ_VERSION([POSTGIS_PROJ_VERSION]) fails.
So try to get version by pkg-config first
Signed-off-by: Maxim Kochetkov <fido_max@inbox.ru>
Fetch from: https://github.com/postgis/postgis/commit/671a878982550e3c590d642620a6621b52c230c7.patch
---
configure.ac | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)
diff --git a/configure.ac b/configure.ac
index 86e1597ee..016f81c7d 100644
--- a/configure.ac
+++ b/configure.ac
@@ -866,6 +866,7 @@ elif test ! -z "$PKG_CONFIG"; then
[
PROJ_CPPFLAGS="$PROJ_CFLAGS"
PROJ_LDFLAGS="$PROJ_LIBS"
+ POSTGIS_PROJ_VERSION=`$PKG_CONFIG proj --modversion | sed 's/\([[0-9]]\).*\([[0-9]]\).*\([[0-9]]\)/\1\2/'`
],
[
PROJ_LDFLAGS="-lproj"
@@ -887,8 +888,10 @@ AC_CHECK_HEADER([proj_api.h],
)]
)
-dnl Return the PROJ.4 version number
-AC_PROJ_VERSION([POSTGIS_PROJ_VERSION])
+dnl Return the PROJ.4 version number if not detected by pkg-config
+if test "x$POSTGIS_PROJ_VERSION" = "x"; then
+ AC_PROJ_VERSION([POSTGIS_PROJ_VERSION])
+fi
AC_DEFINE_UNQUOTED([POSTGIS_PROJ_VERSION], [$POSTGIS_PROJ_VERSION], [PROJ library version])
AC_SUBST([POSTGIS_PROJ_VERSION])
CPPFLAGS="$CPPFLAGS_SAVE"
--
2.30.0