pkgsrc-Changes-HG archive

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

[pkgsrc/trunk]: pkgsrc/mk/compiler Symlink the compiler into ${WRKDIR} so tha...



details:   https://anonhg.NetBSD.org/pkgsrc/rev/435fc3bdb1f8
branches:  trunk
changeset: 467835:435fc3bdb1f8
user:      jlam <jlam%pkgsrc.org@localhost>
date:      Sat Feb 07 02:58:10 2004 +0000

description:
Symlink the compiler into ${WRKDIR} so that there's a consistent path to
the compiler and that it's behind .tools/bin and .buildlink/bin, regardless
of whether or not we're using gcc3-c or not, or whether it's been installed
yet in the process of satisfying dependencies, etc.

diffstat:

 mk/compiler/ccache.mk  |  17 +++++++---
 mk/compiler/distcc.mk  |  18 +++++++---
 mk/compiler/gcc.mk     |  77 +++++++++++++++++++++++++++++--------------------
 mk/compiler/mipspro.mk |  35 ++++++++++++++++-----
 mk/compiler/sunpro.mk  |  35 ++++++++++++++++-----
 5 files changed, 121 insertions(+), 61 deletions(-)

diffs (truncated from 362 to 300 lines):

diff -r 96162f379e10 -r 435fc3bdb1f8 mk/compiler/ccache.mk
--- a/mk/compiler/ccache.mk     Sat Feb 07 02:56:14 2004 +0000
+++ b/mk/compiler/ccache.mk     Sat Feb 07 02:58:10 2004 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: ccache.mk,v 1.10 2004/02/06 04:37:02 jlam Exp $
+# $NetBSD: ccache.mk,v 1.11 2004/02/07 02:58:10 jlam Exp $
 
 .if !defined(COMPILER_CCACHE_MK)
 COMPILER_CCACHE_MK=    one
@@ -38,12 +38,14 @@
 _CCACHE_DIR=   ${WRKDIR}/.ccache
 _CCACHE_LINKS= # empty
 .      if !empty(_LANGUAGES.ccache:Mc)
-CC:=   ${_CCACHE_DIR}/bin/${CC:T}
-_CCACHE_LINKS+=        CC
+_CCACHE_CC:=   ${_CCACHE_DIR}/bin/${CC:T}
+_CCACHE_LINKS+=        _CCACHE_CC
+CC=            ${_CCACHE_CC}
 .      endif
 .      if !empty(_LANGUAGES.ccache:Mc++)
-CXX:=  ${_CCACHE_DIR}/bin/${CXX:T}
-_CCACHE_LINKS+=        CXX
+_CCACHE_CXX:=  ${_CCACHE_DIR}/bin/${CXX:T}
+_CCACHE_LINKS+=        _CCACHE_CXX
+CXX=           ${_CCACHE_CXX}
 .      endif
 .    endif
 .  endif
@@ -56,6 +58,7 @@
 .  if empty(COMPILER_CCACHE_MK:Mtwo)
 COMPILER_CCACHE_MK+=   two
 
+# Prepend the path the to the compiler to the PATH
 .    if !empty(_USE_CCACHE:M[yY][eE][sS])
 .      if !empty(_LANGUAGES.ccache)
 .        if empty(PREPEND_PATH:M${_CCACHE_DIR}/bin)
@@ -64,15 +67,19 @@
 .        endif
 .      endif
 
+# Add the dependency on ccache.
 BUILD_DEPENDS+=        ccache-[0-9]*:../../devel/ccache
 
+# Create symlinks for the compiler into ${WRKDIR}.
 .      if exists(${_CCACHEBASE}/bin/ccache)
 .        for _target_ in ${_CCACHE_LINKS}
+.          if !target(${${_target_}})
 override-tools: ${${_target_}}
 ${${_target_}}:
        ${_PKG_SILENT}${_PKG_DEBUG}${MKDIR} ${.TARGET:H}
        ${_PKG_SILENT}${_PKG_DEBUG}                                     \
        ${LN} -fs ${_CCACHEBASE}/bin/ccache ${.TARGET}
+.          endif
 .        endfor
 .      endif
 .    endif
