[scons] fix with_pgsql

pg_config --includedir --libdir doesn't print the "-I" or "-l" prefixes,
so ParseConfig can't parse it. Use pkg-config instead.
This commit is contained in:
Stefan Bühler 2017-10-24 12:21:18 +02:00 committed by Glenn Strauss
parent 2506e21b08
commit 96e198d621
1 changed files with 1 additions and 4 deletions

View File

@ -385,14 +385,11 @@ if env['with_mysql']:
env['LIBS'] = oldlib
if env['with_pgsql']:
pg_config = checkProgram(env, 'pgsql', 'pg_config')
oldlib = env['LIBS']
env['LIBS'] = []
env.ParseConfig(pg_config + ' --includedir --libdir')
env.ParseConfig('pkg-config libpq --cflags --libs')
env.Append(CPPFLAGS = [ '-DHAVE_PGSQL_H', '-DHAVE_LIBPGSQL' ], LIBPGSQL = 'pq')
env['LIBS'] = oldlib
#if autoconf.CheckLibWithHeader('pq', 'libpq-fe.h', 'C'):
# env.Append(CPPFLAGS = [ '-DHAVE_PGSQL_H', '-DHAVE_LIBPGSQL' ], LIBPGSQL = 'pq')
if env['with_dbi']:
if autoconf.CheckLibWithHeader('dbi', 'dbi/dbi.h', 'C'):