Index: build/config/linux/pkg-config.py |
diff --git a/build/config/linux/pkg-config.py b/build/config/linux/pkg-config.py |
index b0381583c2cad6b0a411da1ed52bc2a24ddf7d73..87fa86da92bb4c29b55b7f709ea65d1dc1dd29d1 100644 |
--- a/build/config/linux/pkg-config.py |
+++ b/build/config/linux/pkg-config.py |
@@ -26,6 +26,9 @@ from optparse import OptionParser |
# When using a sysroot, you must also specify the architecture via |
# "-a <arch>" where arch is either "x86" or "x64". |
# |
+# CrOS builds set the system_libdir. This is specified with |
+# "--system_libdir <libdir>". It defaults to 'lib' |
+# |
# Additionally, you can specify the option --atleast-version. This will skip |
# the normal outputting of a dictionary and instead print true or false, |
# depending on the return value of pkg-config for the given package. |
@@ -53,13 +56,8 @@ def SetConfigPath(options): |
print "You must specify an architecture via -a if using a sysroot." |
sys.exit(1) |
- # In the gyp world this is configurable via the 'system_libdir' variable, |
- # which doesn't seem to have an equivelent in gn yet. |
- # TOOD(sbc): Make this configurable like it is under gyp. |
- libpath = 'lib' |
- |
# Add the sysroot path to the environment's PKG_CONFIG_PATH |
- config_path = sysroot + '/usr/' + libpath + '/pkgconfig' |
+ config_path = sysroot + '/usr/' + options.system_libdir + '/pkgconfig' |
config_path += ':' + sysroot + '/usr/share/pkgconfig' |
if 'PKG_CONFIG_PATH' in os.environ: |
os.environ['PKG_CONFIG_PATH'] += ':' + config_path |
@@ -111,6 +109,8 @@ parser.add_option('-p', action='store', dest='pkg_config', type='string', |
parser.add_option('-v', action='append', dest='strip_out', type='string') |
parser.add_option('-s', action='store', dest='sysroot', type='string') |
parser.add_option('-a', action='store', dest='arch', type='string') |
+parser.add_option('--system_libdir', action='store', dest='system_libdir', |
+ type='string', default='lib') |
parser.add_option('--atleast-version', action='store', |
dest='atleast_version', type='string') |
parser.add_option('--libdir', action='store_true', dest='libdir') |