[BACK]Return to compiler.mk CVS log [TXT][DIR] Up to [cvs.NetBSD.org] / pkgsrc / mk

Annotation of pkgsrc/mk/compiler.mk, Revision 1.29

1.29    ! grant       1: # $NetBSD: compiler.mk,v 1.28 2004/05/08 06:03:26 grant Exp $
1.26      jlam        2: #
                      3: # This Makefile fragment implements handling for supported C/C++/Fortran
                      4: # compilers.
1.8       grant       5: #
1.26      jlam        6: # The following variables are used by this file:
1.1       grant       7: #
1.26      jlam        8: # PKGSRC_COMPILER
                      9: #      A list of values specifying the chain of compilers to be used by
                     10: #      pkgsrc to build packages.
                     11: #
                     12: #      Valid values are:
                     13: #              distcc          distributed C/C++ (chainable)
                     14: #              ccache          compiler cache (chainable)
                     15: #              gcc             GNU
                     16: #              mipspro         Silicon Graphics, Inc. MIPSpro (n32/n64)
                     17: #              mipspro-ucode   Silicon Graphics, Inc. MIPSpro (o32)
                     18: #              sunpro          Sun Microsystems, Inc. WorkShip/Forte/Sun
                     19: #                              ONE Studio
                     20: #
                     21: #      The default is "gcc".  You can use ccache and/or distcc with an
                     22: #      appropriate PKGSRC_COMPILER setting, e.g. "ccache distcc gcc".
                     23: #      The chain should always end in a real compiler.  This should only
                     24: #      be set in /etc/mk.conf.
1.1       grant      25: #
1.7       grant      26: # GCC_REQD
1.26      jlam       27: #      A list of version numbers used to determine the minimum
                     28: #      version of GCC required by a package.  This value should only
                     29: #      be appended to by a package Makefile.
1.7       grant      30: #
1.26      jlam       31: #      NOTE: Be conservative when setting GCC_REQD, as lang/gcc3 is
                     32: #      known not to build on some platforms, e.g. Darwin.  If gcc3 is
1.7       grant      33: #      required, set GCC_REQD=3.0 so that we do not try to pull in
                     34: #      lang/gcc3 unnecessarily and have it fail.
                     35: #
1.26      jlam       36: # USE_PKGSRC_GCC
                     37: #      Force using the appropriate version of GCC from pkgsrc based on
                     38: #      GCC_REQD instead of the native compiler.
                     39: #
1.7       grant      40: # USE_GCC_SHLIB
                     41: #      Indicates that a package uses GCC shared libraries, so we
                     42: #      register a runtime dependency on the compiler package.
                     43: #
1.26      jlam       44: # USE_LANGUAGES
                     45: #      Lists the languages used in the source code of the package,
                     46: #      and is used to determine the correct compilers to install.
                     47: #      Valid values are: c, c++, fortran, java, objc.  The default
                     48: #      is "c".
1.15      grant      49: #
                     50: # The following variables are defined, and available for testing in
                     51: # package Makefiles:
                     52: #
                     53: # CC_VERSION
1.26      jlam       54: #      The compiler and version being used, e.g.,
                     55: #
1.27      sketch     56: #      .include "../../mk/compiler.mk"
1.1       grant      57: #
1.26      jlam       58: #      .if !empty(CC_VERSION:Mgcc-3*)
                     59: #      ...
                     60: #      .endif
1.7       grant      61: #
1.26      jlam       62: # The following variables are deprecated:
1.7       grant      63: #
1.26      jlam       64: # USE_GCC2, USE_GCC3, USE_SUNPRO, USE_MIPSPRO
1.7       grant      65:
1.26      jlam       66: .if !defined(BSD_COMPILER_MK)
                     67: BSD_COMPILER_MK=       defined
1.7       grant      68:
1.26      jlam       69: .include "../../mk/bsd.prefs.mk"
1.7       grant      70:
1.26      jlam       71: # XXX Add this gross and completely inaccurate hack.  Packages that
                     72: # XXX set USE_GCC_SHLIB should be adjusted to set USE_LANGUAGES
                     73: # XXX correctly (most likely by saying it needs either "c++" or
                     74: # XXX "c c++").  This is here for now so that ~85 packages won't
                     75: # XXX suddenly break.
                     76: #
                     77: .if defined(USE_GCC_SHLIB)
                     78: USE_LANGUAGES?=        c c++
