Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Several fixes for configure script #86

Merged
merged 3 commits into from
Jan 10, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
37 changes: 9 additions & 28 deletions configure
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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.
Expand Down Expand Up @@ -3697,44 +3701,21 @@ fi # proj >= 6
#
# POSTGIS/PROJ version:
#

cat > proj_conf_test.c <<_EOCONF
#include <stdio.h>
#ifdef HAVE_PROJ_H
#include <proj.h>
int main(void) {
printf("%d%d%d\n", PROJ_VERSION_MAJOR, PROJ_VERSION_MINOR, PROJ_VERSION_PATCH);
return 0;
}
#else
#include <proj_api.h>
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:
#
Expand Down
37 changes: 9 additions & 28 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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]),
Expand Down Expand Up @@ -347,43 +351,20 @@ fi # proj >= 6
#
# POSTGIS/PROJ version:
#

[cat > proj_conf_test.c <<_EOCONF
#include <stdio.h>
#ifdef HAVE_PROJ_H
#include <proj.h>
int main(void) {
printf("%d%d%d\n", PROJ_VERSION_MAJOR, PROJ_VERSION_MINOR, PROJ_VERSION_PATCH);
return 0;
}
#else
#include <proj_api.h>
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:
#
Expand Down
2 changes: 1 addition & 1 deletion src/Makevars.ucrt
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
2 changes: 1 addition & 1 deletion src/postgis_config.h
Original file line number Diff line number Diff line change
Expand Up @@ -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 */
Expand Down
Loading