Subject: Re: stripping binaries?
To: Georg Schwarz <georg.schwarz@freenet.de>
From: Jeremy C. Reed <reed@reedmedia.net>
List: pkgsrc-users
Date: 04/15/2006 14:02:42
On Sat, 15 Apr 2006, Georg Schwarz wrote:

> How can I make sure that binaries are stripped when installed?

I use the following. (Sorry not a complete diff as I have many other 
changes too.)

 MAKE_ENV+=	WHOLE_ARCHIVE_FLAG=${WHOLE_ARCHIVE_FLAG:Q}
+MAKE_ENV+=	INSTALL_STRIP_FLAG=${_STRIPFLAG_CC:Q}
 MAKE_ENV+=	X11BASE=${X11BASE:Q}
 MAKE_ENV+=	X11PREFIX=${X11PREFIX:Q}
 MAKE_ENV+=	PKGMANDIR=${PKGMANDIR:Q}
@@ -375,8 +381,9 @@
 	${INSTALL} ${COPY} ${_STRIPFLAG_INSTALL} -o ${GAMEOWN} -g ${GAMEGRP} -m ${GAMEMODE}
 INSTALL_SCRIPT?= 	\
 	${INSTALL} ${COPY} -o ${BINOWN} -g ${BINGRP} -m ${BINMODE}
+_STRIPFLAG_INSTALL_LIB?=	${_STRIPFLAG_INSTALL} # this may break some platforms
 INSTALL_LIB?= 		\
-	${INSTALL} ${COPY} -o ${BINOWN} -g ${BINGRP} -m ${BINMODE}
+	${INSTALL} ${COPY} ${_STRIPFLAG_INSTALL_LIB} -o ${BINOWN} -g ${BINGRP} -m ${BINMODE}
 INSTALL_DATA?= 		\
 	${INSTALL} ${COPY} -o ${SHAREOWN} -g ${SHAREGRP} -m ${SHAREMODE}
 INSTALL_GAME_DATA?= 	\
@@ -765,11 +772,17 @@
 #
 .include "../../mk/compiler.mk"
 
+.if !empty(CC_VERSION:Mgcc*)
+# and maybe have an option to say to use _STRIPFLAG_CC ??
+LDFLAGS+=	${_STRIPFLAG_CC}
+.endif
+
 .include "../../mk/wrapper/bsd.wrapper.mk"
 


I have been using for probably a couple years on Linux, NetBSD and 
FreeBSD (all i386 using gcc).


 Jeremy C. Reed

echo '9,J8HD,fDGG8B@?:536FC5=8@I;C5?@H5B0D@5GBIELD54DL>@8L?:5GDEJ8LDG1' |\
sed ss,s50EBsg | tr 0-M 'p.wBt SgiIlxmLhan:o,erDsduv/cyP'