1.14      grant      79: .endif
                     80:
1.26      jlam       81: # By default, assume that the package requires a C compiler.
                     82: USE_LANGUAGES?=        c
1.4       grant      83:
1.26      jlam       84: # Support some deprecated variables for a while.  They'll be removed
                     85: # after the pkgsrc-2004Q1 branch is cut.
1.4       grant      86: #
1.26      jlam       87: .if defined(USE_GCC2)
                     88: GCC_REQD+=             2.8.0
                     89: PKGSRC_COMPILER?=      gcc
                     90: .elif defined(USE_GCC3)
                     91: GCC_REQD+=             3.0
                     92: PKGSRC_COMPILER?=      gcc
                     93: .elif defined(USE_PKGSRC_GCC)
                     94: _USE_PKGSRC_GCC=       yes
                     95: PKGSRC_COMPILER?=      gcc
                     96: .elif defined(USE_SUNPRO)
                     97: PKGSRC_COMPILER?=      sunpro
                     98: .elif defined(USE_MIPSPRO)
                     99: PKGSRC_COMPILER?=      mipspro
1.4       grant     100: .else
1.26      jlam      101: PKGSRC_COMPILER?=      gcc
1.18      grant     102: .endif
                    103:
1.28      grant     104: _COMPILERS=            gcc mipspro sunpro
                    105: _PSEUDO_COMPILERS=     ccache distcc
                    106:
                    107: .if defined(NOT_FOR_COMPILER) && !empty(NOT_FOR_COMPILER)
                    108: .  for _compiler_ in ${_COMPILERS}
                    109: .    if ${NOT_FOR_COMPILER:M${_compiler_}} == ""
                    110: _ACCEPTABLE_COMPILERS+=        ${_compiler_}
                    111: .    endif
                    112: .  endfor
                    113: .elif defined(ONLY_FOR_COMPILER) && !empty(ONLY_FOR_COMPILER)
                    114: .  for _compiler_ in ${_COMPILERS}
                    115: .    if ${ONLY_FOR_COMPILER:M${_compiler_}} != ""
                    116: _ACCEPTABLE_COMPILERS+=        ${_compiler_}
                    117: .    endif
                    118: .  endfor
                    119: .else
                    120: _ACCEPTABLE_COMPILERS+=        ${_COMPILERS}
                    121: .endif
                    122:
                    123: .if defined(_ACCEPTABLE_COMPILERS)
                    124: .  for _acceptable_ in ${_ACCEPTABLE_COMPILERS}
                    125: .    for _compiler_ in ${PKGSRC_COMPILER}
                    126: .      if !empty(_ACCEPTABLE_COMPILERS:M${_compiler_}) && !defined(_COMPILER)
                    127: _COMPILER=     ${_compiler_}
                    128: .      endif
                    129: .    endfor
                    130: .  endfor
                    131: .endif
                    132:
                    133: .if !defined(_COMPILER)
                    134: PKG_FAIL_REASON+=      "No acceptable compiler found for ${PKGNAME}."
                    135: .else
                    136: _PKGSRC_COMPILER:=     ${_COMPILER}
                    137: .endif
                    138:
                    139: .for _compiler_ in ${_PSEUDO_COMPILERS}
                    140: .  if !empty(PKGSRC_COMPILER:M${_compiler_})
1.29    ! grant     141: _PKGSRC_COMPILER:=     ${_PKGSRC_COMPILER} ${_compiler_}
1.26      jlam      142: .  endif
                    143: .endfor
1.21      grant     144:
1.26      jlam      145: .for _compiler_ in ${_PKGSRC_COMPILER}
                    146: .  include "../../mk/compiler/${_compiler_}.mk"
                    147: .endfor
1.21      grant     148:
1.26      jlam      149: .endif # BSD_COMPILER_MK

CVSweb <webmaster@jp.NetBSD.org>