0004-Use-pkg-config-to-get-PROJ-version-if-available.patch 1.4 KB

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