ImageRules: do not include catalogs from .so in dependencies

The rule to add an executable or shared library to the Haiku image
automatically also includes the corresponding locale catalogs and MIME
database entries.

The locale catalogs for .a files linked in the executable are also
included, since .a files are not themselves added to the same package.
This makes sure the executable has all the catalogs it needs.

The jam rule was written assuming that NEEDLIBS would only contain .a
files, but that is not the case when compiling Haiku. Libroot for
example is also in NEEDLIBS (this makes sure it is linked by absolute
file path, whereas LINKLIBS would instead use -lroot and may link the
host system one).

Filter out .so files from the NEEDLIBS list when determining which
catalogs to include.

Fixes #19721.

Change-Id: I04604bd37c656f987dd17be8db6edffe88cee651
Reviewed-on: https://review.haiku-os.org/c/haiku/+/10144
Reviewed-by: Adrien Destugues <[email protected]>
Tested-by: Commit checker robot <[email protected]>
This commit is contained in:
PulkoMandy
2025-12-28 11:57:29 +00:00
committed by Adrien Destugues
parent 457cf2a9bf
commit 368cac3c9d
+13 -9
View File
@@ -275,15 +275,19 @@ rule AddFilesToContainer container : directoryTokens : targets : destName
# files, add those, too.
local catalogTargets = $(target) + [ on $(target) return $(NEEDLIBS) ] ;
for catalogTarget in $(catalogTargets) {
local catalogs
= [ on $(catalogTarget) return $(HAIKU_CATALOG_FILES) ] ;
if $(catalogs) {
local signature
= [ on $(catalogTarget)
return $(HAIKU_CATALOG_SIGNATURE) ] ;
AddFilesToContainer $(container)
: $(systemDirTokens) data locale catalogs $(signature)
: $(catalogs) ;
# NEEDLIBS may also contain .so files, ignore these. They will be added to the image
# separately
if $(catalogTarget:S) != .so {
local catalogs
= [ on $(catalogTarget) return $(HAIKU_CATALOG_FILES) ] ;
if $(catalogs) {
local signature
= [ on $(catalogTarget)
return $(HAIKU_CATALOG_SIGNATURE) ] ;
AddFilesToContainer $(container)
: $(systemDirTokens) data locale catalogs $(signature)
: $(catalogs) ;
}
}
}