ares-emulator / ares

ares is a cross-platform, open source, multi-system emulator, focusing on accuracy and preservation.
https://ares-emu.net
Other
939 stars 114 forks source link

Available library/driver detection in ruby/GNUmakefile is unreliable #321

Open bluewww opened 2 years ago

bluewww commented 2 years ago

I realized when compiling ares on an opensuse tumbleweed machine that drivers are not being included. There seems to be a broad check in ruby/GNUmakefile with test -e /usr/lib/lib$1.so to check whether certain *.so files are available.

Unfortunately, this does not work like this on some distros. For example my libudev has the following full path: /usr/lib/libudev.so.1.

Maybe consider using pkg-config instead to do the detection?

Screwtapello commented 2 years ago

I wrote a patch to make higan use pkg-config, but it significantly slowed down the build process on FreeBSD so he declined to apply it to ares and did his own thing instead.

That said, applications shouldn't link with *.so.1 or *.so.97 or *.so.8.6.7.5.3.0.9 or whatever, they should specifically link to the .so file and the system figures out which specific version of the library to link against. Usually the libwhatever.solink ships with the libwhatever-dev package that includes the headers and pkg-config file, not the libwhatever package that includes libwhatever.so.1.

bluewww commented 2 years ago

You are right I forgot to install the devel package for libudev. Nonetheless for example my libSDL2 is placed under /usr/lib64/libSDL2.so and not /usr/lib so the test -e fails either way.

LukeUsher commented 2 years ago

I wrote a patch to make higan use pkg-config, but it significantly slowed down the build process on FreeBSD so he declined to apply it to ares and did his own thing instead.

That said, applications shouldn't link with *.so.1 or *.so.97 or *.so.8.6.7.5.3.0.9 or whatever, they should specifically link to the .so file and the system figures out which specific version of the library to link against. Usually the libwhatever.solink ships with the libwhatever-dev package that includes the headers and pkg-config file, not the libwhatever package that includes libwhatever.so.1.

I'd be willing to take a look at this if you could create a pull-request

bsdcode commented 1 month ago

Isn't this issue fixed with https://github.com/ares-emulator/ares/commit/be1f4243987adccb23c9145b97f3b8f54c02ae18 since two years?

And regarding:

I wrote a patch to make higan use pkg-config, but it significantly slowed down the build process on FreeBSD so he declined to apply it to ares and did his own thing instead.

no problem here on FreeBSD ;) pkg-config is widely used on FreeBSD too.