annotate lib/swig/swigwin-2.0.11/Tools/config/depcomp @ 1899:b3009adc0e2f

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