diff options
author | markd <markd@pkgsrc.org> | 2016-03-14 20:11:56 +0000 |
---|---|---|
committer | markd <markd@pkgsrc.org> | 2016-03-14 20:11:56 +0000 |
commit | 09058072dfbe9e8eef8888275e35df36e7f6d188 (patch) | |
tree | bb9c9ddd55576b85680c7bdc88cd448a160c1850 | |
parent | 62a47ff12871ea3408ae75497370203ef9d24425 (diff) | |
download | pkgsrc-09058072dfbe9e8eef8888275e35df36e7f6d188.tar.gz |
Add support for -isystem to legacy wrappers.
rewrite "-isystem dir" as "-isystem,dir"
transform "-isystem,dir" in same ways as "-Idir"
rewrite "-isystem,dir" back to "-isystem dir" in cmd-sink
-rw-r--r-- | mk/buildlink3/bsd.buildlink3.mk | 3 | ||||
-rw-r--r-- | mk/wrapper/arg-source | 14 | ||||
-rw-r--r-- | mk/wrapper/cmd-sink | 10 | ||||
-rw-r--r-- | mk/wrapper/gen-transform.sh | 12 | ||||
-rw-r--r-- | mk/wrapper/transform-gcc | 3 |
5 files changed, 37 insertions, 5 deletions
diff --git a/mk/buildlink3/bsd.buildlink3.mk b/mk/buildlink3/bsd.buildlink3.mk index 0cbf2facc57..d4e77781e55 100644 --- a/mk/buildlink3/bsd.buildlink3.mk +++ b/mk/buildlink3/bsd.buildlink3.mk @@ -1,4 +1,4 @@ -# $NetBSD: bsd.buildlink3.mk,v 1.236 2015/05/04 19:23:19 joerg Exp $ +# $NetBSD: bsd.buildlink3.mk,v 1.237 2016/03/14 20:11:56 markd Exp $ # # Copyright (c) 2004 The NetBSD Foundation, Inc. # All rights reserved. @@ -968,6 +968,7 @@ _CWRAPPERS_TRANSFORM+= L:/usr/lib/../libx32:/usr/libx32 # .for _dir_ in ${COMPILER_INCLUDE_DIRS} _BLNK_TRANSFORM+= opt-sub:-I${_dir_}:-I${_BLNK_MANGLE_DIR.${_dir_}} +_BLNK_TRANSFORM+= opt-sub:-isystem,${_dir_}:-isystem,${_BLNK_MANGLE_DIR.${_dir_}} _CWRAPPERS_TRANSFORM+= I:${_dir_}:${_dir_} .endfor .for _dir_ in ${COMPILER_LIB_DIRS} diff --git a/mk/wrapper/arg-source b/mk/wrapper/arg-source index 803f5deddcd..bc78af996a9 100644 --- a/mk/wrapper/arg-source +++ b/mk/wrapper/arg-source @@ -1,4 +1,4 @@ -# $NetBSD: arg-source,v 1.18 2016/03/13 15:32:06 khorben Exp $ +# $NetBSD: arg-source,v 1.19 2016/03/14 20:11:56 markd Exp $ # # Copyright (c) 2004 The NetBSD Foundation, Inc. # All rights reserved. @@ -61,6 +61,18 @@ while $test $# -gt 0; do $debug_log $wrapperlog " (arg-source) push: $arg$nextarg" ;; ############################################################## + # Convert "-isystem /dir" into a single "-isystem,/dir". + # cmd-sync will put it back + ############################################################## + -isystem) + nextarg="$1"; shift + case "$nextarg" in + -*) msg_log $wrapperlog "WARNING: [arg-source] An $arg option must not be followed by another option, $nextarg." ;; + esac + append_queue argbuf "$arg,$nextarg" + $debug_log $wrapperlog " (arg-source) push: $arg,$nextarg" + ;; + ############################################################## # Split -Wl,option1,option2 into -Wl,option1 -Wl,option2 and # process them again. # diff --git a/mk/wrapper/cmd-sink b/mk/wrapper/cmd-sink index 94f25d4ac63..0ac15e5f713 100644 --- a/mk/wrapper/cmd-sink +++ b/mk/wrapper/cmd-sink @@ -1,4 +1,4 @@ -# $NetBSD: cmd-sink,v 1.1 2004/09/21 15:01:41 jlam Exp $ +# $NetBSD: cmd-sink,v 1.2 2016/03/14 20:11:56 markd Exp $ # # Copyright (c) 2004 The NetBSD Foundation, Inc. # All rights reserved. @@ -38,5 +38,13 @@ while ! queue_is_empty cmdbuf; do pop_queue cmdbuf arg $debug_log $wrapperlog " (cmd-sink) pop: $arg" + case $arg in + -isystem,*) + dir="${arg#-isystem,}" + arg="-isystem" + . $buildcmd + arg="$dir" + ;; + esac . $buildcmd done diff --git a/mk/wrapper/gen-transform.sh b/mk/wrapper/gen-transform.sh index 58eabd869af..8227b9a1869 100644 --- a/mk/wrapper/gen-transform.sh +++ b/mk/wrapper/gen-transform.sh @@ -1,6 +1,6 @@ #! @WRAPPER_SHELL@ # -# $NetBSD: gen-transform.sh,v 1.10 2014/12/30 15:13:20 wiz Exp $ +# $NetBSD: gen-transform.sh,v 1.11 2016/03/14 20:11:56 markd Exp $ # # Copyright (c) 2004 The NetBSD Foundation, Inc. # All rights reserved. @@ -81,12 +81,16 @@ gen() transform) $debug_log $wrapperlog " (gen-transform) $_cmd: $@" gen $_action "opt:-I$1:-I$2" + gen $_action "opt:-isystem,$1:-isystem,$2" gen $_action "opt-sub:-I$1:-I$2" + gen $_action "opt-sub:-isystem,$1:-isystem,$2" ;; untransform) $debug_log $wrapperlog " (gen-transform) $_cmd: $@" gen $_action "opt:-I$2:-I$1" + gen $_action "opt:-isystem,$2:-isystem,$1" gen $_action "opt-sub:-I$2:-I$1" + gen $_action "opt-sub:-isystem,$2:-isystem,$1" ;; esac ;; @@ -161,6 +165,7 @@ gen() $debug_log $wrapperlog " (gen-transform) $_cmd: $@" #gen $_action "opt:$1:$2" gen $_action "opt:-I$1:-I$2" + gen $_action "opt:-isystem,$1:-isystem,$2" gen $_action "opt:-L$1:-L$2" gen $_action "rpath-exact:$1:$2" gen $_action "sub-mangle:$1:$2" @@ -172,6 +177,7 @@ gen() no-abspath) $debug_log $wrapperlog " (gen-transform) $_cmd" gen $_action "rm-optarg:-I/" + gen $_action "rm-optarg:-isystem,/" gen $_action "rm-optarg:-L/" for _R in $rpath_options; do gen $_action "rm-optarg:$_R/" @@ -303,7 +309,9 @@ gen() rmdir) $debug_log $wrapperlog " (gen-transform) $_cmd: $@" gen $_action "opt:-I$1:" + gen $_action "opt:-isystem,$1:" gen $_action "rm-optarg:-I$1/" + gen $_action "rm-optarg:-isystem,$1/" gen $_action "opt:-L$1:" gen $_action "rm-optarg:-L$1/" for _R in $rpath_options; do @@ -340,6 +348,7 @@ gen() $debug_log $wrapperlog " (gen-transform) $_cmd: $@" gen $_action "opt-sub-trailer:$1:/\.:$1:" gen $_action "opt-sub-trailer:-I$1:/\.:-I$1:" + gen $_action "opt-sub-trailer:-isystem,$1:/\.:-isystem,$1:" gen $_action "opt-sub-trailer:-L$1:/\.:-L$1:" for _R in $rpath_options; do gen $_action "opt-sub-trailer:$_R$1:/\.:$_R$1:" @@ -355,6 +364,7 @@ gen() #gen $_action "opt-sub:$1:$2" gen $_action "libpath:$1:$2" gen $_action "opt-sub:-I$1:-I$2" + gen $_action "opt-sub:-isystem,$1:-isystem,$2" gen $_action "opt-sub:-L$1:-L$2" gen $_action "sub-rpath:$1:$2" ;; diff --git a/mk/wrapper/transform-gcc b/mk/wrapper/transform-gcc index 4e29fc84e48..231cd9288d4 100644 --- a/mk/wrapper/transform-gcc +++ b/mk/wrapper/transform-gcc @@ -1,4 +1,4 @@ -# $NetBSD: transform-gcc,v 1.31 2016/03/12 21:22:04 khorben Exp $ +# $NetBSD: transform-gcc,v 1.32 2016/03/14 20:11:56 markd Exp $ # # This file handles the transformations needed for gcc that can be done # looking at only one argument at a time. @@ -56,6 +56,7 @@ case $arg in -fweb |\ -fwrapv |\ -ggdb |\ +-isystem,* |\ -M |\ -M[DFMPT] |\ -MMD |\ |