summaryrefslogtreecommitdiff
path: root/mk
diff options
context:
space:
mode:
authorjlam <jlam@pkgsrc.org>2007-07-12 18:59:15 +0000
committerjlam <jlam@pkgsrc.org>2007-07-12 18:59:15 +0000
commit13ed6251ebb031b4bc59db8137bf4db251e53a86 (patch)
tree6b31726dad0aad10534bd10b311c46c86ca9ded5 /mk
parent032306f2fabf94e09615ab96e52591cdf04f29a3 (diff)
downloadpkgsrc-13ed6251ebb031b4bc59db8137bf4db251e53a86.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')
-rw-r--r--mk/configure/bsd.configure-vars.mk7
-rw-r--r--mk/configure/configure.mk15
-rw-r--r--mk/configure/gnu-configure.mk4
-rw-r--r--mk/configure/install-sh-override.mk44
4 files changed, 61 insertions, 9 deletions
diff --git a/mk/configure/bsd.configure-vars.mk b/mk/configure/bsd.configure-vars.mk
index dd3914ce02d..a0617881ade 100644
--- a/mk/configure/bsd.configure-vars.mk
+++ b/mk/configure/bsd.configure-vars.mk
@@ -1,4 +1,4 @@
-# $NetBSD: bsd.configure-vars.mk,v 1.3 2007/06/04 12:10:20 rillig Exp $
+# $NetBSD: bsd.configure-vars.mk,v 1.4 2007/07/12 18:59:15 jlam Exp $
#
# CONFIGURE_DIRS is the list of directories in which to run the
# configure process. If the directories are relative paths,
@@ -25,8 +25,3 @@ SCRIPTS_ENV+= VIEWBASE=${VIEWBASE}
SCRIPTS_ENV+= WRKDIR=${WRKDIR}
SCRIPTS_ENV+= WRKSRC=${WRKSRC}
SCRIPTS_ENV+= X11BASE=${X11BASE}
-
-.if defined(GNU_CONFIGURE)
-TOOLS_CREATE+= install_sh
-TOOLS_SCRIPT.install_sh= ${INSTALL} "$$@"
-.endif
diff --git a/mk/configure/configure.mk b/mk/configure/configure.mk
index 4166ba62f7e..3853dfb3616 100644
--- a/mk/configure/configure.mk
+++ b/mk/configure/configure.mk
@@ -1,4 +1,4 @@
-# $NetBSD: configure.mk,v 1.17 2007/03/15 22:54:24 rillig Exp $
+# $NetBSD: configure.mk,v 1.18 2007/07/12 18:59:15 jlam Exp $
#
# = Package-settable variables =
#
@@ -16,6 +16,16 @@
# CONFIGURE_ARGS is the list of arguments that is passed to the
# configure script.
#
+# 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.
+#
# OVERRIDE_GNU_CONFIG_SCRIPTS
# Whether to override the GNU config.guess and config.sub scripts
# with the pkgsrc versions.
@@ -53,6 +63,9 @@ _BUILD_DEFS+= CONFIGURE_ENV CONFIGURE_ARGS
.if defined(OVERRIDE_GNU_CONFIG_SCRIPTS)
. include "${PKGSRCDIR}/mk/configure/config-override.mk"
.endif
+.if defined(INSTALL_SH_OVERRIDE) && empty(INSTALL_SH_OVERRIDE:M[Nn][Oo])
+. include "${PKGSRCDIR}/mk/configure/install-sh-override.mk"
+.endif
.if defined(USE_LIBTOOL)
. include "${PKGSRCDIR}/mk/configure/libtool-override.mk"
.endif
diff --git a/mk/configure/gnu-configure.mk b/mk/configure/gnu-configure.mk
index a70862a343c..7962d035b6f 100644
--- a/mk/configure/gnu-configure.mk
+++ b/mk/configure/gnu-configure.mk
@@ -1,4 +1,4 @@
-# $NetBSD: gnu-configure.mk,v 1.4 2007/06/04 12:10:20 rillig Exp $
+# $NetBSD: gnu-configure.mk,v 1.5 2007/07/12 18:59:15 jlam Exp $
_VARGROUPS+= gnu-configure
_USER_VARS.gnu-configure= # none
@@ -9,10 +9,10 @@ _PKG_VARS.gnu-configure= GNU_CONFIGURE GNU_CONFIGURE_PREFIX \
HAS_CONFIGURE= defined
OVERRIDE_GNU_CONFIG_SCRIPTS= defined
+INSTALL_SH_OVERRIDE?= # empty
CONFIGURE_ENV+= CONFIG_SHELL=${CONFIG_SHELL:Q}
CONFIGURE_ENV+= LIBS=${LIBS:M*:Q}
-CONFIGURE_ENV+= install_sh=${TOOLS_CMD.install_sh:Q}
CONFIGURE_ENV+= ac_given_INSTALL=${INSTALL:Q}\ -c\ -o\ ${BINOWN}\ -g\ ${BINGRP}
.if (defined(USE_LIBTOOL) || !empty(PKGPATH:Mdevel/libtool-base)) && \
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