pkgsrc-Changes-HG archive

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

[pkgsrc/trunk]: pkgsrc/mk Create a symlink from the "make" requested by the p...



details:   https://anonhg.NetBSD.org/pkgsrc/rev/119fdc0f9d08
branches:  trunk
changeset: 460273:119fdc0f9d08
user:      jlam <jlam%pkgsrc.org@localhost>
date:      Tue Aug 26 20:15:23 2003 +0000

description:
Create a symlink from the "make" requested by the package into
${TOOLS_DIR}/bin/make.  If a package wants GNU make, then it should
set:
        USE_GNU_TOOLS+= make

in the package Makefile.  Allow for USE_GMAKE to continue to work
until we get a chance to sweep through pkgsrc and remove the usage
of this now-redundant variable.

This change allows us to avoid patching makefiles that use a bare
"make" command to invoke sub-make processes.  Idea suggested by
salo%netbsd.org@localhost in pkg/22509.

diffstat:

 mk/bsd.pkg.mk      |  25 ++++++++++++++++---------
 mk/defs.Darwin.mk  |   3 +--
 mk/defs.FreeBSD.mk |   3 +--
 mk/defs.IRIX.mk    |   3 +--
 mk/defs.Linux.mk   |   5 ++---
 mk/defs.NetBSD.mk  |   3 +--
 mk/defs.OpenBSD.mk |   3 +--
 mk/defs.SunOS.mk   |   3 +--
 mk/tools.mk        |  41 +++++++++++++++++++++++++++++++++++++++--
 9 files changed, 63 insertions(+), 26 deletions(-)

diffs (261 lines):

diff -r 4f290465d4a1 -r 119fdc0f9d08 mk/bsd.pkg.mk
--- a/mk/bsd.pkg.mk     Tue Aug 26 19:01:51 2003 +0000
+++ b/mk/bsd.pkg.mk     Tue Aug 26 20:15:23 2003 +0000
@@ -1,4 +1,4 @@
-#      $NetBSD: bsd.pkg.mk,v 1.1245 2003/08/24 08:51:11 jlam Exp $
+#      $NetBSD: bsd.pkg.mk,v 1.1246 2003/08/26 20:15:23 jlam Exp $
 #
 # This file is in the public domain.
 #
@@ -145,17 +145,24 @@
 .  endif
 .endif # USE_IMAKE
 
+.if defined(USE_GNU_TOOLS) && !empty(USE_GNU_TOOLS:Mmake)
+_USE_GMAKE=            yes
+.endif
+
+# XXX USE_GMAKE is redundant since USE_GNU_TOOLS+=make accomplishes the
+# XXX same thing but by using the more general tools.mk framework.  This
+# XXX variable should eventually be reaped from pkgsrc.
+#
 .if defined(USE_GMAKE)
-.  if ${_OPSYS_HAS_GMAKE} == "no"
-BUILD_DEPENDS+=                gmake>=3.78:../../devel/gmake
-.  endif
+_USE_GMAKE=            yes
+.endif
+
+.if defined(_USE_GMAKE)
 MAKE_PROGRAM=          ${GMAKE}
+.elif defined(USE_IMAKE)
+MAKE_PROGRAM=          ${_IMAKE_MAKE}
 .else
-.  if defined(USE_IMAKE)
-MAKE_PROGRAM=          ${_IMAKE_MAKE}
-.  else
 MAKE_PROGRAM=          ${MAKE}
-.  endif
 .endif
 CONFIGURE_ENV+=                MAKE="${MAKE_PROGRAM}"
 
@@ -4324,7 +4331,7 @@
 .  if defined(USE_PERL5) && (${USE_PERL5} == "run")
        @${ECHO} "PERL=`${PERL5} --version 2>/dev/null | ${GREP} 'This is perl'`" >> ${BUILD_INFO_FILE}
 .  endif
-.  ifdef USE_GMAKE
+.  ifdef _USE_GMAKE
        @${ECHO} "GMAKE=`${GMAKE} --version | ${GREP} Make`" >> ${BUILD_INFO_FILE}
 .  endif
 .  if ${CHECK_SHLIBS} == "YES"
diff -r 4f290465d4a1 -r 119fdc0f9d08 mk/defs.Darwin.mk
--- a/mk/defs.Darwin.mk Tue Aug 26 19:01:51 2003 +0000
+++ b/mk/defs.Darwin.mk Tue Aug 26 20:15:23 2003 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: defs.Darwin.mk,v 1.51 2003/08/23 09:07:07 grant Exp $
+# $NetBSD: defs.Darwin.mk,v 1.52 2003/08/26 20:15:25 jlam Exp $
 #
 # Variable definitions for the Darwin operating system.
 
@@ -103,7 +103,6 @@
 
 _DO_SHLIB_CHECKS=      yes     # on installation, fixup PLIST for shared libs
 _IMAKE_MAKE=           ${MAKE} # program which gets invoked by imake
-_OPSYS_HAS_GMAKE=      yes     # GNU make is standard
 .if ${OS_VERSION} >= 6.0
 _OPSYS_HAS_INET6=      yes     # IPv6 is standard
 .else
diff -r 4f290465d4a1 -r 119fdc0f9d08 mk/defs.FreeBSD.mk
--- a/mk/defs.FreeBSD.mk        Tue Aug 26 19:01:51 2003 +0000
+++ b/mk/defs.FreeBSD.mk        Tue Aug 26 20:15:23 2003 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: defs.FreeBSD.mk,v 1.21 2003/04/15 05:29:46 grant Exp $
+# $NetBSD: defs.FreeBSD.mk,v 1.22 2003/08/26 20:15:26 jlam Exp $
 #
 # Variable definitions for the FreeBSD operating system.
 
@@ -118,7 +118,6 @@
 
 _DO_SHLIB_CHECKS=      yes     # fixup PLIST for shared libs/run ldconfig
 _IMAKE_MAKE=           ${MAKE} # program which gets invoked by imake
-_OPSYS_HAS_GMAKE=      no      # GNU make is not standard
 .if exists(/usr/include/netinet6)
 _OPSYS_HAS_INET6=      yes     # IPv6 is standard
 .else
diff -r 4f290465d4a1 -r 119fdc0f9d08 mk/defs.IRIX.mk
--- a/mk/defs.IRIX.mk   Tue Aug 26 19:01:51 2003 +0000
+++ b/mk/defs.IRIX.mk   Tue Aug 26 20:15:23 2003 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: defs.IRIX.mk,v 1.30 2003/07/11 15:40:19 jschauma Exp $
+# $NetBSD: defs.IRIX.mk,v 1.31 2003/08/26 20:15:26 jlam Exp $
 #
 # Variable definitions for the IRIX operating system.
 
@@ -107,7 +107,6 @@
 
 _DO_SHLIB_CHECKS=      yes             # fixup PLIST for shared libs
 _IMAKE_MAKE=           ${MAKE}         # program which gets invoked by imake
-_OPSYS_HAS_GMAKE=      no              # GNU make is not standard
 .if exists(/usr/include/netinet6)
 _OPSYS_HAS_INET6=      yes             # IPv6 is standard
 .else
diff -r 4f290465d4a1 -r 119fdc0f9d08 mk/defs.Linux.mk
--- a/mk/defs.Linux.mk  Tue Aug 26 19:01:51 2003 +0000
+++ b/mk/defs.Linux.mk  Tue Aug 26 20:15:23 2003 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: defs.Linux.mk,v 1.55 2003/08/25 15:47:15 reed Exp $
+# $NetBSD: defs.Linux.mk,v 1.56 2003/08/26 20:15:26 jlam Exp $
 #
 # Variable definitions for the Linux operating system.
 
@@ -39,10 +39,9 @@
 FIND?=         /usr/bin/find
 .if exists(/usr/bin/make)
 GMAKE?=                /usr/bin/make
-_OPSYS_HAS_GMAKE=      yes             # GNU make is standard
+_TOOLS_OPSYS_HAS_GNU.make+=    ${MACHINE_PLATFORM}
 .else
 GMAKE?=                ${LOCALBASE}/bin/gmake
