Skip to content
Snippets Groups Projects
Commit 09625ca7 authored by Joe Garcia's avatar Joe Garcia
Browse files

sysroot shared

parent e4122fd3
No related branches found
No related tags found
No related merge requests found
......@@ -24,6 +24,7 @@ import platform
import shutil
LOG = logging.getLogger(__name__)
sysroot = "/"
# options go here as attributes
OPTS = None
......@@ -162,7 +163,7 @@ def fullrealpath(path,rpaths,loader,executable=None):
return fullrealpath_single(path,rpaths,os.path.dirname(loader),executable)
if len(rpaths)==0:
rpaths=[os.getcwd()]
for p in rpaths+[os.getenv('SYSROOT','/'),os.getcwd()]:
for p in rpaths+[sysroot,os.getcwd()]:
r=fullrealpath_single(path,asUnicode(p),os.path.dirname(loader),executable)
if os.path.exists(r):
return r
......@@ -441,7 +442,7 @@ def probe(base,forbiddenlibs=''):
forbiddenlibs.append(f)
printerr('Forbidden libs are {}'.format(','.join(forbiddenlibs)))
fullbase=os.path.realpath(base)
sysroot=os.getenv('SYSROOT','')
usesysroot=sysroot#os.getenv('SYSROOT','')
for path in hunt_elfs(base,elvish=elvish):
if elvish:
print(path + " => {}".format(printable_rpath(path))),
......@@ -463,8 +464,8 @@ def probe(base,forbiddenlibs=''):
elif lib.startswith('/'):
li=lib
dli=li
if len(sysroot)>1:
li=sysroot+li
if len(usesysroot)>1:
li=usesysroot+li
dli=li
if int(os.getenv("SDKDARWINVERNUMBER"))>=15: #these SDKs don't store dylibs but "tdb" files
if li.endswith('.dylib'):
......@@ -475,7 +476,7 @@ def probe(base,forbiddenlibs=''):
dli=li
if dli.startswith(fullbase):
dli=dli.replace(fullbase,'[ShellB3]:')
if len(sysroot)>1 and dli.startswith(sysroot):
if len(usesysroot)>1 and dli.startswith(usesysroot):
def macVer(v):
vparts=v.replace('*','').split('.')
vv=int(vparts[0])
......@@ -487,7 +488,7 @@ def probe(base,forbiddenlibs=''):
if iv<=11:
return "OS X "+v
return "macOS "+v
dli=dli.replace(sysroot,'['+macVer(os.getenv('MACOSX_DEPLOYMENT_TARGET'))+']:')
dli=dli.replace(usesysroot,'['+macVer(os.getenv('MACOSX_DEPLOYMENT_TARGET'))+']:')
if os.access(li,os.R_OK):
print('{} => {}'.format(lib,dli))
for l in forbiddenlibs:
......@@ -644,6 +645,8 @@ python thosewhohuntelfs.py . common/lib lib --exclude='.*?build/.*' --dry-run --
help='comma-separated library prefixes (e.g. "libxxx,libyyy") that are absolutely forbidden to be linked to (for legacy or known incompatibility)')
parser.add_option('--rpaths', dest='list_rpaths', default=False, action="store_true",
help='just list rpaths of named files')
parser.add_option('--sysroot', dest="sysroot",default=os.getenv('SYSROOT','/'),
help="set the system root, to match up system libraries")
# parser.add_option('-I', '--include-path', dest="includes",
# action="append", help="include path to append to GCCXML call")
......@@ -674,6 +677,9 @@ python thosewhohuntelfs.py . common/lib lib --exclude='.*?build/.*' --dry-run --
OPTS.install_name_tool = os.path.abspath(OPTS.install_name_tool)
assert(os.path.exists(OPTS.install_name_tool))
global sysroot
sysroot=options.sysroot
if not args:
parser.error( 'incorrect arguments, try -h or --help.' )
return 9
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment