diff options
Diffstat (limited to 'meta/classes')
-rw-r--r-- | meta/classes/package.bbclass | 34 |
1 files changed, 27 insertions, 7 deletions
diff --git a/meta/classes/package.bbclass b/meta/classes/package.bbclass index 082f233d88..4eb349d431 100644 --- a/meta/classes/package.bbclass +++ b/meta/classes/package.bbclass | |||
@@ -933,12 +933,17 @@ python package_do_shlibs() { | |||
933 | if m: | 933 | if m: |
934 | needed[pkg].append(m.group(1)) | 934 | needed[pkg].append(m.group(1)) |
935 | m = re.match("\s+SONAME\s+([^\s]*)", l) | 935 | m = re.match("\s+SONAME\s+([^\s]*)", l) |
936 | if m and not m.group(1) in sonames: | 936 | if m: |
937 | # if library is private (only used by package) then do not build shlib for it | 937 | this_soname = m.group(1) |
938 | if not private_libs or -1 == private_libs.find(m.group(1)): | 938 | if not this_soname in sonames: |
939 | sonames.append(m.group(1)) | 939 | # if library is private (only used by package) then do not build shlib for it |
940 | if m and libdir_re.match(root): | 940 | if not private_libs or -1 == private_libs.find(this_soname): |
941 | needs_ldconfig = True | 941 | sonames.append(this_soname) |
942 | if libdir_re.match(root): | ||
943 | needs_ldconfig = True | ||
944 | if snap_symlinks and (file != this_soname): | ||
945 | renames.append((os.path.join(root, file), os.path.join(root, this_soname))) | ||
946 | |||
942 | def darwin_so(root, path, file): | 947 | def darwin_so(root, path, file): |
943 | fullpath = os.path.join(root, file) | 948 | fullpath = os.path.join(root, file) |
944 | if not os.path.exists(fullpath): | 949 | if not os.path.exists(fullpath): |
@@ -1000,6 +1005,17 @@ python package_do_shlibs() { | |||
1000 | if name: | 1005 | if name: |
1001 | needed[pkg].append(name) | 1006 | needed[pkg].append(name) |
1002 | #bb.note("Adding %s for %s" % (name, pkg)) | 1007 | #bb.note("Adding %s for %s" % (name, pkg)) |
1008 | |||
1009 | if bb.data.getVar('PACKAGE_SNAP_LIB_SYMLINKS', d, True) == "1": | ||
1010 | snap_symlinks = True | ||
1011 | else: | ||
1012 | snap_symlinks = False | ||
1013 | |||
1014 | if (bb.data.getVar('USE_LDCONFIG', d, True) or "1") == "1": | ||
1015 | use_ldconfig = True | ||
1016 | else: | ||
1017 | use_ldconfig = False | ||
1018 | |||
1003 | needed = {} | 1019 | needed = {} |
1004 | shlib_provider = {} | 1020 | shlib_provider = {} |
1005 | private_libs = bb.data.getVar('PRIVATE_LIBS', d, True) | 1021 | private_libs = bb.data.getVar('PRIVATE_LIBS', d, True) |
@@ -1009,6 +1025,7 @@ python package_do_shlibs() { | |||
1009 | 1025 | ||
1010 | needed[pkg] = [] | 1026 | needed[pkg] = [] |
1011 | sonames = list() | 1027 | sonames = list() |
1028 | renames = list() | ||
1012 | top = os.path.join(pkgdest, pkg) | 1029 | top = os.path.join(pkgdest, pkg) |
1013 | for root, dirs, files in os.walk(top): | 1030 | for root, dirs, files in os.walk(top): |
1014 | for file in files: | 1031 | for file in files: |
@@ -1020,6 +1037,9 @@ python package_do_shlibs() { | |||
1020 | darwin_so(root, dirs, file) | 1037 | darwin_so(root, dirs, file) |
1021 | elif os.access(path, os.X_OK) or lib_re.match(file): | 1038 | elif os.access(path, os.X_OK) or lib_re.match(file): |
1022 | linux_so(root, dirs, file) | 1039 | linux_so(root, dirs, file) |
1040 | for (old, new) in renames: | ||
1041 | bb.note("Renaming %s to %s" % (old, new)) | ||
1042 | os.rename(old, new) | ||
1023 | shlibs_file = os.path.join(shlibswork_dir, pkg + ".list") | 1043 | shlibs_file = os.path.join(shlibswork_dir, pkg + ".list") |
1024 | shver_file = os.path.join(shlibswork_dir, pkg + ".ver") | 1044 | shver_file = os.path.join(shlibswork_dir, pkg + ".ver") |
1025 | if len(sonames): | 1045 | if len(sonames): |
@@ -1031,7 +1051,7 @@ python package_do_shlibs() { | |||
1031 | fd = open(shver_file, 'w') | 1051 | fd = open(shver_file, 'w') |
1032 | fd.write(ver + '\n') | 1052 | fd.write(ver + '\n') |
1033 | fd.close() | 1053 | fd.close() |
1034 | if needs_ldconfig: | 1054 | if needs_ldconfig and use_ldconfig: |
1035 | bb.debug(1, 'adding ldconfig call to postinst for %s' % pkg) | 1055 | bb.debug(1, 'adding ldconfig call to postinst for %s' % pkg) |
1036 | postinst = bb.data.getVar('pkg_postinst_%s' % pkg, d, True) or bb.data.getVar('pkg_postinst', d, True) | 1056 | postinst = bb.data.getVar('pkg_postinst_%s' % pkg, d, True) or bb.data.getVar('pkg_postinst', d, True) |
1037 | if not postinst: | 1057 | if not postinst: |