Skip to content

Commit

Permalink
build: fix configuring with prebuilt libraries
Browse files Browse the repository at this point in the history
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: nodejs#3135
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Johan Bergström <bugs@bergstroem.nu>
Reviewed-By: Sakthipriyan Vairamani <thechargingvolcano@gmail.com>
  • Loading branch information
zyxar authored and bnoordhuis committed Nov 16, 2015
1 parent 9d0396c commit e2eb334
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions configure
Original file line number Diff line number Diff line change
Expand Up @@ -753,11 +753,15 @@ def configure_library(lib, output):
if pkg_cflags:
output['include_dirs'] += (
filter(None, map(str.strip, pkg_cflags.split('-I'))))
elif options.__dict__[shared_lib + '_includes']:
output['include_dirs'] += [options.__dict__[shared_lib + '_includes']]

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

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

0 comments on commit e2eb334

Please sign in to comment.