Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. =================================================================== RCS file: /ftp/cvs/cvsroot/src/share/mk/bsd.prog.mk,v retrieving revision 1.236 retrieving revision 1.237 diff -u -p -r1.236 -r1.237 --- src/share/mk/bsd.prog.mk 2008/10/02 17:54:53 1.236 +++ src/share/mk/bsd.prog.mk 2008/10/15 17:31:50 1.237 @@ -1,4 +1,4 @@ -# $NetBSD: bsd.prog.mk,v 1.236 2008/10/02 17:54:53 joerg Exp $ +# $NetBSD: bsd.prog.mk,v 1.237 2008/10/15 17:31:50 christos Exp $ # @(#)bsd.prog.mk 8.2 (Berkeley) 4/2/94 .ifndef HOSTPROG @@ -51,6 +51,11 @@ CLEANFILES+=strings @rm -f x.cc .endif +.if defined(MKPIE) && (${MKPIE} != "no") +CFLAGS+= -fPIC +LDFLAGS+= -Wl,-pie -shared-libgcc +.endif + ##### Default values CPPFLAGS+= ${DESTDIR:D-nostdinc ${CPPFLAG_ISYSTEM} ${DESTDIR}/usr/include} CXXFLAGS+= ${DESTDIR:D-nostdinc++ ${CPPFLAG_ISYSTEMXX} ${DESTDIR}/usr/include/g++}