Skip to content

Commit e2eb334

Browse files
zyxarbnoordhuis
authored andcommitted
build: fix configuring with prebuilt libraries
Fix configure_library() to produce correct LDFLAGS when configuring with prebuilt 3rd-party libraries (libuv, openssl, etc) using `pkg-config' or `--shared-{LIBRARY}-includes=xxx --shared-{LIBRARY}-libpath=xxx'. PR-URL: #3135 Reviewed-By: Ben Noordhuis <[email protected]> Reviewed-By: Johan Bergström <[email protected]> Reviewed-By: Sakthipriyan Vairamani <[email protected]>
1 parent 9d0396c commit e2eb334

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

configure

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -753,11 +753,15 @@ def configure_library(lib, output):
753753
if pkg_cflags:
754754
output['include_dirs'] += (
755755
filter(None, map(str.strip, pkg_cflags.split('-I'))))
756+
elif options.__dict__[shared_lib + '_includes']:
757+
output['include_dirs'] += [options.__dict__[shared_lib + '_includes']]
756758

757759
# libpath needs to be provided ahead libraries
758760
if pkg_libpath:
759-
output['libraries'] += (
760-
filter(None, map(str.strip, pkg_cflags.split('-L'))))
761+
output['libraries'] += [pkg_libpath]
762+
elif options.__dict__[shared_lib + '_libpath']:
763+
output['libraries'] += [
764+
'-L%s' % options.__dict__[shared_lib + '_libpath']]
761765

762766
default_libs = getattr(options, shared_lib + '_libname')
763767
default_libs = map('-l{0}'.format, default_libs.split(','))

0 commit comments

Comments
 (0)