pkgsrc-Changes-HG archive

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

[pkgsrc/trunk]: pkgsrc/mk Hiding the PATH from certain phases of the build on...



details:   https://anonhg.NetBSD.org/pkgsrc/rev/71373b1ef905
branches:  trunk
changeset: 467749:71373b1ef905
user:      jlam <jlam%pkgsrc.org@localhost>
date:      Fri Feb 06 04:37:02 2004 +0000

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

 mk/bsd.prefs.mk                 |  18 +++++++++++++++++-
 mk/buildlink2/bsd.buildlink2.mk |   5 ++---
 mk/buildlink3/bsd.buildlink3.mk |   5 ++---
 mk/compiler/ccache.mk           |   5 ++---
 mk/compiler/distcc.mk           |   5 ++---
 mk/compiler/gcc.mk              |  11 +++++------
 mk/compiler/mipspro.mk          |   5 ++---
 mk/compiler/sunpro.mk           |   5 ++---
 mk/tools.mk                     |   5 ++---
 9 files changed, 36 insertions(+), 28 deletions(-)

diffs (196 lines):

diff -r 1c384ac6a17c -r 71373b1ef905 mk/bsd.prefs.mk
--- a/mk/bsd.prefs.mk   Fri Feb 06 03:10:29 2004 +0000
+++ b/mk/bsd.prefs.mk   Fri Feb 06 04:37:02 2004 +0000
@@ -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_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 -r 1c384ac6a17c -r 71373b1ef905 mk/buildlink2/bsd.buildlink2.mk
--- a/mk/buildlink2/bsd.buildlink2.mk   Fri Feb 06 03:10:29 2004 +0000
+++ b/mk/buildlink2/bsd.buildlink2.mk   Fri Feb 06 04:37:02 2004 +0000
@@ -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 @@
 # 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 -r 1c384ac6a17c -r 71373b1ef905 mk/buildlink3/bsd.buildlink3.mk
--- a/mk/buildlink3/bsd.buildlink3.mk   Fri Feb 06 03:10:29 2004 +0000
+++ b/mk/buildlink3/bsd.buildlink3.mk   Fri Feb 06 04:37:02 2004 +0000
@@ -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 @@
 # 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 -r 1c384ac6a17c -r 71373b1ef905 mk/compiler/ccache.mk
--- a/mk/compiler/ccache.mk     Fri Feb 06 03:10:29 2004 +0000
+++ b/mk/compiler/ccache.mk     Fri Feb 06 04:37:02 2004 +0000
@@ -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 @@
 
 .    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 -r 1c384ac6a17c -r 71373b1ef905 mk/compiler/distcc.mk
--- a/mk/compiler/distcc.mk     Fri Feb 06 03:10:29 2004 +0000
+++ b/mk/compiler/distcc.mk     Fri Feb 06 04:37:02 2004 +0000
@@ -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 @@
 
 .    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 -r 1c384ac6a17c -r 71373b1ef905 mk/compiler/gcc.mk
--- a/mk/compiler/gcc.mk        Fri Feb 06 03:10:29 2004 +0000
+++ b/mk/compiler/gcc.mk        Fri Feb 06 04:37:02 2004 +0000
@@ -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 @@
 # 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 -r 1c384ac6a17c -r 71373b1ef905 mk/compiler/mipspro.mk
--- a/mk/compiler/mipspro.mk    Fri Feb 06 03:10:29 2004 +0000
+++ b/mk/compiler/mipspro.mk    Fri Feb 06 04:37:02 2004 +0000
@@ -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 @@
 
 # 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 -r 1c384ac6a17c -r 71373b1ef905 mk/compiler/sunpro.mk
--- a/mk/compiler/sunpro.mk     Fri Feb 06 03:10:29 2004 +0000
+++ b/mk/compiler/sunpro.mk     Fri Feb 06 04:37:02 2004 +0000
@@ -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 @@
 
 # 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 -r 1c384ac6a17c -r 71373b1ef905 mk/tools.mk
--- a/mk/tools.mk       Fri Feb 06 03:10:29 2004 +0000
+++ b/mk/tools.mk       Fri Feb 06 04:37:02 2004 +0000
@@ -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 @@
 # 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



Home | Main Index | Thread Index | Old Index