annotate depcomp @ 424:6d87423a979b 3.0-beta2

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