[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

How to find Multi-Arch path(s)



Hi,

I want to package a software, "iraf" (with extensions) that uses some
system dependent binaries internally. Some of the extensions will be
available in 32 bit only, so this is a good use case for
Multi-Arch. That means, that the binaries will go to

/usr/lib/${DEB_TARGET_MULTIARCH}/iraf

At run time, I would now need to get the list of paths that are
supported by the system, in their "preferred" order (so, even from a
binary compiled for i386, it would be preferred to call a x86_64 binary
if that is supported on the system). This list is generally not known at
compile time, since it depends on the details of the target system
configuration (f.e. an architecture may be supported via a software
emulation).

However, I could not find out how to get this list?

"dpkg --print-architecture" and "dpkg --print-foreign-architectures"
gives only what dpkg is configured for, not what is supported as
executable. And, it does not return the multi-arch triplet.

"dpkg-architecture -q DEB_HOST_MULTIARCH" may give the host architecture
(default, or specified by the arch name), but from the manpage and the
package description of dpkg-dev it is not intended for runtime, but for
package build/development.

So, how can I canonically (ideally from C) retrieve a sorted list of
supported multi arch paths at runtime? Or is there another good way to
solve this? I would think it is a standard use case for multi arch,
isn't it?

Best regards

Ole


Reply to: