| @@ -1,95 +1,95 @@ | | | @@ -1,95 +1,95 @@ |
1 | # $NetBSD: cmd-sink-aix-xlc,v 1.5 2008/11/14 14:04:12 joerg Exp $ | | 1 | # $NetBSD: cmd-sink-aix-xlc,v 1.6 2008/11/27 18:01:17 joerg 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 |
15 | # notice, this list of conditions and the following disclaimer in the | | 15 | # notice, this list of conditions and the following disclaimer in the |
16 | # documentation and/or other materials provided with the distribution. | | 16 | # documentation and/or other materials provided with the distribution. |
17 | # 3. All advertising materials mentioning features or use of this software | | 17 | # 3. All advertising materials mentioning features or use of this software |
18 | # must display the following acknowledgement: | | 18 | # must display the following acknowledgement: |
19 | # This product includes software developed by the NetBSD | | 19 | # This product includes software developed by the NetBSD |
20 | # Foundation, Inc. and its contributors. | | 20 | # Foundation, Inc. and its contributors. |
21 | # 4. Neither the name of The NetBSD Foundation nor the names of its | | 21 | # 4. Neither the name of The NetBSD Foundation nor the names of its |
22 | # contributors may be used to endorse or promote products derived | | 22 | # contributors may be used to endorse or promote products derived |
23 | # from this software without specific prior written permission. | | 23 | # from this software without specific prior written permission. |
24 | # | | 24 | # |
25 | # THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS | | 25 | # THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS |
26 | # ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED | | 26 | # ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED |
27 | # TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR | | 27 | # TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR |
28 | # PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS | | 28 | # PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS |
29 | # BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR | | 29 | # BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR |
30 | # CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF | | 30 | # CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF |
31 | # SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS | | 31 | # SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS |
32 | # INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN | | 32 | # INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN |
33 | # CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) | | 33 | # CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) |
34 | # ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE | | 34 | # ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE |
35 | # POSSIBILITY OF SUCH DAMAGE. | | 35 | # POSSIBILITY OF SUCH DAMAGE. |
36 | | | 36 | |
37 | # Empty out the command buffer and build up the command line in $cmd. | | 37 | # Empty out the command buffer and build up the command line in $cmd. |
38 | blibpath= | | 38 | blibpath= |
39 | orig_blibpath= | | 39 | orig_blibpath= |
40 | while ! queue_is_empty cmdbuf; do | | 40 | while ! queue_is_empty cmdbuf; do |
41 | pop_queue cmdbuf arg | | 41 | pop_queue cmdbuf arg |
42 | $debug_log $wrapperlog " (cmd-sink-aix-xlc) pop: $arg" | | 42 | $debug_log $wrapperlog " (cmd-sink-aix-xlc) pop: $arg" |
43 | case $arg in | | 43 | case $arg in |
44 | -blibpath:*) | | 44 | -blibpath:*) |
45 | orig_blibpath=${arg#-blibpath:} | | 45 | orig_blibpath=${arg#-blibpath:} |
46 | $debug_log $wrapperlog " (cmd-sink-aix-ld) drop: $dir [setting orig_blibpath]" | | 46 | $debug_log $wrapperlog " (cmd-sink-aix-ld) drop: $dir [setting orig_blibpath]" |
47 | ;; | | 47 | ;; |
48 | -Wl,-blibpath:*) | | 48 | -Wl,-blibpath:*) |
49 | orig_blibpath=${arg#-Wl,-blibpath:} | | 49 | orig_blibpath=${arg#-Wl,-blibpath:} |
50 | $debug_log $wrapperlog " (cmd-sink-aix-ld) drop: $dir [setting orig_blibpath]" | | 50 | $debug_log $wrapperlog " (cmd-sink-aix-ld) drop: $dir [setting orig_blibpath]" |
51 | ;; | | 51 | ;; |
52 | ############################################################## | | 52 | ############################################################## |
53 | # AIX xlC doesn't support -Wl,-rpath,* but accumulate them | | 53 | # AIX xlC doesn't support -Wl,-rpath,* but accumulate them |
54 | # into a path collection we can later append to command line | | 54 | # into a path collection we can later append to command line |
55 | # using -blibpath. | | 55 | # using -blibpath. |
56 | ############################################################## | | 56 | ############################################################## |
57 | -R*|-Wl,-R*|-Wl,-rpath,*|-Wl,-rpath-link,*|-Wl,--rpath,*) | | 57 | -R*|-Wl,-R*|-Wl,-rpath,*|-Wl,-rpath-link,*|-Wl,--rpath,*) |
58 | case $arg in | | 58 | case $arg in |
59 | -R*) R="-R" ;; | | 59 | -R*) R="-R" ;; |
60 | -Wl,-R*) R="-Wl,-R" ;; | | 60 | -Wl,-R*) R="-Wl,-R" ;; |
61 | -Wl,-rpath,*) R="-Wl,-rpath," ;; | | 61 | -Wl,-rpath,*) R="-Wl,-rpath," ;; |
62 | -Wl,-rpath-link,*) R="-Wl,-rpath-link," ;; | | 62 | -Wl,-rpath-link,*) R="-Wl,-rpath-link," ;; |
63 | -Wl,--rpath,*) R="-Wl,--rpath," ;; | | 63 | -Wl,--rpath,*) R="-Wl,--rpath," ;; |
64 | esac | | 64 | esac |
65 | dir="${arg#$R}" | | 65 | dir="${arg#$R}" |
66 | case $blibpath in | | 66 | case $blibpath in |
67 | "") blibpath="$dir" ;; | | 67 | "") blibpath="$dir" ;; |
68 | *) blibpath="$blibpath:$dir" ;; | | 68 | *) blibpath="$blibpath:$dir" ;; |
69 | esac | | 69 | esac |
70 | $debug_log $wrapperlog " (cmd-sink-aix-xlc) drop: $dir [adding to blibpath]" | | 70 | $debug_log $wrapperlog " (cmd-sink-aix-xlc) drop: $dir [adding to blibpath]" |
71 | ;; | | 71 | ;; |
72 | *) | | 72 | *) |
73 | . $buildcmd | | 73 | . $buildcmd |
74 | ;; | | 74 | ;; |
75 | esac | | 75 | esac |
76 | done | | 76 | done |
77 | | | 77 | |
78 | # AIX xlc uses -blibpath to set the runtime library search path. | | 78 | # AIX xlc uses -blibpath to set the runtime library search path. |
79 | arg="-Wl,-blibpath:/usr/usr/lib:/lib" | | 79 | arg="-Wl,-blibpath:/usr/usr/lib:/lib" |
80 | if $test -n "$orig_blibpath"; then | | 80 | if $test -n "$orig_blibpath"; then |
81 | arg="$arg:$orig_blibpath" | | 81 | arg="$arg:$orig_blibpath" |
82 | fi | | 82 | fi |
83 | if $test -n "$blibpath"; then | | 83 | if $test -n "$blibpath"; then |
84 | arg="$arg:$blibpath" | | 84 | arg="$arg:$blibpath" |
85 | fi | | 85 | fi |
86 | $debug_log $wrapperlog " (cmd-sink-aix-xlc) pop: $arg" | | 86 | $debug_log $wrapperlog " (cmd-sink-aix-xlc) pop: $arg" |
87 | . $buildcmd | | 87 | . $buildcmd |
88 | | | 88 | |
89 | # Force dynamic linkage on AIX to get preference of dynamic libraries | | 89 | # Force dynamic linkage on AIX to get preference of dynamic libraries |
90 | # over library archives. | | 90 | # over library archives. |
91 | if $test "$dont_link" != "yes"; then | | 91 | if $test "$dont_link" != "yes"; then |
92 | arg="-brtl" | | 92 | arg="-Wl,-brtl" |
93 | $debug_log $wrapperlog " (cmd-sink-aix-xlc) pop: $arg" | | 93 | $debug_log $wrapperlog " (cmd-sink-aix-xlc) pop: $arg" |
94 | . $buildcmd | | 94 | . $buildcmd |
95 | fi | | 95 | fi |