-_OPSYS_HAS_GMAKE=      no              # rare, but possible
 .endif
 .if exists(/bin/grep)
 GREP?=         /bin/grep
diff -r 4f290465d4a1 -r 119fdc0f9d08 mk/defs.NetBSD.mk
--- a/mk/defs.NetBSD.mk Tue Aug 26 19:01:51 2003 +0000
+++ b/mk/defs.NetBSD.mk Tue Aug 26 20:15:23 2003 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: defs.NetBSD.mk,v 1.50 2003/07/23 20:13:47 jmc Exp $
+# $NetBSD: defs.NetBSD.mk,v 1.51 2003/08/26 20:15:26 jlam Exp $
 #
 # Variable definitions for the NetBSD operating system.
 
@@ -114,7 +114,6 @@
 
 _DO_SHLIB_CHECKS=      yes     # fixup PLIST for shared libs/run ldconfig
 _IMAKE_MAKE=           ${MAKE} # program which gets invoked by imake
-_OPSYS_HAS_GMAKE=      no      # GNU make is not standard
 .if exists(/usr/include/netinet6)
 _OPSYS_HAS_INET6=      yes     # IPv6 is standard
 .else
diff -r 4f290465d4a1 -r 119fdc0f9d08 mk/defs.OpenBSD.mk
--- a/mk/defs.OpenBSD.mk        Tue Aug 26 19:01:51 2003 +0000
+++ b/mk/defs.OpenBSD.mk        Tue Aug 26 20:15:23 2003 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: defs.OpenBSD.mk,v 1.17 2003/04/15 05:29:47 grant Exp $
+# $NetBSD: defs.OpenBSD.mk,v 1.18 2003/08/26 20:15:26 jlam Exp $
 #
 # Variable definitions for the OpenBSD operating system.
 
@@ -110,7 +110,6 @@
 
 _DO_SHLIB_CHECKS=      yes     # fixup PLIST for shared libs/run ldconfig
 _IMAKE_MAKE=           ${MAKE} # program which gets invoked by imake
-_OPSYS_HAS_GMAKE=      no      # GNU make is not standard
 .if exists(/usr/include/netinet6)
 _OPSYS_HAS_INET6=      yes     # IPv6 is standard
 .else
diff -r 4f290465d4a1 -r 119fdc0f9d08 mk/defs.SunOS.mk
--- a/mk/defs.SunOS.mk  Tue Aug 26 19:01:51 2003 +0000
+++ b/mk/defs.SunOS.mk  Tue Aug 26 20:15:23 2003 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: defs.SunOS.mk,v 1.63 2003/08/21 11:59:22 gavan Exp $
+# $NetBSD: defs.SunOS.mk,v 1.64 2003/08/26 20:15:27 jlam Exp $
 #
 # Variable definitions for the SunOS/Solaris operating system.
 
@@ -118,7 +118,6 @@
 
 _DO_SHLIB_CHECKS=      yes             # fixup PLIST for shared libs
 _IMAKE_MAKE=   /usr/ccs/bin/make       # program which gets invoked by imake
-_OPSYS_HAS_GMAKE=      no              # GNU make is not standard
 .if exists(/usr/include/netinet/ip6.h)
 _OPSYS_HAS_INET6=      yes             # IPv6 is standard
 .else
diff -r 4f290465d4a1 -r 119fdc0f9d08 mk/tools.mk
--- a/mk/tools.mk       Tue Aug 26 19:01:51 2003 +0000
+++ b/mk/tools.mk       Tue Aug 26 20:15:23 2003 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: tools.mk,v 1.9 2003/08/17 04:06:36 jlam Exp $
+# $NetBSD: tools.mk,v 1.10 2003/08/26 20:15:27 jlam Exp $
 #
 # This Makefile creates a ${TOOLS_DIR} directory and populates the bin
 # subdir with tools that hide the ones outside of ${TOOLS_DIR}.
@@ -113,7 +113,7 @@
 # defining e.g. USE_GNU_TOOLS+="awk sed".  Version numbers are not
 # considered.
 
