annotate depcomp @ 154:fbc6ea067364 2.1

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