diff options
author | jlam <jlam@pkgsrc.org> | 2004-02-05 03:35:20 +0000 |
---|---|---|
committer | jlam <jlam@pkgsrc.org> | 2004-02-05 03:35:20 +0000 |
commit | c2d20bedad498d2bf5cda3907503947cbece550a (patch) | |
tree | 84ce346aea1279853619868492e14aa7f57e83c9 /mk/compiler | |
parent | 1a04714dd4f768ce5c6e515b6175cf404065241a (diff) | |
download | pkgsrc-c2d20bedad498d2bf5cda3907503947cbece550a.tar.gz |
Allow bsd.compiler.mk to be included by both bsd.prefs.mk and bsd.pkg.mk.
Any additions to DEPENDS/BUILD_DEPENDS or inclusions of buildlink[23].mk
files are deferred till bsd.compiler.mk is included by bsd.pkg.mk. We
allow bsd.compiler.mk to be included by bsd.prefs.mk solely for the purpose
of setting CC_VERSION properly for use by package Makefiles.
There is the surprising behaviour that CC_VERSION won't necessarily have
the correct value at all times until after "make extract" has been
completed (dependencies are installed before "make extract"), so package
Makefile writers should keep that in mind. Just to note that this is
_existing_ behaviour that's preserved by these changes.
Diffstat (limited to 'mk/compiler')
-rw-r--r-- | mk/compiler/bsd.compiler.mk | 31 | ||||
-rw-r--r-- | mk/compiler/ccache.mk | 73 | ||||
-rw-r--r-- | mk/compiler/distcc.mk | 71 | ||||
-rw-r--r-- | mk/compiler/gcc.mk | 252 | ||||
-rw-r--r-- | mk/compiler/mipspro.mk | 40 | ||||
-rw-r--r-- | mk/compiler/sunpro.mk | 40 |
6 files changed, 281 insertions, 226 deletions
diff --git a/mk/compiler/bsd.compiler.mk b/mk/compiler/bsd.compiler.mk index 96a66916842..e2570b47ace 100644 --- a/mk/compiler/bsd.compiler.mk +++ b/mk/compiler/bsd.compiler.mk @@ -1,4 +1,4 @@ -# $NetBSD: bsd.compiler.mk,v 1.6 2004/02/02 10:53:08 jlam Exp $ +# $NetBSD: bsd.compiler.mk,v 1.7 2004/02/05 03:35:20 jlam Exp $ # # This Makefile fragment implements handling for supported C/C++/Fortran # compilers. @@ -71,9 +71,9 @@ BSD_COMPILER_MK= defined # XXX "c c++"). This is here for now so that ~85 packages won't # XXX suddenly break. # -.if defined(USE_GCC_SHLIB) +. if defined(USE_GCC_SHLIB) USE_LANGUAGES?= c c++ -.endif +. endif # By default, assume that the package requires a C compiler. USE_LANGUAGES?= c @@ -81,32 +81,31 @@ 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) +. if defined(USE_GCC2) GCC_REQD?= 2.8.0 PKGSRC_COMPILER?= gcc -.elif defined(USE_GCC3) +. elif defined(USE_GCC3) GCC_REQD?= 3.0 PKGSRC_COMPILER?= gcc -.elif defined(USE_PKGSRC_GCC) +. elif defined(USE_PKGSRC_GCC) _USE_PKGSRC_GCC= yes PKGSRC_COMPILER?= gcc -.elif defined(USE_SUNPRO) +. elif defined(USE_SUNPRO) PKGSRC_COMPILER?= sunpro -.elif defined(USE_MIPSPRO) +. elif defined(USE_MIPSPRO) PKGSRC_COMPILER?= mipspro -.else +. else PKGSRC_COMPILER?= gcc -.endif +. endif _PKGSRC_COMPILER= # empty -.for _compiler_ in ${PKGSRC_COMPILER} -. if empty(_PKGSRC_COMPILER:M${_compiler_}) +. for _compiler_ in ${PKGSRC_COMPILER} +. if empty(_PKGSRC_COMPILER:M${_compiler_}) _PKGSRC_COMPILER:= ${_compiler_} ${_PKGSRC_COMPILER} -. endif -.endfor +. endif +. endfor +.endif # BSD_COMPILER_MK .for _compiler_ in ${_PKGSRC_COMPILER} . include "../../mk/compiler/${_compiler_}.mk" .endfor - -.endif # BSD_COMPILER_MK diff --git a/mk/compiler/ccache.mk b/mk/compiler/ccache.mk index 8a41c57b9d5..2ed8eefb9be 100644 --- a/mk/compiler/ccache.mk +++ b/mk/compiler/ccache.mk @@ -1,16 +1,16 @@ -# $NetBSD: ccache.mk,v 1.6 2004/02/03 20:38:39 jlam Exp $ +# $NetBSD: ccache.mk,v 1.7 2004/02/05 03:35:20 jlam Exp $ .if !defined(COMPILER_CCACHE_MK) -COMPILER_CCACHE_MK= defined +COMPILER_CCACHE_MK= one -.if !empty(PKGPATH:Mdevel/ccache) +. 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,49 +18,60 @@ _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 - -.if !empty(_USE_CCACHE:M[yY][eE][sS]) -# -# Add the dependency on ccache. -BUILD_DEPENDS+= ccache-[0-9]*:../../devel/ccache -.endif +. endif -EVAL_PREFIX+= _CCACHEBASE=ccache +. 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) -PATH:= ${_CCACHE_DIR}/bin:${PATH} -. endif -. if !empty(_LANGUAGES.ccache:Mc) +. if !empty(_LANGUAGES.ccache:Mc) CC:= ${_CCACHE_DIR}/bin/${CC:T} _CCACHE_LINKS+= CC -. endif -. if !empty(_LANGUAGES.ccache:Mc++) +. endif +. if !empty(_LANGUAGES.ccache:Mc++) CXX:= ${_CCACHE_DIR}/bin/${CXX:T} _CCACHE_LINKS+= CXX +. 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:M+*) +. if empty(COMPILER_CCACHE_MK:Mtwo) +COMPILER_CCACHE_MK+= two + +. if !empty(_USE_CCACHE:M[yY][eE][sS]) +. if !empty(_LANGUAGES.ccache) +PATH:= ${_CCACHE_DIR}/bin:${PATH} +. endif -. for _target_ in ${_CCACHE_LINKS} +BUILD_DEPENDS+= ccache-[0-9]*:../../devel/ccache + +. if exists(${_CCACHEBASE}/bin/ccache) +. for _target_ in ${_CCACHE_LINKS} override-tools: ${${_target_}} ${${_target_}}: ${_PKG_SILENT}${_PKG_DEBUG}${MKDIR} ${.TARGET:H} ${_PKG_SILENT}${_PKG_DEBUG} \ ${LN} -fs ${_CCACHEBASE}/bin/ccache ${.TARGET} -. endfor -.endif - -.endif # COMPILER_CCACHE_MK +. endfor +. endif +. endif +. endif # COMPILER_CCACHE_MK +.endif # BSD_PREFS_MK diff --git a/mk/compiler/distcc.mk b/mk/compiler/distcc.mk index ee9d8ef64c7..5d0524d9399 100644 --- a/mk/compiler/distcc.mk +++ b/mk/compiler/distcc.mk @@ -1,16 +1,16 @@ -# $NetBSD: distcc.mk,v 1.9 2004/02/03 20:38:39 jlam Exp $ +# $NetBSD: distcc.mk,v 1.10 2004/02/05 03:35:20 jlam Exp $ .if !defined(COMPILER_DISTCC_MK) -COMPILER_DISTCC_MK= defined +COMPILER_DISTCC_MK= one -.if !empty(PKGPATH:Mdevel/distcc) +. 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,49 +18,60 @@ _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 - -.if !empty(_USE_DISTCC:M[yY][eE][sS]) -# -# Add the dependency on distcc. -BUILD_DEPENDS+= distcc-[0-9]*:../../devel/distcc -.endif +. endif +. 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) -PATH:= ${_DISTCC_DIR}/bin:${PATH} -. endif -. if !empty(_LANGUAGES.distcc:Mc) +. if !empty(_LANGUAGES.distcc:Mc) CC:= ${_DISTCC_DIR}/bin/${CC:T} _DISTCC_LINKS+= CC -. endif -. if !empty(_LANGUAGES.distcc:Mc++) +. endif +. if !empty(_LANGUAGES.distcc:Mc++) CXX:= ${_DISTCC_DIR}/bin/${CXX:T} _DISTCC_LINKS+= CXX +. 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:M+*) +. if empty(COMPILER_DISTCC_MK:Mtwo) +COMPILER_DISTCC_MK+= two + +. if !empty(_USE_DISTCC:M[yY][eE][sS]) +. if !empty(_LANGUAGES.distcc) +PATH:= ${_DISTCC_DIR}/bin:${PATH} +. endif -. for _target_ in ${_DISTCC_LINKS} +BUILD_DEPENDS+= distcc-[0-9]*:../../devel/distcc + +. if exists(${_DISTCCBASE}/bin/distcc) +. for _target_ in ${_DISTCC_LINKS} override-tools: ${${_target_}} ${${_target_}}: ${_PKG_SILENT}${_PKG_DEBUG}${MKDIR} ${.TARGET:H} ${_PKG_SILENT}${_PKG_DEBUG} \ ${LN} -fs ${_DISTCCBASE}/bin/distcc ${.TARGET} -. endfor -.endif - -.endif # COMPILER_DISTCC_MK +. endfor +. endif +. endif +. endif # COMPILER_DISTCC_MK +.endif # BSD_PREFS_MK diff --git a/mk/compiler/gcc.mk b/mk/compiler/gcc.mk index 78c58023755..aa1bd5aebd1 100644 --- a/mk/compiler/gcc.mk +++ b/mk/compiler/gcc.mk @@ -1,7 +1,7 @@ -# $NetBSD: gcc.mk,v 1.35 2004/02/05 01:57:38 jlam Exp $ +# $NetBSD: gcc.mk,v 1.36 2004/02/05 03:35:20 jlam Exp $ .if !defined(COMPILER_GCC_MK) -COMPILER_GCC_MK= defined +COMPILER_GCC_MK= one GCC_REQD?= 2.8.0 @@ -19,157 +19,157 @@ _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]* _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 -. endif -.endfor +. endfor -.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]) +. endif +. endfor +. if !empty(_GCC_PKG_SATISFIES_DEP:M[yY][eE][sS]) _GCC_STRICTEST_REQD= ${_version_} +. endif . endif -. endif +. endfor . 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 -.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 LANGUAGES.gcc= c c++ fortran objc _LANGUAGES.gcc= # empty -. for _lang_ in ${USE_LANGUAGES} +. for _lang_ in ${USE_LANGUAGES} _LANGUAGES.gcc+= ${LANGUAGES.gcc:M${_lang_}} -. endfor -. if !empty(PKGPATH:Mlang/gcc) +. endfor +. 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 -. endif -.elif !empty(_NEED_GCC3:M[yY][eE][sS]) +. elif !empty(_NEED_GCC3:M[yY][eE][sS]) # # We require gcc-3.x in the lang/gcc3-* directories. # _GCC_PKGBASE= gcc3-c LANGUAGES.gcc= c c++ fortran java objc _LANGUAGES.gcc= # empty -. for _lang_ in ${USE_LANGUAGES} +. for _lang_ in ${USE_LANGUAGES} _LANGUAGES.gcc+= ${LANGUAGES.gcc:M${_lang_}} -. endfor -. if !empty(PKGPATH:Mlang/gcc3-c) +. endfor +. 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 defined(_NEED_GCC3) -. if !empty(PKGPATH:Mlang/gcc3-c++) +. if defined(_NEED_GCC3) +. 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 !empty(_IS_BUILTIN_GCC:M[nN][oO]) +. if !defined(_USE_PKGSRC_GCC) +. if !empty(_IS_BUILTIN_GCC:M[nN][oO]) _USE_PKGSRC_GCC= YES -. else +. else _GCC_TEST_DEPENDS= gcc>=${_GCC_REQD} _USE_PKGSRC_GCC!= \ if ${PKG_ADMIN} pmatch '${_GCC_TEST_DEPENDS}' ${_GCC_PKG}; then \ @@ -177,13 +177,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 \ @@ -192,13 +192,13 @@ _NEED_NEWER_GCC!= \ ${ECHO} "YES"; \ fi MAKEFLAGS+= _NEED_NEWER_GCC="${_NEED_NEWER_GCC}" -.endif -.if !empty(_USE_PKGSRC_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. @@ -229,83 +229,97 @@ _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 -LDFLAGS+= ${_GCC_LDFLAGS} - -# Add the dependency on GCC. -. 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 -BUILD_DEPENDS+= ${_GCC_DEPENDENCY} -. endif +LDFLAGS+= ${_GCC_LDFLAGS} . endif -.endif # Point the variables that specify the compiler to the installed # GCC executables. # -.if !empty(_USE_PKGSRC_GCC:M[yY][eE][sS]) -. if exists(${_GCC_PREFIX}bin/gcc) && !empty(_LANGUAGES.gcc) -PATH:= ${_GCC_PREFIX}bin:${PATH} -. endif -. if exists(${_GCC_PREFIX}bin/gcc) && !empty(_LANGUAGES.gcc:Mc) +. 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) +. 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++) +. 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) +. endif +. if exists(${_GCC_PREFIX}bin/g77) && !empty(_LANGUAGES.gcc:Mfortran) F77= ${_GCC_PREFIX}bin/g77 PKG_FC:= ${F77} -. endif -.else -. if !empty(_IS_BUILTIN_GCC:M[yY][eE][sS]) -. if !empty(_CC:M/*) -PATH:= ${_CC:H}:${PATH} . endif . 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(${CC}) +. 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`"; \ else \ ${ECHO} "gcc-${_GCC_REQD}"; \ fi -. else +. else CC_VERSION= gcc-${_GCC_REQD} -. endif -.else +. endif +. else CC_VERSION= ${_GCC_PKG} -.endif - +. 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 + +# 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) +PATH:= ${_GCC_PREFIX}bin:${PATH} +. endif +. else +. if !empty(_IS_BUILTIN_GCC:M[yY][eE][sS]) +. if !empty(_CC:M/*) +PATH:= ${_CC:H}:${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) +DEPENDS+= ${_GCC_DEPENDENCY} +. else +BUILD_DEPENDS+= ${_GCC_DEPENDENCY} +. endif +. endif +. endif +. endif # COMPILER_GCC_MK +.endif # BSD_PREFS_MK diff --git a/mk/compiler/mipspro.mk b/mk/compiler/mipspro.mk index e7ecd4986dc..ea7dbf90cb9 100644 --- a/mk/compiler/mipspro.mk +++ b/mk/compiler/mipspro.mk @@ -1,7 +1,7 @@ -# $NetBSD: mipspro.mk,v 1.8 2004/02/05 01:57:38 jlam Exp $ +# $NetBSD: mipspro.mk,v 1.9 2004/02/05 03:35:20 jlam Exp $ .if !defined(COMPILER_MIPSPRO_MK) -COMPILER_MIPSPRO_MK= defined +COMPILER_MIPSPRO_MK= one MIPSPROBASE?= /usr @@ -11,25 +11,35 @@ 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 -.if !empty(_LANGUAGES.mipspro) -PATH:= ${MIPSPROBASE}/bin:${PATH} -.endif -.if !empty(_LANGUAGES.mipspro:Mc) +. if !empty(_LANGUAGES.mipspro:Mc) CC= ${MIPSPROBASE}/bin/cc CPP= ${MIPSPROBASE}/bin/cc -E -.endif -.if !empty(_LANGUAGES.mipspro:Mc++) +. endif +. if !empty(_LANGUAGES.mipspro:Mc++) CXX= ${MIPSPROBASE}/bin/CC -.endif +. endif -if exists(${CC}) +. if exists(${CC}) CC_VERSION!= ${CC} -V 2>&1 | ${GREP} '^cc' -.else +. else CC_VERSION= mipspro -.endif - +. 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:M+*) +. if empty(COMPILER_MIPSPRO_MK:Mtwo) +COMPILER_MIPSPRO_MK+= two + +# Prepend the path to the compiler to the PATH. +. if !empty(_LANGUAGES.mipspro) +PATH:= ${MIPSPROBASE}/bin:${PATH} +. endif +. endif # COMPILER_MIPSPRO_MK +.endif # BSD_PREFS_MK diff --git a/mk/compiler/sunpro.mk b/mk/compiler/sunpro.mk index 7618004907f..aa8a5bcadef 100644 --- a/mk/compiler/sunpro.mk +++ b/mk/compiler/sunpro.mk @@ -1,7 +1,7 @@ -# $NetBSD: sunpro.mk,v 1.6 2004/02/05 01:57:38 jlam Exp $ +# $NetBSD: sunpro.mk,v 1.7 2004/02/05 03:35:20 jlam Exp $ .if !defined(COMPILER_SUNPRO_MK) -COMPILER_SUNPRO_MK= defined +COMPILER_SUNPRO_MK= one SUNWSPROBASE?= /opt/SUNWspro @@ -11,27 +11,37 @@ 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 -.if !empty(_LANGUAGES.sunpro) -PATH:= ${SUNWSPROBASE}/bin:${PATH} -.endif -.if !empty(_LANGUAGES.sunpro:Mc) +. if !empty(_LANGUAGES.sunpro:Mc) CC= ${SUNWSPROBASE}/bin/cc CPP= ${SUNWSPROBASE}/bin/cc -E -.endif -.if !empty(_LANGUAGES.sunpro:Mc++) +. endif +. if !empty(_LANGUAGES.sunpro:Mc++) CXX= ${SUNWSPROBASE}/bin/CC -.endif +. endif _COMPILER_LD_FLAG= # empty -.if exists(${CC}) +. if exists(${CC}) CC_VERSION!= ${CC} -V 2>&1 | ${GREP} '^cc' -.else +. else CC_VERSION= sunpro -.endif - +. 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:M+*) +. if empty(COMPILER_SUNPRO_MK:Mtwo) +COMPILER_SUNPRO_MK+= two + +# Prepend the path to the compiler to the PATH. +. if !empty(_LANGUAGES.sunpro) +PATH:= ${SUNWSPROBASE}/bin:${PATH} +. endif +. endif # COMPILER_SUNPRO_MK +.endif # BSD_PREFS_MK |