diff -r 96162f379e10 -r 435fc3bdb1f8 mk/compiler/distcc.mk
--- a/mk/compiler/distcc.mk     Sat Feb 07 02:56:14 2004 +0000
+++ b/mk/compiler/distcc.mk     Sat Feb 07 02:58:10 2004 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: distcc.mk,v 1.13 2004/02/06 04:37:02 jlam Exp $
+# $NetBSD: distcc.mk,v 1.14 2004/02/07 02:58:10 jlam Exp $
 
 .if !defined(COMPILER_DISTCC_MK)
 COMPILER_DISTCC_MK=    one
@@ -38,12 +38,14 @@
 _DISTCC_DIR=   ${WRKDIR}/.distcc
 _DISTCC_LINKS= # empty
 .      if !empty(_LANGUAGES.distcc:Mc)
-CC:=   ${_DISTCC_DIR}/bin/${CC:T}
-_DISTCC_LINKS+=        CC
+_DISTCC_CC:=   ${_DISTCC_DIR}/bin/${CC:T}
+_DISTCC_LINKS+=        _DISTCC_CC
+CC=            ${_DISTCC_CC}
 .      endif
 .      if !empty(_LANGUAGES.distcc:Mc++)
-CXX:=  ${_DISTCC_DIR}/bin/${CXX:T}
-_DISTCC_LINKS+=        CXX
+_DISTCC_CXX:=  ${_DISTCC_DIR}/bin/${CXX:T}
+_DISTCC_LINKS+=        _DISTCC_CXX
+CXX=           ${_DISTCC_CXX}
 .      endif
 .    endif
 .  endif
@@ -56,6 +58,7 @@
 .  if empty(COMPILER_DISTCC_MK:Mtwo)
 COMPILER_DISTCC_MK+=   two
 
+# Prepend the path to the compiler to the PATH.
 .    if !empty(_USE_DISTCC:M[yY][eE][sS])
 .      if !empty(_LANGUAGES.distcc)
 .        if empty(PREPEND_PATH:M${_DISTCC_DIR}/bin)
@@ -63,17 +66,20 @@
 PATH:=         ${_DISTCC_DIR}/bin:${PATH}
 .        endif
 .      endif
-.    endif
 
+# Add the dependency on distcc.
 BUILD_DEPENDS+=        distcc-[0-9]*:../../devel/distcc
 
+# Create symlinks for the compiler into ${WRKDIR}.
 .      if exists(${_DISTCCBASE}/bin/distcc)
 .        for _target_ in ${_DISTCC_LINKS}
+.          if !target(${${_target_}})
 override-tools: ${${_target_}}
 ${${_target_}}:
        ${_PKG_SILENT}${_PKG_DEBUG}${MKDIR} ${.TARGET:H}
        ${_PKG_SILENT}${_PKG_DEBUG}                                     \
        ${LN} -fs ${_DISTCCBASE}/bin/distcc ${.TARGET}
+.          endif
 .        endfor
 .      endif
 .    endif
diff -r 96162f379e10 -r 435fc3bdb1f8 mk/compiler/gcc.mk
--- a/mk/compiler/gcc.mk        Sat Feb 07 02:56:14 2004 +0000
+++ b/mk/compiler/gcc.mk        Sat Feb 07 02:58:10 2004 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: gcc.mk,v 1.43 2004/02/06 20:15:49 jlam Exp $
+# $NetBSD: gcc.mk,v 1.44 2004/02/07 02:58:10 jlam Exp $
 
 .if !defined(COMPILER_GCC_MK)
 COMPILER_GCC_MK=       one
@@ -27,9 +27,7 @@
 .        endif
 .      endif
 .    endfor
-.    if !empty(_CC:M/*)
 MAKEFLAGS+=    _CC=${_CC:Q}
-.    endif
 .  endif
 
 .  if !defined(_GCC_VERSION)
@@ -249,20 +247,34 @@
 # Point the variables that specify the compiler to the installed
 # GCC executables.
 #
+_GCC_DIR=      ${WRKDIR}/.gcc
+_GCC_LINKS=    # empty
+
 .  if !empty(_USE_PKGSRC_GCC:M[yY][eE][sS])
-.    if exists(${_GCC_PREFIX}bin/gcc) && !empty(_LANGUAGES.gcc:Mc)
-CC=            ${_GCC_PREFIX}bin/gcc
-.    endif
-.    if exists(${_GCC_PREFIX}bin/cpp) && !empty(_LANGUAGES.gcc:Mc)
-CPP=           ${_GCC_PREFIX}bin/cpp
-.    endif
-.    if exists(${_GCC_PREFIX}bin/g++) && !empty(_LANGUAGES.gcc:Mc++)
-CXX=           ${_GCC_PREFIX}bin/g++
-.    endif
-.    if exists(${_GCC_PREFIX}bin/g77) && !empty(_LANGUAGES.gcc:Mfortran)
-F77=           ${_GCC_PREFIX}bin/g77
+_GCCBINDIR=    ${_GCC_PREFIX}bin
+.  elif !empty(_IS_BUILTIN_GCC:M[yY][eE][sS])
+_GCCBINDIR=    ${_CC:H}
+.  endif
+.  if exists(${_GCCBINDIR}/gcc) && !empty(_LANGUAGES.gcc:Mc)
+_GCC_CC=       ${_GCC_DIR}/bin/gcc
+_GCC_LINKS+=   _GCC_CC
+CC=            ${_GCC_CC}
+.  endif
+.  if exists(${_GCCBINDIR}/cpp) && !empty(_LANGUAGES.gcc:Mc)
+_GCC_CPP=      ${_GCC_DIR}/bin/cpp
+_GCC_LINKS+=   _GCC_CPP
+CPP=           ${_GCC_CPP}
+.  endif
+.  if exists(${_GCCBINDIR}/g++) && !empty(_LANGUAGES.gcc:Mc++)
+_GCC_CXX=      ${_GCC_DIR}/bin/g++
+_GCC_LINKS+=   _GCC_CXX
+CXX=           ${_GCC_CXX}
+.  endif
+.  if exists(${_GCCBINDIR}/g77) && !empty(_LANGUAGES.gcc:Mfortran)
+_GCC_F77=      ${_GCC_DIR}/bin/g77
+_GCC_LINKS+=   _GCC_F77
+F77=           ${_GCC_F77}
 PKG_FC:=       ${F77}
-.    endif
 .  endif
 
 # GCC passes flags to the linker using "-Wl,".
@@ -274,9 +286,9 @@
 .  endif
 
 .  if !empty(_USE_PKGSRC_GCC:M[yY][eE][sS])
-.    if exists(${CC})
-CC_VERSION!=   if ${CC} -dumpversion > /dev/null 2>&1; then            \
-                       ${ECHO} "gcc-`${CC} -dumpversion`";             \
+.    if exists(${_GCCBINDIR}/gcc)
+CC_VERSION!=   if ${_GCCBINDIR}/gcc -dumpversion > /dev/null 2>&1; then \
+                       ${ECHO} "gcc-`${_GCCBINDIR}/gcc -dumpversion`"; \
                else                                                    \
                        ${ECHO} "gcc-${_GCC_REQD}";                     \
                fi
@@ -296,20 +308,10 @@
 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(PREPEND_PATH:M${_GCC_PREFIX}bin)
-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(PREPEND_PATH:M${_CC_DIRPATH})
-PREPEND_PATH+= ${_CC_DIRPATH}
-PATH:=         ${_CC_DIRPATH}:${PATH}
-.        endif
+.    if !empty(_LANGUAGES.gcc)
+.      if empty(PREPEND_PATH:M${_GCC_DIR}/bin)
+PREPEND_PATH+= ${_GCC_DIR}/bin
+PATH:=         ${_GCC_DIR}/bin:${PATH}
 .      endif
 .    endif
 
@@ -331,5 +333,16 @@
 .        endif
 .      endif
 .    endif
+
+# Create symlinks for the compiler into ${WRKDIR}.
+.    for _target_ in ${_GCC_LINKS}
+.      if !target(${${_target_}})
+override-tools: ${${_target_}}        
+${${_target_}}:
+       ${_PKG_SILENT}${_PKG_DEBUG}${MKDIR} ${.TARGET:H}
+       ${_PKG_SILENT}${_PKG_DEBUG}                                     \
+       ${LN} -fs ${_GCCBINDIR}/${${_target_}:T} ${.TARGET}
+.      endif
+.    endfor
 .  endif # COMPILER_GCC_MK
 .endif  # BSD_PREFS_MK
diff -r 96162f379e10 -r 435fc3bdb1f8 mk/compiler/mipspro.mk
--- a/mk/compiler/mipspro.mk    Sat Feb 07 02:56:14 2004 +0000
+++ b/mk/compiler/mipspro.mk    Sat Feb 07 02:58:10 2004 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: mipspro.mk,v 1.13 2004/02/06 04:37:02 jlam Exp $
+# $NetBSD: mipspro.mk,v 1.14 2004/02/07 02:58:10 jlam Exp $
 
 .if !defined(COMPILER_MIPSPRO_MK)
 COMPILER_MIPSPRO_MK=   one
@@ -15,17 +15,23 @@
 _LANGUAGES.mipspro+=   ${LANGUAGES.mipspro:M${_lang_}}
 .  endfor
 
+_MIPSPRO_DIR=          ${WRKDIR}/.mipspro
+_MIPSPRO_LINKS=                # empty
 .  if !empty(_LANGUAGES.mipspro:Mc)
-CC=    ${MIPSPROBASE}/bin/cc
-CPP=   ${MIPSPROBASE}/bin/cc -E
+_MIPSPRO_CC=           ${_MIPSPRO_DIR}/bin/cc
+_MIPSPRO_LINKS+=       _MIPSPRO_CC
+CC=                    ${_MIPSPRO_CC}
+CPP=                   ${_MIPSPRO_CC} -E
 .  endif
 .  if !empty(_LANGUAGES.mipspro:Mc++)
-CXX=   ${MIPSPROBASE}/bin/CC
+_MIPSPRO_CXX=          ${_MIPSPRO_DIR}/bin/CC
+_MIPSPRO_LINKS+=       _MIPSPRO_CXX
+CXX=                   ${_MIPSPRO_CXX}
 .  endif
 
-.  if exists(${CC})
+.  if exists(${MIPSPROBASE}/bin/cc)
 # MIPSpro Compilers: Version 7.3.1.2m
-CC_VERSION!=   ${CC} -version 2>&1 | ${GREP} '^MIPSpro'
+CC_VERSION!=   ${MIPSPROBASE}/bin/cc -version 2>&1 | ${GREP} '^MIPSpro'
 .  else
 CC_VERSION=    MIPSpro
 .  endif
@@ -40,10 +46,21 @@
 
 # Prepend the path to the compiler to the PATH.
 .    if !empty(_LANGUAGES.mipspro)
-.      if empty(PREPEND_PATH:M${MIPSPROBASE}/bin)
-PREPEND_PATH+= ${MIPSPROBASE}/bin
-PATH:=         ${MIPSPROBASE}/bin:${PATH}
+.      if empty(PREPEND_PATH:M${_MIPSPRO_DIR}/bin)
+PREPEND_PATH+= ${_MIPSPRO_DIR}/bin
+PATH:=         ${_MIPSPRO_DIR}/bin:${PATH}
 .      endif
 .    endif
+
+# Create symlinks for the compiler into ${WRKDIR}.
+.    for _target_ in ${_MIPSPRO_LINKS}
+.      if !target(${${_target_}})
+override-tools: ${${_target_}}
+${${_target_}}:
+       ${_PKG_SILENT}${_PKG_DEBUG}${MKDIR} ${.TARGET:H}
+       ${_PKG_SILENT}${_PKG_DEBUG}                                     \
+       ${LN} -fs ${MIPSPROBASE}/bin/${${_target_}:T} ${.TARGET}
+.      endif
+.    endfor
 .  endif # COMPILER_MIPSPRO_MK
 .endif  # BSD_PREFS_MK
diff -r 96162f379e10 -r 435fc3bdb1f8 mk/compiler/sunpro.mk
--- a/mk/compiler/sunpro.mk     Sat Feb 07 02:56:14 2004 +0000



Home | Main Index | Thread Index | Old Index