diff options
author | rillig <rillig@pkgsrc.org> | 2007-02-06 20:33:50 +0000 |
---|---|---|
committer | rillig <rillig@pkgsrc.org> | 2007-02-06 20:33:50 +0000 |
commit | fdd5258a69b5ee28d400710d2e7bc52c61911a5f (patch) | |
tree | 9f48ee730eee4fb288ccd5582e650a5f18a7d9d4 /mk | |
parent | f705bc4de846050fc0ee4765e09eedbacecaf5ca (diff) | |
download | pkgsrc-fdd5258a69b5ee28d400710d2e7bc52c61911a5f.tar.gz |
Added a new variable wrapper_type to the wrappers, so that the
transformations can decide whether they happen in a C or a C++ compiler.
Now the wrappers don't depend on the basename of the executed compiler
wrapper anymore.
Fixes PR 35555.
Diffstat (limited to 'mk')
-rw-r--r-- | mk/wrapper/bsd.wrapper.mk | 4 | ||||
-rw-r--r-- | mk/wrapper/transform-sunpro-cc | 18 | ||||
-rw-r--r-- | mk/wrapper/wrapper.sh | 3 |
3 files changed, 14 insertions, 11 deletions
diff --git a/mk/wrapper/bsd.wrapper.mk b/mk/wrapper/bsd.wrapper.mk index fa28690e450..7137d75f729 100644 --- a/mk/wrapper/bsd.wrapper.mk +++ b/mk/wrapper/bsd.wrapper.mk @@ -1,4 +1,4 @@ -# $NetBSD: bsd.wrapper.mk,v 1.62 2007/01/17 13:20:56 rillig Exp $ +# $NetBSD: bsd.wrapper.mk,v 1.63 2007/02/06 20:33:50 rillig Exp $ # # Copyright (c) 2005 The NetBSD Foundation, Inc. # All rights reserved. @@ -214,6 +214,7 @@ _WRAP_SCAN.${_wrappee_}?= ${_WRAP_SCAN} _WRAP_TRANSFORM.${_wrappee_}?= ${_WRAP_TRANSFORM} _WRAP_TRANSFORM_SED.${_wrappee_}?= ${_WRAP_TRANSFORM_SED} _WRAP_SKIP_TRANSFORM.${_wrappee_}?= ${_WRAP_SKIP_TRANSFORM} +_WRAP_TYPE.${_wrappee_}?= ${_wrappee_} .endfor # _WRAPPEES .if !empty(PKGSRC_COMPILER:Maix-xlc) @@ -369,6 +370,7 @@ _WRAP_SUBST_SED.${_wrappee_}= \ -e "s|@_WRAP_SKIP_TRANSFORM@|${_WRAP_SKIP_TRANSFORM.${_wrappee_}:Q}|g" \ -e "s|@_WRAP_TRANSFORM@|${_WRAP_TRANSFORM.${_wrappee_}:Q}|g" \ -e "s|@_WRAP_TRANSFORM_SED@|${_WRAP_TRANSFORM_SED.${_wrappee_}:Q}|g" \ + -e "s|@_WRAP_TYPE@|${_WRAP_TYPE.${_wrappee_}}|g" \ -e "s|@WRAPPER_DEBUG@|${_WRAPPER_DEBUG}|g" \ -e "s|@WRAPPER_UPDATE_CACHE@|${WRAPPER_UPDATE_CACHE}|g" \ ${_WRAP_SUBST_SED} diff --git a/mk/wrapper/transform-sunpro-cc b/mk/wrapper/transform-sunpro-cc index 13318388403..660ee034e98 100644 --- a/mk/wrapper/transform-sunpro-cc +++ b/mk/wrapper/transform-sunpro-cc @@ -1,4 +1,4 @@ -# $NetBSD: transform-sunpro-cc,v 1.23 2007/01/17 13:19:47 rillig Exp $ +# $NetBSD: transform-sunpro-cc,v 1.24 2007/02/06 20:33:51 rillig Exp $ # # Copyright (c) 2004 The NetBSD Foundation, Inc. # All rights reserved. @@ -67,17 +67,17 @@ case $arg in -Wl,--export-dynamic |\ -Wl,-E ) transform_discard ;; --W[02aclmop],* ) case ${0##*/} in - cc | gcc) transform_pass ;; - CC | g++ | c++) transform_discard_with_warning ;; - *) echo "ERROR: [transform-sunpro-cc] cmd = $0"; exit 1 ;; +-W[02aclmop],* ) case $wrapper_type in + CC) transform_pass ;; + CXX) transform_discard_with_warning ;; + *) echo "ERROR: [transform-sunpro-cc] unknown wrapper type: $wrapper_type"; exit 1 ;; esac ;; -Wall |\ --W ) case ${0##*/} in - cc | gcc) transform_to "-v" ;; - CC | g++ | c++) transform_to_and_split "+w +w2" ;; - *) echo "ERROR: [transform-sunpro-cc] cmd = $0"; exit 1 ;; +-W ) case $wrapper_type in + CC) transform_to "-v" ;; + CXX) transform_to_and_split "+w +w2" ;; + *) echo "ERROR: [transform-sunpro-cc] unknown wrapper type: $wrapper_type"; exit 1 ;; esac ;; # Ignore options that are probably meant for GCC. diff --git a/mk/wrapper/wrapper.sh b/mk/wrapper/wrapper.sh index 545602451fe..b03087d23f8 100644 --- a/mk/wrapper/wrapper.sh +++ b/mk/wrapper/wrapper.sh @@ -1,6 +1,6 @@ #! @WRAPPER_SHELL@ # -# $NetBSD: wrapper.sh,v 1.13 2007/01/02 17:13:59 rillig Exp $ +# $NetBSD: wrapper.sh,v 1.14 2007/02/06 20:33:51 rillig Exp $ # # Copyright (c) 2004 The NetBSD Foundation, Inc. # All rights reserved. @@ -53,6 +53,7 @@ scan="@_WRAP_SCAN@" transform="@_WRAP_TRANSFORM@" transform_sed="@_WRAP_TRANSFORM_SED@" wrapper_subr_sh="@_WRAP_SUBR_SH@" +wrapper_type="@_WRAP_TYPE@" wrapperlog="${WRAPPER_LOG-@_WRAP_LOG@}" skip_transform="${WRAPPER_SKIP_TRANSFORM-@_WRAP_SKIP_TRANSFORM@}" debug="${WRAPPER_DEBUG-@WRAPPER_DEBUG@}" |