diff options
author | jlam <jlam> | 2007-07-12 18:59:15 +0000 |
---|---|---|
committer | jlam <jlam> | 2007-07-12 18:59:15 +0000 |
commit | 2fbf34d89e366b09311d17d67e2aea09e7f6688f (patch) | |
tree | 6b31726dad0aad10534bd10b311c46c86ca9ded5 /mk/configure/install-sh-override.mk | |
parent | e378de5c985c3a0783b72f00f3f66e0a94c907b0 (diff) | |
download | pkgsrc-2fbf34d89e366b09311d17d67e2aea09e7f6688f.tar.gz |
No longer pass install_sh in the environment to GNU configure scripts.
We fix GNU configure script stupidity by directly replacing the stock
install-sh script provided by the software with the BSD install-compatible
sysutils/install-sh script.
A new package-settable variable comes to life:
INSTALL_SH_OVERRIDE is a list of files relative to WRKSRC which
should be overridden by the install-sh script from
sysutils/install-sh. If not defined or set to "no", then
no files are overridden.
Possible values: no, defined, undefined.
Default value: defined when GNU_CONFIGURE is defined, undefined
otherwise.
Get rid of the install_sh tool, which is no longer needed.
Diffstat (limited to 'mk/configure/install-sh-override.mk')
-rw-r--r-- | mk/configure/install-sh-override.mk | 44 |
1 files changed, 44 insertions, 0 deletions
diff --git a/mk/configure/install-sh-override.mk b/mk/configure/install-sh-override.mk new file mode 100644 index 00000000000..dde7e0a42d0 --- /dev/null +++ b/mk/configure/install-sh-override.mk @@ -0,0 +1,44 @@ +# $NetBSD: install-sh-override.mk,v 1.1 2007/07/12 18:59:15 jlam Exp $ + +###################################################################### +### install-sh-override (PRIVATE) +###################################################################### +### install-sh-override replace any existing install-sh under +### ${WRKSRC} with the version from sysutils/install-sh, which works +### on all pkgsrc platforms, in particular Interix. +### +do-configure-pre-hook: install-sh-override + +OVERRIDE_DIRDEPTH.install-sh?= ${OVERRIDE_DIRDEPTH} + +_SCRIPT.install-sh-override= \ + ${RM} -f $$file; \ + ${SED} -e "s|@DEFAULT_INSTALL_MODE@|${PKGDIRMODE}|g" \ + ${PKGSRCDIR}/sysutils/install-sh/files/install-sh.in \ + > $$file; \ + ${CHMOD} +x $$file + +.PHONY: install-sh-override +install-sh-override: + @${STEP_MSG} "Replacing install-sh with pkgsrc version" +.if defined(INSTALL_SH_OVERRIDE) && !empty(INSTALL_SH_OVERRIDE) + ${_PKG_SILENT}${_PKG_DEBUG}set -e; \ + cd ${WRKSRC}; \ + set -- dummy ${INSTALL_SH_OVERRIDE}; shift; \ + while [ $$# -gt 0 ]; do \ + file="$$1"; shift; \ + [ -f "$$file" ] || [ -h "$$file" ] || continue; \ + ${_SCRIPT.${.TARGET}}; \ + done +.else + ${_PKG_SILENT}${_PKG_DEBUG}set -e; \ + cd ${WRKSRC}; \ + depth=0; pattern=install-sh; \ + while [ $$depth -le ${OVERRIDE_DIRDEPTH.install-sh} ]; do \ + for file in $$pattern; do \ + [ -f "$$file" ] || [ -h "$$file" ] || continue; \ + ${_SCRIPT.${.TARGET}}; \ + done; \ + depth=`${EXPR} $$depth + 1`; pattern="*/$$pattern"; \ + done +.endif |