pkgsrc/mk/compiler/gcc.mk

271 lines
7.2 KiB
Makefile
Raw Normal View History

# $NetBSD: gcc.mk,v 1.9 2004/02/02 10:34:00 jlam Exp $
New compiler specification framework, based on mk/compiler.mk. The changes from the old compiler.mk are: * Split apart the compiler-specific logic into separate files. This should make supporting other compilers a bit easier. * Deprecate all of the USE_* compiler.mk variables, e.g. USE_GCC[23], USE_SUNPRO, etc. It's all replaced with a new PKGSRC_COMPILER variable. * Clean up the GCC handling so that it's all controlled by a single variable GCC_REQD. The following behaviour is expected: (a) If USE_PKGSRC_GCC is defined, then pretend there is no GCC on the system. (b) If there is no GCC, then the appropriate GCC corresponding to GCC_REQD is installed and used. (c) If there is a GCC, if it satisfies GCC_REQD, then use it; otherwise install and use the appropriate GCC package. (d) If lang/gcc is installed and GCC_REQD > 2.95.3, then lang/gcc3 is installed and used. (e) If lang/gcc3 is installed and GCC_REQD = 2.95.3, then gcc3 is still used instead of installing lang/gcc. New features include: * PKGSRC_COMPILER takes a list of values specifying the chain of compilers to call when building packages. Valid values are: distcc distributed C/C++ (chainable) ccache compiler cache (chainable) gcc GNU mipspro Silicon Graphics, Inc. MIPSpro 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". * Change GCC_REQD to hold a list of values that we scan through to find the highest version of GCC required by the build. Package Makefiles should now do "GCC_REQD+=..." instead of "GCC_REQD=...".
2004-02-01 01:31:00 +01:00
.if !defined(COMPILER_GCC_MK)
COMPILER_GCC_MK= defined
GCC_REQD?= 2.8.0
# _GCC_DIST_VERSION is the highest version of GCC installed by the pkgsrc
# without the PKGREVISIONs.
#
_GCC_DIST_VERSION= 3.3.2
New compiler specification framework, based on mk/compiler.mk. The changes from the old compiler.mk are: * Split apart the compiler-specific logic into separate files. This should make supporting other compilers a bit easier. * Deprecate all of the USE_* compiler.mk variables, e.g. USE_GCC[23], USE_SUNPRO, etc. It's all replaced with a new PKGSRC_COMPILER variable. * Clean up the GCC handling so that it's all controlled by a single variable GCC_REQD. The following behaviour is expected: (a) If USE_PKGSRC_GCC is defined, then pretend there is no GCC on the system. (b) If there is no GCC, then the appropriate GCC corresponding to GCC_REQD is installed and used. (c) If there is a GCC, if it satisfies GCC_REQD, then use it; otherwise install and use the appropriate GCC package. (d) If lang/gcc is installed and GCC_REQD > 2.95.3, then lang/gcc3 is installed and used. (e) If lang/gcc3 is installed and GCC_REQD = 2.95.3, then gcc3 is still used instead of installing lang/gcc. New features include: * PKGSRC_COMPILER takes a list of values specifying the chain of compilers to call when building packages. Valid values are: distcc distributed C/C++ (chainable) ccache compiler cache (chainable) gcc GNU mipspro Silicon Graphics, Inc. MIPSpro 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". * Change GCC_REQD to hold a list of values that we scan through to find the highest version of GCC required by the build. Package Makefiles should now do "GCC_REQD+=..." instead of "GCC_REQD=...".
2004-02-01 01:31:00 +01:00
# _GCC2_PATTERNS matches N s.t. N <= 2.95.3.
_GCC2_PATTERNS= 2.8 2.8.* 2.9 2.9.* 2.[1-8][0-9] 2.[1-8][0-9].* \
2.9[0-4] 2.9[0-4].* 2.95 2.95.[0-3]
# _GCC3_PATTERNS matches N s.t. 2.95.3 < N.
_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(_IS_BUILTIN_GCC)
#
# GCC in older versions of Darwin report "Apple Computer ... based on gcc
# version ...", so we can't just grep for "^gcc".
#
_IS_BUILTIN_GCC!= \
gccpath="`${TYPE} ${CC} | ${AWK} '{ print $$NF }'`"; \
case $$gccpath in \
${LOCALBASE}/*) \
${ECHO} "NO"; \
;; \
*) \
if ${CC} -v 2>&1 | ${GREP} -q 'gcc version'; then \
${ECHO} "YES"; \
else \
${ECHO} "NO"; \
fi; \
;; \
esac
.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"
_GCC_PKG_SATISFIES_DEP= YES
. 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
. 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
New compiler specification framework, based on mk/compiler.mk. The changes from the old compiler.mk are: * Split apart the compiler-specific logic into separate files. This should make supporting other compilers a bit easier. * Deprecate all of the USE_* compiler.mk variables, e.g. USE_GCC[23], USE_SUNPRO, etc. It's all replaced with a new PKGSRC_COMPILER variable. * Clean up the GCC handling so that it's all controlled by a single variable GCC_REQD. The following behaviour is expected: (a) If USE_PKGSRC_GCC is defined, then pretend there is no GCC on the system. (b) If there is no GCC, then the appropriate GCC corresponding to GCC_REQD is installed and used. (c) If there is a GCC, if it satisfies GCC_REQD, then use it; otherwise install and use the appropriate GCC package. (d) If lang/gcc is installed and GCC_REQD > 2.95.3, then lang/gcc3 is installed and used. (e) If lang/gcc3 is installed and GCC_REQD = 2.95.3, then gcc3 is still used instead of installing lang/gcc. New features include: * PKGSRC_COMPILER takes a list of values specifying the chain of compilers to call when building packages. Valid values are: distcc distributed C/C++ (chainable) ccache compiler cache (chainable) gcc GNU mipspro Silicon Graphics, Inc. MIPSpro 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". * Change GCC_REQD to hold a list of values that we scan through to find the highest version of GCC required by the build. Package Makefiles should now do "GCC_REQD+=..." instead of "GCC_REQD=...".
2004-02-01 01:31:00 +01:00
.for _pattern_ in ${_GCC2_PATTERNS}
. if !empty(_GCC_REQD:M${_pattern_})
_NEED_GCC2= yes
New compiler specification framework, based on mk/compiler.mk. The changes from the old compiler.mk are: * Split apart the compiler-specific logic into separate files. This should make supporting other compilers a bit easier. * Deprecate all of the USE_* compiler.mk variables, e.g. USE_GCC[23], USE_SUNPRO, etc. It's all replaced with a new PKGSRC_COMPILER variable. * Clean up the GCC handling so that it's all controlled by a single variable GCC_REQD. The following behaviour is expected: (a) If USE_PKGSRC_GCC is defined, then pretend there is no GCC on the system. (b) If there is no GCC, then the appropriate GCC corresponding to GCC_REQD is installed and used. (c) If there is a GCC, if it satisfies GCC_REQD, then use it; otherwise install and use the appropriate GCC package. (d) If lang/gcc is installed and GCC_REQD > 2.95.3, then lang/gcc3 is installed and used. (e) If lang/gcc3 is installed and GCC_REQD = 2.95.3, then gcc3 is still used instead of installing lang/gcc. New features include: * PKGSRC_COMPILER takes a list of values specifying the chain of compilers to call when building packages. Valid values are: distcc distributed C/C++ (chainable) ccache compiler cache (chainable) gcc GNU mipspro Silicon Graphics, Inc. MIPSpro 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". * Change GCC_REQD to hold a list of values that we scan through to find the highest version of GCC required by the build. Package Makefiles should now do "GCC_REQD+=..." instead of "GCC_REQD=...".
2004-02-01 01:31:00 +01:00
. endif
.endfor
_NEED_GCC3?= no
New compiler specification framework, based on mk/compiler.mk. The changes from the old compiler.mk are: * Split apart the compiler-specific logic into separate files. This should make supporting other compilers a bit easier. * Deprecate all of the USE_* compiler.mk variables, e.g. USE_GCC[23], USE_SUNPRO, etc. It's all replaced with a new PKGSRC_COMPILER variable. * Clean up the GCC handling so that it's all controlled by a single variable GCC_REQD. The following behaviour is expected: (a) If USE_PKGSRC_GCC is defined, then pretend there is no GCC on the system. (b) If there is no GCC, then the appropriate GCC corresponding to GCC_REQD is installed and used. (c) If there is a GCC, if it satisfies GCC_REQD, then use it; otherwise install and use the appropriate GCC package. (d) If lang/gcc is installed and GCC_REQD > 2.95.3, then lang/gcc3 is installed and used. (e) If lang/gcc3 is installed and GCC_REQD = 2.95.3, then gcc3 is still used instead of installing lang/gcc. New features include: * PKGSRC_COMPILER takes a list of values specifying the chain of compilers to call when building packages. Valid values are: distcc distributed C/C++ (chainable) ccache compiler cache (chainable) gcc GNU mipspro Silicon Graphics, Inc. MIPSpro 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". * Change GCC_REQD to hold a list of values that we scan through to find the highest version of GCC required by the build. Package Makefiles should now do "GCC_REQD+=..." instead of "GCC_REQD=...".
2004-02-01 01:31:00 +01:00
.for _pattern_ in ${_GCC3_PATTERNS}
. if !empty(_GCC_REQD:M${_pattern_})
_NEED_GCC3= yes
New compiler specification framework, based on mk/compiler.mk. The changes from the old compiler.mk are: * Split apart the compiler-specific logic into separate files. This should make supporting other compilers a bit easier. * Deprecate all of the USE_* compiler.mk variables, e.g. USE_GCC[23], USE_SUNPRO, etc. It's all replaced with a new PKGSRC_COMPILER variable. * Clean up the GCC handling so that it's all controlled by a single variable GCC_REQD. The following behaviour is expected: (a) If USE_PKGSRC_GCC is defined, then pretend there is no GCC on the system. (b) If there is no GCC, then the appropriate GCC corresponding to GCC_REQD is installed and used. (c) If there is a GCC, if it satisfies GCC_REQD, then use it; otherwise install and use the appropriate GCC package. (d) If lang/gcc is installed and GCC_REQD > 2.95.3, then lang/gcc3 is installed and used. (e) If lang/gcc3 is installed and GCC_REQD = 2.95.3, then gcc3 is still used instead of installing lang/gcc. New features include: * PKGSRC_COMPILER takes a list of values specifying the chain of compilers to call when building packages. Valid values are: distcc distributed C/C++ (chainable) ccache compiler cache (chainable) gcc GNU mipspro Silicon Graphics, Inc. MIPSpro 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". * Change GCC_REQD to hold a list of values that we scan through to find the highest version of GCC required by the build. Package Makefiles should now do "GCC_REQD+=..." instead of "GCC_REQD=...".
2004-02-01 01:31:00 +01:00
. endif
.endfor
.if defined(_NEED_GCC2)
#
# We require gcc-2.x in the lang/gcc directory.
#
New compiler specification framework, based on mk/compiler.mk. The changes from the old compiler.mk are: * Split apart the compiler-specific logic into separate files. This should make supporting other compilers a bit easier. * Deprecate all of the USE_* compiler.mk variables, e.g. USE_GCC[23], USE_SUNPRO, etc. It's all replaced with a new PKGSRC_COMPILER variable. * Clean up the GCC handling so that it's all controlled by a single variable GCC_REQD. The following behaviour is expected: (a) If USE_PKGSRC_GCC is defined, then pretend there is no GCC on the system. (b) If there is no GCC, then the appropriate GCC corresponding to GCC_REQD is installed and used. (c) If there is a GCC, if it satisfies GCC_REQD, then use it; otherwise install and use the appropriate GCC package. (d) If lang/gcc is installed and GCC_REQD > 2.95.3, then lang/gcc3 is installed and used. (e) If lang/gcc3 is installed and GCC_REQD = 2.95.3, then gcc3 is still used instead of installing lang/gcc. New features include: * PKGSRC_COMPILER takes a list of values specifying the chain of compilers to call when building packages. Valid values are: distcc distributed C/C++ (chainable) ccache compiler cache (chainable) gcc GNU mipspro Silicon Graphics, Inc. MIPSpro 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". * Change GCC_REQD to hold a list of values that we scan through to find the highest version of GCC required by the build. Package Makefiles should now do "GCC_REQD+=..." instead of "GCC_REQD=...".
2004-02-01 01:31:00 +01:00
_GCC_PKGBASE= gcc
LANGUAGES.gcc= c c++ fortran objc
_LANGUAGES.gcc= # empty
. for _lang_ in ${USE_LANGUAGES}
_LANGUAGES.gcc= ${LANGUAGES.gcc:M${_lang_}}
. endfor
New compiler specification framework, based on mk/compiler.mk. The changes from the old compiler.mk are: * Split apart the compiler-specific logic into separate files. This should make supporting other compilers a bit easier. * Deprecate all of the USE_* compiler.mk variables, e.g. USE_GCC[23], USE_SUNPRO, etc. It's all replaced with a new PKGSRC_COMPILER variable. * Clean up the GCC handling so that it's all controlled by a single variable GCC_REQD. The following behaviour is expected: (a) If USE_PKGSRC_GCC is defined, then pretend there is no GCC on the system. (b) If there is no GCC, then the appropriate GCC corresponding to GCC_REQD is installed and used. (c) If there is a GCC, if it satisfies GCC_REQD, then use it; otherwise install and use the appropriate GCC package. (d) If lang/gcc is installed and GCC_REQD > 2.95.3, then lang/gcc3 is installed and used. (e) If lang/gcc3 is installed and GCC_REQD = 2.95.3, then gcc3 is still used instead of installing lang/gcc. New features include: * PKGSRC_COMPILER takes a list of values specifying the chain of compilers to call when building packages. Valid values are: distcc distributed C/C++ (chainable) ccache compiler cache (chainable) gcc GNU mipspro Silicon Graphics, Inc. MIPSpro 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". * Change GCC_REQD to hold a list of values that we scan through to find the highest version of GCC required by the build. Package Makefiles should now do "GCC_REQD+=..." instead of "GCC_REQD=...".
2004-02-01 01:31:00 +01:00
. if !empty(PKGPATH:Mlang/gcc)
_IGNORE_GCC= yes
MAKEFLAGS+= _IGNORE_GCC=yes
. elif !empty(_LANGUAGES.gcc)
_GCC_PKGSRCDIR= ../../lang/gcc
_GCC_DEPENDENCY= gcc>=${_GCC_REQD}:../../lang/gcc
New compiler specification framework, based on mk/compiler.mk. The changes from the old compiler.mk are: * Split apart the compiler-specific logic into separate files. This should make supporting other compilers a bit easier. * Deprecate all of the USE_* compiler.mk variables, e.g. USE_GCC[23], USE_SUNPRO, etc. It's all replaced with a new PKGSRC_COMPILER variable. * Clean up the GCC handling so that it's all controlled by a single variable GCC_REQD. The following behaviour is expected: (a) If USE_PKGSRC_GCC is defined, then pretend there is no GCC on the system. (b) If there is no GCC, then the appropriate GCC corresponding to GCC_REQD is installed and used. (c) If there is a GCC, if it satisfies GCC_REQD, then use it; otherwise install and use the appropriate GCC package. (d) If lang/gcc is installed and GCC_REQD > 2.95.3, then lang/gcc3 is installed and used. (e) If lang/gcc3 is installed and GCC_REQD = 2.95.3, then gcc3 is still used instead of installing lang/gcc. New features include: * PKGSRC_COMPILER takes a list of values specifying the chain of compilers to call when building packages. Valid values are: distcc distributed C/C++ (chainable) ccache compiler cache (chainable) gcc GNU mipspro Silicon Graphics, Inc. MIPSpro 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". * Change GCC_REQD to hold a list of values that we scan through to find the highest version of GCC required by the build. Package Makefiles should now do "GCC_REQD+=..." instead of "GCC_REQD=...".
2004-02-01 01:31:00 +01:00
. endif
.elif defined(_NEED_GCC3)
#
# 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}
_LANGUAGES.gcc= ${LANGUAGES.gcc:M${_lang_}}
. endfor
. if !empty(PKGPATH:Mlang/gcc3-c)
_IGNORE_GCC3C= yes
MAKEFLAGS+= _IGNORE_GCC3C=yes
. elif !empty(_LANGUAGES.gcc:Mc)
_GCC_PKGSRCDIR= ../../lang/gcc3-c
_GCC_DEPENDENCY= gcc3-c>=${_GCC_REQD}:../../lang/gcc3-c
. endif
. if !empty(PKGPATH:Mlang/gcc3-c++)
_IGNORE_GCC3CXX= yes
MAKEFLAGS+= _IGNORE_GCC3CXX=yes
. elif !empty(_LANGUAGES.gcc:Mc++)
_GCC_PKGSRCDIR+= ../../lang/gcc3-c++
_GCC_DEPENDENCY+= gcc3-c++>=${_GCC_REQD}:../../lang/gcc3-c++
. endif
. if !empty(PKGPATH:Mlang/gcc3-f77)
_IGNORE_GCC3F77= yes
MAKEFLAGS+= _IGNORE_GCC3F77=yes
. elif !empty(_LANGUAGES.gcc:Mfortran)
_GCC_PKGSRCDIR+= ../../lang/gcc3-f77
_GCC_DEPENDENCY+= gcc3-f77>=${_GCC_REQD}:../../lang/gcc3-f77
New compiler specification framework, based on mk/compiler.mk. The changes from the old compiler.mk are: * Split apart the compiler-specific logic into separate files. This should make supporting other compilers a bit easier. * Deprecate all of the USE_* compiler.mk variables, e.g. USE_GCC[23], USE_SUNPRO, etc. It's all replaced with a new PKGSRC_COMPILER variable. * Clean up the GCC handling so that it's all controlled by a single variable GCC_REQD. The following behaviour is expected: (a) If USE_PKGSRC_GCC is defined, then pretend there is no GCC on the system. (b) If there is no GCC, then the appropriate GCC corresponding to GCC_REQD is installed and used. (c) If there is a GCC, if it satisfies GCC_REQD, then use it; otherwise install and use the appropriate GCC package. (d) If lang/gcc is installed and GCC_REQD > 2.95.3, then lang/gcc3 is installed and used. (e) If lang/gcc3 is installed and GCC_REQD = 2.95.3, then gcc3 is still used instead of installing lang/gcc. New features include: * PKGSRC_COMPILER takes a list of values specifying the chain of compilers to call when building packages. Valid values are: distcc distributed C/C++ (chainable) ccache compiler cache (chainable) gcc GNU mipspro Silicon Graphics, Inc. MIPSpro 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". * Change GCC_REQD to hold a list of values that we scan through to find the highest version of GCC required by the build. Package Makefiles should now do "GCC_REQD+=..." instead of "GCC_REQD=...".
2004-02-01 01:31:00 +01:00
. endif
.endif
_GCC_DEPENDS= ${_GCC_PKGBASE}>=${_GCC_REQD}
.if defined(_IGNORE_GCC) || defined(_IGNORE_GCC3C)
New compiler specification framework, based on mk/compiler.mk. The changes from the old compiler.mk are: * Split apart the compiler-specific logic into separate files. This should make supporting other compilers a bit easier. * Deprecate all of the USE_* compiler.mk variables, e.g. USE_GCC[23], USE_SUNPRO, etc. It's all replaced with a new PKGSRC_COMPILER variable. * Clean up the GCC handling so that it's all controlled by a single variable GCC_REQD. The following behaviour is expected: (a) If USE_PKGSRC_GCC is defined, then pretend there is no GCC on the system. (b) If there is no GCC, then the appropriate GCC corresponding to GCC_REQD is installed and used. (c) If there is a GCC, if it satisfies GCC_REQD, then use it; otherwise install and use the appropriate GCC package. (d) If lang/gcc is installed and GCC_REQD > 2.95.3, then lang/gcc3 is installed and used. (e) If lang/gcc3 is installed and GCC_REQD = 2.95.3, then gcc3 is still used instead of installing lang/gcc. New features include: * PKGSRC_COMPILER takes a list of values specifying the chain of compilers to call when building packages. Valid values are: distcc distributed C/C++ (chainable) ccache compiler cache (chainable) gcc GNU mipspro Silicon Graphics, Inc. MIPSpro 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". * Change GCC_REQD to hold a list of values that we scan through to find the highest version of GCC required by the build. Package Makefiles should now do "GCC_REQD+=..." instead of "GCC_REQD=...".
2004-02-01 01:31:00 +01:00
_USE_PKGSRC_GCC= NO
.endif
.if !defined(_USE_PKGSRC_GCC)
. if !empty(_IS_BUILTIN_GCC:M[nN][oO])
_USE_PKGSRC_GCC= YES
. else
_GCC_VERSION_STRING!= ${CC} -v 2>&1 | ${GREP} 'gcc version'
. 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*)
_GCC_VERSION!= ${CC} -dumpversion
. else
_GCC_VERSION= 0
. endif
_GCC_TEST_DEPENDS= gcc>=${_GCC_REQD}
_GCC_PKG= gcc-${_GCC_VERSION}
New compiler specification framework, based on mk/compiler.mk. The changes from the old compiler.mk are: * Split apart the compiler-specific logic into separate files. This should make supporting other compilers a bit easier. * Deprecate all of the USE_* compiler.mk variables, e.g. USE_GCC[23], USE_SUNPRO, etc. It's all replaced with a new PKGSRC_COMPILER variable. * Clean up the GCC handling so that it's all controlled by a single variable GCC_REQD. The following behaviour is expected: (a) If USE_PKGSRC_GCC is defined, then pretend there is no GCC on the system. (b) If there is no GCC, then the appropriate GCC corresponding to GCC_REQD is installed and used. (c) If there is a GCC, if it satisfies GCC_REQD, then use it; otherwise install and use the appropriate GCC package. (d) If lang/gcc is installed and GCC_REQD > 2.95.3, then lang/gcc3 is installed and used. (e) If lang/gcc3 is installed and GCC_REQD = 2.95.3, then gcc3 is still used instead of installing lang/gcc. New features include: * PKGSRC_COMPILER takes a list of values specifying the chain of compilers to call when building packages. Valid values are: distcc distributed C/C++ (chainable) ccache compiler cache (chainable) gcc GNU mipspro Silicon Graphics, Inc. MIPSpro 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". * Change GCC_REQD to hold a list of values that we scan through to find the highest version of GCC required by the build. Package Makefiles should now do "GCC_REQD+=..." instead of "GCC_REQD=...".
2004-02-01 01:31:00 +01:00
_USE_PKGSRC_GCC!= \
if ${PKG_ADMIN} pmatch '${_GCC_TEST_DEPENDS}' ${_GCC_PKG}; then \
${ECHO} "NO"; \
else \
${ECHO} "YES"; \
fi
. endif
.endif
.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.
#
_COMPILER_LD_FLAG= -Wl,
_GCC_SUBPREFIX!= \
if ${PKG_INFO} -qe ${_GCC_PKGBASE}; then \
${PKG_INFO} -f ${_GCC_PKGBASE} | \
${GREP} "File:.*bin/gcc" | \
${SED} -e "s/.*File: *//;s/bin\/gcc.*//;q"; \
else \
${ECHO} "not_found/"; \
fi
_GCC_PREFIX= ${LOCALBASE}/${_GCC_SUBPREFIX}
_GCC_LIBGCCDIR!= \
if [ -x ${_GCC_PREFIX}bin/gcc ]; then \
${DIRNAME} `${_GCC_PREFIX}bin/gcc --print-libgcc-file-name`; \
else \
${ECHO} "not_found"; \
fi
_GCC_ARCHSUBDIR= ${_GCC_LIBGCCDIR:S|^${LOCALBASE}/${_GCC_SUBPREFIX}||}
_GCC_ARCHDIR= ${_GCC_PREFIX}${_GCC_ARCHSUBDIR}
_GCC_LDFLAGS= # empty
.for _dir_ in ${_GCC_ARCHDIR} ${_GCC_PREFIX}lib
_GCC_LDFLAGS+= -L${_dir_} ${_COMPILER_LD_FLAG}${RPATH_FLAG}${_dir_}
.endfor
LDFLAGS+= ${_GCC_LDFLAGS}
.endif
# Check if any of the versions of GCC in pkgsrc can satisfy the _GCC_REQD
# requirement.
#
.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 \
${ECHO} "NO"; \
else \
${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])
PKG_SKIP_REASON= "Unable to satisfy dependency: ${_GCC_DEPENDS}"
.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
New compiler specification framework, based on mk/compiler.mk. The changes from the old compiler.mk are: * Split apart the compiler-specific logic into separate files. This should make supporting other compilers a bit easier. * Deprecate all of the USE_* compiler.mk variables, e.g. USE_GCC[23], USE_SUNPRO, etc. It's all replaced with a new PKGSRC_COMPILER variable. * Clean up the GCC handling so that it's all controlled by a single variable GCC_REQD. The following behaviour is expected: (a) If USE_PKGSRC_GCC is defined, then pretend there is no GCC on the system. (b) If there is no GCC, then the appropriate GCC corresponding to GCC_REQD is installed and used. (c) If there is a GCC, if it satisfies GCC_REQD, then use it; otherwise install and use the appropriate GCC package. (d) If lang/gcc is installed and GCC_REQD > 2.95.3, then lang/gcc3 is installed and used. (e) If lang/gcc3 is installed and GCC_REQD = 2.95.3, then gcc3 is still used instead of installing lang/gcc. New features include: * PKGSRC_COMPILER takes a list of values specifying the chain of compilers to call when building packages. Valid values are: distcc distributed C/C++ (chainable) ccache compiler cache (chainable) gcc GNU mipspro Silicon Graphics, Inc. MIPSpro 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". * Change GCC_REQD to hold a list of values that we scan through to find the highest version of GCC required by the build. Package Makefiles should now do "GCC_REQD+=..." instead of "GCC_REQD=...".
2004-02-01 01:31:00 +01:00
. else
. if defined(USE_GCC_SHLIB)
DEPENDS+= ${_GCC_DEPENDENCY}
New compiler specification framework, based on mk/compiler.mk. The changes from the old compiler.mk are: * Split apart the compiler-specific logic into separate files. This should make supporting other compilers a bit easier. * Deprecate all of the USE_* compiler.mk variables, e.g. USE_GCC[23], USE_SUNPRO, etc. It's all replaced with a new PKGSRC_COMPILER variable. * Clean up the GCC handling so that it's all controlled by a single variable GCC_REQD. The following behaviour is expected: (a) If USE_PKGSRC_GCC is defined, then pretend there is no GCC on the system. (b) If there is no GCC, then the appropriate GCC corresponding to GCC_REQD is installed and used. (c) If there is a GCC, if it satisfies GCC_REQD, then use it; otherwise install and use the appropriate GCC package. (d) If lang/gcc is installed and GCC_REQD > 2.95.3, then lang/gcc3 is installed and used. (e) If lang/gcc3 is installed and GCC_REQD = 2.95.3, then gcc3 is still used instead of installing lang/gcc. New features include: * PKGSRC_COMPILER takes a list of values specifying the chain of compilers to call when building packages. Valid values are: distcc distributed C/C++ (chainable) ccache compiler cache (chainable) gcc GNU mipspro Silicon Graphics, Inc. MIPSpro 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". * Change GCC_REQD to hold a list of values that we scan through to find the highest version of GCC required by the build. Package Makefiles should now do "GCC_REQD+=..." instead of "GCC_REQD=...".
2004-02-01 01:31:00 +01:00
. else
BUILD_DEPENDS+= ${_GCC_DEPENDENCY}
New compiler specification framework, based on mk/compiler.mk. The changes from the old compiler.mk are: * Split apart the compiler-specific logic into separate files. This should make supporting other compilers a bit easier. * Deprecate all of the USE_* compiler.mk variables, e.g. USE_GCC[23], USE_SUNPRO, etc. It's all replaced with a new PKGSRC_COMPILER variable. * Clean up the GCC handling so that it's all controlled by a single variable GCC_REQD. The following behaviour is expected: (a) If USE_PKGSRC_GCC is defined, then pretend there is no GCC on the system. (b) If there is no GCC, then the appropriate GCC corresponding to GCC_REQD is installed and used. (c) If there is a GCC, if it satisfies GCC_REQD, then use it; otherwise install and use the appropriate GCC package. (d) If lang/gcc is installed and GCC_REQD > 2.95.3, then lang/gcc3 is installed and used. (e) If lang/gcc3 is installed and GCC_REQD = 2.95.3, then gcc3 is still used instead of installing lang/gcc. New features include: * PKGSRC_COMPILER takes a list of values specifying the chain of compilers to call when building packages. Valid values are: distcc distributed C/C++ (chainable) ccache compiler cache (chainable) gcc GNU mipspro Silicon Graphics, Inc. MIPSpro 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". * Change GCC_REQD to hold a list of values that we scan through to find the highest version of GCC required by the build. Package Makefiles should now do "GCC_REQD+=..." instead of "GCC_REQD=...".
2004-02-01 01:31:00 +01:00
. endif
. 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)
New compiler specification framework, based on mk/compiler.mk. The changes from the old compiler.mk are: * Split apart the compiler-specific logic into separate files. This should make supporting other compilers a bit easier. * Deprecate all of the USE_* compiler.mk variables, e.g. USE_GCC[23], USE_SUNPRO, etc. It's all replaced with a new PKGSRC_COMPILER variable. * Clean up the GCC handling so that it's all controlled by a single variable GCC_REQD. The following behaviour is expected: (a) If USE_PKGSRC_GCC is defined, then pretend there is no GCC on the system. (b) If there is no GCC, then the appropriate GCC corresponding to GCC_REQD is installed and used. (c) If there is a GCC, if it satisfies GCC_REQD, then use it; otherwise install and use the appropriate GCC package. (d) If lang/gcc is installed and GCC_REQD > 2.95.3, then lang/gcc3 is installed and used. (e) If lang/gcc3 is installed and GCC_REQD = 2.95.3, then gcc3 is still used instead of installing lang/gcc. New features include: * PKGSRC_COMPILER takes a list of values specifying the chain of compilers to call when building packages. Valid values are: distcc distributed C/C++ (chainable) ccache compiler cache (chainable) gcc GNU mipspro Silicon Graphics, Inc. MIPSpro 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". * Change GCC_REQD to hold a list of values that we scan through to find the highest version of GCC required by the build. Package Makefiles should now do "GCC_REQD+=..." instead of "GCC_REQD=...".
2004-02-01 01:31:00 +01:00
PATH:= ${_GCC_PREFIX}bin:${PATH}
. endif
. if exists(${_GCC_PREFIX}bin/gcc) && !empty(_LANGUAGES.gcc:Mc)
New compiler specification framework, based on mk/compiler.mk. The changes from the old compiler.mk are: * Split apart the compiler-specific logic into separate files. This should make supporting other compilers a bit easier. * Deprecate all of the USE_* compiler.mk variables, e.g. USE_GCC[23], USE_SUNPRO, etc. It's all replaced with a new PKGSRC_COMPILER variable. * Clean up the GCC handling so that it's all controlled by a single variable GCC_REQD. The following behaviour is expected: (a) If USE_PKGSRC_GCC is defined, then pretend there is no GCC on the system. (b) If there is no GCC, then the appropriate GCC corresponding to GCC_REQD is installed and used. (c) If there is a GCC, if it satisfies GCC_REQD, then use it; otherwise install and use the appropriate GCC package. (d) If lang/gcc is installed and GCC_REQD > 2.95.3, then lang/gcc3 is installed and used. (e) If lang/gcc3 is installed and GCC_REQD = 2.95.3, then gcc3 is still used instead of installing lang/gcc. New features include: * PKGSRC_COMPILER takes a list of values specifying the chain of compilers to call when building packages. Valid values are: distcc distributed C/C++ (chainable) ccache compiler cache (chainable) gcc GNU mipspro Silicon Graphics, Inc. MIPSpro 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". * Change GCC_REQD to hold a list of values that we scan through to find the highest version of GCC required by the build. Package Makefiles should now do "GCC_REQD+=..." instead of "GCC_REQD=...".
2004-02-01 01:31:00 +01:00
CC= ${_GCC_PREFIX}bin/gcc
. endif
. if exists(${_GCC_PREFIX}bin/cpp) && !empty(_LANGUAGES.gcc:Mc)
New compiler specification framework, based on mk/compiler.mk. The changes from the old compiler.mk are: * Split apart the compiler-specific logic into separate files. This should make supporting other compilers a bit easier. * Deprecate all of the USE_* compiler.mk variables, e.g. USE_GCC[23], USE_SUNPRO, etc. It's all replaced with a new PKGSRC_COMPILER variable. * Clean up the GCC handling so that it's all controlled by a single variable GCC_REQD. The following behaviour is expected: (a) If USE_PKGSRC_GCC is defined, then pretend there is no GCC on the system. (b) If there is no GCC, then the appropriate GCC corresponding to GCC_REQD is installed and used. (c) If there is a GCC, if it satisfies GCC_REQD, then use it; otherwise install and use the appropriate GCC package. (d) If lang/gcc is installed and GCC_REQD > 2.95.3, then lang/gcc3 is installed and used. (e) If lang/gcc3 is installed and GCC_REQD = 2.95.3, then gcc3 is still used instead of installing lang/gcc. New features include: * PKGSRC_COMPILER takes a list of values specifying the chain of compilers to call when building packages. Valid values are: distcc distributed C/C++ (chainable) ccache compiler cache (chainable) gcc GNU mipspro Silicon Graphics, Inc. MIPSpro 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". * Change GCC_REQD to hold a list of values that we scan through to find the highest version of GCC required by the build. Package Makefiles should now do "GCC_REQD+=..." instead of "GCC_REQD=...".
2004-02-01 01:31:00 +01:00
CPP= ${_GCC_PREFIX}bin/cpp
. endif
. if exists(${_GCC_PREFIX}bin/g++) && !empty(_LANGUAGES.gcc:Mc++)
New compiler specification framework, based on mk/compiler.mk. The changes from the old compiler.mk are: * Split apart the compiler-specific logic into separate files. This should make supporting other compilers a bit easier. * Deprecate all of the USE_* compiler.mk variables, e.g. USE_GCC[23], USE_SUNPRO, etc. It's all replaced with a new PKGSRC_COMPILER variable. * Clean up the GCC handling so that it's all controlled by a single variable GCC_REQD. The following behaviour is expected: (a) If USE_PKGSRC_GCC is defined, then pretend there is no GCC on the system. (b) If there is no GCC, then the appropriate GCC corresponding to GCC_REQD is installed and used. (c) If there is a GCC, if it satisfies GCC_REQD, then use it; otherwise install and use the appropriate GCC package. (d) If lang/gcc is installed and GCC_REQD > 2.95.3, then lang/gcc3 is installed and used. (e) If lang/gcc3 is installed and GCC_REQD = 2.95.3, then gcc3 is still used instead of installing lang/gcc. New features include: * PKGSRC_COMPILER takes a list of values specifying the chain of compilers to call when building packages. Valid values are: distcc distributed C/C++ (chainable) ccache compiler cache (chainable) gcc GNU mipspro Silicon Graphics, Inc. MIPSpro 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". * Change GCC_REQD to hold a list of values that we scan through to find the highest version of GCC required by the build. Package Makefiles should now do "GCC_REQD+=..." instead of "GCC_REQD=...".
2004-02-01 01:31:00 +01:00
CXX= ${_GCC_PREFIX}bin/g++
. endif
. if exists(${_GCC_PREFIX}bin/g77) && !empty(_LANGUAGES.gcc:Mfortran)
New compiler specification framework, based on mk/compiler.mk. The changes from the old compiler.mk are: * Split apart the compiler-specific logic into separate files. This should make supporting other compilers a bit easier. * Deprecate all of the USE_* compiler.mk variables, e.g. USE_GCC[23], USE_SUNPRO, etc. It's all replaced with a new PKGSRC_COMPILER variable. * Clean up the GCC handling so that it's all controlled by a single variable GCC_REQD. The following behaviour is expected: (a) If USE_PKGSRC_GCC is defined, then pretend there is no GCC on the system. (b) If there is no GCC, then the appropriate GCC corresponding to GCC_REQD is installed and used. (c) If there is a GCC, if it satisfies GCC_REQD, then use it; otherwise install and use the appropriate GCC package. (d) If lang/gcc is installed and GCC_REQD > 2.95.3, then lang/gcc3 is installed and used. (e) If lang/gcc3 is installed and GCC_REQD = 2.95.3, then gcc3 is still used instead of installing lang/gcc. New features include: * PKGSRC_COMPILER takes a list of values specifying the chain of compilers to call when building packages. Valid values are: distcc distributed C/C++ (chainable) ccache compiler cache (chainable) gcc GNU mipspro Silicon Graphics, Inc. MIPSpro 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". * Change GCC_REQD to hold a list of values that we scan through to find the highest version of GCC required by the build. Package Makefiles should now do "GCC_REQD+=..." instead of "GCC_REQD=...".
2004-02-01 01:31:00 +01:00
F77= ${_GCC_PREFIX}bin/g77
PKG_FC:= ${F77}
. endif
.else
. if !empty(_IS_BUILTIN_GCC:M[yY][eE][sS])
_GCC_PATH!= ${TYPE} ${CC} | ${AWK} '{ print $$NF }'
PATH:= ${_GCC_PATH:H}:${PATH}
. endif
New compiler specification framework, based on mk/compiler.mk. The changes from the old compiler.mk are: * Split apart the compiler-specific logic into separate files. This should make supporting other compilers a bit easier. * Deprecate all of the USE_* compiler.mk variables, e.g. USE_GCC[23], USE_SUNPRO, etc. It's all replaced with a new PKGSRC_COMPILER variable. * Clean up the GCC handling so that it's all controlled by a single variable GCC_REQD. The following behaviour is expected: (a) If USE_PKGSRC_GCC is defined, then pretend there is no GCC on the system. (b) If there is no GCC, then the appropriate GCC corresponding to GCC_REQD is installed and used. (c) If there is a GCC, if it satisfies GCC_REQD, then use it; otherwise install and use the appropriate GCC package. (d) If lang/gcc is installed and GCC_REQD > 2.95.3, then lang/gcc3 is installed and used. (e) If lang/gcc3 is installed and GCC_REQD = 2.95.3, then gcc3 is still used instead of installing lang/gcc. New features include: * PKGSRC_COMPILER takes a list of values specifying the chain of compilers to call when building packages. Valid values are: distcc distributed C/C++ (chainable) ccache compiler cache (chainable) gcc GNU mipspro Silicon Graphics, Inc. MIPSpro 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". * Change GCC_REQD to hold a list of values that we scan through to find the highest version of GCC required by the build. Package Makefiles should now do "GCC_REQD+=..." instead of "GCC_REQD=...".
2004-02-01 01:31:00 +01:00
.endif
# Pass the required flags to imake to tell it we're using gcc on Solaris.
.if ${OPSYS} == "SunOS"
IMAKEOPTS+= -DHasGcc2=YES -DHasGcc2ForCplusplus=YES
.endif
.if !empty(_USE_PKGSRC_GCC:M[yY][eE][sS])
CC_VERSION!= if ${CC} -dumpversion > /dev/null 2>&1; then \
${ECHO} "gcc-`${CC} -dumpversion`"; \
else \
${ECHO} "gcc-${_GCC_REQD}"; \
fi
.else
CC_VERSION= ${_GCC_PKG}
.endif
.endif # COMPILER_GCC_MK