]> granicus.if.org Git - postgis/commitdiff
Configure: Avoid unnecessary errors with PROJ6
authorRaúl Marín Rodríguez <rmrodriguez@carto.com>
Wed, 19 Jun 2019 15:02:57 +0000 (15:02 +0000)
committerRaúl Marín Rodríguez <rmrodriguez@carto.com>
Wed, 19 Jun 2019 15:02:57 +0000 (15:02 +0000)
No point on checking proj_api.h for PROJ6, just check
for proj.h directly

Related to #4372

git-svn-id: http://svn.osgeo.org/postgis/trunk@17538 b70326c6-7e19-0410-871a-916f4a2858ee

configure.ac

index 054b213823dd01e6f1db6ce82af9520892238d76..eee4e8f079953895551467bfc82008a7cd0c3a92 100644 (file)
@@ -868,18 +868,6 @@ elif test ! -z "$PKG_CONFIG"; then
             ])
 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 @@ if test ! "$POSTGIS_PROJ_VERSION" -ge 46; then
        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])