[postgis-tickets] r17538 - Configure: Avoid unnecessary errors with PROJ6

Raul raul at rmr.ninja
Wed Jun 19 08:02:57 PDT 2019


Author: algunenano
Date: 2019-06-19 08:02:57 -0700 (Wed, 19 Jun 2019)
New Revision: 17538

Modified:
   trunk/configure.ac
Log:
Configure: Avoid unnecessary errors with PROJ6

No point on checking proj_api.h for PROJ6, just check
for proj.h directly

Related to #4372



Modified: trunk/configure.ac
===================================================================
--- trunk/configure.ac	2019-06-19 11:57:19 UTC (rev 17537)
+++ trunk/configure.ac	2019-06-19 15:02:57 UTC (rev 17538)
@@ -868,18 +868,6 @@
             ])
 fi
 
-
-dnl Check that we can find the proj_api.h header file
-CPPFLAGS_SAVE="$CPPFLAGS"
-CPPFLAGS="$PROJ_CPPFLAGS"
-AC_CHECK_HEADER([proj_api.h],
-	[],
-	[AC_CHECK_HEADER([proj.h],
-		[],
-		[AC_MSG_ERROR([could not find proj.h or proj_api.h - you may need to specify the directory of a PROJ installation using --with-projdir])]
-		)]
-	)
-
 dnl Return the PROJ.4 version number
 AC_PROJ_VERSION([POSTGIS_PROJ_VERSION])
 AC_DEFINE_UNQUOTED([POSTGIS_PROJ_VERSION], [$POSTGIS_PROJ_VERSION], [PROJ library version])
@@ -891,6 +879,20 @@
 	AC_MSG_ERROR([PostGIS requires PROJ >= 4.6.0])
 fi
 
+dnl Check that we can find proj headers
+CPPFLAGS_SAVE="$CPPFLAGS"
+CPPFLAGS="$PROJ_CPPFLAGS"
+if test ! "$POSTGIS_PROJ_VERSION" -ge 60; then
+	AC_CHECK_HEADER([proj_api.h],
+		[],
+		[AC_MSG_ERROR([could not find proj.h or proj_api.h - you may need to specify the directory of a PROJ installation using --with-projdir])]
+	)
+else
+	AC_CHECK_HEADER([proj.h],
+		[],
+		[AC_MSG_ERROR([could not find proj.h or proj_api.h - you may need to specify the directory of a PROJ installation using --with-projdir])]
+        )
+fi
 AC_SUBST([PROJ_CPPFLAGS])
 AC_SUBST([PROJ_LDFLAGS])
 



More information about the postgis-tickets mailing list