gdal/pkg-config-libpq.patch
Dirk Stoecker 512b36bea1 Accepting request 692204 from home:bruno_friedmann:branches:Application:Geo
- Update to version 2.4.1 (52 bugfix release)
  Full changelog https://trac.osgeo.org/gdal/wiki/Release/2.4.1-News
- Packaging:
  + Remove merged upstream patch
    add-support-for-poppler-0.72.0-and-0.73.0.patch
    Poppler-revision-version-management.patch
  + Add pkg-config-libpq.patch upstream issue#1412 pr#1418 wip
    use pkg-config for libpq
  + Secure libproj detection with tail -n1
  + Remove trailing space in changes

OBS-URL: https://build.opensuse.org/request/show/692204
OBS-URL: https://build.opensuse.org/package/show/Application:Geo/gdal?expand=0&rev=88
2019-04-08 14:08:57 +00:00

66 lines
2.2 KiB
Diff

diff -rup a/configure.ac b/configure.ac
--- a/configure.ac 2019-03-15 13:30:02.000000000 +0100
+++ b/configure.ac 2019-04-06 21:29:50.153490589 +0200
@@ -1249,12 +1249,10 @@ PG_CONFIG=no
AC_ARG_WITH(pg,
AS_HELP_STRING([--with-pg[=ARG]],
- [Include PostgreSQL GDAL/OGR Support (ARG=path to pg_config)]),,)
+ [Include PostgreSQL GDAL/OGR Support (ARG=yes,no)]),,)
if test "x$with_pg" = "xyes" -o "x$with_pg" = "x" ; then
- AC_PATH_PROG(PG_CONFIG, pg_config, no)
-else
- PG_CONFIG=$with_pg
+ PG_CONFIG=yes
fi
AC_MSG_CHECKING([for PostgreSQL])
@@ -1268,23 +1266,24 @@ if test "x$PG_CONFIG" = "xno" ; then
AC_MSG_RESULT([no])
else
- if test -d ${PG_CONFIG} ; then
- AC_MSG_RESULT([no])
- AC_MSG_ERROR([--with-pg argument is a directory. It should be the path to the pg_config script, often somewhere like /usr/local/pgsql/bin/pg_config.])
- fi
-
- if test \! -x ${PG_CONFIG} ; then
- AC_MSG_RESULT([no])
- AC_MSG_ERROR([--with-pg argument is a not an executable file. It should be the path to the pg_config script, often somewhere like /usr/local/pgsql/bin/pg_config.])
- fi
-
- AC_MSG_RESULT([yes])
- AC_CHECK_LIB(pq,PQconnectdb,HAVE_PG=yes,HAVE_PG=no,-L`$PG_CONFIG --libdir`)
+ PKG_PROG_PKG_CONFIG([0.21])
+ PKG_CHECK_MODULES([PQ],[libpq > 9.1], [HAVE_PG=yes], [HAVE_PG=no])
if test "${HAVE_PG}" = "yes" ; then
- LIBS=-L`$PG_CONFIG --libdir`" -lpq $LIBS"
- PG_INC=-I`$PG_CONFIG --includedir`" -I"`$PG_CONFIG --includedir-server`
+ PG_LIB="${PQ_LIBS}"
+ PG_INC="${PQ_CFLAGS}"
+ SAVED_LIBS="${LIBS}"
+ LIBS="${PG_LIBS}"
+ AC_CHECK_LIB(pq,PQconnectdb,HAVE_PG=yes,HAVE_PG=no)
+ LIBS="${SAVED_LIBS}"
+ if test "${HAVE_PG}" = "yes" ; then
+ LIBS="${PG_LIB} ${LIBS}"
+ fi
+ else
+ if "x$with_pg" = "xyes"; then
+ AC_MSG_ERROR([--with-pg was requested, but libpq is not available])
+ fi
fi
fi
@@ -1293,6 +1292,7 @@ AC_SUBST(HAVE_PG,$HAVE_PG)
AC_SUBST(PG_INC,$PG_INC)
AC_SUBST(PG_LIB,$PG_LIB)
+
dnl ---------------------------------------------------------------------------
dnl Check if we should build with GRASS support.
dnl ---------------------------------------------------------------------------