summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'net-libs/iojs/files/iojs-1.2.0-pkgconfig.patch')
-rw-r--r--net-libs/iojs/files/iojs-1.2.0-pkgconfig.patch56
1 files changed, 56 insertions, 0 deletions
diff --git a/net-libs/iojs/files/iojs-1.2.0-pkgconfig.patch b/net-libs/iojs/files/iojs-1.2.0-pkgconfig.patch
new file mode 100644
index 000000000000..8eaa0236278b
--- /dev/null
+++ b/net-libs/iojs/files/iojs-1.2.0-pkgconfig.patch
@@ -0,0 +1,56 @@
+configure: fix pkg_config usage
+
+Cross compilation did pick up wrong libraries as it was using the system
+pkg-config.
+
+patch by Paul McClave <pmcclave@chromium.org>
+
+--- a/configure
++++ b/configure
+@@ -299,12 +299,13 @@
+
+
+ def pkg_config(pkg):
+- cmd = os.popen('pkg-config --libs %s' % pkg, 'r')
++ pkg_config = os.environ.get('PKG_CONFIG', 'pkg-config')
++ cmd = os.popen(pkg_config + ' --libs %s' % pkg, 'r')
+ libs = cmd.readline().strip()
+ ret = cmd.close()
+ if (ret): return None
+
+- cmd = os.popen('pkg-config --cflags %s' % pkg, 'r')
++ cmd = os.popen(pkg_config + ' --cflags %s' % pkg, 'r')
+ cflags = cmd.readline().strip()
+ ret = cmd.close()
+ if (ret): return None
+@@ -553,15 +554,21 @@
+ def configure_libz(o):
+ o['variables']['node_shared_zlib'] = b(options.shared_zlib)
+
+- # assume shared_zlib if one of these is set?
+- if options.shared_zlib_libpath:
+- o['libraries'] += ['-L%s' % options.shared_zlib_libpath]
+- if options.shared_zlib_libname:
+- o['libraries'] += ['-l%s' % options.shared_zlib_libname]
+- elif options.shared_zlib:
+- o['libraries'] += ['-lz']
+- if options.shared_zlib_includes:
+- o['include_dirs'] += [options.shared_zlib_includes]
++ if options.shared_zlib:
++ (libs, cflags) = pkg_config('zlib') or ('-lz', '')
++
++ if options.shared_zlib_libpath:
++ o['libraries'] += ['-L%s' % options.shared_zlib_libpath]
++
++ if options.shared_zlib_libname:
++ o['libraries'] += ['-l%s' % options.shared_zlib_libname]
++ else:
++ o['libraries'] += libs.split()
++
++ if options.shared_zlib_includes:
++ o['include_dirs'] += [options.shared_zlib_includes]
++ else:
++ o['cflags'] += cflags.split()
+
+
+ def configure_http_parser(o):