JonnyJD/python-discid

Find libdiscid in current folder for linux/unix

Closed this issue · 2 comments

On Windows and Darwin finding libdiscid in the current folder works fine, but on Linux/Unix we have to use ./libdiscid.*

Problem found on a sunos5 machine (sys.platform) without root access (no system-wide install) and verified on linux.

We have to make sure that the general detection still works, of course.

This blocks #16

On Linux find_library finds a system-wide library and returns the (base) filename.
./libdiscid.so.0 is needed to access the file in the current folder ("local") (on a probably "standard" setup).

On Darwin find_library will give a full path if it finds a system-wide library, but will also find a local library already.
(installing libdiscid per cmake with sudo make install works fine, by the way)
Local libraries don't need ./ prepended, and the current folder is already preferred!

On Windows find_library will find the library (given actual file names) in the Windows system32 folder/PATH and give the full path. It also finds a library in the current folder (and gives the filename), but system-wide is preferred.
Local libraries don't need .\ prepended, but both .\ and ./ prepended work.

On Cygwin find_library finds the library system-wide (with "discid", found when in /usr/local/bin/) and returns the (base) filename. find_library will also find a "local" library and will prefer it. Libdiscid's cmake make install will install into /usr/local/lib, which is not found by cygwin.
However, ./cygdiscid-0.dll and .\cycdiscid-0.dll still find a system-wide library, but only when no local library is found.

sunos5 needs ./ prepended. No further testing available.

BSD was not tested, but I guess they work the same as Linux and SunOS.

See also:
http://docs.python.org/2/library/ctypes.html#finding-shared-libraries