summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorjlam <jlam@pkgsrc.org>2003-08-26 20:15:23 +0000
committerjlam <jlam@pkgsrc.org>2003-08-26 20:15:23 +0000
commit9fbdc941fea7d21de5d5b90812f86cfcc394704e (patch)
tree8b1c3bab1e6dabee92b179dc0fdf2dc62269e99a
parent4826d368a2175f7a2e4026e3ee433f5c184ee2a4 (diff)
downloadpkgsrc-9fbdc941fea7d21de5d5b90812f86cfcc394704e.tar.gz
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 in pkg/22509.
-rw-r--r--mk/bsd.pkg.mk25
-rw-r--r--mk/defs.Darwin.mk3
-rw-r--r--mk/defs.FreeBSD.mk3
-rw-r--r--mk/defs.IRIX.mk3
-rw-r--r--mk/defs.Linux.mk5
-rw-r--r--mk/defs.NetBSD.mk3
-rw-r--r--mk/defs.OpenBSD.mk3
-rw-r--r--mk/defs.SunOS.mk3
-rw-r--r--mk/tools.mk41
9 files changed, 63 insertions, 26 deletions
diff --git a/mk/bsd.pkg.mk b/mk/bsd.pkg.mk
index 83be8cab2f7..f39c2e23017 100644
--- a/mk/bsd.pkg.mk
+++ b/mk/bsd.pkg.mk
@@ -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 @@ PKG_FAIL_REASON+= "${PKGNAME} uses imake, but the buildlink-x11 package was foun
. 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}
-.else
-. if defined(USE_IMAKE)
+.elif defined(USE_IMAKE)
MAKE_PROGRAM= ${_IMAKE_MAKE}
-. else
+.else
MAKE_PROGRAM= ${MAKE}
-. endif
.endif
CONFIGURE_ENV+= MAKE="${MAKE_PROGRAM}"
@@ -4324,7 +4331,7 @@ fake-pkg: ${PLIST} ${DESCR} ${MESSAGE}
. 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 --git a/mk/defs.Darwin.mk b/mk/defs.Darwin.mk
index 8bd88b14aba..d7068125fb4 100644
--- a/mk/defs.Darwin.mk
+++ b/mk/defs.Darwin.mk
@@ -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 @@ IMAKE_MANNEWSUFFIX= ${IMAKE_MAN_SUFFIX}
_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 --git a/mk/defs.FreeBSD.mk b/mk/defs.FreeBSD.mk
index e2a4c13b293..f8c0f4410a6 100644
--- a/mk/defs.FreeBSD.mk
+++ b/mk/defs.FreeBSD.mk
@@ -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 @@ IMAKE_MANNEWSUFFIX= 0
_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 --git a/mk/defs.IRIX.mk b/mk/defs.IRIX.mk
index 2fa3d35a8d3..d31db15a58d 100644
--- a/mk/defs.IRIX.mk
+++ b/mk/defs.IRIX.mk
@@ -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 @@ IMAKE_MANNEWSUFFIX= z
_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 --git a/mk/defs.Linux.mk b/mk/defs.Linux.mk
index d5dc3ffec72..d85f1d0fb96 100644
--- a/mk/defs.Linux.mk
+++ b/mk/defs.Linux.mk
@@ -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 @@ FILE_CMD?= /usr/bin/file
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 --git a/mk/defs.NetBSD.mk b/mk/defs.NetBSD.mk
index edc4a79105c..135de477a63 100644
--- a/mk/defs.NetBSD.mk
+++ b/mk/defs.NetBSD.mk
@@ -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 @@ IMAKE_MANNEWSUFFIX= 0
_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 --git a/mk/defs.OpenBSD.mk b/mk/defs.OpenBSD.mk
index 45aa8fb97b4..0e76d2c3e73 100644
--- a/mk/defs.OpenBSD.mk
+++ b/mk/defs.OpenBSD.mk
@@ -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 @@ IMAKE_MANNEWSUFFIX= 0
_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 --git a/mk/defs.SunOS.mk b/mk/defs.SunOS.mk
index d36ce310b6e..15d0fc96d0d 100644
--- a/mk/defs.SunOS.mk
+++ b/mk/defs.SunOS.mk
@@ -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 @@ IMAKE_MANNEWSUFFIX= ${IMAKE_MAN_SUFFIX}
_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 --git a/mk/tools.mk b/mk/tools.mk
index b0c6443e566..b88eaf2ac8f 100644
--- a/mk/tools.mk
+++ b/mk/tools.mk
@@ -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 @@ ${TOOLS_DIR}/bin/makeinfo: ${_GNU_MISSING}
# 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 @@ USE_GNU_TOOLS?= # empty
_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_OPSYS_HAS_GNU.sed+= Linux-*-*
#
_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_REPLACE_OPSYS.sed+= SunOS-*-*
#
_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 @@ _TOOLS_OVERRIDE.grep= NO
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 @@ ${TOOLS_DIR}/bin/${_tool_}:
. 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