How to get the system library path on Unix (Linux, FreeBSD)
I need a more-or-less portable programmatic way for querying the the dynamic library path list. For Linux, I can concatenate the `$LD_LIBRARY_PATH` and the contents of `/etc/ld.so.conf` (processing the `include` directives as needed), but that doesn't work e.g. on FreeBSD.

Ultimately, I need a Python function for doing that. It can call gcc or other external commands if needed.
How to get the system library path on Unix (Linux, FreeBSD)
===

I need a more-or-less portable programmatic way for querying the the dynamic library path list. For Linux, I can concatenate the `$LD_LIBRARY_PATH` and the contents of `/etc/ld.so.conf` (processing the `include` directives as needed), but that doesn't work e.g. on FreeBSD.

Ultimately, I need a Python function for doing that. It can call gcc or other external commands if needed.