annotate depcomp @ 269:6cbc409ff09f 2.6

Added asprintf redux
author lost
date Tue, 22 Dec 2009 05:53:05 +0000
parents 68fbca173508
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
265
68fbca173508 Added generated files for release
lost
parents:
diff changeset
1 #! /bin/sh
68fbca173508 Added generated files for release
lost
parents:
diff changeset
2 # depcomp - compile a program generating dependencies as side-effects
68fbca173508 Added generated files for release
lost
parents:
diff changeset
3
68fbca173508 Added generated files for release
lost
parents:
diff changeset
4 scriptversion=2009-04-28.21; # UTC
68fbca173508 Added generated files for release
lost
parents:
diff changeset
5
68fbca173508 Added generated files for release
lost
parents:
diff changeset
6 # Copyright (C) 1999, 2000, 2003, 2004, 2005, 2006, 2007, 2009 Free
68fbca173508 Added generated files for release
lost
parents:
diff changeset
7 # Software Foundation, Inc.
68fbca173508 Added generated files for release
lost
parents:
diff changeset
8
68fbca173508 Added generated files for release
lost
parents:
diff changeset
9 # This program is free software; you can redistribute it and/or modify
68fbca173508 Added generated files for release
lost
parents:
diff changeset
10 # it under the terms of the GNU General Public License as published by
68fbca173508 Added generated files for release
lost
parents:
diff changeset
11 # the Free Software Foundation; either version 2, or (at your option)
68fbca173508 Added generated files for release
lost
parents:
diff changeset
12 # any later version.
68fbca173508 Added generated files for release
lost
parents:
diff changeset
13
68fbca173508 Added generated files for release
lost
parents:
diff changeset
14 # This program is distributed in the hope that it will be useful,
68fbca173508 Added generated files for release
lost
parents:
diff changeset
15 # but WITHOUT ANY WARRANTY; without even the implied warranty of
68fbca173508 Added generated files for release
lost
parents:
diff changeset
16 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
68fbca173508 Added generated files for release
lost
parents:
diff changeset
17 # GNU General Public License for more details.
68fbca173508 Added generated files for release
lost
parents:
diff changeset
18
68fbca173508 Added generated files for release
lost
parents:
diff changeset
19 # You should have received a copy of the GNU General Public License
68fbca173508 Added generated files for release
lost
parents:
diff changeset
20 # along with this program. If not, see <http://www.gnu.org/licenses/>.
68fbca173508 Added generated files for release
lost
parents:
diff changeset
21
68fbca173508 Added generated files for release
lost
parents:
diff changeset
22 # As a special exception to the GNU General Public License, if you
68fbca173508 Added generated files for release
lost
parents:
diff changeset
23 # distribute this file as part of a program that contains a
68fbca173508 Added generated files for release
lost
parents:
diff changeset
24 # configuration script generated by Autoconf, you may include it under
68fbca173508 Added generated files for release
lost
parents:
diff changeset
25 # the same distribution terms that you use for the rest of that program.
68fbca173508 Added generated files for release
lost
parents:
diff changeset
26
68fbca173508 Added generated files for release
lost
parents:
diff changeset
27 # Originally written by Alexandre Oliva <oliva@dcc.unicamp.br>.
68fbca173508 Added generated files for release
lost
parents:
diff changeset
28
68fbca173508 Added generated files for release
lost
parents:
diff changeset
29 case $1 in
68fbca173508 Added generated files for release
lost
parents:
diff changeset
30 '')
68fbca173508 Added generated files for release
lost
parents:
diff changeset
31 echo "$0: No command. Try \`$0 --help' for more information." 1>&2
68fbca173508 Added generated files for release
lost
parents:
diff changeset
32 exit 1;
68fbca173508 Added generated files for release
lost
parents:
diff changeset
33 ;;
68fbca173508 Added generated files for release
lost
parents:
diff changeset
34 -h | --h*)
68fbca173508 Added generated files for release
lost
parents:
diff changeset
35 cat <<\EOF
68fbca173508 Added generated files for release
lost
parents:
diff changeset
36 Usage: depcomp [--help] [--version] PROGRAM [ARGS]
68fbca173508 Added generated files for release
lost
parents:
diff changeset
37
68fbca173508 Added generated files for release
lost
parents:
diff changeset
38 Run PROGRAMS ARGS to compile a file, generating dependencies
68fbca173508 Added generated files for release
lost
parents:
diff changeset
39 as side-effects.
68fbca173508 Added generated files for release
lost
parents:
diff changeset
40
68fbca173508 Added generated files for release
lost
parents:
diff changeset
41 Environment variables:
68fbca173508 Added generated files for release
lost
parents:
diff changeset
42 depmode Dependency tracking mode.
68fbca173508 Added generated files for release
lost
parents:
diff changeset
43 source Source file read by `PROGRAMS ARGS'.
68fbca173508 Added generated files for release
lost
parents:
diff changeset
44 object Object file output by `PROGRAMS ARGS'.
68fbca173508 Added generated files for release
lost
parents:
diff changeset
45 DEPDIR directory where to store dependencies.
68fbca173508 Added generated files for release
lost
parents:
diff changeset
46 depfile Dependency file to output.
68fbca173508 Added generated files for release
lost
parents:
diff changeset
47 tmpdepfile Temporary file to use when outputing dependencies.
68fbca173508 Added generated files for release
lost
parents:
diff changeset
48 libtool Whether libtool is used (yes/no).
68fbca173508 Added generated files for release
lost
parents:
diff changeset
49
68fbca173508 Added generated files for release
lost
parents:
diff changeset
50 Report bugs to <bug-automake@gnu.org>.
68fbca173508 Added generated files for release
lost
parents:
diff changeset
51 EOF
68fbca173508 Added generated files for release
lost
parents:
diff changeset
52 exit $?
68fbca173508 Added generated files for release
lost
parents:
diff changeset
53 ;;
68fbca173508 Added generated files for release
lost
parents:
diff changeset
54 -v | --v*)
68fbca173508 Added generated files for release
lost
parents:
diff changeset
55 echo "depcomp $scriptversion"
68fbca173508 Added generated files for release
lost
parents:
diff changeset
56 exit $?
68fbca173508 Added generated files for release
lost
parents:
diff changeset
57 ;;
68fbca173508 Added generated files for release
lost
parents:
diff changeset
58 esac
68fbca173508 Added generated files for release
lost
parents:
diff changeset
59
68fbca173508 Added generated files for release
lost
parents:
diff changeset
60 if test -z "$depmode" || test -z "$source" || test -z "$object"; then
68fbca173508 Added generated files for release
lost
parents:
diff changeset
61 echo "depcomp: Variables source, object and depmode must be set" 1>&2
68fbca173508 Added generated files for release
lost
parents:
diff changeset
62 exit 1
68fbca173508 Added generated files for release
lost
parents:
diff changeset
63 fi
68fbca173508 Added generated files for release
lost
parents:
diff changeset
64
68fbca173508 Added generated files for release
lost
parents:
diff changeset
65 # Dependencies for sub/bar.o or sub/bar.obj go into sub/.deps/bar.Po.
68fbca173508 Added generated files for release
lost
parents:
diff changeset
66 depfile=${depfile-`echo "$object" |
68fbca173508 Added generated files for release
lost
parents:
diff changeset
67 sed 's|[^\\/]*$|'${DEPDIR-.deps}'/&|;s|\.\([^.]*\)$|.P\1|;s|Pobj$|Po|'`}
68fbca173508 Added generated files for release
lost
parents:
diff changeset
68 tmpdepfile=${tmpdepfile-`echo "$depfile" | sed 's/\.\([^.]*\)$/.T\1/'`}
68fbca173508 Added generated files for release
lost
parents:
diff changeset
69
68fbca173508 Added generated files for release
lost
parents:
diff changeset
70 rm -f "$tmpdepfile"
68fbca173508 Added generated files for release
lost
parents:
diff changeset
71
68fbca173508 Added generated files for release
lost
parents:
diff changeset
72 # Some modes work just like other modes, but use different flags. We
68fbca173508 Added generated files for release
lost
parents:
diff changeset
73 # parameterize here, but still list the modes in the big case below,
68fbca173508 Added generated files for release
lost
parents:
diff changeset
74 # to make depend.m4 easier to write. Note that we *cannot* use a case
68fbca173508 Added generated files for release
lost
parents:
diff changeset
75 # here, because this file can only contain one case statement.
68fbca173508 Added generated files for release
lost
parents:
diff changeset
76 if test "$depmode" = hp; then
68fbca173508 Added generated files for release
lost
parents:
diff changeset
77 # HP compiler uses -M and no extra arg.
68fbca173508 Added generated files for release
lost
parents:
diff changeset
78 gccflag=-M
68fbca173508 Added generated files for release
lost
parents:
diff changeset
79 depmode=gcc
68fbca173508 Added generated files for release
lost
parents:
diff changeset
80 fi
68fbca173508 Added generated files for release
lost
parents:
diff changeset
81
68fbca173508 Added generated files for release
lost
parents:
diff changeset
82 if test "$depmode" = dashXmstdout; then
68fbca173508 Added generated files for release
lost
parents:
diff changeset
83 # This is just like dashmstdout with a different argument.
68fbca173508 Added generated files for release
lost
parents:
diff changeset
84 dashmflag=-xM
68fbca173508 Added generated files for release
lost
parents:
diff changeset
85 depmode=dashmstdout
68fbca173508 Added generated files for release
lost
parents:
diff changeset
86 fi
68fbca173508 Added generated files for release
lost
parents:
diff changeset
87
68fbca173508 Added generated files for release
lost
parents:
diff changeset
88 cygpath_u="cygpath -u -f -"
68fbca173508 Added generated files for release
lost
parents:
diff changeset
89 if test "$depmode" = msvcmsys; then
68fbca173508 Added generated files for release
lost
parents:
diff changeset
90 # This is just like msvisualcpp but w/o cygpath translation.
68fbca173508 Added generated files for release
lost
parents:
diff changeset
91 # Just convert the backslash-escaped backslashes to single forward
68fbca173508 Added generated files for release
lost
parents:
diff changeset
92 # slashes to satisfy depend.m4
68fbca173508 Added generated files for release
lost
parents:
diff changeset
93 cygpath_u="sed s,\\\\\\\\,/,g"
68fbca173508 Added generated files for release
lost
parents:
diff changeset
94 depmode=msvisualcpp
68fbca173508 Added generated files for release
lost
parents:
diff changeset
95 fi
68fbca173508 Added generated files for release
lost
parents:
diff changeset
96
68fbca173508 Added generated files for release
lost
parents:
diff changeset
97 case "$depmode" in
68fbca173508 Added generated files for release
lost
parents:
diff changeset
98 gcc3)
68fbca173508 Added generated files for release
lost
parents:
diff changeset
99 ## gcc 3 implements dependency tracking that does exactly what
68fbca173508 Added generated files for release
lost
parents:
diff changeset
100 ## we want. Yay! Note: for some reason libtool 1.4 doesn't like
68fbca173508 Added generated files for release
lost
parents:
diff changeset
101 ## it if -MD -MP comes after the -MF stuff. Hmm.
68fbca173508 Added generated files for release
lost
parents:
diff changeset
102 ## Unfortunately, FreeBSD c89 acceptance of flags depends upon
68fbca173508 Added generated files for release
lost
parents:
diff changeset
103 ## the command line argument order; so add the flags where they
68fbca173508 Added generated files for release
lost
parents:
diff changeset
104 ## appear in depend2.am. Note that the slowdown incurred here
68fbca173508 Added generated files for release
lost
parents:
diff changeset
105 ## affects only configure: in makefiles, %FASTDEP% shortcuts this.
68fbca173508 Added generated files for release
lost
parents:
diff changeset
106 for arg
68fbca173508 Added generated files for release
lost
parents:
diff changeset
107 do
68fbca173508 Added generated files for release
lost
parents:
diff changeset
108 case $arg in
68fbca173508 Added generated files for release
lost
parents:
diff changeset
109 -c) set fnord "$@" -MT "$object" -MD -MP -MF "$tmpdepfile" "$arg" ;;
68fbca173508 Added generated files for release
lost
parents:
diff changeset
110 *) set fnord "$@" "$arg" ;;
68fbca173508 Added generated files for release
lost
parents:
diff changeset
111 esac
68fbca173508 Added generated files for release
lost
parents:
diff changeset
112 shift # fnord
68fbca173508 Added generated files for release
lost
parents:
diff changeset
113 shift # $arg
68fbca173508 Added generated files for release
lost
parents:
diff changeset
114 done
68fbca173508 Added generated files for release
lost
parents:
diff changeset
115 "$@"
68fbca173508 Added generated files for release
lost
parents:
diff changeset
116 stat=$?
68fbca173508 Added generated files for release
lost
parents:
diff changeset
117 if test $stat -eq 0; then :
68fbca173508 Added generated files for release
lost
parents:
diff changeset
118 else
68fbca173508 Added generated files for release
lost
parents:
diff changeset
119 rm -f "$tmpdepfile"
68fbca173508 Added generated files for release
lost
parents:
diff changeset
120 exit $stat
68fbca173508 Added generated files for release
lost
parents:
diff changeset
121 fi
68fbca173508 Added generated files for release
lost
parents:
diff changeset
122 mv "$tmpdepfile" "$depfile"
68fbca173508 Added generated files for release
lost
parents:
diff changeset
123 ;;
68fbca173508 Added generated files for release
lost
parents:
diff changeset
124
68fbca173508 Added generated files for release
lost
parents:
diff changeset
125 gcc)
68fbca173508 Added generated files for release
lost
parents:
diff changeset
126 ## There are various ways to get dependency output from gcc. Here's
68fbca173508 Added generated files for release
lost
parents:
diff changeset
127 ## why we pick this rather obscure method:
68fbca173508 Added generated files for release
lost
parents:
diff changeset
128 ## - Don't want to use -MD because we'd like the dependencies to end
68fbca173508 Added generated files for release
lost
parents:
diff changeset
129 ## up in a subdir. Having to rename by hand is ugly.
68fbca173508 Added generated files for release
lost
parents:
diff changeset
130 ## (We might end up doing this anyway to support other compilers.)
68fbca173508 Added generated files for release
lost
parents:
diff changeset
131 ## - The DEPENDENCIES_OUTPUT environment variable makes gcc act like
68fbca173508 Added generated files for release
lost
parents:
diff changeset
132 ## -MM, not -M (despite what the docs say).
68fbca173508 Added generated files for release
lost
parents:
diff changeset
133 ## - Using -M directly means running the compiler twice (even worse
68fbca173508 Added generated files for release
lost
parents:
diff changeset
134 ## than renaming).
68fbca173508 Added generated files for release
lost
parents:
diff changeset
135 if test -z "$gccflag"; then
68fbca173508 Added generated files for release
lost
parents:
diff changeset
136 gccflag=-MD,
68fbca173508 Added generated files for release
lost
parents:
diff changeset
137 fi
68fbca173508 Added generated files for release
lost
parents:
diff changeset
138 "$@" -Wp,"$gccflag$tmpdepfile"
68fbca173508 Added generated files for release
lost
parents:
diff changeset
139 stat=$?
68fbca173508 Added generated files for release
lost
parents:
diff changeset
140 if test $stat -eq 0; then :
68fbca173508 Added generated files for release
lost
parents:
diff changeset
141 else
68fbca173508 Added generated files for release
lost
parents:
diff changeset
142 rm -f "$tmpdepfile"
68fbca173508 Added generated files for release
lost
parents:
diff changeset
143 exit $stat
68fbca173508 Added generated files for release
lost
parents:
diff changeset
144 fi
68fbca173508 Added generated files for release
lost
parents:
diff changeset
145 rm -f "$depfile"
68fbca173508 Added generated files for release
lost
parents:
diff changeset
146 echo "$object : \\" > "$depfile"
68fbca173508 Added generated files for release
lost
parents:
diff changeset
147 alpha=ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz
68fbca173508 Added generated files for release
lost
parents:
diff changeset
148 ## The second -e expression handles DOS-style file names with drive letters.
68fbca173508 Added generated files for release
lost
parents:
diff changeset
149 sed -e 's/^[^:]*: / /' \
68fbca173508 Added generated files for release
lost
parents:
diff changeset
150 -e 's/^['$alpha']:\/[^:]*: / /' < "$tmpdepfile" >> "$depfile"
68fbca173508 Added generated files for release
lost
parents:
diff changeset
151 ## This next piece of magic avoids the `deleted header file' problem.
68fbca173508 Added generated files for release
lost
parents:
diff changeset
152 ## The problem is that when a header file which appears in a .P file
68fbca173508 Added generated files for release
lost
parents:
diff changeset
153 ## is deleted, the dependency causes make to die (because there is
68fbca173508 Added generated files for release
lost
parents:
diff changeset
154 ## typically no way to rebuild the header). We avoid this by adding
68fbca173508 Added generated files for release
lost
parents:
diff changeset
155 ## dummy dependencies for each header file. Too bad gcc doesn't do
68fbca173508 Added generated files for release
lost
parents:
diff changeset
156 ## this for us directly.
68fbca173508 Added generated files for release
lost
parents:
diff changeset
157 tr ' ' '
68fbca173508 Added generated files for release
lost
parents:
diff changeset
158 ' < "$tmpdepfile" |
68fbca173508 Added generated files for release
lost
parents:
diff changeset
159 ## Some versions of gcc put a space before the `:'. On the theory
68fbca173508 Added generated files for release
lost
parents:
diff changeset
160 ## that the space means something, we add a space to the output as
68fbca173508 Added generated files for release
lost
parents:
diff changeset
161 ## well.
68fbca173508 Added generated files for release
lost
parents:
diff changeset
162 ## Some versions of the HPUX 10.20 sed can't process this invocation
68fbca173508 Added generated files for release
lost
parents:
diff changeset
163 ## correctly. Breaking it into two sed invocations is a workaround.
68fbca173508 Added generated files for release
lost
parents:
diff changeset
164 sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile"
68fbca173508 Added generated files for release
lost
parents:
diff changeset
165 rm -f "$tmpdepfile"
68fbca173508 Added generated files for release
lost
parents:
diff changeset
166 ;;
68fbca173508 Added generated files for release
lost
parents:
diff changeset
167
68fbca173508 Added generated files for release
lost
parents:
diff changeset
168 hp)
68fbca173508 Added generated files for release
lost
parents:
diff changeset
169 # This case exists only to let depend.m4 do its work. It works by
68fbca173508 Added generated files for release
lost
parents:
diff changeset
170 # looking at the text of this script. This case will never be run,
68fbca173508 Added generated files for release
lost
parents:
diff changeset
171 # since it is checked for above.
68fbca173508 Added generated files for release
lost
parents:
diff changeset
172 exit 1
68fbca173508 Added generated files for release
lost
parents:
diff changeset
173 ;;
68fbca173508 Added generated files for release
lost
parents:
diff changeset
174
68fbca173508 Added generated files for release
lost
parents:
diff changeset
175 sgi)
68fbca173508 Added generated files for release
lost
parents:
diff changeset
176 if test "$libtool" = yes; then
68fbca173508 Added generated files for release
lost
parents:
diff changeset
177 "$@" "-Wp,-MDupdate,$tmpdepfile"
68fbca173508 Added generated files for release
lost
parents:
diff changeset
178 else
68fbca173508 Added generated files for release
lost
parents:
diff changeset
179 "$@" -MDupdate "$tmpdepfile"
68fbca173508 Added generated files for release
lost
parents:
diff changeset
180 fi
68fbca173508 Added generated files for release
lost
parents:
diff changeset
181 stat=$?
68fbca173508 Added generated files for release
lost
parents:
diff changeset
182 if test $stat -eq 0; then :
68fbca173508 Added generated files for release
lost
parents:
diff changeset
183 else
68fbca173508 Added generated files for release
lost
parents:
diff changeset
184 rm -f "$tmpdepfile"
68fbca173508 Added generated files for release
lost
parents:
diff changeset
185 exit $stat
68fbca173508 Added generated files for release
lost
parents:
diff changeset
186 fi
68fbca173508 Added generated files for release
lost
parents:
diff changeset
187 rm -f "$depfile"
68fbca173508 Added generated files for release
lost
parents:
diff changeset
188
68fbca173508 Added generated files for release
lost
parents:
diff changeset
189 if test -f "$tmpdepfile"; then # yes, the sourcefile depend on other files
68fbca173508 Added generated files for release
lost
parents:
diff changeset
190 echo "$object : \\" > "$depfile"
68fbca173508 Added generated files for release
lost
parents:
diff changeset
191
68fbca173508 Added generated files for release
lost
parents:
diff changeset
192 # Clip off the initial element (the dependent). Don't try to be
68fbca173508 Added generated files for release
lost
parents:
diff changeset
193 # clever and replace this with sed code, as IRIX sed won't handle
68fbca173508 Added generated files for release
lost
parents:
diff changeset
194 # lines with more than a fixed number of characters (4096 in
68fbca173508 Added generated files for release
lost
parents:
diff changeset
195 # IRIX 6.2 sed, 8192 in IRIX 6.5). We also remove comment lines;
68fbca173508 Added generated files for release
lost
parents:
diff changeset
196 # the IRIX cc adds comments like `#:fec' to the end of the
68fbca173508 Added generated files for release
lost
parents:
diff changeset
197 # dependency line.
68fbca173508 Added generated files for release
lost
parents:
diff changeset
198 tr ' ' '
68fbca173508 Added generated files for release
lost
parents:
diff changeset
199 ' < "$tmpdepfile" \
68fbca173508 Added generated files for release
lost
parents:
diff changeset
200 | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' | \
68fbca173508 Added generated files for release
lost
parents:
diff changeset
201 tr '
68fbca173508 Added generated files for release
lost
parents:
diff changeset
202 ' ' ' >> "$depfile"
68fbca173508 Added generated files for release
lost
parents:
diff changeset
203 echo >> "$depfile"
68fbca173508 Added generated files for release
lost
parents:
diff changeset
204
68fbca173508 Added generated files for release
lost
parents:
diff changeset
205 # The second pass generates a dummy entry for each header file.
68fbca173508 Added generated files for release
lost
parents:
diff changeset
206 tr ' ' '
68fbca173508 Added generated files for release
lost
parents:
diff changeset
207 ' < "$tmpdepfile" \
68fbca173508 Added generated files for release
lost
parents:
diff changeset
208 | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' -e 's/$/:/' \
68fbca173508 Added generated files for release
lost
parents:
diff changeset
209 >> "$depfile"
68fbca173508 Added generated files for release
lost
parents:
diff changeset
210 else
68fbca173508 Added generated files for release
lost
parents:
diff changeset
211 # The sourcefile does not contain any dependencies, so just
68fbca173508 Added generated files for release
lost
parents:
diff changeset
212 # store a dummy comment line, to avoid errors with the Makefile
68fbca173508 Added generated files for release
lost
parents:
diff changeset
213 # "include basename.Plo" scheme.
68fbca173508 Added generated files for release
lost
parents:
diff changeset
214 echo "#dummy" > "$depfile"
68fbca173508 Added generated files for release
lost
parents:
diff changeset
215 fi
68fbca173508 Added generated files for release
lost
parents:
diff changeset
216 rm -f "$tmpdepfile"
68fbca173508 Added generated files for release
lost
parents:
diff changeset
217 ;;
68fbca173508 Added generated files for release
lost
parents:
diff changeset
218
68fbca173508 Added generated files for release
lost
parents:
diff changeset
219 aix)
68fbca173508 Added generated files for release
lost
parents:
diff changeset
220 # The C for AIX Compiler uses -M and outputs the dependencies
68fbca173508 Added generated files for release
lost
parents:
diff changeset
221 # in a .u file. In older versions, this file always lives in the
68fbca173508 Added generated files for release
lost
parents:
diff changeset
222 # current directory. Also, the AIX compiler puts `$object:' at the
68fbca173508 Added generated files for release
lost
parents:
diff changeset
223 # start of each line; $object doesn't have directory information.
68fbca173508 Added generated files for release
lost
parents:
diff changeset
224 # Version 6 uses the directory in both cases.
68fbca173508 Added generated files for release
lost
parents:
diff changeset
225 dir=`echo "$object" | sed -e 's|/[^/]*$|/|'`
68fbca173508 Added generated files for release
lost
parents:
diff changeset
226 test "x$dir" = "x$object" && dir=
68fbca173508 Added generated files for release
lost
parents:
diff changeset
227 base=`echo "$object" | sed -e 's|^.*/||' -e 's/\.o$//' -e 's/\.lo$//'`
68fbca173508 Added generated files for release
lost
parents:
diff changeset
228 if test "$libtool" = yes; then
68fbca173508 Added generated files for release
lost
parents:
diff changeset
229 tmpdepfile1=$dir$base.u
68fbca173508 Added generated files for release
lost
parents:
diff changeset
230 tmpdepfile2=$base.u
68fbca173508 Added generated files for release
lost
parents:
diff changeset
231 tmpdepfile3=$dir.libs/$base.u
68fbca173508 Added generated files for release
lost
parents:
diff changeset
232 "$@" -Wc,-M
68fbca173508 Added generated files for release
lost
parents:
diff changeset
233 else
68fbca173508 Added generated files for release
lost
parents:
diff changeset
234 tmpdepfile1=$dir$base.u
68fbca173508 Added generated files for release
lost
parents:
diff changeset
235 tmpdepfile2=$dir$base.u
68fbca173508 Added generated files for release
lost
parents:
diff changeset
236 tmpdepfile3=$dir$base.u
68fbca173508 Added generated files for release
lost
parents:
diff changeset
237 "$@" -M
68fbca173508 Added generated files for release
lost
parents:
diff changeset
238 fi
68fbca173508 Added generated files for release
lost
parents:
diff changeset
239 stat=$?
68fbca173508 Added generated files for release
lost
parents:
diff changeset
240
68fbca173508 Added generated files for release
lost
parents:
diff changeset
241 if test $stat -eq 0; then :
68fbca173508 Added generated files for release
lost
parents:
diff changeset
242 else
68fbca173508 Added generated files for release
lost
parents:
diff changeset
243 rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3"
68fbca173508 Added generated files for release
lost
parents:
diff changeset
244 exit $stat
68fbca173508 Added generated files for release
lost
parents:
diff changeset
245 fi
68fbca173508 Added generated files for release
lost
parents:
diff changeset
246
68fbca173508 Added generated files for release
lost
parents:
diff changeset
247 for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3"
68fbca173508 Added generated files for release
lost
parents:
diff changeset
248 do
68fbca173508 Added generated files for release
lost
parents:
diff changeset
249 test -f "$tmpdepfile" && break
68fbca173508 Added generated files for release
lost
parents:
diff changeset
250 done
68fbca173508 Added generated files for release
lost
parents:
diff changeset
251 if test -f "$tmpdepfile"; then
68fbca173508 Added generated files for release
lost
parents:
diff changeset
252 # Each line is of the form `foo.o: dependent.h'.
68fbca173508 Added generated files for release
lost
parents:
diff changeset
253 # Do two passes, one to just change these to
68fbca173508 Added generated files for release
lost
parents:
diff changeset
254 # `$object: dependent.h' and one to simply `dependent.h:'.
68fbca173508 Added generated files for release
lost
parents:
diff changeset
255 sed -e "s,^.*\.[a-z]*:,$object:," < "$tmpdepfile" > "$depfile"
68fbca173508 Added generated files for release
lost
parents:
diff changeset
256 # That's a tab and a space in the [].
68fbca173508 Added generated files for release
lost
parents:
diff changeset
257 sed -e 's,^.*\.[a-z]*:[ ]*,,' -e 's,$,:,' < "$tmpdepfile" >> "$depfile"
68fbca173508 Added generated files for release
lost
parents:
diff changeset
258 else
68fbca173508 Added generated files for release
lost
parents:
diff changeset
259 # The sourcefile does not contain any dependencies, so just
68fbca173508 Added generated files for release
lost
parents:
diff changeset
260 # store a dummy comment line, to avoid errors with the Makefile
68fbca173508 Added generated files for release
lost
parents:
diff changeset
261 # "include basename.Plo" scheme.
68fbca173508 Added generated files for release
lost
parents:
diff changeset
262 echo "#dummy" > "$depfile"
68fbca173508 Added generated files for release
lost
parents:
diff changeset
263 fi
68fbca173508 Added generated files for release
lost
parents:
diff changeset
264 rm -f "$tmpdepfile"
68fbca173508 Added generated files for release
lost
parents:
diff changeset
265 ;;
68fbca173508 Added generated files for release
lost
parents:
diff changeset
266
68fbca173508 Added generated files for release
lost
parents:
diff changeset
267 icc)
68fbca173508 Added generated files for release
lost
parents:
diff changeset
268 # Intel's C compiler understands `-MD -MF file'. However on
68fbca173508 Added generated files for release
lost
parents:
diff changeset
269 # icc -MD -MF foo.d -c -o sub/foo.o sub/foo.c
68fbca173508 Added generated files for release
lost
parents:
diff changeset
270 # ICC 7.0 will fill foo.d with something like
68fbca173508 Added generated files for release
lost
parents:
diff changeset
271 # foo.o: sub/foo.c
68fbca173508 Added generated files for release
lost
parents:
diff changeset
272 # foo.o: sub/foo.h
68fbca173508 Added generated files for release
lost
parents:
diff changeset
273 # which is wrong. We want:
68fbca173508 Added generated files for release
lost
parents:
diff changeset
274 # sub/foo.o: sub/foo.c
68fbca173508 Added generated files for release
lost
parents:
diff changeset
275 # sub/foo.o: sub/foo.h
68fbca173508 Added generated files for release
lost
parents:
diff changeset
276 # sub/foo.c:
68fbca173508 Added generated files for release
lost
parents:
diff changeset
277 # sub/foo.h:
68fbca173508 Added generated files for release
lost
parents:
diff changeset
278 # ICC 7.1 will output
68fbca173508 Added generated files for release
lost
parents:
diff changeset
279 # foo.o: sub/foo.c sub/foo.h
68fbca173508 Added generated files for release
lost
parents:
diff changeset
280 # and will wrap long lines using \ :
68fbca173508 Added generated files for release
lost
parents:
diff changeset
281 # foo.o: sub/foo.c ... \
68fbca173508 Added generated files for release
lost
parents:
diff changeset
282 # sub/foo.h ... \
68fbca173508 Added generated files for release
lost
parents:
diff changeset
283 # ...
68fbca173508 Added generated files for release
lost
parents:
diff changeset
284
68fbca173508 Added generated files for release
lost
parents:
diff changeset
285 "$@" -MD -MF "$tmpdepfile"
68fbca173508 Added generated files for release
lost
parents:
diff changeset
286 stat=$?
68fbca173508 Added generated files for release
lost
parents:
diff changeset
287 if test $stat -eq 0; then :
68fbca173508 Added generated files for release
lost
parents:
diff changeset
288 else
68fbca173508 Added generated files for release
lost
parents:
diff changeset
289 rm -f "$tmpdepfile"
68fbca173508 Added generated files for release
lost
parents:
diff changeset
290 exit $stat
68fbca173508 Added generated files for release
lost
parents:
diff changeset
291 fi
68fbca173508 Added generated files for release
lost
parents:
diff changeset
292 rm -f "$depfile"
68fbca173508 Added generated files for release
lost
parents:
diff changeset
293 # Each line is of the form `foo.o: dependent.h',
68fbca173508 Added generated files for release
lost
parents:
diff changeset
294 # or `foo.o: dep1.h dep2.h \', or ` dep3.h dep4.h \'.
68fbca173508 Added generated files for release
lost
parents:
diff changeset
295 # Do two passes, one to just change these to
68fbca173508 Added generated files for release
lost
parents:
diff changeset
296 # `$object: dependent.h' and one to simply `dependent.h:'.
68fbca173508 Added generated files for release
lost
parents:
diff changeset
297 sed "s,^[^:]*:,$object :," < "$tmpdepfile" > "$depfile"
68fbca173508 Added generated files for release
lost
parents:
diff changeset
298 # Some versions of the HPUX 10.20 sed can't process this invocation
68fbca173508 Added generated files for release
lost
parents:
diff changeset
299 # correctly. Breaking it into two sed invocations is a workaround.
68fbca173508 Added generated files for release
lost
parents:
diff changeset
300 sed 's,^[^:]*: \(.*\)$,\1,;s/^\\$//;/^$/d;/:$/d' < "$tmpdepfile" |
68fbca173508 Added generated files for release
lost
parents:
diff changeset
301 sed -e 's/$/ :/' >> "$depfile"
68fbca173508 Added generated files for release
lost
parents:
diff changeset
302 rm -f "$tmpdepfile"
68fbca173508 Added generated files for release
lost
parents:
diff changeset
303 ;;
68fbca173508 Added generated files for release
lost
parents:
diff changeset
304
68fbca173508 Added generated files for release
lost
parents:
diff changeset
305 hp2)
68fbca173508 Added generated files for release
lost
parents:
diff changeset
306 # The "hp" stanza above does not work with aCC (C++) and HP's ia64
68fbca173508 Added generated files for release
lost
parents:
diff changeset
307 # compilers, which have integrated preprocessors. The correct option
68fbca173508 Added generated files for release
lost
parents:
diff changeset
308 # to use with these is +Maked; it writes dependencies to a file named
68fbca173508 Added generated files for release
lost
parents:
diff changeset
309 # 'foo.d', which lands next to the object file, wherever that
68fbca173508 Added generated files for release
lost
parents:
diff changeset
310 # happens to be.
68fbca173508 Added generated files for release
lost
parents:
diff changeset
311 # Much of this is similar to the tru64 case; see comments there.
68fbca173508 Added generated files for release
lost
parents:
diff changeset
312 dir=`echo "$object" | sed -e 's|/[^/]*$|/|'`
68fbca173508 Added generated files for release
lost
parents:
diff changeset
313 test "x$dir" = "x$object" && dir=
68fbca173508 Added generated files for release
lost
parents:
diff changeset
314 base=`echo "$object" | sed -e 's|^.*/||' -e 's/\.o$//' -e 's/\.lo$//'`
68fbca173508 Added generated files for release
lost
parents:
diff changeset
315 if test "$libtool" = yes; then
68fbca173508 Added generated files for release
lost
parents:
diff changeset
316 tmpdepfile1=$dir$base.d
68fbca173508 Added generated files for release
lost
parents:
diff changeset
317 tmpdepfile2=$dir.libs/$base.d
68fbca173508 Added generated files for release
lost
parents:
diff changeset
318 "$@" -Wc,+Maked
68fbca173508 Added generated files for release
lost
parents:
diff changeset
319 else
68fbca173508 Added generated files for release
lost
parents:
diff changeset
320 tmpdepfile1=$dir$base.d
68fbca173508 Added generated files for release
lost
parents:
diff changeset
321 tmpdepfile2=$dir$base.d
68fbca173508 Added generated files for release
lost
parents:
diff changeset
322 "$@" +Maked
68fbca173508 Added generated files for release
lost
parents:
diff changeset
323 fi
68fbca173508 Added generated files for release
lost
parents:
diff changeset
324 stat=$?
68fbca173508 Added generated files for release
lost
parents:
diff changeset
325 if test $stat -eq 0; then :
68fbca173508 Added generated files for release
lost
parents:
diff changeset
326 else
68fbca173508 Added generated files for release
lost
parents:
diff changeset
327 rm -f "$tmpdepfile1" "$tmpdepfile2"
68fbca173508 Added generated files for release
lost
parents:
diff changeset
328 exit $stat
68fbca173508 Added generated files for release
lost
parents:
diff changeset
329 fi
68fbca173508 Added generated files for release
lost
parents:
diff changeset
330
68fbca173508 Added generated files for release
lost
parents:
diff changeset
331 for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2"
68fbca173508 Added generated files for release
lost
parents:
diff changeset
332 do
68fbca173508 Added generated files for release
lost
parents:
diff changeset
333 test -f "$tmpdepfile" && break
68fbca173508 Added generated files for release
lost
parents:
diff changeset
334 done
68fbca173508 Added generated files for release
lost
parents:
diff changeset
335 if test -f "$tmpdepfile"; then
68fbca173508 Added generated files for release
lost
parents:
diff changeset
336 sed -e "s,^.*\.[a-z]*:,$object:," "$tmpdepfile" > "$depfile"
68fbca173508 Added generated files for release
lost
parents:
diff changeset
337 # Add `dependent.h:' lines.
68fbca173508 Added generated files for release
lost
parents:
diff changeset
338 sed -ne '2,${
68fbca173508 Added generated files for release
lost
parents:
diff changeset
339 s/^ *//
68fbca173508 Added generated files for release
lost
parents:
diff changeset
340 s/ \\*$//
68fbca173508 Added generated files for release
lost
parents:
diff changeset
341 s/$/:/
68fbca173508 Added generated files for release
lost
parents:
diff changeset
342 p
68fbca173508 Added generated files for release
lost
parents:
diff changeset
343 }' "$tmpdepfile" >> "$depfile"
68fbca173508 Added generated files for release
lost
parents:
diff changeset
344 else
68fbca173508 Added generated files for release
lost
parents:
diff changeset
345 echo "#dummy" > "$depfile"
68fbca173508 Added generated files for release
lost
parents:
diff changeset
346 fi
68fbca173508 Added generated files for release
lost
parents:
diff changeset
347 rm -f "$tmpdepfile" "$tmpdepfile2"
68fbca173508 Added generated files for release
lost
parents:
diff changeset
348 ;;
68fbca173508 Added generated files for release
lost
parents:
diff changeset
349
68fbca173508 Added generated files for release
lost
parents:
diff changeset
350 tru64)
68fbca173508 Added generated files for release
lost
parents:
diff changeset
351 # The Tru64 compiler uses -MD to generate dependencies as a side
68fbca173508 Added generated files for release
lost
parents:
diff changeset
352 # effect. `cc -MD -o foo.o ...' puts the dependencies into `foo.o.d'.
68fbca173508 Added generated files for release
lost
parents:
diff changeset
353 # At least on Alpha/Redhat 6.1, Compaq CCC V6.2-504 seems to put
68fbca173508 Added generated files for release
lost
parents:
diff changeset
354 # dependencies in `foo.d' instead, so we check for that too.
68fbca173508 Added generated files for release
lost
parents:
diff changeset
355 # Subdirectories are respected.
68fbca173508 Added generated files for release
lost
parents:
diff changeset
356 dir=`echo "$object" | sed -e 's|/[^/]*$|/|'`
68fbca173508 Added generated files for release
lost
parents:
diff changeset
357 test "x$dir" = "x$object" && dir=
68fbca173508 Added generated files for release
lost
parents:
diff changeset
358 base=`echo "$object" | sed -e 's|^.*/||' -e 's/\.o$//' -e 's/\.lo$//'`
68fbca173508 Added generated files for release
lost
parents:
diff changeset
359
68fbca173508 Added generated files for release
lost
parents:
diff changeset
360 if test "$libtool" = yes; then
68fbca173508 Added generated files for release
lost
parents:
diff changeset
361 # With Tru64 cc, shared objects can also be used to make a
68fbca173508 Added generated files for release
lost
parents:
diff changeset
362 # static library. This mechanism is used in libtool 1.4 series to
68fbca173508 Added generated files for release
lost
parents:
diff changeset
363 # handle both shared and static libraries in a single compilation.
68fbca173508 Added generated files for release
lost
parents:
diff changeset
364 # With libtool 1.4, dependencies were output in $dir.libs/$base.lo.d.
68fbca173508 Added generated files for release
lost
parents:
diff changeset
365 #
68fbca173508 Added generated files for release
lost
parents:
diff changeset
366 # With libtool 1.5 this exception was removed, and libtool now
68fbca173508 Added generated files for release
lost
parents:
diff changeset
367 # generates 2 separate objects for the 2 libraries. These two
68fbca173508 Added generated files for release
lost
parents:
diff changeset
368 # compilations output dependencies in $dir.libs/$base.o.d and
68fbca173508 Added generated files for release
lost
parents:
diff changeset
369 # in $dir$base.o.d. We have to check for both files, because
68fbca173508 Added generated files for release
lost
parents:
diff changeset
370 # one of the two compilations can be disabled. We should prefer
68fbca173508 Added generated files for release
lost
parents:
diff changeset
371 # $dir$base.o.d over $dir.libs/$base.o.d because the latter is
68fbca173508 Added generated files for release
lost
parents:
diff changeset
372 # automatically cleaned when .libs/ is deleted, while ignoring
68fbca173508 Added generated files for release
lost
parents:
diff changeset
373 # the former would cause a distcleancheck panic.
68fbca173508 Added generated files for release
lost
parents:
diff changeset
374 tmpdepfile1=$dir.libs/$base.lo.d # libtool 1.4
68fbca173508 Added generated files for release
lost
parents:
diff changeset
375 tmpdepfile2=$dir$base.o.d # libtool 1.5
68fbca173508 Added generated files for release
lost
parents:
diff changeset
376 tmpdepfile3=$dir.libs/$base.o.d # libtool 1.5
68fbca173508 Added generated files for release
lost
parents:
diff changeset
377 tmpdepfile4=$dir.libs/$base.d # Compaq CCC V6.2-504
68fbca173508 Added generated files for release
lost
parents:
diff changeset
378 "$@" -Wc,-MD
68fbca173508 Added generated files for release
lost
parents:
diff changeset
379 else
68fbca173508 Added generated files for release
lost
parents:
diff changeset
380 tmpdepfile1=$dir$base.o.d
68fbca173508 Added generated files for release
lost
parents:
diff changeset
381 tmpdepfile2=$dir$base.d
68fbca173508 Added generated files for release
lost
parents:
diff changeset
382 tmpdepfile3=$dir$base.d
68fbca173508 Added generated files for release
lost
parents:
diff changeset
383 tmpdepfile4=$dir$base.d
68fbca173508 Added generated files for release
lost
parents:
diff changeset
384 "$@" -MD
68fbca173508 Added generated files for release
lost
parents:
diff changeset
385 fi
68fbca173508 Added generated files for release
lost
parents:
diff changeset
386
68fbca173508 Added generated files for release
lost
parents:
diff changeset
387 stat=$?
68fbca173508 Added generated files for release
lost
parents:
diff changeset
388 if test $stat -eq 0; then :
68fbca173508 Added generated files for release
lost
parents:
diff changeset
389 else
68fbca173508 Added generated files for release
lost
parents:
diff changeset
390 rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" "$tmpdepfile4"
68fbca173508 Added generated files for release
lost
parents:
diff changeset
391 exit $stat
68fbca173508 Added generated files for release
lost
parents:
diff changeset
392 fi
68fbca173508 Added generated files for release
lost
parents:
diff changeset
393
68fbca173508 Added generated files for release
lost
parents:
diff changeset
394 for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" "$tmpdepfile4"
68fbca173508 Added generated files for release
lost
parents:
diff changeset
395 do
68fbca173508 Added generated files for release
lost
parents:
diff changeset
396 test -f "$tmpdepfile" && break
68fbca173508 Added generated files for release
lost
parents:
diff changeset
397 done
68fbca173508 Added generated files for release
lost
parents:
diff changeset
398 if test -f "$tmpdepfile"; then
68fbca173508 Added generated files for release
lost
parents:
diff changeset
399 sed -e "s,^.*\.[a-z]*:,$object:," < "$tmpdepfile" > "$depfile"
68fbca173508 Added generated files for release
lost
parents:
diff changeset
400 # That's a tab and a space in the [].
68fbca173508 Added generated files for release
lost
parents:
diff changeset
401 sed -e 's,^.*\.[a-z]*:[ ]*,,' -e 's,$,:,' < "$tmpdepfile" >> "$depfile"
68fbca173508 Added generated files for release
lost
parents:
diff changeset
402 else
68fbca173508 Added generated files for release
lost
parents:
diff changeset
403 echo "#dummy" > "$depfile"
68fbca173508 Added generated files for release
lost
parents:
diff changeset
404 fi
68fbca173508 Added generated files for release
lost
parents:
diff changeset
405 rm -f "$tmpdepfile"
68fbca173508 Added generated files for release
lost
parents:
diff changeset
406 ;;
68fbca173508 Added generated files for release
lost
parents:
diff changeset
407
68fbca173508 Added generated files for release
lost
parents:
diff changeset
408 #nosideeffect)
68fbca173508 Added generated files for release
lost
parents:
diff changeset
409 # This comment above is used by automake to tell side-effect
68fbca173508 Added generated files for release
lost
parents:
diff changeset
410 # dependency tracking mechanisms from slower ones.
68fbca173508 Added generated files for release
lost
parents:
diff changeset
411
68fbca173508 Added generated files for release
lost
parents:
diff changeset
412 dashmstdout)
68fbca173508 Added generated files for release
lost
parents:
diff changeset
413 # Important note: in order to support this mode, a compiler *must*
68fbca173508 Added generated files for release
lost
parents:
diff changeset
414 # always write the preprocessed file to stdout, regardless of -o.
68fbca173508 Added generated files for release
lost
parents:
diff changeset
415 "$@" || exit $?
68fbca173508 Added generated files for release
lost
parents:
diff changeset
416
68fbca173508 Added generated files for release
lost
parents:
diff changeset
417 # Remove the call to Libtool.
68fbca173508 Added generated files for release
lost
parents:
diff changeset
418 if test "$libtool" = yes; then
68fbca173508 Added generated files for release
lost
parents:
diff changeset
419 while test "X$1" != 'X--mode=compile'; do
68fbca173508 Added generated files for release
lost
parents:
diff changeset
420 shift
68fbca173508 Added generated files for release
lost
parents:
diff changeset
421 done
68fbca173508 Added generated files for release
lost
parents:
diff changeset
422 shift
68fbca173508 Added generated files for release
lost
parents:
diff changeset
423 fi
68fbca173508 Added generated files for release
lost
parents:
diff changeset
424
68fbca173508 Added generated files for release
lost
parents:
diff changeset
425 # Remove `-o $object'.
68fbca173508 Added generated files for release
lost
parents:
diff changeset
426 IFS=" "
68fbca173508 Added generated files for release
lost
parents:
diff changeset
427 for arg
68fbca173508 Added generated files for release
lost
parents:
diff changeset
428 do
68fbca173508 Added generated files for release
lost
parents:
diff changeset
429 case $arg in
68fbca173508 Added generated files for release
lost
parents:
diff changeset
430 -o)
68fbca173508 Added generated files for release
lost
parents:
diff changeset
431 shift
68fbca173508 Added generated files for release
lost
parents:
diff changeset
432 ;;
68fbca173508 Added generated files for release
lost
parents:
diff changeset
433 $object)
68fbca173508 Added generated files for release
lost
parents:
diff changeset
434 shift
68fbca173508 Added generated files for release
lost
parents:
diff changeset
435 ;;
68fbca173508 Added generated files for release
lost
parents:
diff changeset
436 *)
68fbca173508 Added generated files for release
lost
parents:
diff changeset
437 set fnord "$@" "$arg"
68fbca173508 Added generated files for release
lost
parents:
diff changeset
438 shift # fnord
68fbca173508 Added generated files for release
lost
parents:
diff changeset
439 shift # $arg
68fbca173508 Added generated files for release
lost
parents:
diff changeset
440 ;;
68fbca173508 Added generated files for release
lost
parents:
diff changeset
441 esac
68fbca173508 Added generated files for release
lost
parents:
diff changeset
442 done
68fbca173508 Added generated files for release
lost
parents:
diff changeset
443
68fbca173508 Added generated files for release
lost
parents:
diff changeset
444 test -z "$dashmflag" && dashmflag=-M
68fbca173508 Added generated files for release
lost
parents:
diff changeset
445 # Require at least two characters before searching for `:'
68fbca173508 Added generated files for release
lost
parents:
diff changeset
446 # in the target name. This is to cope with DOS-style filenames:
68fbca173508 Added generated files for release
lost
parents:
diff changeset
447 # a dependency such as `c:/foo/bar' could be seen as target `c' otherwise.
68fbca173508 Added generated files for release
lost
parents:
diff changeset
448 "$@" $dashmflag |
68fbca173508 Added generated files for release
lost
parents:
diff changeset
449 sed 's:^[ ]*[^: ][^:][^:]*\:[ ]*:'"$object"'\: :' > "$tmpdepfile"
68fbca173508 Added generated files for release
lost
parents:
diff changeset
450 rm -f "$depfile"
68fbca173508 Added generated files for release
lost
parents:
diff changeset
451 cat < "$tmpdepfile" > "$depfile"
68fbca173508 Added generated files for release
lost
parents:
diff changeset
452 tr ' ' '
68fbca173508 Added generated files for release
lost
parents:
diff changeset
453 ' < "$tmpdepfile" | \
68fbca173508 Added generated files for release
lost
parents:
diff changeset
454 ## Some versions of the HPUX 10.20 sed can't process this invocation
68fbca173508 Added generated files for release
lost
parents:
diff changeset
455 ## correctly. Breaking it into two sed invocations is a workaround.
68fbca173508 Added generated files for release
lost
parents:
diff changeset
456 sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile"
68fbca173508 Added generated files for release
lost
parents:
diff changeset
457 rm -f "$tmpdepfile"
68fbca173508 Added generated files for release
lost
parents:
diff changeset
458 ;;
68fbca173508 Added generated files for release
lost
parents:
diff changeset
459
68fbca173508 Added generated files for release
lost
parents:
diff changeset
460 dashXmstdout)
68fbca173508 Added generated files for release
lost
parents:
diff changeset
461 # This case only exists to satisfy depend.m4. It is never actually
68fbca173508 Added generated files for release
lost
parents:
diff changeset
462 # run, as this mode is specially recognized in the preamble.
68fbca173508 Added generated files for release
lost
parents:
diff changeset
463 exit 1
68fbca173508 Added generated files for release
lost
parents:
diff changeset
464 ;;
68fbca173508 Added generated files for release
lost
parents:
diff changeset
465
68fbca173508 Added generated files for release
lost
parents:
diff changeset
466 makedepend)
68fbca173508 Added generated files for release
lost
parents:
diff changeset
467 "$@" || exit $?
68fbca173508 Added generated files for release
lost
parents:
diff changeset
468 # Remove any Libtool call
68fbca173508 Added generated files for release
lost
parents:
diff changeset
469 if test "$libtool" = yes; then
68fbca173508 Added generated files for release
lost
parents:
diff changeset
470 while test "X$1" != 'X--mode=compile'; do
68fbca173508 Added generated files for release
lost
parents:
diff changeset
471 shift
68fbca173508 Added generated files for release
lost
parents:
diff changeset
472 done
68fbca173508 Added generated files for release
lost
parents:
diff changeset
473 shift
68fbca173508 Added generated files for release
lost
parents:
diff changeset
474 fi
68fbca173508 Added generated files for release
lost
parents:
diff changeset
475 # X makedepend
68fbca173508 Added generated files for release
lost
parents:
diff changeset
476 shift
68fbca173508 Added generated files for release
lost
parents:
diff changeset
477 cleared=no eat=no
68fbca173508 Added generated files for release
lost
parents:
diff changeset
478 for arg
68fbca173508 Added generated files for release
lost
parents:
diff changeset
479 do
68fbca173508 Added generated files for release
lost
parents:
diff changeset
480 case $cleared in
68fbca173508 Added generated files for release
lost
parents:
diff changeset
481 no)
68fbca173508 Added generated files for release
lost
parents:
diff changeset
482 set ""; shift
68fbca173508 Added generated files for release
lost
parents:
diff changeset
483 cleared=yes ;;
68fbca173508 Added generated files for release
lost
parents:
diff changeset
484 esac
68fbca173508 Added generated files for release
lost
parents:
diff changeset
485 if test $eat = yes; then
68fbca173508 Added generated files for release
lost
parents:
diff changeset
486 eat=no
68fbca173508 Added generated files for release
lost
parents:
diff changeset
487 continue
68fbca173508 Added generated files for release
lost
parents:
diff changeset
488 fi
68fbca173508 Added generated files for release
lost
parents:
diff changeset
489 case "$arg" in
68fbca173508 Added generated files for release
lost
parents:
diff changeset
490 -D*|-I*)
68fbca173508 Added generated files for release
lost
parents:
diff changeset
491 set fnord "$@" "$arg"; shift ;;
68fbca173508 Added generated files for release
lost
parents:
diff changeset
492 # Strip any option that makedepend may not understand. Remove
68fbca173508 Added generated files for release
lost
parents:
diff changeset
493 # the object too, otherwise makedepend will parse it as a source file.
68fbca173508 Added generated files for release
lost
parents:
diff changeset
494 -arch)
68fbca173508 Added generated files for release
lost
parents:
diff changeset
495 eat=yes ;;
68fbca173508 Added generated files for release
lost
parents:
diff changeset
496 -*|$object)
68fbca173508 Added generated files for release
lost
parents:
diff changeset
497 ;;
68fbca173508 Added generated files for release
lost
parents:
diff changeset
498 *)
68fbca173508 Added generated files for release
lost
parents:
diff changeset
499 set fnord "$@" "$arg"; shift ;;
68fbca173508 Added generated files for release
lost
parents:
diff changeset
500 esac
68fbca173508 Added generated files for release
lost
parents:
diff changeset
501 done
68fbca173508 Added generated files for release
lost
parents:
diff changeset
502 obj_suffix=`echo "$object" | sed 's/^.*\././'`
68fbca173508 Added generated files for release
lost
parents:
diff changeset
503 touch "$tmpdepfile"
68fbca173508 Added generated files for release
lost
parents:
diff changeset
504 ${MAKEDEPEND-makedepend} -o"$obj_suffix" -f"$tmpdepfile" "$@"
68fbca173508 Added generated files for release
lost
parents:
diff changeset
505 rm -f "$depfile"
68fbca173508 Added generated files for release
lost
parents:
diff changeset
506 cat < "$tmpdepfile" > "$depfile"
68fbca173508 Added generated files for release
lost
parents:
diff changeset
507 sed '1,2d' "$tmpdepfile" | tr ' ' '
68fbca173508 Added generated files for release
lost
parents:
diff changeset
508 ' | \
68fbca173508 Added generated files for release
lost
parents:
diff changeset
509 ## Some versions of the HPUX 10.20 sed can't process this invocation
68fbca173508 Added generated files for release
lost
parents:
diff changeset
510 ## correctly. Breaking it into two sed invocations is a workaround.
68fbca173508 Added generated files for release
lost
parents:
diff changeset
511 sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile"
68fbca173508 Added generated files for release
lost
parents:
diff changeset
512 rm -f "$tmpdepfile" "$tmpdepfile".bak
68fbca173508 Added generated files for release
lost
parents:
diff changeset
513 ;;
68fbca173508 Added generated files for release
lost
parents:
diff changeset
514
68fbca173508 Added generated files for release
lost
parents:
diff changeset
515 cpp)
68fbca173508 Added generated files for release
lost
parents:
diff changeset
516 # Important note: in order to support this mode, a compiler *must*
68fbca173508 Added generated files for release
lost
parents:
diff changeset
517 # always write the preprocessed file to stdout.
68fbca173508 Added generated files for release
lost
parents:
diff changeset
518 "$@" || exit $?
68fbca173508 Added generated files for release
lost
parents:
diff changeset
519
68fbca173508 Added generated files for release
lost
parents:
diff changeset
520 # Remove the call to Libtool.
68fbca173508 Added generated files for release
lost
parents:
diff changeset
521 if test "$libtool" = yes; then
68fbca173508 Added generated files for release
lost
parents:
diff changeset
522 while test "X$1" != 'X--mode=compile'; do
68fbca173508 Added generated files for release
lost
parents:
diff changeset
523 shift
68fbca173508 Added generated files for release
lost
parents:
diff changeset
524 done
68fbca173508 Added generated files for release
lost
parents:
diff changeset
525 shift
68fbca173508 Added generated files for release
lost
parents:
diff changeset
526 fi
68fbca173508 Added generated files for release
lost
parents:
diff changeset
527
68fbca173508 Added generated files for release
lost
parents:
diff changeset
528 # Remove `-o $object'.
68fbca173508 Added generated files for release
lost
parents:
diff changeset
529 IFS=" "
68fbca173508 Added generated files for release
lost
parents:
diff changeset
530 for arg
68fbca173508 Added generated files for release
lost
parents:
diff changeset
531 do
68fbca173508 Added generated files for release
lost
parents:
diff changeset
532 case $arg in
68fbca173508 Added generated files for release
lost
parents:
diff changeset
533 -o)
68fbca173508 Added generated files for release
lost
parents:
diff changeset
534 shift
68fbca173508 Added generated files for release
lost
parents:
diff changeset
535 ;;
68fbca173508 Added generated files for release
lost
parents:
diff changeset
536 $object)
68fbca173508 Added generated files for release
lost
parents:
diff changeset
537 shift
68fbca173508 Added generated files for release
lost
parents:
diff changeset
538 ;;
68fbca173508 Added generated files for release
lost
parents:
diff changeset
539 *)
68fbca173508 Added generated files for release
lost
parents:
diff changeset
540 set fnord "$@" "$arg"
68fbca173508 Added generated files for release
lost
parents:
diff changeset
541 shift # fnord
68fbca173508 Added generated files for release
lost
parents:
diff changeset
542 shift # $arg
68fbca173508 Added generated files for release
lost
parents:
diff changeset
543 ;;
68fbca173508 Added generated files for release
lost
parents:
diff changeset
544 esac
68fbca173508 Added generated files for release
lost
parents:
diff changeset
545 done
68fbca173508 Added generated files for release
lost
parents:
diff changeset
546
68fbca173508 Added generated files for release
lost
parents:
diff changeset
547 "$@" -E |
68fbca173508 Added generated files for release
lost
parents:
diff changeset
548 sed -n -e '/^# [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' \
68fbca173508 Added generated files for release
lost
parents:
diff changeset
549 -e '/^#line [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' |
68fbca173508 Added generated files for release
lost
parents:
diff changeset
550 sed '$ s: \\$::' > "$tmpdepfile"
68fbca173508 Added generated files for release
lost
parents:
diff changeset
551 rm -f "$depfile"
68fbca173508 Added generated files for release
lost
parents:
diff changeset
552 echo "$object : \\" > "$depfile"
68fbca173508 Added generated files for release
lost
parents:
diff changeset
553 cat < "$tmpdepfile" >> "$depfile"
68fbca173508 Added generated files for release
lost
parents:
diff changeset
554 sed < "$tmpdepfile" '/^$/d;s/^ //;s/ \\$//;s/$/ :/' >> "$depfile"
68fbca173508 Added generated files for release
lost
parents:
diff changeset
555 rm -f "$tmpdepfile"
68fbca173508 Added generated files for release
lost
parents:
diff changeset
556 ;;
68fbca173508 Added generated files for release
lost
parents:
diff changeset
557
68fbca173508 Added generated files for release
lost
parents:
diff changeset
558 msvisualcpp)
68fbca173508 Added generated files for release
lost
parents:
diff changeset
559 # Important note: in order to support this mode, a compiler *must*
68fbca173508 Added generated files for release
lost
parents:
diff changeset
560 # always write the preprocessed file to stdout.
68fbca173508 Added generated files for release
lost
parents:
diff changeset
561 "$@" || exit $?
68fbca173508 Added generated files for release
lost
parents:
diff changeset
562
68fbca173508 Added generated files for release
lost
parents:
diff changeset
563 # Remove the call to Libtool.
68fbca173508 Added generated files for release
lost
parents:
diff changeset
564 if test "$libtool" = yes; then
68fbca173508 Added generated files for release
lost
parents:
diff changeset
565 while test "X$1" != 'X--mode=compile'; do
68fbca173508 Added generated files for release
lost
parents:
diff changeset
566 shift
68fbca173508 Added generated files for release
lost
parents:
diff changeset
567 done
68fbca173508 Added generated files for release
lost
parents:
diff changeset
568 shift
68fbca173508 Added generated files for release
lost
parents:
diff changeset
569 fi
68fbca173508 Added generated files for release
lost
parents:
diff changeset
570
68fbca173508 Added generated files for release
lost
parents:
diff changeset
571 IFS=" "
68fbca173508 Added generated files for release
lost
parents:
diff changeset
572 for arg
68fbca173508 Added generated files for release
lost
parents:
diff changeset
573 do
68fbca173508 Added generated files for release
lost
parents:
diff changeset
574 case "$arg" in
68fbca173508 Added generated files for release
lost
parents:
diff changeset
575 -o)
68fbca173508 Added generated files for release
lost
parents:
diff changeset
576 shift
68fbca173508 Added generated files for release
lost
parents:
diff changeset
577 ;;
68fbca173508 Added generated files for release
lost
parents:
diff changeset
578 $object)
68fbca173508 Added generated files for release
lost
parents:
diff changeset
579 shift
68fbca173508 Added generated files for release
lost
parents:
diff changeset
580 ;;
68fbca173508 Added generated files for release
lost
parents:
diff changeset
581 "-Gm"|"/Gm"|"-Gi"|"/Gi"|"-ZI"|"/ZI")
68fbca173508 Added generated files for release
lost
parents:
diff changeset
582 set fnord "$@"
68fbca173508 Added generated files for release
lost
parents:
diff changeset
583 shift
68fbca173508 Added generated files for release
lost
parents:
diff changeset
584 shift
68fbca173508 Added generated files for release
lost
parents:
diff changeset
585 ;;
68fbca173508 Added generated files for release
lost
parents:
diff changeset
586 *)
68fbca173508 Added generated files for release
lost
parents:
diff changeset
587 set fnord "$@" "$arg"
68fbca173508 Added generated files for release
lost
parents:
diff changeset
588 shift
68fbca173508 Added generated files for release
lost
parents:
diff changeset
589 shift
68fbca173508 Added generated files for release
lost
parents:
diff changeset
590 ;;
68fbca173508 Added generated files for release
lost
parents:
diff changeset
591 esac
68fbca173508 Added generated files for release
lost
parents:
diff changeset
592 done
68fbca173508 Added generated files for release
lost
parents:
diff changeset
593 "$@" -E 2>/dev/null |
68fbca173508 Added generated files for release
lost
parents:
diff changeset
594 sed -n '/^#line [0-9][0-9]* "\([^"]*\)"/ s::\1:p' | $cygpath_u | sort -u > "$tmpdepfile"
68fbca173508 Added generated files for release
lost
parents:
diff changeset
595 rm -f "$depfile"
68fbca173508 Added generated files for release
lost
parents:
diff changeset
596 echo "$object : \\" > "$depfile"
68fbca173508 Added generated files for release
lost
parents:
diff changeset
597 sed < "$tmpdepfile" -n -e 's% %\\ %g' -e '/^\(.*\)$/ s:: \1 \\:p' >> "$depfile"
68fbca173508 Added generated files for release
lost
parents:
diff changeset
598 echo " " >> "$depfile"
68fbca173508 Added generated files for release
lost
parents:
diff changeset
599 sed < "$tmpdepfile" -n -e 's% %\\ %g' -e '/^\(.*\)$/ s::\1\::p' >> "$depfile"
68fbca173508 Added generated files for release
lost
parents:
diff changeset
600 rm -f "$tmpdepfile"
68fbca173508 Added generated files for release
lost
parents:
diff changeset
601 ;;
68fbca173508 Added generated files for release
lost
parents:
diff changeset
602
68fbca173508 Added generated files for release
lost
parents:
diff changeset
603 msvcmsys)
68fbca173508 Added generated files for release
lost
parents:
diff changeset
604 # This case exists only to let depend.m4 do its work. It works by
68fbca173508 Added generated files for release
lost
parents:
diff changeset
605 # looking at the text of this script. This case will never be run,
68fbca173508 Added generated files for release
lost
parents:
diff changeset
606 # since it is checked for above.
68fbca173508 Added generated files for release
lost
parents:
diff changeset
607 exit 1
68fbca173508 Added generated files for release
lost
parents:
diff changeset
608 ;;
68fbca173508 Added generated files for release
lost
parents:
diff changeset
609
68fbca173508 Added generated files for release
lost
parents:
diff changeset
610 none)
68fbca173508 Added generated files for release
lost
parents:
diff changeset
611 exec "$@"
68fbca173508 Added generated files for release
lost
parents:
diff changeset
612 ;;
68fbca173508 Added generated files for release
lost
parents:
diff changeset
613
68fbca173508 Added generated files for release
lost
parents:
diff changeset
614 *)
68fbca173508 Added generated files for release
lost
parents:
diff changeset
615 echo "Unknown depmode $depmode" 1>&2
68fbca173508 Added generated files for release
lost
parents:
diff changeset
616 exit 1
68fbca173508 Added generated files for release
lost
parents:
diff changeset
617 ;;
68fbca173508 Added generated files for release
lost
parents:
diff changeset
618 esac
68fbca173508 Added generated files for release
lost
parents:
diff changeset
619
68fbca173508 Added generated files for release
lost
parents:
diff changeset
620 exit 0
68fbca173508 Added generated files for release
lost
parents:
diff changeset
621
68fbca173508 Added generated files for release
lost
parents:
diff changeset
622 # Local Variables:
68fbca173508 Added generated files for release
lost
parents:
diff changeset
623 # mode: shell-script
68fbca173508 Added generated files for release
lost
parents:
diff changeset
624 # sh-indentation: 2
68fbca173508 Added generated files for release
lost
parents:
diff changeset
625 # eval: (add-hook 'write-file-hooks 'time-stamp)
68fbca173508 Added generated files for release
lost
parents:
diff changeset
626 # time-stamp-start: "scriptversion="
68fbca173508 Added generated files for release
lost
parents:
diff changeset
627 # time-stamp-format: "%:y-%02m-%02d.%02H"
68fbca173508 Added generated files for release
lost
parents:
diff changeset
628 # time-stamp-time-zone: "UTC"
68fbca173508 Added generated files for release
lost
parents:
diff changeset
629 # time-stamp-end: "; # UTC"
68fbca173508 Added generated files for release
lost
parents:
diff changeset
630 # End: