pkgsrc/devel/waf/waf.mk
kamil 5efb30bf91 Add WAF_REPLACE_EXECUTABLE in waf.mk
The waf tool has been designed as a bundled 3rd party script in a software
tarball. For this reason some vendors freely modify these scripts and are
technically incompatible with the stock one.

Allow to use waf.mk goodies in such circumstances by specifying
"WAF_REPLACE_EXECUTABL=no" in a package's Makefile. Retain the default
behavior of replacing or copying waf into a package unchanged.

Reviewed by <wiz>
2016-06-18 21:46:07 +00:00

39 lines
988 B
Makefile

# $NetBSD: waf.mk,v 1.5 2016/06/18 21:46:07 kamil Exp $
WAF_ENV+= CC=${CC:Q}
WAF_ENV+= CFLAGS=${CFLAGS:Q}
WAF_ENV+= CXX=${CXX:Q}
WAF_ENV+= CXXFLAGS=${CXXFLAGS:Q}
WAF_ENV+= DESTDIR=${DESTDIR}
WAF_ENV+= LINKFLAGS=${LDFLAGS:Q}
WAF_ENV+= PATH=${PATH:Q}
WAF_ENV+= PREFIX=${PREFIX}
.if defined(MAKE_JOBS)
WAF_ENV+= JOBS=${MAKE_JOBS:Q}
.endif
# Kludge to support rst2man on Mac OS X, PR pkg/49921
.include "../../mk/bsd.prefs.mk"
.if ${OPSYS} == "Darwin"
WAF_ENV+= LC_ALL="en_US.UTF-8"
.endif
WAF_HAS_MANDIR?= yes
.if !empty(WAF_HAS_MANDIR:M[yY][eE][sS])
WAF_ARGS+= --mandir=${PREFIX}/${PKGMANDIR}
.endif
WAF_REPLACE_EXECUTABLE?= yes
.if !empty(WAF_REPLACE_EXECUTABLE:M[yY][eE][sS])
post-extract:
cp ${PREFIX}/bin/waf ${WRKSRC}
.endif
do-configure:
cd ${WRKSRC} && ${SETENV} ${WAF_ENV} ./waf ${WAF_ARGS} ${WAF_CONFIGURE_ARGS} configure
do-build:
cd ${WRKSRC} && ${SETENV} ${WAF_ENV} ./waf ${WAF_ARGS}
do-install:
cd ${WRKSRC} && ${SETENV} ${WAF_ENV} ./waf ${WAF_ARGS} install