Ver código fonte

+test for PROJ 5 when configuring

git-svn-id: https://svn.osgeo.org/grass/grass/trunk@72391 15284696-431f-4ddb-bdfa-cd5b030d7da7
Markus Metz 7 anos atrás
pai
commit
af3d27f68c
3 arquivos alterados com 636 adições e 495 exclusões
  1. 604 479
      configure
  2. 29 16
      configure.in
  3. 3 0
      include/config.h.in

Diferenças do arquivo suprimidas por serem muito extensas
+ 604 - 479
configure


+ 29 - 16
configure.in

@@ -678,36 +678,49 @@ AC_SUBST(ZSTDLIB)
 PROJINC=
 PROJLIB=
 PROJSHARE=
+PROJ4API=0
 
 # With PROJ includes directory
 
-LOC_CHECK_INC_PATH(proj,External PROJ.4,PROJINC)
+LOC_CHECK_INC_PATH(proj,External PROJ,PROJINC)
 
-LOC_CHECK_INCLUDES(proj_api.h,External PROJ.4,$PROJINC)
+# PROJ version check: if proj.h exists, it must be proj 5+
+LOC_CHECK_INCLUDES(proj.h,External PROJ,$PROJINC,PROJ4API=1)
 
-# PROJ version check
+if test $PROJ4API = 0 ; then
+    AC_MSG_RESULT([using new PROJ version 5+ API])
 
-if test "$cross_compiling" = yes; then
-    AC_MSG_WARN([*** Cannot check PROJ.4 version (cross-compiling).])
+    # With PROJ library directory
+
+    LOC_CHECK_LIB_PATH(proj,External PROJ,PROJLIB)
+    LOC_CHECK_LIBS(proj,proj_pj_info,External PROJ,$PROJLIB,PROJLIB,,,)
 else
-    LOC_CHECK_VERSION_INT(proj_api.h,PJ_VERSION,External PROJ.4,proj_ver,$PROJINC,0)
+    AC_MSG_RESULT([using old PROJ version 4 API])
 
-    if test `expr "$proj_ver" \< 446` = 1 ; then
-        AC_MSG_ERROR([*** PROJ.4.4.6 or later is required.])
-    fi
-fi
+    LOC_CHECK_INCLUDES(proj_api.h,External PROJ,$PROJINC)
+    # PROJ version check for v4.x
 
-# With PROJ library directory
+    if test "$cross_compiling" = yes; then
+	AC_MSG_WARN([*** Cannot check PROJ.4 version (cross-compiling).])
+    else
+	LOC_CHECK_VERSION_INT(proj_api.h,PJ_VERSION,External PROJ.4,proj_ver,$PROJINC,0)
 
-LOC_CHECK_LIB_PATH(proj,External PROJ.4,PROJLIB)
+	if test `expr "$proj_ver" \< 446` = 1 ; then
+	    AC_MSG_ERROR([*** PROJ.4.4.6 or later is required.])
+	fi
+    fi
+
+    # With PROJ library directory
 
-LOC_CHECK_LIBS(proj,pj_get_def,External PROJ.4,$PROJLIB,PROJLIB,,,)
+    LOC_CHECK_LIB_PATH(proj,External PROJ.4,PROJLIB)
+    LOC_CHECK_LIBS(proj,pj_get_def,External PROJ.4,$PROJLIB,PROJLIB,,,)
+fi
 
 # With PROJ share directory
 
-LOC_CHECK_SHARE_PATH(proj,External PROJ.4,PROJSHARE)
+LOC_CHECK_SHARE_PATH(proj,External PROJ,PROJSHARE)
 if test -z "$PROJSHARE" ; then
-    AC_MSG_WARN([*** External PROJ.4 directory not specified; default will be used])
+    AC_MSG_WARN([*** External PROJ directory not specified; default will be used])
     PROJSHARE=/usr/share/proj
 fi
 
@@ -716,7 +729,7 @@ if test "$cross_compiling" = "yes" ; then
     AC_MSG_CHECKING([for epsg])
     AC_MSG_RESULT([unknown (cross-compiling)])
 else
-    LOC_CHECK_SHARE(epsg,External PROJ.4,$PROJSHARE,[
+    LOC_CHECK_SHARE(epsg,External PROJ,$PROJSHARE,[
     AC_MSG_WARN([*** Unable to locate PROJ data files.])
     ])
 fi

+ 3 - 0
include/config.h.in

@@ -146,6 +146,9 @@
 /* define if SQLite is to be used */
 #undef HAVE_SQLITE
 
+/* define if proj.h exists */
+#undef HAVE_PROJ_H
+
 /* define if GDAL is to be used */
 #undef HAVE_GDAL