Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(11)

Side by Side Diff: build/config/linux/pkg-config.py

Issue 1530723002: GN: Don't default to using lib64 in PKG_CONFIG_PATH (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | build/linux/pkg-config-wrapper » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 # Copyright (c) 2013 The Chromium Authors. All rights reserved. 1 # Copyright (c) 2013 The Chromium Authors. All rights reserved.
2 # Use of this source code is governed by a BSD-style license that can be 2 # Use of this source code is governed by a BSD-style license that can be
3 # found in the LICENSE file. 3 # found in the LICENSE file.
4 4
5 import json 5 import json
6 import os 6 import os
7 import subprocess 7 import subprocess
8 import sys 8 import sys
9 import re 9 import re
10 from optparse import OptionParser 10 from optparse import OptionParser
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
45 45
46 sysroot = options.sysroot 46 sysroot = options.sysroot
47 if not sysroot: 47 if not sysroot:
48 sysroot = "" 48 sysroot = ""
49 49
50 # Compute the library path name based on the architecture. 50 # Compute the library path name based on the architecture.
51 arch = options.arch 51 arch = options.arch
52 if sysroot and not arch: 52 if sysroot and not arch:
53 print "You must specify an architecture via -a if using a sysroot." 53 print "You must specify an architecture via -a if using a sysroot."
54 sys.exit(1) 54 sys.exit(1)
55 if arch == 'x64': 55
56 libpath = 'lib64' 56 # In the gyp world this is configurable via the 'system_libdir' variable,
57 else: 57 # which doesn't seem to have an equivelent in gn yet.
58 libpath = 'lib' 58 # TOOD(sbc): Make this configurable like it is under gyp.
59 libpath = 'lib'
59 60
60 # Add the sysroot path to the environment's PKG_CONFIG_PATH 61 # Add the sysroot path to the environment's PKG_CONFIG_PATH
61 config_path = sysroot + '/usr/' + libpath + '/pkgconfig' 62 config_path = sysroot + '/usr/' + libpath + '/pkgconfig'
62 config_path += ':' + sysroot + '/usr/share/pkgconfig' 63 config_path += ':' + sysroot + '/usr/share/pkgconfig'
63 if 'PKG_CONFIG_PATH' in os.environ: 64 if 'PKG_CONFIG_PATH' in os.environ:
64 os.environ['PKG_CONFIG_PATH'] += ':' + config_path 65 os.environ['PKG_CONFIG_PATH'] += ':' + config_path
65 else: 66 else:
66 os.environ['PKG_CONFIG_PATH'] = config_path 67 os.environ['PKG_CONFIG_PATH'] = config_path
67 68
68 69
(...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after
191 # this anyway. Removing it here prevents a bunch of duplicate inclusions on 192 # this anyway. Removing it here prevents a bunch of duplicate inclusions on
192 # the command line. 193 # the command line.
193 pass 194 pass
194 else: 195 else:
195 cflags.append(flag) 196 cflags.append(flag)
196 197
197 # Output a GN array, the first one is the cflags, the second are the libs. The 198 # Output a GN array, the first one is the cflags, the second are the libs. The
198 # JSON formatter prints GN compatible lists when everything is a list of 199 # JSON formatter prints GN compatible lists when everything is a list of
199 # strings. 200 # strings.
200 print json.dumps([includes, cflags, libs, lib_dirs, ldflags]) 201 print json.dumps([includes, cflags, libs, lib_dirs, ldflags])
OLDNEW
« no previous file with comments | « no previous file | build/linux/pkg-config-wrapper » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698