|
Lines 9-14
import io
Link Here
|
| 9 |
import stat |
9 |
import stat |
| 10 |
import sys |
10 |
import sys |
| 11 |
import time |
11 |
import time |
|
|
12 |
import re |
| 13 |
import platform |
| 12 |
|
14 |
|
| 13 |
import portage |
15 |
import portage |
| 14 |
from portage import os, _encodings, _unicode_decode, _unicode_encode |
16 |
from portage import os, _encodings, _unicode_decode, _unicode_encode |
|
Lines 189-199
def _env_update(makelinks, target_root, prev_mtimes, contents, env,
Link Here
|
| 189 |
if (oldld != newld): |
191 |
if (oldld != newld): |
| 190 |
#ld.so.conf needs updating and ldconfig needs to be run |
192 |
#ld.so.conf needs updating and ldconfig needs to be run |
| 191 |
myfd = atomic_ofstream(ldsoconf_path) |
193 |
myfd = atomic_ofstream(ldsoconf_path) |
|
|
194 |
if ostype == "FreeBSD" and platform.machine() == "amd64": |
| 195 |
ld32soconf_path = os.path.join(eroot, "etc", "ld32.so.conf") |
| 196 |
myfd32 = atomic_ofstream(ld32soconf_path) |
| 192 |
myfd.write("# ld.so.conf autogenerated by env-update; make all changes to\n") |
197 |
myfd.write("# ld.so.conf autogenerated by env-update; make all changes to\n") |
| 193 |
myfd.write("# contents of /etc/env.d directory\n") |
198 |
myfd.write("# contents of /etc/env.d directory\n") |
| 194 |
for x in specials["LDPATH"]: |
199 |
for x in specials["LDPATH"]: |
| 195 |
myfd.write(x + "\n") |
200 |
if ostype == "FreeBSD" and platform.machine() == "amd64": |
|
|
201 |
if re.search("lib32", x) != None: |
| 202 |
myfd32.write(x + "\n") |
| 203 |
elif re.search("gcc", x) != None: |
| 204 |
gccldconf = x.split('\n') |
| 205 |
for y in gccldconf: |
| 206 |
if re.search("gcc.*/32", y) != None: |
| 207 |
myfd32.write(y + "\n") |
| 208 |
else: |
| 209 |
myfd.write(y + "\n") |
| 210 |
else: |
| 211 |
myfd.write(x + "\n") |
| 212 |
else: |
| 213 |
myfd.write(x + "\n") |
| 196 |
myfd.close() |
214 |
myfd.close() |
|
|
215 |
if ostype == "FreeBSD" and platform.machine() == "amd64": |
| 216 |
myfd32.close() |
| 197 |
|
217 |
|
| 198 |
potential_lib_dirs = set() |
218 |
potential_lib_dirs = set() |
| 199 |
for lib_dir_glob in ('usr/lib*', 'lib*'): |
219 |
for lib_dir_glob in ('usr/lib*', 'lib*'): |
|
Lines 328-333
def _env_update(makelinks, target_root, prev_mtimes, contents, env,
Link Here
|
| 328 |
os.system(("cd / ; %s -elf -i " + \ |
348 |
os.system(("cd / ; %s -elf -i " + \ |
| 329 |
"-f '%svar/run/ld-elf.so.hints' '%setc/ld.so.conf'") % \ |
349 |
"-f '%svar/run/ld-elf.so.hints' '%setc/ld.so.conf'") % \ |
| 330 |
(ldconfig, target_root, target_root)) |
350 |
(ldconfig, target_root, target_root)) |
|
|
351 |
if ostype == "FreeBSD" and platform.machine() == "amd64": |
| 352 |
writemsg_level(_(">>> Regenerating %svar/run/ld-elf32.so.hints...\n") % \ |
| 353 |
target_root) |
| 354 |
os.system(("cd / ; %s -32 -elf -i " + \ |
| 355 |
"-f '%svar/run/ld-elf32.so.hints' '%setc/ld32.so.conf'") % \ |
| 356 |
(ldconfig, target_root, target_root)) |
| 331 |
|
357 |
|
| 332 |
del specials["LDPATH"] |
358 |
del specials["LDPATH"] |
| 333 |
|
359 |
|