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