Re: [PATCH v2 1/4] Leave choosing level of optimalization and linker flags to package maintainer.
From: Coly Li <hidden>
Date: 2016-09-13 15:34:07
在 16/9/13 下午6:55, Marcin Mirosław 写道:
Currently is adding "-static" to linker flags. This needs compiling a couple of dependent libraries to get static version of it. It is a little problematic, at least on Gentoo. Also static binary isn't needed for typical usage, if somebody need it then it's easy to add "-static" to env variable LDFLAGS and get static binary. Similar to CFLAGS, it's easier to add "-g" to CFLAGS than negating it by using "-g0".
Hi Marcin, Do you mean bcache-tools/Makefile ? I can see '-g', but for '-static' I don't see it. I clone the code from https://github.com/g2p/bcache-tools.git, or should I look at other code ? Coly
quoted hunk ↗ jump to hunk
Signed-off-by: Marcin Mirosław <redacted> --- Makefile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)diff --git a/Makefile b/Makefile index 9f2773e..e9ca92d 100644 --- a/Makefile +++ b/Makefile@@ -1,8 +1,8 @@ PREFIX=/usr INSTALL=install -CFLAGS+=-std=gnu99 -O2 -Wall -g -D_FILE_OFFSET_BITS=64 -I. -LDFLAGS+=-static +CFLAGS:=-std=gnu99 -O2 -Wall -D_FILE_OFFSET_BITS=64 -I. $(CFLAGS) +LDFLAGS+= PKGCONFIG_LIBS="blkid uuid libnih" CFLAGS+=`pkg-config --cflags ${PKGCONFIG_LIBS}`
-- Coly Li