Linaro / OpenCSD

CoreSight trace stream decoder developed openly
https://github.com/Linaro/opencsd/wiki
Other
141 stars 53 forks source link

Support DESTDIR in install targets #30

Closed rossburton closed 3 years ago

rossburton commented 4 years ago

The idiom for install rules (as per automake, cmake, meson, etc) is that you can set PREFIX=/usr and DESTDIR=/my/build/tree, so that you can install to /my/build/tree/usr/ for packaging.

OpenCSD doesn't support this and currently PREFIX has to be manually extended with the DESTDIR. The moment the build wants to embed the prefix into the binaries, this workaround will fail.

Simply adding $(DESTDIR) before the target paths in the install rule will solve this.

mikel-armbb commented 4 years ago

Hi Ross, [added Coresight ML]

AFAIK we haven't had issues with packaging reported by Debian / RPM packagers.

That said I have no objection to adding something like this. Are you suggesting that in the makefile:

INSTALL_LIB_DIR=$(PREFIX)/$(LIB_PATH) INSTALL_BIN_DIR=$(PREFIX)/bin export INSTALL_INCLUDE_DIR=$(PREFIX)/include/

becomes

INSTALL_LIB_DIR=$(DESTDIR)$(PREFIX)/$(LIB_PATH) INSTALL_BIN_DIR=$(DESTDIR)$(PREFIX)/bin export INSTALL_INCLUDE_DIR=$(DESTDIR)$(PREFIX)/include/

?

If this works for you or you want to supply a patch that does, I can test and providing no objections can include in next release. (probably next week to collect up a number of minor outstanding issues)

Regards

Mike

On Mon, 26 Oct 2020 at 09:10, Ross Burton notifications@github.com wrote:

The idiom for install rules (as per automake, cmake, meson, etc) is that you can set PREFIX=/usr and DESTDIR=/my/build/tree, so that you can install to /my/build/tree/usr/ for packaging.

OpenCSD doesn't support this and currently PREFIX has to be manually extended with the DESTDIR. The moment the build wants to embed the prefix into the binaries, this workaround will fail.

Simply adding $(DESTDIR) before the target paths in the install rule will solve this.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/Linaro/OpenCSD/issues/30, or unsubscribe https://github.com/notifications/unsubscribe-auth/ADF7BM7IEV3ZTXYVXP7ZT4LSMU4I3ANCNFSM4S7DFCMA .

-- Mike Leach Principal Engineer, ARM Ltd. Manchester Design Centre. UK

rossburton commented 4 years ago

The Debian packages also go through hoops to install, this line is working around the same issue: https://salsa.debian.org/wookey/libopencsd/-/blob/dgit/sid/debian/rules#L51

Yes, that change would be sufficient.

mikel-armbb commented 3 years ago

Added to v0.14.4