swfmill 0.0.1

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