On Thu, Jun 09, 2022 at 10:26:13AM +0100, Simon McVittie wrote:
> On Thu, 09 Jun 2022 at 13:03:25 +0500, Andrey Rahmatullin wrote:
> > The normal way for this is putting it into
> > /usr/lib/<triplet>/pkgname/foo.so, and according to the code below you'll
> > need the full path at the run time so you indeed need the triplet at both
> > build and run time.
> 
> You can do something like
> 
>      handle = dlopen("/usr/${LIB}/pkgname/foo.so", flags);
> [...]
> 
> Then you'd install the private library into what Autotools would refer to
> as ${libdir}/pkgname/foo.so (adjust as necessary for other build systems)
> and it will usually end up in the correct place. This assumes that
> ${libdir} is configured to something like
> ${exec_prefix}/lib/x86_64-linux-gnu or ${exec_prefix}/lib64 as appropriate
> for the distribution, but that's normally true anyway, and in particular
> should be true in debhelper.

Thanks Simon!

The build system here is the standard Python setup.py, except for this
library.  That is built by the following script:

---
g++ -m64 -shared -o attach_linux_amd64.so -fPIC -nostartfiles attach.cpp
mv attach_linux_amd64.so ../attach_linux_amd64.so
echo Compiled amd64
---

There's not even an attempt at working out ${libdir} or so on.  It
seems like overkill to set up a whole Autotools environment for this
one file :-(

I'm still unsure why I shouldn't just put it in the Python package
area near the cython files such as
/usr/lib/python3/dist-packages/_pydevd_bundle/pydevd_cython.cpython-310-x86_64-linux-gnu.so

Best wishes,

   Julian

Reply via email to