-_TOOLS=                awk grep sed
+_TOOLS=                awk grep make sed
 
 .if defined(_IGNORE_USE_GNU_TOOLS)
 USE_GNU_TOOLS:=                # empty
@@ -128,6 +128,7 @@
 _TOOLS_OPSYS_HAS_GNU.awk+=     FreeBSD-*-* Linux-*-* NetBSD-*-* OpenBSD-*-*
 _TOOLS_OPSYS_HAS_GNU.grep+=    Darwin-*-* FreeBSD-*-* Linux-*-*
 _TOOLS_OPSYS_HAS_GNU.grep+=    NetBSD-*-* OpenBSD-*-*
+_TOOLS_OPSYS_HAS_GNU.make+=    Darwin-*-*
 _TOOLS_OPSYS_HAS_GNU.sed+=     Linux-*-*
 
 # These platforms have GNUish versions of the tools available in the base
@@ -137,6 +138,7 @@
 #
 _TOOLS_REPLACE_OPSYS.awk+=     SunOS-*-*
 _TOOLS_REPLACE_OPSYS.grep+=    SunOS-*-*
+_TOOLS_REPLACE_OPSYS.make+=    # empty
 _TOOLS_REPLACE_OPSYS.sed+=     SunOS-*-*
 
 # These platforms have completely unusable versions of these tools, and
@@ -144,6 +146,7 @@
 #
 _TOOLS_OPSYS_INCOMPAT.awk+=    # empty
 _TOOLS_OPSYS_INCOMPAT.grep+=   # empty
+_TOOLS_OPSYS_INCOMPAT.make+=   # empty
 _TOOLS_OPSYS_INCOMPAT.sed+=    # empty
 
 # Default to not requiring GNU tools.
@@ -214,6 +217,21 @@
 MAKEFLAGS+=            _IGNORE_USE_GNU_TOOLS=
 .endif
 
+.if ${_TOOLS_REPLACE.make} == "YES"
+_TOOLS_OVERRIDE.make=  YES
+_TOOLS_PROGNAME.make=  ${GMAKE}
+.endif
+.if (${_TOOLS_NEED_GNU.make} == "YES") && empty(PKGPATH:Mdevel/gmake)
+BUILD_DEPENDS+=                gmake>=3.78:../../devel/gmake
+_TOOLS_OVERRIDE.make=  YES
+_TOOLS_PROGNAME.make=  ${LOCALBASE}/bin/${GNU_PROGRAM_PREFIX}make
+GREP:=                 ${_TOOLS_PROGNAME.make}
+.endif
+.if !empty(PKGPATH:Mdevel/gmake)
+_TOOLS_OVERRIDE.make=  NO
+MAKEFLAGS+=            _IGNORE_USE_GNU_TOOLS=
+.endif
+
 .if ${_TOOLS_REPLACE.sed} == "YES"
 _TOOLS_OVERRIDE.sed=   YES
 _TOOLS_PROGNAME.sed=   ${SED}
@@ -246,4 +264,23 @@
 .  endif
 .endfor
 
+# Always provide a symlink from ${TOOLS_DIR}/bin/make to the "make"
+# used to build the package.  The following only creates the symlink
+# if GNU make isn't required (and already symlinked from above).
+#
+override-tools: ${TOOLS_DIR}/bin/make
+
+.if !target(${TOOLS_DIR}/bin/make)
+${TOOLS_DIR}/bin/make:
+       ${_PKG_SILENT}${_PKG_DEBUG}                                     \
+       case ${MAKE_PROGRAM} in                                         \
+       /*)     src="${MAKE_PROGRAM}" ;;                                \
+       *)      src=`${TYPE} ${MAKE_PROGRAM} | ${AWK} '{ print $$NF }'` ;; \
+       esac;                                                           \
+       if [ -x $$src -a ! -f ${.TARGET} ]; then                        \
+               ${MKDIR} ${.TARGET:H};                                  \
+               ${LN} -sf $$src ${.TARGET};                             \
+       fi
+.endif
+
 .endif # TOOLS_MK



Home | Main Index | Thread Index | Old Index