mirror of
https://github.com/psycopg/psycopg2.git
synced 2025-07-31 18:40:09 +03:00
Take libdir from pg_config --ldflags
On OS X with OpenSSL installed via brew, `-lssl` is not found during the linker stage. This can be remedied by correctly taking into account the build-time settings for PostgreSQL. Since the format is incompatible, this commit introduces some string parsing to retrieve the directories referenced in the linker call.
This commit is contained in:
parent
bc65c636ae
commit
1c57209144
5
setup.py
5
setup.py
|
@ -409,6 +409,11 @@ For further information please check the 'doc/src/install.rst' file (also at
|
|||
|
||||
try:
|
||||
self.library_dirs.append(pg_config_helper.query("libdir"))
|
||||
# Parse LD_FLAGS: turn "-L/foo -L/bar -Wxyz" into ["/foo", "/bar"]
|
||||
ld_flags = pg_config_helper.query("ldflags")
|
||||
ld_flags = filter(lambda x: x.startswith('-L'), ld_flags.split(' '))
|
||||
ld_flags = map(lambda x: x[2:], ld_flags)
|
||||
self.library_dirs.extend(ld_flags)
|
||||
self.include_dirs.append(pg_config_helper.query("includedir"))
|
||||
self.include_dirs.append(pg_config_helper.query("includedir-server"))
|
||||
pgversion = pg_config_helper.query("version").split()[1]
|
||||
|
|
Loading…
Reference in New Issue
Block a user