annotate depcomp @ 448:5cccf90bf838 3.0 tip

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