diff --git a/configure b/configure index c66a1fc..a747ebd 100755 --- a/configure +++ b/configure @@ -2302,7 +2302,7 @@ PROJ6="no" PROJH="no" if test "${proj_config_ok}" = yes; then PROJ_VERSION=`${PROJ_CONFIG} --modversion` - PROJV1=`echo "${PROJ_VERSION}" | cut -c 1` + PROJV1=`echo "${PROJ_VERSION}" | cut -d "." -f 1` if test "${PROJV1}" -ge 5; then PROJ6="yes" PROJ_CPPFLAGS="${PROJ_CPPFLAGS} -DHAVE_PROJ_H" @@ -3509,7 +3509,11 @@ fi ${CC} ${CFLAGS} ${CPPFLAGS} ${LDFLAGS} -o proj_conf_test proj_conf_test.c ${PROJ_LIBS} +if test "x$cross_compiling" = "xyes"; then +proj_version="${PROJ_VERSION}" +else proj_version=`./proj_conf_test` +fi # Check whether --with-proj-share was given. @@ -3697,44 +3701,21 @@ fi # proj >= 6 # # POSTGIS/PROJ version: # - -cat > proj_conf_test.c <<_EOCONF -#include -#ifdef HAVE_PROJ_H -#include -int main(void) { - printf("%d%d%d\n", PROJ_VERSION_MAJOR, PROJ_VERSION_MINOR, PROJ_VERSION_PATCH); - return 0; -} -#else -#include -int main(void) { - printf("%d\n", PJ_VERSION); - return 0; -} -#endif -_EOCONF - -# AC_MSG_NOTICE([PKG_LIBS: ${PKG_LIBS}]) - -${CC} ${CFLAGS} ${CPPFLAGS} ${LDFLAGS} -o proj_conf_test proj_conf_test.c ${PROJ_LIBS} - -proj_version=`./proj_conf_test` - -POSTGIS_PROJ_VERSION=`echo $proj_version | cut -c "1,2"` +PROJ_VERSION_MAJOR=`echo $proj_version | cut -d "." -f 1` +PROJ_VERSION_MINOR=`echo $proj_version | cut -d "." -f 2` +POSTGIS_PROJ_VERSION="${PROJ_VERSION_MAJOR}${PROJ_VERSION_MINOR}" { printf "%s\n" "$as_me:${as_lineno-$LINENO}: POSTGIS_PROJ_VERSION: ${POSTGIS_PROJ_VERSION}" >&5 printf "%s\n" "$as_me: POSTGIS_PROJ_VERSION: ${POSTGIS_PROJ_VERSION}" >&6;} #AC_SUBST([POSTGIS_PROJ_VERSION],["${PROJV12}"]) #AC_DEFINE_UNQUOTED([POSTGIS_PROJ_VERSION], [$POSTGIS_PROJ_VERSION], [PROJ library version]) -# xxx +PKG_CPPFLAGS="${PKG_CPPFLAGS} -DPOSTGIS_PROJ_VERSION=${POSTGIS_PROJ_VERSION}" if test ${POSTGIS_PROJ_VERSION} -lt 60 ; then PKG_CPPFLAGS="${PKG_CPPFLAGS} -DACCEPT_USE_OF_DEPRECATED_PROJ_API_H" else PKG_CPPFLAGS="${PKG_CPPFLAGS} -DUSE_PROJ_H" fi - # # GEOS: # diff --git a/configure.ac b/configure.ac index 45de45e..ff38ddc 100644 --- a/configure.ac +++ b/configure.ac @@ -58,7 +58,7 @@ PROJ6="no" PROJH="no" if test "${proj_config_ok}" = yes; then PROJ_VERSION=`${PROJ_CONFIG} --modversion` - PROJV1=`echo "${PROJ_VERSION}" | cut -c 1` + PROJV1=`echo "${PROJ_VERSION}" | cut -d "." -f 1` if test "${PROJV1}" -ge 5; then PROJ6="yes" PROJ_CPPFLAGS="${PROJ_CPPFLAGS} -DHAVE_PROJ_H" @@ -173,7 +173,11 @@ fi ${CC} ${CFLAGS} ${CPPFLAGS} ${LDFLAGS} -o proj_conf_test proj_conf_test.c ${PROJ_LIBS} +if test "x$cross_compiling" = "xyes"; then +proj_version="${PROJ_VERSION}" +else proj_version=`./proj_conf_test` +fi AC_ARG_WITH([proj-share], AS_HELP_STRING([--with-proj-share=SHARE_PATH],[the location of proj metadata files]), @@ -347,43 +351,20 @@ fi # proj >= 6 # # POSTGIS/PROJ version: # - -[cat > proj_conf_test.c <<_EOCONF -#include -#ifdef HAVE_PROJ_H -#include -int main(void) { - printf("%d%d%d\n", PROJ_VERSION_MAJOR, PROJ_VERSION_MINOR, PROJ_VERSION_PATCH); - return 0; -} -#else -#include -int main(void) { - printf("%d\n", PJ_VERSION); - return 0; -} -#endif -_EOCONF] - -# AC_MSG_NOTICE([PKG_LIBS: ${PKG_LIBS}]) - -${CC} ${CFLAGS} ${CPPFLAGS} ${LDFLAGS} -o proj_conf_test proj_conf_test.c ${PROJ_LIBS} - -proj_version=`./proj_conf_test` - -POSTGIS_PROJ_VERSION=`echo $proj_version | cut -c "1,2"` +PROJ_VERSION_MAJOR=`echo $proj_version | cut -d "." -f 1` +PROJ_VERSION_MINOR=`echo $proj_version | cut -d "." -f 2` +POSTGIS_PROJ_VERSION="${PROJ_VERSION_MAJOR}${PROJ_VERSION_MINOR}" AC_MSG_NOTICE([POSTGIS_PROJ_VERSION: ${POSTGIS_PROJ_VERSION}]) #AC_SUBST([POSTGIS_PROJ_VERSION],["${PROJV12}"]) #AC_DEFINE_UNQUOTED([POSTGIS_PROJ_VERSION], [$POSTGIS_PROJ_VERSION], [PROJ library version]) AC_SUBST(POSTGIS_PROJ_VERSION) -# xxx +PKG_CPPFLAGS="${PKG_CPPFLAGS} -DPOSTGIS_PROJ_VERSION=${POSTGIS_PROJ_VERSION}" if test ${POSTGIS_PROJ_VERSION} -lt 60 ; then PKG_CPPFLAGS="${PKG_CPPFLAGS} -DACCEPT_USE_OF_DEPRECATED_PROJ_API_H" else PKG_CPPFLAGS="${PKG_CPPFLAGS} -DUSE_PROJ_H" fi - # # GEOS: # diff --git a/src/Makevars.ucrt b/src/Makevars.ucrt index 0c46c1a..1274e36 100644 --- a/src/Makevars.ucrt +++ b/src/Makevars.ucrt @@ -85,7 +85,7 @@ LIBSHARPYUV = $(or $(and $(wildcard $(R_TOOLS_SOFT)/lib/libsharpyuv.a),-lsharpyu PKG_LIBS = \ -L./liblwgeom -llwgeomstatic \ --fopenmp -lgdal -larmadillo -lopenblas -lgfortran -lquadmath -lpq -lpgcommon -lpgport -lodbc32 -lodbccp32 -lblosc -lkea -lhdf5_cpp -lhdf5 -lpoppler -llcms2 -lfreetype -lharfbuzz -lfreetype -llz4 -lpcre2-8 -lxml2 -lopenjp2 -lnetcdf -lmysqlclient -lspatialite -lgeos_c -lgeos -lminizip -lgeos -ljson-c -lgta -lfreexl -lexpat -lssl -lpsapi -lgif -lmfhdf -lhdf5_hl -lcrypto -lportablexdr -ldf -lhdf5 -lsz -lpng16 -lpng -lpoppler -llcms2 -lfreetype -lharfbuzz -lfreetype -llz4 -lpcre2-8 -lpcre -lcurl -lbcrypt -lrtmp -lssl -lssh2 -lidn2 -lunistring -liconv -lgcrypt -lcrypto -lgpg-error -lws2_32 -ltiff -llzma -ljpeg -lz -lcfitsio -lzstd -lwebpdecoder -lwebp $(LIBSHARPYUV) -lsbml-static -lgeotiff -lproj -lsqlite3 -lbz2 -lcrypt32 -lwldap32 -lsecur32 +-fopenmp -lgdal -larmadillo -lopenblas -lgfortran -lquadmath -lpq -lpgcommon -lpgport -lodbc32 -lodbccp32 -lblosc -lkea -lhdf5_cpp -lhdf5 -lpoppler -llcms2 -lfreetype -lharfbuzz -lfreetype -llz4 -lpcre2-8 -lxml2 -lopenjp2 -lnetcdf -lmysqlclient -lspatialite -lgeos_c -lgeos -lminizip -lgeos -ljson-c -lgta -lfreexl -lexpat -lssl -lpsapi -lgif -lmfhdf -lhdf5_hl -lcrypto -lportablexdr -ldf -lhdf5 -lsz -lpng16 -lpng -lpoppler -llcms2 -lfreetype -lharfbuzz -lfreetype -llz4 -lpcre2-8 -lpcre -lproj -lcurl -lbcrypt -lrtmp -lssl -lssh2 -lidn2 -lunistring -liconv -lgcrypt -lcrypto -lgpg-error -lws2_32 -ltiff -llzma -ljpeg -lz -lcfitsio -lzstd -lwebpdecoder -lwebp $(LIBSHARPYUV) -lsbml-static -lgeotiff -lsqlite3 -lbz2 -lcrypt32 -lwldap32 -lsecur32 all: clean winlibs diff --git a/src/postgis_config.h b/src/postgis_config.h index a88dc8c..df0ee6c 100644 --- a/src/postgis_config.h +++ b/src/postgis_config.h @@ -121,7 +121,7 @@ #define POSTGIS_PGSQL_VERSION 100 /* PROJ library version */ -#define POSTGIS_PROJ_VERSION 91 +/* #define POSTGIS_PROJ_VERSION 91 */ /* PostGIS Raster build date */ /* #undef POSTGIS_RASTER_BUILD_DATE */