pkgsrc-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[pkgsrc/trunk]: pkgsrc/mk/configure No longer pass install_sh in the environm...



details:   https://anonhg.NetBSD.org/pkgsrc/rev/62dc8f9d0472
branches:  trunk
changeset: 530866:62dc8f9d0472
user:      jlam <jlam%pkgsrc.org@localhost>
date:      Thu Jul 12 18:59:15 2007 +0000

description:
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:

 mk/configure/bsd.configure-vars.mk  |   7 +-----
 mk/configure/configure.mk           |  15 +++++++++++-
 mk/configure/gnu-configure.mk       |   4 +-
 mk/configure/install-sh-override.mk |  44 +++++++++++++++++++++++++++++++++++++
 4 files changed, 61 insertions(+), 9 deletions(-)

diffs (123 lines):

diff -r f978b2a02155 -r 62dc8f9d0472 mk/configure/bsd.configure-vars.mk
--- a/mk/configure/bsd.configure-vars.mk        Thu Jul 12 18:32:49 2007 +0000
+++ b/mk/configure/bsd.configure-vars.mk        Thu Jul 12 18:59:15 2007 +0000
@@ -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+=  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 -r f978b2a02155 -r 62dc8f9d0472 mk/configure/configure.mk
--- a/mk/configure/configure.mk Thu Jul 12 18:32:49 2007 +0000
+++ b/mk/configure/configure.mk Thu Jul 12 18:59:15 2007 +0000
@@ -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 @@
 .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 -r f978b2a02155 -r 62dc8f9d0472 mk/configure/gnu-configure.mk
--- a/mk/configure/gnu-configure.mk     Thu Jul 12 18:32:49 2007 +0000
+++ b/mk/configure/gnu-configure.mk     Thu Jul 12 18:59:15 2007 +0000
@@ -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 @@
 
 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 -r f978b2a02155 -r 62dc8f9d0472 mk/configure/install-sh-override.mk
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/mk/configure/install-sh-override.mk       Thu Jul 12 18:59:15 2007 +0000
@@ -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



Home | Main Index | Thread Index | Old Index