Index: bsd.port.mk =================================================================== --- bsd.port.mk (revision 328463) +++ bsd.port.mk (working copy) @@ -1546,6 +1546,7 @@ WRKSRC:= ${WRKSRC}/${WRKSRC_SUBDIR} .endif +PORTBINDIR?= ${WRKDIR}/bin PATCH_WRKSRC?= ${WRKSRC} CONFIGURE_WRKSRC?= ${WRKSRC} BUILD_WRKSRC?= ${WRKSRC} @@ -1690,13 +1691,7 @@ READELF SIZE STRINGS BINUTILS_NO_MAKE_ENV?= . for b in ${BINUTILS} -${b}= ${LOCALBASE}/bin/${b:C/PP/++/:L} -. if defined(GNU_CONFIGURE) || defined(BINUTILS_CONFIGURE) -CONFIGURE_ENV+= ${b}="${${b}}" -. endif -. if ${BINUTILS_NO_MAKE_ENV:M${b}} == "" -MAKE_ENV+= ${b}="${${b}}" -. endif +BINLINKS+= ${b:L}:${LOCALBASE}/bin/${b:C/PP/++/:L} . endfor .endif @@ -2033,6 +2028,21 @@ .include "${USESDIR}/${_f}.mk" .endfor +.if defined(BINLINKS) +PATH:= ${PORTBINDIR}:${PATH} +.if !${MAKE_ENV:MPATH=*} && !${CONFIGURE_ENV:MPATH=*} +MAKE_ENV+= PATH=${PATH} +CONFIGURE_ENV+= PATH=${PATH} +.endif + +create-binlinks: + @${MKDIR} ${PORTBINDIR} ; \ + for link in ${BINLINKS}; do \ + ln -sf $${link#*:} ${PORTBINDIR}/$${link%:*} ; \ + done +post-extract: create-binlinks +.endif + .if defined(USE_XORG) # Add explicit X options to avoid problems with false positives in configure .if defined(GNU_CONFIGURE) Index: bsd.gcc.mk =================================================================== --- bsd.gcc.mk (revision 328463) +++ bsd.gcc.mk (working copy) @@ -195,9 +195,11 @@ . else _GCC_PORT:= gcc${V} . endif -CC:= gcc${V} -CXX:= g++${V} -CPP:= cpp${V} +BINLINKS:= ${BINLINKS} \ + cc:${LOCALBASE}/bin/gcc${V} \ + gcc:${LOCALBASE}/bin/gcc${V} \ + c++:${LOCALBASE}/bin/g++${V} \ + g++:${LOCALBASE}/bin/g++${V} . if ${_USE_GCC} != 3.4 _GCC_RUNTIME:= ${LOCALBASE}/lib/gcc${V} CFLAGS+= -Wl,-rpath=${_GCC_RUNTIME}