scons: fix rtree config check if statically linking sqlite3
This commit is contained in:
parent
1251a57e4e
commit
f8316fcbe8
1 changed files with 21 additions and 2 deletions
23
SConstruct
23
SConstruct
|
@ -452,6 +452,7 @@ pickle_store = [# Scons internal variables
|
||||||
'CAIROMM_LINKFLAGS',
|
'CAIROMM_LINKFLAGS',
|
||||||
'CAIROMM_CPPPATHS',
|
'CAIROMM_CPPPATHS',
|
||||||
'SVG_RENDERER',
|
'SVG_RENDERER',
|
||||||
|
'SQLITE_LINKFLAGS'
|
||||||
]
|
]
|
||||||
|
|
||||||
# Add all other user configurable options to pickle pickle_store
|
# Add all other user configurable options to pickle pickle_store
|
||||||
|
@ -987,7 +988,7 @@ if not preconfigured:
|
||||||
env['LIBDIR_SCHEMA'] = LIBDIR_SCHEMA
|
env['LIBDIR_SCHEMA'] = LIBDIR_SCHEMA
|
||||||
env['PLUGINS'] = PLUGINS
|
env['PLUGINS'] = PLUGINS
|
||||||
env['EXTRA_FREETYPE_LIBS'] = []
|
env['EXTRA_FREETYPE_LIBS'] = []
|
||||||
|
env['SQLITE_LINKFLAGS'] = []
|
||||||
# previously a leading / was expected for LIB_DIR_NAME
|
# previously a leading / was expected for LIB_DIR_NAME
|
||||||
# now strip it to ensure expected behavior
|
# now strip it to ensure expected behavior
|
||||||
if env['LIB_DIR_NAME'].startswith(os.path.sep):
|
if env['LIB_DIR_NAME'].startswith(os.path.sep):
|
||||||
|
@ -1236,11 +1237,29 @@ if not preconfigured:
|
||||||
env.Replace(**backup)
|
env.Replace(**backup)
|
||||||
env['SKIPPED_DEPS'].append(details['lib'])
|
env['SKIPPED_DEPS'].append(details['lib'])
|
||||||
if plugin == 'sqlite':
|
if plugin == 'sqlite':
|
||||||
|
sqlite_backup = env.Clone().Dictionary()
|
||||||
|
|
||||||
|
# if statically linking, on linux we likely
|
||||||
|
# need to link sqlite to pthreads and dl
|
||||||
|
if env['RUNTIME_LINK'] == 'static':
|
||||||
|
if conf.CheckPKGConfig('0.15.0') and conf.CheckPKG('sqlite3'):
|
||||||
|
sqlite_env = env.Clone()
|
||||||
|
try:
|
||||||
|
sqlite_env.ParseConfig('pkg-config --static --libs sqlite3')
|
||||||
|
for lib in sqlite_env['LIBS']:
|
||||||
|
if not lib in env['LIBS']:
|
||||||
|
env["SQLITE_LINKFLAGS"].append(lib)
|
||||||
|
env.Append(LIBS=lib)
|
||||||
|
except OSError,e:
|
||||||
|
pass
|
||||||
|
|
||||||
if not conf.sqlite_has_rtree():
|
if not conf.sqlite_has_rtree():
|
||||||
env.Replace(**backup)
|
env.Replace(**sqlite_backup)
|
||||||
if details['lib'] in env['LIBS']:
|
if details['lib'] in env['LIBS']:
|
||||||
env['LIBS'].remove(details['lib'])
|
env['LIBS'].remove(details['lib'])
|
||||||
env['SKIPPED_DEPS'].append('sqlite_rtree')
|
env['SKIPPED_DEPS'].append('sqlite_rtree')
|
||||||
|
else:
|
||||||
|
env.Replace(**sqlite_backup)
|
||||||
|
|
||||||
elif details['lib'] and details['inc']:
|
elif details['lib'] and details['inc']:
|
||||||
if not conf.CheckLibWithHeader(details['lib'], details['inc'], details['lang']):
|
if not conf.CheckLibWithHeader(details['lib'], details['inc'], details['lang']):
|
||||||
|
|
Loading…
Reference in a new issue