proot-me / proot

chroot, mount --bind, and binfmt_misc without privilege/setup for Linux
https://proot-me.github.io
GNU General Public License v2.0
1.96k stars 369 forks source link

Please support overriding ld/pkg-config commands #359

Open nya3jp opened 1 year ago

nya3jp commented 1 year ago

I'd like to build proot with prefixed toolchains, and it requires allowing to override commands with Make variables. Currently many commands are overridable, but there are two exceptions: ld and pkg-config.

ld is hard-coded here:

BUILD_ID_NONE := $(shell if ld --build-id=none --version >/dev/null 2>&1; then echo ',--build-id=none'; fi)

https://github.com/proot-me/proot/blob/master/src/GNUmakefile#L162

pkg-config is hard-coded here:

CFLAGS   += -g -Wall -Wextra -O2
CFLAGS   += $(shell pkg-config --cflags talloc)
LDFLAGS  += -Wl,-z,noexecstack
LDFLAGS  += $(shell pkg-config --libs talloc)

https://github.com/proot-me/proot/blob/master/src/GNUmakefile#L25