From 65d2d9d1887375fff8916df92ab3adfd09b12f10 Mon Sep 17 00:00:00 2001 From: Mickey Rose Date: Mon, 19 Aug 2019 17:35:45 +0200 Subject: [PATCH] scons: use gdal-config to obtain GDAL data path --- SConstruct | 20 ++++++-------------- 1 file changed, 6 insertions(+), 14 deletions(-) diff --git a/SConstruct b/SConstruct index e102d4d90..9e8d579ee 100644 --- a/SConstruct +++ b/SConstruct @@ -763,7 +763,7 @@ def ogr_enabled(context): context.Message( 'Checking if gdal is ogr enabled... ') context.sconf.cached = False ret, out = config_command(env['GDAL_CONFIG'], '--ogr-enabled') - if ret and out: + if ret: ret = (out == 'yes') if not ret: if 'ogr' not in env['SKIPPED_DEPS']: @@ -913,29 +913,21 @@ int main() { def CheckGdalData(context, silent=False): - + env = context.env if not silent: context.Message('Checking for GDAL data directory... ') - ret, out = context.TryRun(""" - -#include "cpl_config.h" -#include - -int main() { - std::cout << GDAL_PREFIX << "/share/gdal" << std::endl; - return 0; -} - -""", '.cpp') + context.sconf.cached = False + ret, out = config_command(env['GDAL_CONFIG'], '--datadir') value = out.strip() if silent: context.did_show_result=1 if ret: - context.Result('GDAL_PREFIX returned %s' % value) + context.Result('%s returned %s' % (env['GDAL_CONFIG'], value)) else: context.Result('Failed to detect (mapnik-config will have null value)') return value + def CheckProjData(context, silent=False): if not silent: