diff options
author | jlam <jlam@pkgsrc.org> | 2004-02-18 13:32:38 +0000 |
---|---|---|
committer | jlam <jlam@pkgsrc.org> | 2004-02-18 13:32:38 +0000 |
commit | c40ee95964564e28bc4d27851d406f8cd0048057 (patch) | |
tree | 4a6b9245550fffa4e5469f8b4f800859f0b85289 /mk/compiler | |
parent | a59f9c214394899b3d1eb6baa2719d8eb3c61f2d (diff) | |
download | pkgsrc-c40ee95964564e28bc4d27851d406f8cd0048057.tar.gz |
* Move pkgsrc/mk/compiler/bsd.compiler.mk to pkgsrc/mk/compiler.mk.
Package Makefiles may now directly include compiler.mk.
* Don't include compiler.mk within bsd.prefs.mk any longer. It was only
included for the purposes of defining CC_VERSION. Packages that want
to test the value of CC_VERSION should now first include
"../../mk/compiler.mk". Any GCC_REQD statements in package Makefiles
should be set before compiler.mk is included.
* Simpllfy pkgsrc/mk/compiler/*.mk files as a result of not needing to
be included indirectly by bsd.prefs.mk. We remove the special handling
associated with detecting whether the file was included from within
bsd.prefs.mk. These files are now much more straightforward to write
and understand.
* G/C the BSD_PREFS_MK stack mechanism as the only users (compiler/*)
no longer need it.
* Ensure that directories are prepended to the PATH only from within
bsd.pkg.mk.
Diffstat (limited to 'mk/compiler')
-rw-r--r-- | mk/compiler/bsd.compiler.mk | 113 | ||||
-rw-r--r-- | mk/compiler/ccache.mk | 69 | ||||
-rw-r--r-- | mk/compiler/distcc.mk | 69 | ||||
-rw-r--r-- | mk/compiler/gcc.mk | 255 | ||||
-rw-r--r-- | mk/compiler/mipspro-ucode.mk | 22 | ||||
-rw-r--r-- | mk/compiler/mipspro.mk | 51 | ||||
-rw-r--r-- | mk/compiler/sunpro.mk | 51 |
7 files changed, 231 insertions, 399 deletions
diff --git a/mk/compiler/bsd.compiler.mk b/mk/compiler/bsd.compiler.mk deleted file mode 100644 index 3e299d94a93..00000000000 --- a/mk/compiler/bsd.compiler.mk +++ /dev/null @@ -1,113 +0,0 @@ -# $NetBSD: bsd.compiler.mk,v 1.10 2004/02/18 11:18:43 jlam Exp $ -# -# This Makefile fragment implements handling for supported C/C++/Fortran -# compilers. -# -# The following variables are used and should all be defined either -# in or before the first inclusion of bsd.prefs.mk: -# -# PKGSRC_COMPILER -# A list of values specifying the chain of compilers to be used by -# pkgsrc to build packages. -# -# Valid values are: -# distcc distributed C/C++ (chainable) -# ccache compiler cache (chainable) -# gcc GNU -# mipspro Silicon Graphics, Inc. MIPSpro (n32/n64) -# mipspro-ucode Silicon Graphics, Inc. MIPSpro (o32) -# sunpro Sun Microsystems, Inc. WorkShip/Forte/Sun -# ONE Studio -# -# The default is "gcc". You can use ccache and/or distcc with an -# appropriate PKGSRC_COMPILER setting, e.g. "ccache distcc gcc". -# The chain should always end in a real compiler. This should only -# be set in /etc/mk.conf. -# -# GCC_REQD -# A list of version numbers used to determine the minimum -# version of GCC required by a package. This value should only -# be appended to by a package Makefile. -# -# NOTE: Be conservative when setting GCC_REQD, as lang/gcc3 is -# known not to build on some platforms, e.g. Darwin. If gcc3 is -# required, set GCC_REQD=3.0 so that we do not try to pull in -# lang/gcc3 unnecessarily and have it fail. -# -# USE_PKGSRC_GCC -# Force using the appropriate version of GCC from pkgsrc based on -# GCC_REQD instead of the native compiler. -# -# USE_GCC_SHLIB -# Indicates that a package uses GCC shared libraries, so we -# register a runtime dependency on the compiler package. -# -# USE_LANGUAGES -# Lists the languages used in the source code of the package, -# and is used to determine the correct compilers to install. -# Valid values are: c, c++, fortran, java, objc. The default -# is "c". -# -# The following variables are defined, and available for testing in -# package Makefiles: -# -# CC_VERSION -# The compiler and version being used, e.g., -# -# .include "../../mk/bsd.prefs.mk" -# -# .if !empty(CC_VERSION:Mgcc-3*) -# ... -# .endif -# -# The following variables are deprecated: -# -# USE_GCC2, USE_GCC3, USE_SUNPRO, USE_MIPSPRO - -.if !defined(BSD_COMPILER_MK) -BSD_COMPILER_MK= defined - -# XXX Add this gross and completely inaccurate hack. Packages that -# XXX set USE_GCC_SHLIB should be adjusted to set USE_LANGUAGES -# XXX correctly (most likely by saying it needs either "c++" or -# XXX "c c++"). This is here for now so that ~85 packages won't -# XXX suddenly break. -# -. if defined(USE_GCC_SHLIB) -USE_LANGUAGES?= c c++ -. endif - -# By default, assume that the package requires a C compiler. -USE_LANGUAGES?= c - -# Support some deprecated variables for a while. They'll be removed -# after the pkgsrc-2004Q1 branch is cut. -# -. if defined(USE_GCC2) -GCC_REQD+= 2.8.0 -PKGSRC_COMPILER?= gcc -. elif defined(USE_GCC3) -GCC_REQD+= 3.0 -PKGSRC_COMPILER?= gcc -. elif defined(USE_PKGSRC_GCC) -_USE_PKGSRC_GCC= yes -PKGSRC_COMPILER?= gcc -. elif defined(USE_SUNPRO) -PKGSRC_COMPILER?= sunpro -. elif defined(USE_MIPSPRO) -PKGSRC_COMPILER?= mipspro -. else -PKGSRC_COMPILER?= gcc -. endif - -_PKGSRC_COMPILER= # empty -. for _compiler_ in ${PKGSRC_COMPILER} -. if empty(_PKGSRC_COMPILER:M${_compiler_}) -_PKGSRC_COMPILER:= ${_compiler_} ${_PKGSRC_COMPILER} -. endif -. endfor -.endif # BSD_COMPILER_MK - -.for _compiler_ in ${_PKGSRC_COMPILER} -. include "../../mk/compiler/${_compiler_}.mk" -.endfor diff --git a/mk/compiler/ccache.mk b/mk/compiler/ccache.mk index c8595701653..437870d7b2b 100644 --- a/mk/compiler/ccache.mk +++ b/mk/compiler/ccache.mk @@ -1,16 +1,18 @@ -# $NetBSD: ccache.mk,v 1.14 2004/02/12 08:54:48 jlam Exp $ +# $NetBSD: ccache.mk,v 1.15 2004/02/18 13:32:38 jlam Exp $ .if !defined(COMPILER_CCACHE_MK) -COMPILER_CCACHE_MK= one +COMPILER_CCACHE_MK= defined -. if !empty(PKGPATH:Mdevel/ccache) +.include "../../mk/bsd.prefs.mk" + +.if !empty(PKGPATH:Mdevel/ccache) IGNORE_CCACHE= yes MAKEFLAGS+= IGNORE_CCACHE=yes -. endif +.endif -. if defined(IGNORE_CCACHE) +.if defined(IGNORE_CCACHE) _USE_CCACHE= NO -. endif +.endif # LANGUAGES.<compiler> is the list of supported languages by the compiler. # _LANGUAGES.<compiler> is ${LANGUAGES.<compiler>} restricted to the ones @@ -18,56 +20,43 @@ _USE_CCACHE= NO # LANGUAGES.ccache= c c++ _LANGUAGES.ccache= # empty -. for _lang_ in ${USE_LANGUAGES} +.for _lang_ in ${USE_LANGUAGES} _LANGUAGES.ccache+= ${LANGUAGES.ccache:M${_lang_}} -. endfor -. if empty(_LANGUAGES.ccache) +.endfor +.if empty(_LANGUAGES.ccache) _USE_CCACHE= NO -. endif +.endif -. if !defined(_USE_CCACHE) +.if !defined(_USE_CCACHE) _USE_CCACHE= YES -. endif +.endif -. if !empty(_USE_CCACHE:M[yY][eE][sS]) +.if !empty(_USE_CCACHE:M[yY][eE][sS]) EVAL_PREFIX+= _CCACHEBASE=ccache _CCACHEBASE_DEFAULT= ${LOCALBASE} _CCACHEBASE?= ${LOCALBASE} -. if exists(${_CCACHEBASE}/bin/ccache) +. if exists(${_CCACHEBASE}/bin/ccache) _CCACHE_DIR= ${WRKDIR}/.ccache _CCACHE_LINKS= # empty -. if !empty(_LANGUAGES.ccache:Mc) +. if !empty(_LANGUAGES.ccache:Mc) _CCACHE_CC:= ${_CCACHE_DIR}/bin/${PKG_CC:T} _CCACHE_LINKS+= _CCACHE_CC PKG_CC:= ${_CCACHE_CC} CC= ${PKG_CC:T} -. endif -. if !empty(_LANGUAGES.ccache:Mc++) +. endif +. if !empty(_LANGUAGES.ccache:Mc++) _CCACHE_CXX:= ${_CCACHE_DIR}/bin/${PKG_CXX:T} _CCACHE_LINKS+= _CCACHE_CXX PKG_CXX:= ${_CCACHE_CXX} CXX= ${PKG_CXX:T} -. endif . endif . endif -.endif # COMPILER_CCACHE_MK - -# The following section is included only if we're not being included by -# bsd.prefs.mk. -# -.if empty(BSD_PREFS_MK) -. 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) +. if !empty(_LANGUAGES.ccache) PREPEND_PATH+= ${_CCACHE_DIR}/bin -PATH:= ${_CCACHE_DIR}/bin:${PATH} -. endif -. endif +. endif # Add the dependency on ccache. BUILD_DEPENDS+= ccache-[0-9]*:../../devel/ccache @@ -79,17 +68,17 @@ CONFIGURE_ENV+= CCACHE_HASHCC=${CC_VERSION_STRING:Q} MAKE_ENV+= CCACHE_HASHCC=${CC_VERSION_STRING:Q} # Create symlinks for the compiler into ${WRKDIR}. -. if exists(${_CCACHEBASE}/bin/ccache) -. for _target_ in ${_CCACHE_LINKS} -. if !target(${${_target_}}) +. 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 -. endif # COMPILER_CCACHE_MK -.endif # BSD_PREFS_MK +. endfor +. endif +.endif # _USE_CCACHE == "yes" + +.endif # COMPILER_CCACHE_MK diff --git a/mk/compiler/distcc.mk b/mk/compiler/distcc.mk index e950375d679..21c572c80a4 100644 --- a/mk/compiler/distcc.mk +++ b/mk/compiler/distcc.mk @@ -1,16 +1,18 @@ -# $NetBSD: distcc.mk,v 1.16 2004/02/09 01:29:29 jlam Exp $ +# $NetBSD: distcc.mk,v 1.17 2004/02/18 13:32:38 jlam Exp $ .if !defined(COMPILER_DISTCC_MK) -COMPILER_DISTCC_MK= one +COMPILER_DISTCC_MK= defined -. if !empty(PKGPATH:Mdevel/distcc) +.include "../../mk/bsd.prefs.mk" + +.if !empty(PKGPATH:Mdevel/distcc) IGNORE_DISTCC= yes MAKEFLAGS+= IGNORE_DISTCC=yes -. endif +.endif -. if defined(IGNORE_DISTCC) +.if defined(IGNORE_DISTCC) _USE_DISTCC= NO -. endif +.endif # LANGUAGES.<compiler> is the list of supported languages by the compiler. # _LANGUAGES.<compiler> is ${LANGUAGES.<compiler>} restricted to the ones @@ -18,72 +20,59 @@ _USE_DISTCC= NO # LANGUAGES.distcc= c c++ _LANGUAGES.distcc= # empty -. for _lang_ in ${USE_LANGUAGES} +.for _lang_ in ${USE_LANGUAGES} _LANGUAGES.distcc+= ${LANGUAGES.distcc:M${_lang_}} -. endfor -. if empty(_LANGUAGES.distcc) +.endfor +.if empty(_LANGUAGES.distcc) _USE_DISTCC= NO -. endif +.endif -. if !defined(_USE_DISTCC) +.if !defined(_USE_DISTCC) _USE_DISTCC= YES -. endif +.endif -. if !empty(_USE_DISTCC:M[yY][eE][sS]) +.if !empty(_USE_DISTCC:M[yY][eE][sS]) EVAL_PREFIX+= _DISTCCBASE=distcc _DISTCCBASE_DEFAULT= ${LOCALBASE} _DISTCCBASE?= ${LOCALBASE} -. if exists(${_DISTCCBASE}/bin/distcc) +. if exists(${_DISTCCBASE}/bin/distcc) _DISTCC_DIR= ${WRKDIR}/.distcc _DISTCC_LINKS= # empty -. if !empty(_LANGUAGES.distcc:Mc) +. if !empty(_LANGUAGES.distcc:Mc) _DISTCC_CC:= ${_DISTCC_DIR}/bin/${PKG_CC:T} _DISTCC_LINKS+= _DISTCC_CC PKG_CC:= ${_DISTCC_CC} CC= ${PKG_CC:T} -. endif -. if !empty(_LANGUAGES.distcc:Mc++) +. endif +. if !empty(_LANGUAGES.distcc:Mc++) _DISTCC_CXX:= ${_DISTCC_DIR}/bin/${PKG_CXX:T} _DISTCC_LINKS+= _DISTCC_CXX PKG_CXX:= ${_DISTCC_CXX} CXX= ${PKG_CXX:T} -. endif . endif . endif -.endif # COMPILER_DISTCC_MK - -# The following section is included only if we're not being included by -# bsd.prefs.mk. -# -.if empty(BSD_PREFS_MK) -. 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) +. if !empty(_LANGUAGES.distcc) PREPEND_PATH+= ${_DISTCC_DIR}/bin -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_}}) +. 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 -. endif # COMPILER_DISTCC_MK -.endif # BSD_PREFS_MK +. endfor +. endif +.endif # _USE_DISTCC == "yes" + +.endif # COMPILER_DISTCC_MK diff --git a/mk/compiler/gcc.mk b/mk/compiler/gcc.mk index 75f7d5cb3bd..d9a7bd11b7e 100644 --- a/mk/compiler/gcc.mk +++ b/mk/compiler/gcc.mk @@ -1,7 +1,9 @@ -# $NetBSD: gcc.mk,v 1.52 2004/02/15 13:34:33 jlam Exp $ +# $NetBSD: gcc.mk,v 1.53 2004/02/18 13:32:38 jlam Exp $ .if !defined(COMPILER_GCC_MK) -COMPILER_GCC_MK= one +COMPILER_GCC_MK= defined + +.include "../../mk/bsd.prefs.mk" GCC_REQD+= 2.8.0 @@ -18,162 +20,162 @@ _GCC2_PATTERNS= 2.8 2.8.* 2.9 2.9.* 2.[1-8][0-9] 2.[1-8][0-9].* \ _GCC3_PATTERNS= 2.95.[4-9]* 2.95.[1-9][0-9]* 2.9[6-9] 2.9[6-9].* \ 2.[1-9][0-9][0-9]* 3.* [4-9]* -. if !defined(_CC) +.if !defined(_CC) _CC:= ${CC:C/^/_asdf_/1:M_asdf_*:S/^_asdf_//} -. for _dir_ in ${PATH:C/\:/ /g} -. if empty(_CC:M/*) -. if exists(${_dir_}/${CC:C/^/_asdf_/1:M_asdf_*:S/^_asdf_//}) +. for _dir_ in ${PATH:C/\:/ /g} +. if empty(_CC:M/*) +. if exists(${_dir_}/${CC:C/^/_asdf_/1:M_asdf_*:S/^_asdf_//}) _CC:= ${_dir_}/${CC:C/^/_asdf_/1:M_asdf_*:S/^_asdf_//} -. endif . endif -. endfor +. endif +. endfor MAKEFLAGS+= _CC=${_CC:Q} -. endif +.endif -. if !defined(_GCC_VERSION) +.if !defined(_GCC_VERSION) _GCC_VERSION_STRING!= \ ( ${_CC} -v 2>&1 | ${GREP} 'gcc version' ) 2>/dev/null || ${ECHO} 0 -. if !empty(_GCC_VERSION_STRING:Megcs*) +. if !empty(_GCC_VERSION_STRING:Megcs*) _GCC_VERSION= 2.8.1 # egcs is considered to be gcc-2.8.1. -. elif !empty(_GCC_VERSION_STRING:Mgcc*) +. elif !empty(_GCC_VERSION_STRING:Mgcc*) _GCC_VERSION!= ${_CC} -dumpversion -. else +. else _GCC_VERSION= 0 -. endif . endif +.endif _GCC_PKG= gcc-${_GCC_VERSION} -. if !empty(_CC:M${LOCALBASE}/*) +.if !empty(_CC:M${LOCALBASE}/*) _IS_BUILTIN_GCC= NO GCC_REQD+= ${_GCC_VERSION} -. else -. if !empty(_CC:M/*) +.else +. if !empty(_CC:M/*) # # GCC in older versions of Darwin report "Apple Computer ... based on gcc # version ...", so we can't just grep for "^gcc". # -. if ${_GCC_VERSION} != "0" +. if ${_GCC_VERSION} != "0" _IS_BUILTIN_GCC= YES -. else -_IS_BUILTIN_GCC= NO -. endif . else _IS_BUILTIN_GCC= NO . endif +. else +_IS_BUILTIN_GCC= NO . endif +.endif # Distill the GCC_REQD list into a single _GCC_REQD value that is the # highest version of GCC required. # _GCC_STRICTEST_REQD?= none -. for _version_ in ${GCC_REQD} -. for _pkg_ in gcc-${_version_} -. if ${_GCC_STRICTEST_REQD} == "none" +.for _version_ in ${GCC_REQD} +. for _pkg_ in gcc-${_version_} +. if ${_GCC_STRICTEST_REQD} == "none" _GCC_PKG_SATISFIES_DEP= YES -. for _vers_ in ${GCC_REQD} -. if !empty(_GCC_PKG_SATISFIES_DEP:M[yY][eE][sS]) +. for _vers_ in ${GCC_REQD} +. if !empty(_GCC_PKG_SATISFIES_DEP:M[yY][eE][sS]) _GCC_PKG_SATISFIES_DEP!= \ if ${PKG_ADMIN} pmatch 'gcc>=${_vers_}' ${_pkg_}; then \ ${ECHO} "YES"; \ else \ ${ECHO} "NO"; \ fi -. endif -. endfor -. if !empty(_GCC_PKG_SATISFIES_DEP:M[yY][eE][sS]) -_GCC_STRICTEST_REQD= ${_version_} . endif +. endfor +. if !empty(_GCC_PKG_SATISFIES_DEP:M[yY][eE][sS]) +_GCC_STRICTEST_REQD= ${_version_} . endif -. endfor +. endif . endfor +.endfor _GCC_REQD= ${_GCC_STRICTEST_REQD} # Determine whether we require GCC-2.x or GCC-3.x by examining _GCC_REQD. _NEED_GCC2?= no -. for _pattern_ in ${_GCC2_PATTERNS} -. if !empty(_GCC_REQD:M${_pattern_}) +.for _pattern_ in ${_GCC2_PATTERNS} +. if !empty(_GCC_REQD:M${_pattern_}) _NEED_GCC2= yes -. endif -. endfor +. endif +.endfor _NEED_GCC3?= no -. for _pattern_ in ${_GCC3_PATTERNS} -. if !empty(_GCC_REQD:M${_pattern_}) +.for _pattern_ in ${_GCC3_PATTERNS} +. if !empty(_GCC_REQD:M${_pattern_}) _NEED_GCC3= yes -. endif -. endfor +. endif +.endfor # Assume by default that GCC will only provide a C compiler. LANGUAGES.gcc?= c -. if !empty(_NEED_GCC2:M[yY][eE][sS]) +.if !empty(_NEED_GCC2:M[yY][eE][sS]) LANGUAGES.gcc= c c++ fortran objc -. elif !empty(_NEED_GCC3:M[yY][eE][sS]) +.elif !empty(_NEED_GCC3:M[yY][eE][sS]) LANGUAGES.gcc= c c++ fortran java objc -. endif +.endif _LANGUAGES.gcc= # empty -. for _lang_ in ${USE_LANGUAGES} +.for _lang_ in ${USE_LANGUAGES} _LANGUAGES.gcc+= ${LANGUAGES.gcc:M${_lang_}} -. endfor +.endfor -. if !empty(_NEED_GCC2:M[yY][eE][sS]) +.if !empty(_NEED_GCC2:M[yY][eE][sS]) # # We require gcc-2.x in the lang/gcc directory. # _GCC_PKGBASE= gcc -. if !empty(PKGPATH:Mlang/gcc) +. if !empty(PKGPATH:Mlang/gcc) _IGNORE_GCC= yes MAKEFLAGS+= _IGNORE_GCC=yes -. endif -. if !defined(_IGNORE_GCC) && !empty(_LANGUAGES.gcc) +. endif +. if !defined(_IGNORE_GCC) && !empty(_LANGUAGES.gcc) _GCC_PKGSRCDIR= ../../lang/gcc _GCC_DEPENDENCY= gcc>=${_GCC_REQD}:../../lang/gcc -. if !empty(_LANGUAGES.gcc:Mc++) +. if !empty(_LANGUAGES.gcc:Mc++) USE_GCC_SHLIB?= yes -. endif . endif -. elif !empty(_NEED_GCC3:M[yY][eE][sS]) +. endif +.elif !empty(_NEED_GCC3:M[yY][eE][sS]) # # We require gcc-3.x in the lang/gcc3-* directories. # _GCC_PKGBASE= gcc3-c -. if !empty(PKGPATH:Mlang/gcc3-c) +. if !empty(PKGPATH:Mlang/gcc3-c) _IGNORE_GCC= yes MAKEFLAGS+= _IGNORE_GCC=yes -. endif -. if !defined(_IGNORE_GCC) && !empty(_LANGUAGES.gcc:Mc) +. endif +. if !defined(_IGNORE_GCC) && !empty(_LANGUAGES.gcc:Mc) _GCC_PKGSRCDIR= ../../lang/gcc3-c _GCC_DEPENDENCY= gcc3-c>=${_GCC_REQD}:../../lang/gcc3-c -. endif . endif +.endif _GCC_DEPENDS= ${_GCC_PKGBASE}>=${_GCC_REQD} -. if !empty(_NEED_GCC3:M[yY][eE][sS]) -. if !empty(PKGPATH:Mlang/gcc3-c++) +.if !empty(_NEED_GCC3:M[yY][eE][sS]) +. if !empty(PKGPATH:Mlang/gcc3-c++) _IGNORE_GCC3CXX= yes MAKEFLAGS+= _IGNORE_GCC3CXX=yes -. endif -. if !defined(_IGNORE_GCC3CXX) && !empty(_LANGUAGES.gcc:Mc++) +. endif +. if !defined(_IGNORE_GCC3CXX) && !empty(_LANGUAGES.gcc:Mc++) _GCC_PKGSRCDIR+= ../../lang/gcc3-c++ _GCC_DEPENDENCY+= gcc3-c++>=${_GCC_REQD}:../../lang/gcc3-c++ USE_GCC_SHLIB?= yes -. endif -. if !empty(PKGPATH:Mlang/gcc3-f77) +. endif +. if !empty(PKGPATH:Mlang/gcc3-f77) _IGNORE_GCC3F77= yes MAKEFLAGS+= _IGNORE_GCC3F77=yes -. endif -. if !defined(_IGNORE_GCC3F77) && !empty(_LANGUAGES.gcc:Mfortran) +. endif +. if !defined(_IGNORE_GCC3F77) && !empty(_LANGUAGES.gcc:Mfortran) _GCC_PKGSRCDIR+= ../../lang/gcc3-f77 _GCC_DEPENDENCY+= gcc3-f77>=${_GCC_REQD}:../../lang/gcc3-f77 USE_GCC_SHLIB?= yes -. endif . endif +.endif -. if defined(_IGNORE_GCC) +.if defined(_IGNORE_GCC) _USE_PKGSRC_GCC= NO -. endif +.endif -. if !defined(_USE_PKGSRC_GCC) +.if !defined(_USE_PKGSRC_GCC) _USE_PKGSRC_GCC= YES -. if !empty(_IS_BUILTIN_GCC:M[yY][eE][sS]) +. if !empty(_IS_BUILTIN_GCC:M[yY][eE][sS]) _GCC_TEST_DEPENDS= gcc>=${_GCC_REQD} _USE_PKGSRC_GCC!= \ if ${PKG_ADMIN} pmatch '${_GCC_TEST_DEPENDS}' ${_GCC_PKG}; then \ @@ -181,13 +183,13 @@ _USE_PKGSRC_GCC!= \ else \ ${ECHO} "YES"; \ fi -. endif . endif +.endif # Check if any of the versions of GCC in pkgsrc can satisfy the _GCC_REQD # requirement. # -. if !defined(_NEED_NEWER_GCC) +.if !defined(_NEED_NEWER_GCC) _PKGSRC_GCC_VERSION= ${_GCC_PKGBASE}-${_GCC_DIST_VERSION} _NEED_NEWER_GCC!= \ if ${PKG_ADMIN} pmatch '${_GCC_DEPENDS}' ${_PKGSRC_GCC_VERSION}; then \ @@ -196,13 +198,13 @@ _NEED_NEWER_GCC!= \ ${ECHO} "YES"; \ fi MAKEFLAGS+= _NEED_NEWER_GCC=${_NEED_NEWER_GCC} -. endif -. if !empty(_USE_PKGSRC_GCC:M[yY][eE][sS]) && \ - !empty(_NEED_NEWER_GCC:M[yY][eE][sS]) +.endif +.if !empty(_USE_PKGSRC_GCC:M[yY][eE][sS]) && \ + !empty(_NEED_NEWER_GCC:M[yY][eE][sS]) PKG_SKIP_REASON= "Unable to satisfy dependency: ${_GCC_DEPENDS}" -. endif +.endif -. if !empty(_USE_PKGSRC_GCC:M[yY][eE][sS]) +.if !empty(_USE_PKGSRC_GCC:M[yY][eE][sS]) # # Ensure that the correct rpath is passed to the linker if we need to # link against gcc shared libs. @@ -233,17 +235,17 @@ _GCC_ARCHDIR!= \ else \ ${ECHO} "_GCC_ARCHDIR_not_found"; \ fi -. if empty(_GCC_ARCHDIR:M*not_found*) +. if empty(_GCC_ARCHDIR:M*not_found*) _GCC_PREFIX:= ${_GCC_ARCHDIR:H:H:H:H}/ _GCC_SUBPREFIX:= ${_GCC_ARCHDIR:H:H:H:H:T}/ -. endif +. endif _GCC_LIBDIRS= ${_GCC_ARCHDIR} ${_GCC_PREFIX}lib _GCC_LDFLAGS= # empty -. for _dir_ in ${_GCC_LIBDIRS:N*not_found*} +. for _dir_ in ${_GCC_LIBDIRS:N*not_found*} _GCC_LDFLAGS+= -L${_dir_} ${_COMPILER_LD_FLAG}${RPATH_FLAG}${_dir_} -. endfor +. endfor LDFLAGS+= ${_GCC_LDFLAGS} -. endif +.endif # Point the variables that specify the compiler to the installed # GCC executables. @@ -251,46 +253,46 @@ LDFLAGS+= ${_GCC_LDFLAGS} _GCC_DIR= ${WRKDIR}/.gcc _GCC_LINKS= # empty -. if !empty(_USE_PKGSRC_GCC:M[yY][eE][sS]) +.if !empty(_USE_PKGSRC_GCC:M[yY][eE][sS]) _GCCBINDIR= ${_GCC_PREFIX}bin -. elif !empty(_IS_BUILTIN_GCC:M[yY][eE][sS]) +.elif !empty(_IS_BUILTIN_GCC:M[yY][eE][sS]) _GCCBINDIR= ${_CC:H} -. endif -. if exists(${_GCCBINDIR}/gcc) +.endif +.if exists(${_GCCBINDIR}/gcc) _GCC_CC= ${_GCC_DIR}/bin/gcc _GCC_LINKS+= _GCC_CC PKG_CC= ${_GCC_CC} CC= ${PKG_CC:T} -. endif -. if exists(${_GCCBINDIR}/cpp) +.endif +.if exists(${_GCCBINDIR}/cpp) _GCC_CPP= ${_GCC_DIR}/bin/cpp _GCC_LINKS+= _GCC_CPP PKG_CPP= ${_GCC_CPP} CPP= ${PKG_CPP:T} -. endif -. if exists(${_GCCBINDIR}/g++) +.endif +.if exists(${_GCCBINDIR}/g++) _GCC_CXX= ${_GCC_DIR}/bin/g++ _GCC_LINKS+= _GCC_CXX PKG_CXX= ${_GCC_CXX} CXX= ${PKG_CXX:T} -. endif -. if exists(${_GCCBINDIR}/g77) +.endif +.if exists(${_GCCBINDIR}/g77) _GCC_FC= ${_GCC_DIR}/bin/g77 _GCC_LINKS+= _GCC_FC PKG_FC= ${_GCC_FC} FC= ${PKG_FC:T} -. endif +.endif # GCC passes flags to the linker using "-Wl,". _COMPILER_LD_FLAG= -Wl, # Pass the required flags to imake to tell it we're using gcc on Solaris. -. if ${OPSYS} == "SunOS" +.if ${OPSYS} == "SunOS" IMAKEOPTS+= -DHasGcc2=YES -DHasGcc2ForCplusplus=YES -. endif +.endif -. if !empty(_USE_PKGSRC_GCC:M[yY][eE][sS]) -. if exists(${_GCCBINDIR}/gcc) +.if !empty(_USE_PKGSRC_GCC:M[yY][eE][sS]) +. if exists(${_GCCBINDIR}/gcc) CC_VERSION_STRING!= ${_GCCBINDIR}/gcc -v 2>&1 CC_VERSION!= \ if ${_GCCBINDIR}/gcc -dumpversion > /dev/null 2>&1; then \ @@ -299,53 +301,42 @@ CC_VERSION!= \ ${ECHO} "gcc-${_GCC_REQD}"; \ fi -. else +. else CC_VERSION_STRING= ${CC_VERSION} CC_VERSION= gcc-${_GCC_REQD} -. endif -. else +. endif +.else CC_VERSION_STRING= ${CC_VERSION} CC_VERSION= ${_GCC_PKG} -. endif -.endif # COMPILER_GCC_MK - -# The following section is included only if we're not being included by -# bsd.prefs.mk. -# -.if empty(BSD_PREFS_MK) -. if empty(COMPILER_GCC_MK:Mtwo) -COMPILER_GCC_MK+= two +.endif # Prepend the path to the compiler to the PATH. -. if !empty(_LANGUAGES.gcc) -. if empty(PREPEND_PATH:M${_GCC_DIR}/bin) +.if !empty(_LANGUAGES.gcc) PREPEND_PATH+= ${_GCC_DIR}/bin -PATH:= ${_GCC_DIR}/bin:${PATH} -. endif -. endif +.endif # Add the dependency on GCC. -. if !empty(_USE_PKGSRC_GCC:M[yY][eE][sS]) -. if empty(USE_BUILDLINK2:M[nN][oO]) -. for _dir_ in ${_GCC_PKGSRCDIR} -. include "${_dir_}/buildlink2.mk" -. endfor -. elif !empty(USE_BUILDLINK3:M[yY][eE][sS]) -. for _dir_ in ${_GCC_PKGSRCDIR} -. include "${_dir_}/buildlink3.mk" -. endfor -. else -. if defined(USE_GCC_SHLIB) +.if !empty(_USE_PKGSRC_GCC:M[yY][eE][sS]) +. if empty(USE_BUILDLINK2:M[nN][oO]) +. for _dir_ in ${_GCC_PKGSRCDIR} +. include "${_dir_}/buildlink2.mk" +. endfor +. elif !empty(USE_BUILDLINK3:M[yY][eE][sS]) +. for _dir_ in ${_GCC_PKGSRCDIR} +. include "${_dir_}/buildlink3.mk" +. endfor +. else +. if defined(USE_GCC_SHLIB) DEPENDS+= ${_GCC_DEPENDENCY} -. else +. else BUILD_DEPENDS+= ${_GCC_DEPENDENCY} -. endif -. endif . endif +. endif +.endif # Create compiler driver scripts in ${WRKDIR}. -. for _target_ in ${_GCC_LINKS} -. if !target(${${_target_}}) +.for _target_ in ${_GCC_LINKS} +. if !target(${${_target_}}) override-tools: ${${_target_}} ${${_target_}}: ${_PKG_SILENT}${_PKG_DEBUG}${MKDIR} ${.TARGET:H} @@ -354,7 +345,7 @@ ${${_target_}}: ${ECHO} 'exec ${_GCCBINDIR}/${${_target_}:T} "$$@"'; \ ) > ${.TARGET} ${_PKG_SILENT}${_PKG_DEBUG}${CHMOD} +x ${.TARGET} -. endif -. endfor -. endif # COMPILER_GCC_MK -.endif # BSD_PREFS_MK +. endif +.endfor + +.endif # COMPILER_GCC_MK diff --git a/mk/compiler/mipspro-ucode.mk b/mk/compiler/mipspro-ucode.mk index ed34c87bef8..60136fb5303 100644 --- a/mk/compiler/mipspro-ucode.mk +++ b/mk/compiler/mipspro-ucode.mk @@ -1,18 +1,12 @@ -# $NetBSD: mipspro-ucode.mk,v 1.1 2004/02/18 11:18:43 jlam Exp $ +# $NetBSD: mipspro-ucode.mk,v 1.2 2004/02/18 13:32:38 jlam Exp $ .if !defined(COMPILER_MIPSPRO_UCODE_MK) -COMPILER_MIPSPRO_UCODE_MK= one +COMPILER_MIPSPRO_UCODE_MK= defined -CC_VERSION= MIPSpro Compilers: Version 4.x (ucode) -. include "../../mk/compilers/mipspro.mk" -.endif # COMPILER_MIPSPRO_UCODE_MK +.include "../../mk/bsd.prefs.mk" + +CC_VERSION?= MIPSpro Compilers: Version 4.x (ucode) -# The following section is included only if we're not being included by -# bsd.prefs.mk. -# -.if empty(BSD_PREFS_MK) -. if empty(COMPILER_MIPSPRO_UCODE_MK:Mtwo) -COMPILER_MIPSPRO_UCODE_MK+= two -. include "../../mk/compilers/mipspro.mk" -. endif # COMPILER_MIPSPRO_UCODE_MK -.endif # BSD_PREFS_MK +.include "../../mk/compilers/mipspro.mk" + +.endif # COMPILER_MIPSPRO_UCODE_MK diff --git a/mk/compiler/mipspro.mk b/mk/compiler/mipspro.mk index c63eb6543a4..a37aaa463a8 100644 --- a/mk/compiler/mipspro.mk +++ b/mk/compiler/mipspro.mk @@ -1,7 +1,9 @@ -# $NetBSD: mipspro.mk,v 1.21 2004/02/18 11:13:54 jlam Exp $ +# $NetBSD: mipspro.mk,v 1.22 2004/02/18 13:32:38 jlam Exp $ .if !defined(COMPILER_MIPSPRO_MK) -COMPILER_MIPSPRO_MK= one +COMPILER_MIPSPRO_MK= defined + +.include "../../mk/bsd.prefs.mk" MIPSPROBASE?= /usr @@ -11,53 +13,42 @@ MIPSPROBASE?= /usr # LANGUAGES.mipspro= c c++ _LANGUAGES.mipspro= # empty -. for _lang_ in ${USE_LANGUAGES} +.for _lang_ in ${USE_LANGUAGES} _LANGUAGES.mipspro+= ${LANGUAGES.mipspro:M${_lang_}} -. endfor +.endfor _MIPSPRO_DIR= ${WRKDIR}/.mipspro _MIPSPRO_LINKS= # empty -. if exists(${MIPSPROBASE}/bin/cc) +.if exists(${MIPSPROBASE}/bin/cc) _MIPSPRO_CC= ${_MIPSPRO_DIR}/bin/cc _MIPSPRO_LINKS+= _MIPSPRO_CC PKG_CC= ${_MIPSPRO_CC} CC= ${PKG_CC:T} -. endif -. if exists(${MIPSPROBASE}/bin/CC) +.endif +.if exists(${MIPSPROBASE}/bin/CC) _MIPSPRO_CXX= ${_MIPSPRO_DIR}/bin/CC _MIPSPRO_LINKS+= _MIPSPRO_CXX PKG_CXX= ${_MIPSPRO_CXX} CXX= ${PKG_CXX:T} -. endif +.endif -. if exists(${MIPSPROBASE}/bin/cc) +.if exists(${MIPSPROBASE}/bin/cc) # MIPSpro Compilers: Version 7.3.1.2m CC_VERSION_STRING!= ${MIPSPROBASE}/bin/cc -version 2>&1 || ${TRUE} CC_VERSION!= ${MIPSPROBASE}/bin/cc -version 2>&1 | ${GREP} '^MIPSpro' -. else +.else CC_VERSION_STRING?= ${CC_VERSION} CC_VERSION?= MIPSpro Compilers -. endif -.endif # COMPILER_MIPSPRO_MK - -# The following section is included only if we're not being included by -# bsd.prefs.mk. -# -.if empty(BSD_PREFS_MK) -. if empty(COMPILER_MIPSPRO_MK:Mtwo) -COMPILER_MIPSPRO_MK+= two +.endif # Prepend the path to the compiler to the PATH. -. if !empty(_LANGUAGES.mipspro) -. if empty(PREPEND_PATH:M${_MIPSPRO_DIR}/bin) +.if !empty(_LANGUAGES.mipspro) PREPEND_PATH+= ${_MIPSPRO_DIR}/bin -PATH:= ${_MIPSPRO_DIR}/bin:${PATH} -. endif -. endif +.endif # Create compiler driver scripts in ${WRKDIR}. -. for _target_ in ${_MIPSPRO_LINKS} -. if !target(${${_target_}}) +.for _target_ in ${_MIPSPRO_LINKS} +. if !target(${${_target_}}) override-tools: ${${_target_}} ${${_target_}}: ${_PKG_SILENT}${_PKG_DEBUG}${MKDIR} ${.TARGET:H} @@ -66,7 +57,7 @@ ${${_target_}}: ${ECHO} 'exec ${MIPSPROBASE}/bin/${${_target_}:T} "$$@"'; \ ) > ${.TARGET} ${_PKG_SILENT}${_PKG_DEBUG}${CHMOD} +x ${.TARGET} -. endif -. endfor -. endif # COMPILER_MIPSPRO_MK -.endif # BSD_PREFS_MK +. endif +.endfor + +.endif # COMPILER_MIPSPRO_MK diff --git a/mk/compiler/sunpro.mk b/mk/compiler/sunpro.mk index 7512e4d593b..e62ff6dcc83 100644 --- a/mk/compiler/sunpro.mk +++ b/mk/compiler/sunpro.mk @@ -1,7 +1,9 @@ -# $NetBSD: sunpro.mk,v 1.19 2004/02/18 11:13:54 jlam Exp $ +# $NetBSD: sunpro.mk,v 1.20 2004/02/18 13:32:38 jlam Exp $ .if !defined(COMPILER_SUNPRO_MK) -COMPILER_SUNPRO_MK= one +COMPILER_SUNPRO_MK= defined + +.include "../../mk/bsd.prefs.mk" SUNWSPROBASE?= /opt/SUNWspro @@ -11,54 +13,43 @@ SUNWSPROBASE?= /opt/SUNWspro # LANGUAGES.sunpro= c c++ _LANGUAGES.sunpro= # empty -. for _lang_ in ${USE_LANGUAGES} +.for _lang_ in ${USE_LANGUAGES} _LANGUAGES.sunpro+= ${LANGUAGES.sunpro:M${_lang_}} -. endfor +.endfor _SUNPRO_DIR= ${WRKDIR}/.sunpro _SUNPRO_LINKS= # empty -. if exists(${SUNWSPROBASE}/bin/cc) +.if exists(${SUNWSPROBASE}/bin/cc) _SUNPRO_CC= ${_SUNPRO_DIR}/bin/cc _SUNPRO_LINKS+= _SUNPRO_CC PKG_CC= ${_SUNPRO_CC} CC= ${PKG_CC:T} -. endif -. if exists(${SUNWSPROBASE}/bin/CC) +.endif +.if exists(${SUNWSPROBASE}/bin/CC) _SUNPRO_CXX= ${_SUNPRO_DIR}/bin/CC _SUNPRO_LINKS+= _SUNPRO_CXX PKG_CXX= ${_SUNPRO_CXX} CXX= ${PKG_CXX:T} -. endif +.endif _COMPILER_LD_FLAG= # empty -. if exists(${SUNWSPROBASE}/bin/cc) +.if exists(${SUNWSPROBASE}/bin/cc) CC_VERSION_STRING!= ${SUNWSPROBASE}/bin/cc -V 2>&1 || ${TRUE} CC_VERSION!= ${SUNWSPROBASE}/bin/cc -V 2>&1 | ${GREP} '^cc' -. else +.else CC_VERSION_STRING?= ${CC_VERSION} CC_VERSION?= cc: Sun C -. endif -.endif # COMPILER_SUNPRO_MK - -# The following section is included only if we're not being included by -# bsd.prefs.mk. -# -.if empty(BSD_PREFS_MK) -. if empty(COMPILER_SUNPRO_MK:Mtwo) -COMPILER_SUNPRO_MK+= two +.endif # Prepend the path to the compiler to the PATH. -. if !empty(_LANGUAGES.sunpro) -. if empty(PREPEND_PATH:M${_SUNPRO_DIR}/bin) +.if !empty(_LANGUAGES.sunpro) PREPEND_PATH+= ${_SUNPRO_DIR}/bin -PATH:= ${_SUNPRO_DIR}/bin:${PATH} -. endif -. endif +.endif # Create compiler driver scripts in ${WRKDIR}. -. for _target_ in ${_SUNPRO_LINKS} -. if !target(${${_target_}}) +.for _target_ in ${_SUNPRO_LINKS} +. if !target(${${_target_}}) override-tools: ${${_target_}} ${${_target_}}: ${_PKG_SILENT}${_PKG_DEBUG}${MKDIR} ${.TARGET:H} @@ -67,7 +58,7 @@ ${${_target_}}: ${ECHO} 'exec ${SUNWSPROBASE}/bin/${${_target_}:T} "$$@"'; \ ) > ${.TARGET} ${_PKG_SILENT}${_PKG_DEBUG}${CHMOD} +x ${.TARGET} -. endif -. endfor -. endif # COMPILER_SUNPRO_MK -.endif # BSD_PREFS_MK +. endif +.endfor + +.endif # COMPILER_SUNPRO_MK |