| @@ -1,14 +1,14 @@ | | | @@ -1,14 +1,14 @@ |
1 | # $NetBSD: arg-source,v 1.19 2016/03/14 20:11:56 markd Exp $ | | 1 | # $NetBSD: arg-source,v 1.20 2016/09/16 13:12:29 ryoon Exp $ |
2 | # | | 2 | # |
3 | # Copyright (c) 2004 The NetBSD Foundation, Inc. | | 3 | # Copyright (c) 2004 The NetBSD Foundation, Inc. |
4 | # All rights reserved. | | 4 | # All rights reserved. |
5 | # | | 5 | # |
6 | # This code is derived from software contributed to The NetBSD Foundation | | 6 | # This code is derived from software contributed to The NetBSD Foundation |
7 | # by Johnny C. Lam. | | 7 | # by Johnny C. Lam. |
8 | # | | 8 | # |
9 | # Redistribution and use in source and binary forms, with or without | | 9 | # Redistribution and use in source and binary forms, with or without |
10 | # modification, are permitted provided that the following conditions | | 10 | # modification, are permitted provided that the following conditions |
11 | # are met: | | 11 | # are met: |
12 | # 1. Redistributions of source code must retain the above copyright | | 12 | # 1. Redistributions of source code must retain the above copyright |
13 | # notice, this list of conditions and the following disclaimer. | | 13 | # notice, this list of conditions and the following disclaimer. |
14 | # 2. Redistributions in binary form must reproduce the above copyright | | 14 | # 2. Redistributions in binary form must reproduce the above copyright |
| @@ -40,29 +40,30 @@ | | | @@ -40,29 +40,30 @@ |
40 | # This script should be sourced within a loop and upon exiting returns | | 40 | # This script should be sourced within a loop and upon exiting returns |
41 | # an argument in $arg. | | 41 | # an argument in $arg. |
42 | # | | 42 | # |
43 | # This is done by pushing the next command-line argument onto a queue, | | 43 | # This is done by pushing the next command-line argument onto a queue, |
44 | # then using a processing loop to pop an argument off of the top of | | 44 | # then using a processing loop to pop an argument off of the top of |
45 | # the queue, transform it, and possibly push more arguments back onto | | 45 | # the queue, transform it, and possibly push more arguments back onto |
46 | # the queue. | | 46 | # the queue. |
47 | | | 47 | |
48 | # Push arguments from the command line into the argument buffer. | | 48 | # Push arguments from the command line into the argument buffer. |
49 | while $test $# -gt 0; do | | 49 | while $test $# -gt 0; do |
50 | arg="$1"; shift | | 50 | arg="$1"; shift |
51 | case $arg in | | 51 | case $arg in |
52 | ############################################################## | | 52 | ############################################################## |
53 | # Merge "-I /dir" into a single "-I/dir". Same for -L, -R. | | 53 | # Merge "-I /dir" into a single "-I/dir". Same for -l, -D, |
| | | 54 | # -L and -R. |
54 | ############################################################## | | 55 | ############################################################## |
55 | -[DILR]) | | 56 | -[lDILR]) |
56 | nextarg="$1"; shift | | 57 | nextarg="$1"; shift |
57 | case "$nextarg" in | | 58 | case "$nextarg" in |
58 | -*) msg_log $wrapperlog "WARNING: [arg-source] An $arg option must not be followed by another option, $nextarg." ;; | | 59 | -*) msg_log $wrapperlog "WARNING: [arg-source] An $arg option must not be followed by another option, $nextarg." ;; |
59 | esac | | 60 | esac |
60 | append_queue argbuf "$arg$nextarg" | | 61 | append_queue argbuf "$arg$nextarg" |
61 | $debug_log $wrapperlog " (arg-source) push: $arg$nextarg" | | 62 | $debug_log $wrapperlog " (arg-source) push: $arg$nextarg" |
62 | ;; | | 63 | ;; |
63 | ############################################################## | | 64 | ############################################################## |
64 | # Convert "-isystem /dir" into a single "-isystem,/dir". | | 65 | # Convert "-isystem /dir" into a single "-isystem,/dir". |
65 | # cmd-sync will put it back | | 66 | # cmd-sync will put it back |
66 | ############################################################## | | 67 | ############################################################## |
67 | -isystem) | | 68 | -isystem) |
68 | nextarg="$1"; shift | | 69 | nextarg="$1"; shift |