acmel / dwarves

Pahole and the dwarves
GNU General Public License v2.0
192 stars 52 forks source link

libraries end up installed directly under CMAKE_INSTALL_PREFIX #48

Open Apteryks opened 6 months ago

Apteryks commented 6 months ago

Currently, this is what the installation tree looks like when specifying just the global installation prefix:

$ ll /gnu/store/g6iwnr0wrga0zr8f6bd97vz2jq1h944r-dwarves-1.26/
total 524
dr-xr-xr-x 1 root root    186 31 déc.   1969 bin/
dr-xr-xr-x 1 root root     22 31 déc.   1969 etc/
dr-xr-xr-x 1 root root     14 31 déc.   1969 include/
lrwxrwxrwx 1 root root     20 31 déc.   1969 libdwarves_emit.so -> libdwarves_emit.so.1
lrwxrwxrwx 1 root root     24 31 déc.   1969 libdwarves_emit.so.1 -> libdwarves_emit.so.1.0.0
-r-xr-xr-x 2 root root  32712 31 déc.   1969 libdwarves_emit.so.1.0.0
lrwxrwxrwx 1 root root     26 31 déc.   1969 libdwarves_reorganize.so -> libdwarves_reorganize.so.1
lrwxrwxrwx 1 root root     30 31 déc.   1969 libdwarves_reorganize.so.1 -> libdwarves_reorganize.so.1.0.0
-r-xr-xr-x 2 root root  28752 31 déc.   1969 libdwarves_reorganize.so.1.0.0
lrwxrwxrwx 1 root root     15 31 déc.   1969 libdwarves.so -> libdwarves.so.1
lrwxrwxrwx 1 root root     19 31 déc.   1969 libdwarves.so.1 -> libdwarves.so.1.0.0
-r-xr-xr-x 2 root root 442624 31 déc.   1969 libdwarves.so.1.0.0
dr-xr-xr-x 1 root root     26 31 déc.   1969 share/

This is unconventional; the convention being that the libraries should go under $PREFIX/lib.

Apteryks commented 6 months ago

The README does mention one should use cmake -D__LIB=lib .., but it seems this should at least be the default.

Apteryks commented 6 months ago

I guess it should simply honor CMAKE_INSTALL_LIBDIRinstead of replacing it with __LIB. Distributions such as GNU Guix are already setting that as part of their build tooling.

matthew-olson-intel commented 1 week ago

I agree; the CMake file should simply install in CMAKE_INSTALL_LIBDIR. Latest master still installs things into /usr/local by default.