summaryrefslogtreecommitdiff
path: root/mk
diff options
context:
space:
mode:
authorjlam <jlam@pkgsrc.org>2004-02-06 04:37:02 +0000
committerjlam <jlam@pkgsrc.org>2004-02-06 04:37:02 +0000
commitd72bb0e381ac340e9822b3b8a4a2d4a4f6df46f6 (patch)
treef6ef70f7dd739d99171898ff7944f83d524e3f1e /mk
parentfd4c71ddde3378e0d549a90a5a311d8243a37f6e (diff)
downloadpkgsrc-d72bb0e381ac340e9822b3b8a4a2d4a4f6df46f6.tar.gz
Hiding the PATH from certain phases of the build only accidentally worked
due to a type on gcc.mk that causes the ${_GCC_PREFIX}/bin to always be prepended to the PATH. The problem that was hiding was "make" resolving to ${TOOLS_DIR}/bin/make if the package used GNU make, which broke building since the package Makefile is a BSD Makefile and we passed PATH to some phases of the build. Fix this by expanding MAKE to the full path to ${MAKE} in bsd.prefs.mk. We also garbage collect the now useless checks for PHASES_AFTER_BUILDLINK that cluttered the PREPEND_PATH code.
Diffstat (limited to 'mk')
-rw-r--r--mk/bsd.prefs.mk18
-rw-r--r--mk/buildlink2/bsd.buildlink2.mk5
-rw-r--r--mk/buildlink3/bsd.buildlink3.mk5
-rw-r--r--mk/compiler/ccache.mk5
-rw-r--r--mk/compiler/distcc.mk5
-rw-r--r--mk/compiler/gcc.mk11
-rw-r--r--mk/compiler/mipspro.mk5
-rw-r--r--mk/compiler/sunpro.mk5
-rw-r--r--mk/tools.mk5
9 files changed, 36 insertions, 28 deletions
diff --git a/mk/bsd.prefs.mk b/mk/bsd.prefs.mk
index 9b941a2e53d..3dfdbda988d 100644
--- a/mk/bsd.prefs.mk
+++ b/mk/bsd.prefs.mk
@@ -1,4 +1,4 @@
-# $NetBSD: bsd.prefs.mk,v 1.148 2004/02/05 03:39:17 jlam Exp $
+# $NetBSD: bsd.prefs.mk,v 1.149 2004/02/06 04:37:02 jlam Exp $
#
# Make file, included to get the site preferences, if any. Should
# only be included by package Makefiles before any .if defined()
@@ -18,6 +18,22 @@ BSD_PREFS_MK:= ${BSD_PREFS_MK}+
BSD_PKG_MK=1
__PREFIX_SET__:=${PREFIX}
+# Expand MAKE to a full path.
+.if !defined(_MAKE)
+_MAKE:= ${MAKE}
+. for _dir_ in ${PATH:C/\:/ /g}
+. if empty(_MAKE:M/*)
+. if exists(${_dir_}/${MAKE})
+_MAKE:= ${_dir_}/${MAKE}
+. endif
+. endif
+. endfor
+. if !empty(_MAKE:M/*)
+MAKEFLAGS+= _MAKE="${_MAKE}"
+. endif
+.endif
+MAKE:= ${_MAKE}
+
.if exists(/usr/bin/uname)
UNAME=/usr/bin/uname
.elif exists(/bin/uname)
diff --git a/mk/buildlink2/bsd.buildlink2.mk b/mk/buildlink2/bsd.buildlink2.mk
index fe3175c49d7..8aba55b7bf1 100644
--- a/mk/buildlink2/bsd.buildlink2.mk
+++ b/mk/buildlink2/bsd.buildlink2.mk
@@ -1,4 +1,4 @@
-# $NetBSD: bsd.buildlink2.mk,v 1.111 2004/02/06 03:04:50 jlam Exp $
+# $NetBSD: bsd.buildlink2.mk,v 1.112 2004/02/06 04:37:02 jlam Exp $
#
# An example package buildlink2.mk file:
#
@@ -125,8 +125,7 @@ LDFLAGS+= ${FLAG}
# Prepend ${BUILDLINK_DIR}/bin to the PATH so that the wrappers are found
# first when searching for executables.
#
-.if !empty(PHASES_AFTER_BUILDLINK:M${PKG_PHASE}) && \
- empty(PREPEND_PATH:M${BUILDLINK_DIR}/bin)
+.if empty(PREPEND_PATH:M${BUILDLINK_DIR}/bin)
PREPEND_PATH+= ${BUILDLINK_DIR}/bin
PATH:= ${BUILDLINK_DIR}/bin:${PATH}
.endif
diff --git a/mk/buildlink3/bsd.buildlink3.mk b/mk/buildlink3/bsd.buildlink3.mk
index 7caec21041c..1ee99407306 100644
--- a/mk/buildlink3/bsd.buildlink3.mk
+++ b/mk/buildlink3/bsd.buildlink3.mk
@@ -1,4 +1,4 @@
-# $NetBSD: bsd.buildlink3.mk,v 1.76 2004/02/06 03:04:50 jlam Exp $
+# $NetBSD: bsd.buildlink3.mk,v 1.77 2004/02/06 04:37:02 jlam Exp $
#
# An example package buildlink3.mk file:
#
@@ -54,8 +54,7 @@ BUILDLINK_OPSYS?= ${OPSYS}
# Prepend ${BUILDLINK_DIR}/bin to the PATH so that the wrappers are found
# first when searching for executables.
#
-.if !empty(PHASES_AFTER_BUILDLINK:M${PKG_PHASE}) && \
- empty(PREPEND_PATH:M${BUILDLINK_DIR}/bin)
+.if empty(PREPEND_PATH:M${BUILDLINK_DIR}/bin)
PREPEND_PATH+= ${BUILDLINK_DIR}/bin
. if defined(_OPSYS_DEFAULT_PATH)
PATH:= ${BUILDLINK_DIR}/bin:${_OPSYS_DEFAULT_PATH}
diff --git a/mk/compiler/ccache.mk b/mk/compiler/ccache.mk
index 22ce3a7e6ab..e636c0b7d6d 100644
--- a/mk/compiler/ccache.mk
+++ b/mk/compiler/ccache.mk
@@ -1,4 +1,4 @@
-# $NetBSD: ccache.mk,v 1.9 2004/02/06 03:04:50 jlam Exp $
+# $NetBSD: ccache.mk,v 1.10 2004/02/06 04:37:02 jlam Exp $
.if !defined(COMPILER_CCACHE_MK)
COMPILER_CCACHE_MK= one
@@ -58,8 +58,7 @@ COMPILER_CCACHE_MK+= two
. if !empty(_USE_CCACHE:M[yY][eE][sS])
. if !empty(_LANGUAGES.ccache)
-. if !empty(PHASES_AFTER_BUILDLINK:M${PKG_PHASE}) && \
- empty(PREPEND_PATH:M${_CCACHE_DIR}/bin)
+. if empty(PREPEND_PATH:M${_CCACHE_DIR}/bin)
PREPEND_PATH+= ${_CCACHE_DIR}/bin
PATH:= ${_CCACHE_DIR}/bin:${PATH}
. endif
diff --git a/mk/compiler/distcc.mk b/mk/compiler/distcc.mk
index c93040344d8..b256179d4ce 100644
--- a/mk/compiler/distcc.mk
+++ b/mk/compiler/distcc.mk
@@ -1,4 +1,4 @@
-# $NetBSD: distcc.mk,v 1.12 2004/02/06 03:04:50 jlam Exp $
+# $NetBSD: distcc.mk,v 1.13 2004/02/06 04:37:02 jlam Exp $
.if !defined(COMPILER_DISTCC_MK)
COMPILER_DISTCC_MK= one
@@ -58,8 +58,7 @@ COMPILER_DISTCC_MK+= two
. if !empty(_USE_DISTCC:M[yY][eE][sS])
. if !empty(_LANGUAGES.distcc)
-. if !empty(PHASES_AFTER_BUILDLINK:M${PKG_PHASE}) && \
- empty(PREPEND_PATH:M${_DISTCC_DIR}/bin)
+. if empty(PREPEND_PATH:M${_DISTCC_DIR}/bin)
PREPEND_PATH+= ${_DISTCC_DIR}/bin
PATH:= ${_DISTCC_DIR}/bin:${PATH}
. endif
diff --git a/mk/compiler/gcc.mk b/mk/compiler/gcc.mk
index b3295ed0333..2b142b26e17 100644
--- a/mk/compiler/gcc.mk
+++ b/mk/compiler/gcc.mk
@@ -1,4 +1,4 @@
-# $NetBSD: gcc.mk,v 1.38 2004/02/06 03:04:50 jlam Exp $
+# $NetBSD: gcc.mk,v 1.39 2004/02/06 04:37:02 jlam Exp $
.if !defined(COMPILER_GCC_MK)
COMPILER_GCC_MK= one
@@ -298,17 +298,16 @@ COMPILER_GCC_MK+= two
# Prepend the path to the compiler to the PATH.
. if !empty(_USE_PKGSRC_GCC:M[yY][eE][sS])
. if exists(${_GCC_PREFIX}bin/gcc) && !empty(_LANGUAGES.gcc)
-. if !empty(PHASES_AFTER_BUILDLINK:M${PKG_PHASE}) && \
- empty(PREPEND_PATH:M${_GCC_PREFIX}bin)
-PREPEND_PATH+= ${GCC_PREFIX}bin
+. if empty(PREPEND_PATH:M${_GCC_PREFIX}bin)
+FOO!= echo ${PREPEND_PATH} 1>&2; echo 0
+PREPEND_PATH+= ${_GCC_PREFIX}bin
PATH:= ${_GCC_PREFIX}bin:${PATH}
. endif
. endif
. elif !empty(_IS_BUILTIN_GCC:M[yY][eE][sS])
_CC_DIRPATH= ${_CC:H}
. if !empty(_CC_DIRPATH:M/*)
-. if !empty(PHASES_AFTER_BUILDLINK:M${PKG_PHASE}) && \
- empty(PREPEND_PATH:M${_CC_DIRPATH})
+. if empty(PREPEND_PATH:M${_CC_DIRPATH})
PREPEND_PATH+= ${_CC_DIRPATH}
PATH:= ${_CC_DIRPATH}:${PATH}
. endif
diff --git a/mk/compiler/mipspro.mk b/mk/compiler/mipspro.mk
index 0868c146c13..22d72b26c5e 100644
--- a/mk/compiler/mipspro.mk
+++ b/mk/compiler/mipspro.mk
@@ -1,4 +1,4 @@
-# $NetBSD: mipspro.mk,v 1.12 2004/02/06 03:04:50 jlam Exp $
+# $NetBSD: mipspro.mk,v 1.13 2004/02/06 04:37:02 jlam Exp $
.if !defined(COMPILER_MIPSPRO_MK)
COMPILER_MIPSPRO_MK= one
@@ -40,8 +40,7 @@ COMPILER_MIPSPRO_MK+= two
# Prepend the path to the compiler to the PATH.
. if !empty(_LANGUAGES.mipspro)
-. if !empty(PHASES_AFTER_BUILDLINK:M${PKG_PHASE}) && \
- empty(PREPEND_PATH:M${MIPSPROBASE}/bin)
+. if empty(PREPEND_PATH:M${MIPSPROBASE}/bin)
PREPEND_PATH+= ${MIPSPROBASE}/bin
PATH:= ${MIPSPROBASE}/bin:${PATH}
. endif
diff --git a/mk/compiler/sunpro.mk b/mk/compiler/sunpro.mk
index 827eb990edc..b15d4eb0ec0 100644
--- a/mk/compiler/sunpro.mk
+++ b/mk/compiler/sunpro.mk
@@ -1,4 +1,4 @@
-# $NetBSD: sunpro.mk,v 1.9 2004/02/06 03:04:50 jlam Exp $
+# $NetBSD: sunpro.mk,v 1.10 2004/02/06 04:37:02 jlam Exp $
.if !defined(COMPILER_SUNPRO_MK)
COMPILER_SUNPRO_MK= one
@@ -41,8 +41,7 @@ COMPILER_SUNPRO_MK+= two
# Prepend the path to the compiler to the PATH.
. if !empty(_LANGUAGES.sunpro)
-. if !empty(PHASES_AFTER_BUILDLINK:M${PKG_PHASE}) && \
- empty(PREPEND_PATH:M${SUNWSPROBASE}/bin)
+. if empty(PREPEND_PATH:M${SUNWSPROBASE}/bin)
PREPEND_PATH+= ${SUNWSPROBASE}/bin
PATH:= ${SUNWSPROBASE}/bin:${PATH}
. endif
diff --git a/mk/tools.mk b/mk/tools.mk
index 483ad3a7b0b..357dec7547f 100644
--- a/mk/tools.mk
+++ b/mk/tools.mk
@@ -1,4 +1,4 @@
-# $NetBSD: tools.mk,v 1.24 2004/02/06 03:04:50 jlam Exp $
+# $NetBSD: tools.mk,v 1.25 2004/02/06 04:37:02 jlam Exp $
#
# This Makefile creates a ${TOOLS_DIR} directory and populates the bin
# subdir with tools that hide the ones outside of ${TOOLS_DIR}.
@@ -12,8 +12,7 @@ TOOLS_MK= # defined
# first when searching for executables.
#
TOOLS_DIR= ${WRKDIR}/.tools
-.if !empty(PHASES_AFTER_BUILDLINK:M${PKG_PHASE}) && \
- empty(PREPEND_PATH:M${TOOLS_DIR}/bin)
+.if empty(PREPEND_PATH:M${TOOLS_DIR}/bin)
PREPEND_PATH+= ${TOOLS_DIR}/bin
PATH:= ${TOOLS_DIR}/bin:${PATH}
.endif