summaryrefslogtreecommitdiff
path: root/mk/compiler.mk
diff options
context:
space:
mode:
authorjlam <jlam>2004-11-30 14:50:37 +0000
committerjlam <jlam>2004-11-30 14:50:37 +0000
commitdafcb520fd1e098cce6c17d978e5fb0a11b63dce (patch)
treefe0208b86b0f4fd875482f1d22c775959c8becd5 /mk/compiler.mk
parent6f46ce69012cdc617a7ada7eab952a048b57d715 (diff)
downloadpkgsrc-dafcb520fd1e098cce6c17d978e5fb0a11b63dce.tar.gz
Modify the way that the toolchain variables, e.g. CC, CPP, CXX, LD, etc.,
are handled. The idea now is to simply remove the paths in the values of these variables, leaving behind only the basename plus any arguments, e.g.: CC= /usr/local/bin/gcc becomes CC= gcc CPP= /usr/local/bin/gcc -E becomes CPP= gcc -E The wrapper scripts are generated for every unique executable mentioned by the toolchain variables, so for the example above, only a "gcc" wrapper script is generated for ${CC} and ${CPP}. PKG_{CC,CPP,CXX,etc.} are the paths to the executables wrapped by the wrapper scripts. Note that it's now possible to set "CC" to something more than just the path to the compiler, e.g. CC= cc -ffast-math -funroll-loops -fomit-frame-pointer and the full value of ${CC} will be passed through via CONFIGURE_ENV and MAKE_ENV.
Diffstat (limited to 'mk/compiler.mk')
-rw-r--r--mk/compiler.mk18
1 files changed, 10 insertions, 8 deletions
diff --git a/mk/compiler.mk b/mk/compiler.mk
index e71cebda1da..8d52e1a9a52 100644
--- a/mk/compiler.mk
+++ b/mk/compiler.mk
@@ -1,4 +1,4 @@
-# $NetBSD: compiler.mk,v 1.39 2004/11/28 21:32:47 jlam Exp $
+# $NetBSD: compiler.mk,v 1.40 2004/11/30 14:50:37 jlam Exp $
#
# This Makefile fragment implements handling for supported C/C++/Fortran
# compilers.
@@ -117,17 +117,19 @@ _PKGSRC_COMPILER:= ${_compiler_} ${_PKGSRC_COMPILER}
.endfor
_PKGSRC_COMPILER:= ${_COMPILER} ${_PKGSRC_COMPILER}
-# Set initial values for PKG_{CC,CPP,CXX,FC} which are used within the
-# ${compiler}.mk files to discover the short names of the compilers.
-#
-PKG_CC:= ${CC}
-PKG_CPP:= ${CPP}
-PKG_CXX:= ${CXX}
-PKG_FC:= ${FC}
+_COMPILER_STRIP_VARS= # empty
.for _compiler_ in ${_PKGSRC_COMPILER}
. include "../../mk/compiler/${_compiler_}.mk"
.endfor
+.undef _compiler_
+
+# Strip the leading paths from the toolchain variables since we manipulate
+# the PATH to use the correct executable.
+#
+.for _var_ in ${_COMPILER_STRIP_VARS}
+${_var_}:= ${${_var_}:C/^/_asdf_/1:M_asdf_*:S/^_asdf_//:T} ${${_var_}:C/^/_asdf_/1:N_asdf_*}
+.endfor
.if defined(ABI) && !empty(ABI)
_WRAP_EXTRA_ARGS.CC+= ${_COMPILER_ABI_FLAG.${ABI}}