Multiarch in Debian means that multiple architectures can be installed
together in a single system. If multiple architectures are installed,
we should not end up with installing libraries compiled for the host
system the directory for the last detected architecture, which might
be different from the host.
In my case, x86 library was installed to /usr/lib/arm-linux-gnueabihf.
To detect the correct directory, we now use the dpkg-architecture
command, which knows the correct path. I hope this should work on all
Debian/Ubuntu-based systems.
It might be possible that the previously used checks in the Makefile
were also effective on some non-Debian distributions and this stops
working because those distributions don't have the dpkg-architecture
command. The workaround is to specify LIBDIR explicitly on the make
command line:
Multiarch in Debian means that multiple architectures can be installed together in a single system. If multiple architectures are installed, we should not end up with installing libraries compiled for the host system the directory for the last detected architecture, which might be different from the host.
In my case, x86 library was installed to /usr/lib/arm-linux-gnueabihf.
To detect the correct directory, we now use the dpkg-architecture command, which knows the correct path. I hope this should work on all Debian/Ubuntu-based systems.
It might be possible that the previously used checks in the Makefile were also effective on some non-Debian distributions and this stops working because those distributions don't have the dpkg-architecture command. The workaround is to specify LIBDIR explicitly on the make command line: