Commit 63a8e93a authored by Raúl Marín's avatar Raúl Marín

Use pkg-config to improve dependency detection

Closes #4324
Closes https://github.com/postgis/postgis/pull/372



git-svn-id: http://svn.osgeo.org/postgis/trunk@17233 b70326c6-7e19-0410-871a-916f4a2858ee
parent 58420d95
Pipeline #47042338 passed with stage
in 29 minutes and 46 seconds
This diff is collapsed.
......@@ -52,7 +52,7 @@ EXTRA_CLEAN += sql/*.sql
DOCS = README.address_standardizer
PG_CPPFLAGS = @CFLAGS@ @CPPFLAGS@
SHLIB_LINK = @SHLIB_LINK@ -lpcre
SHLIB_LINK = @SHLIB_LINK@ @PCRE_LDFLAGS@
EXTRA_CLEAN = usps-st-city-name.txt mk-st-regexp mk-city-regex test_main
REGRESS = test-init-extensions test-parseaddress test-standardize_address_1 test-standardize_address_2
......
......@@ -1373,7 +1373,6 @@ static void test_spheroid_area(void)
CU_ASSERT_DOUBLE_EQUAL(a1, 12341436880.106982993974659, 0.1);
/* spheroid: Planimeter -E -p 20 -r --input-string "3 -2;4 -2;4 -1;3 -1" */
#if PROJ_GEODESIC
// printf("XXXXX %d\n", PJ_VERSION);
a2 = lwgeom_area_spheroid(lwg, &s);
CU_ASSERT_DOUBLE_EQUAL(a2, 12286884908.946891319597874, 0.1);
#endif
......
......@@ -32,10 +32,11 @@
#include <stdarg.h>
#include <stdio.h>
#include <stdint.h>
#define ACCEPT_USE_OF_DEPRECATED_PROJ_API_H 1
#include "../postgis_config.h"
#include "proj_api.h"
#if defined(PJ_VERSION) && PJ_VERSION >= 490
#if POSTGIS_PROJ_VERSION >= 49
/* Enable new geodesic functions */
#define PROJ_GEODESIC 1
#else
......
......@@ -33,16 +33,10 @@
#define JSON_C_VERSION_013 (13 << 8)
#ifdef HAVE_LIBJSON_C
#include <json-c/json.h>
#if !defined(JSON_C_VERSION_NUM) || JSON_C_VERSION_NUM < JSON_C_VERSION_013
#include <json-c/json_object_private.h>
#endif
#else
#include <json/json.h>
#include <json.h>
#if !defined(JSON_C_VERSION_NUM) || JSON_C_VERSION_NUM < JSON_C_VERSION_013
#include <json/json_object_private.h>
#endif
#include <json_object_private.h>
#endif
#ifndef JSON_C_VERSION
......
......@@ -32,12 +32,9 @@
#include "liblwgeom.h"
#include "lwgeom_export.h"
#ifdef HAVE_LIBJSON
# ifdef HAVE_LIBJSON_C
# include <json-c/json.h>
# else
# include <json/json.h>
# endif
#if defined(HAVE_LIBJSON) || defined(HAVE_LIBJSON_C)
#include <json.h>
/* We don't include <utils/builtins.h> to avoid collisions with json-c/json.h */
static text*
......
......@@ -113,6 +113,9 @@
/* Define to 1 if wagyu is being built */
#undef HAVE_WAGYU
/* Define to 1 if sfcgal is being built */
#undef HAVE_SFCGAL
/* Define to the sub-directory in which libtool stores uninstalled libraries.
*/
#undef LT_OBJDIR
......@@ -156,6 +159,9 @@
/* PROJ library version */
#undef POSTGIS_PROJ_VERSION
/* PROJ 6: Flag to use the old API */
#undef ACCEPT_USE_OF_DEPRECATED_PROJ_API_H
/* PostGIS Raster build date */
#undef POSTGIS_RASTER_BUILD_DATE
......
libtool.m4
lt~obsolete.m4
ltsugar.m4
ltoptions.m4
ltversion.m4
dnl **********************************************************************
dnl *
dnl * PostGIS - Spatial Types for PostgreSQL
dnl * http://postgis.net
dnl * Copyright 2008 Mark Cave-Ayland
dnl *
dnl * This program is free software; you can redistribute it and/or
dnl * modify it under the terms of the GNU General Public License
dnl * as published by the Free Software Foundation; either version 2
dnl * of the License, or (at your option) any later version.
dnl *
dnl * This program is distributed in the hope that it will be useful,
dnl * but WITHOUT ANY WARRANTY; without even the implied warranty of
dnl * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
dnl * GNU General Public License for more details.
dnl *
dnl * You should have received a copy of the GNU General Public License
dnl * along with this program; if not, write to the Free Software Foundation,
dnl * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
dnl *
dnl **********************************************************************
dnl
dnl Return the PROJ.4 version number
dnl
AC_DEFUN([AC_PROJ_VERSION], [
AC_RUN_IFELSE(
[AC_LANG_PROGRAM([
#ifdef HAVE_STDINT_H
#include <stdio.h>
#endif
#define ACCEPT_USE_OF_DEPRECATED_PROJ_API_H 1
#include "proj_api.h"
],
[
FILE *fp;
fp = fopen("conftest.out", "w");
fprintf(fp, "%d\n", PJ_VERSION);
fclose(fp)])
],
[
dnl The program ran successfully, so return the version number in the form MAJORMINOR
$1=`cat conftest.out | sed 's/\([[0-9]]\)\([[0-9]]\)\([[0-9]]\)/\1\2/'`
],
[
dnl The program failed so return an empty variable
$1=""
]
)
])
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment