rice-jdguyot 1.4.0.p1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (203) hide show
  1. data/COPYING +23 -0
  2. data/Doxyfile +1253 -0
  3. data/Makefile.am +26 -0
  4. data/Makefile.in +743 -0
  5. data/README +1119 -0
  6. data/README.mingw +8 -0
  7. data/Rakefile +33 -0
  8. data/aclocal.m4 +874 -0
  9. data/bootstrap +8 -0
  10. data/config.guess +1500 -0
  11. data/config.sub +1616 -0
  12. data/configure +7461 -0
  13. data/configure.ac +52 -0
  14. data/depcomp +584 -0
  15. data/doxygen.ac +314 -0
  16. data/doxygen.am +186 -0
  17. data/extconf.rb +34 -0
  18. data/install-sh +507 -0
  19. data/missing +367 -0
  20. data/post-autoconf.rb +22 -0
  21. data/post-automake.rb +28 -0
  22. data/rice/Address_Registration_Guard.cpp +22 -0
  23. data/rice/Address_Registration_Guard.hpp +7 -0
  24. data/rice/Address_Registration_Guard.ipp +37 -0
  25. data/rice/Address_Registration_Guard_defn.hpp +75 -0
  26. data/rice/Allocation_Strategies.hpp +37 -0
  27. data/rice/Arg.hpp +8 -0
  28. data/rice/Arg_impl.hpp +127 -0
  29. data/rice/Arg_operators.cpp +21 -0
  30. data/rice/Arg_operators.hpp +19 -0
  31. data/rice/Array.hpp +220 -0
  32. data/rice/Array.ipp +263 -0
  33. data/rice/Builtin_Object.hpp +8 -0
  34. data/rice/Builtin_Object.ipp +50 -0
  35. data/rice/Builtin_Object_defn.hpp +51 -0
  36. data/rice/Class.cpp +57 -0
  37. data/rice/Class.hpp +8 -0
  38. data/rice/Class.ipp +6 -0
  39. data/rice/Class_defn.hpp +83 -0
  40. data/rice/Constructor.hpp +367 -0
  41. data/rice/Critical_Guard.hpp +40 -0
  42. data/rice/Critical_Guard.ipp +26 -0
  43. data/rice/Data_Object.hpp +8 -0
  44. data/rice/Data_Object.ipp +133 -0
  45. data/rice/Data_Object_defn.hpp +132 -0
  46. data/rice/Data_Type.cpp +54 -0
  47. data/rice/Data_Type.hpp +8 -0
  48. data/rice/Data_Type.ipp +365 -0
  49. data/rice/Data_Type_defn.hpp +261 -0
  50. data/rice/Data_Type_fwd.hpp +12 -0
  51. data/rice/Director.cpp +13 -0
  52. data/rice/Director.hpp +39 -0
  53. data/rice/Enum.hpp +117 -0
  54. data/rice/Enum.ipp +246 -0
  55. data/rice/Exception.cpp +59 -0
  56. data/rice/Exception.hpp +9 -0
  57. data/rice/Exception_Base.hpp +8 -0
  58. data/rice/Exception_Base.ipp +13 -0
  59. data/rice/Exception_Base_defn.hpp +27 -0
  60. data/rice/Exception_defn.hpp +69 -0
  61. data/rice/Hash.hpp +210 -0
  62. data/rice/Hash.ipp +338 -0
  63. data/rice/Identifier.cpp +8 -0
  64. data/rice/Identifier.hpp +50 -0
  65. data/rice/Identifier.ipp +33 -0
  66. data/rice/Jump_Tag.hpp +24 -0
  67. data/rice/Makefile.am +130 -0
  68. data/rice/Makefile.in +716 -0
  69. data/rice/Module.cpp +84 -0
  70. data/rice/Module.hpp +8 -0
  71. data/rice/Module.ipp +6 -0
  72. data/rice/Module_defn.hpp +88 -0
  73. data/rice/Module_impl.hpp +281 -0
  74. data/rice/Module_impl.ipp +348 -0
  75. data/rice/Object.cpp +160 -0
  76. data/rice/Object.hpp +8 -0
  77. data/rice/Object.ipp +19 -0
  78. data/rice/Object_defn.hpp +191 -0
  79. data/rice/Require_Guard.hpp +21 -0
  80. data/rice/String.cpp +94 -0
  81. data/rice/String.hpp +89 -0
  82. data/rice/Struct.cpp +117 -0
  83. data/rice/Struct.hpp +162 -0
  84. data/rice/Struct.ipp +26 -0
  85. data/rice/Symbol.cpp +25 -0
  86. data/rice/Symbol.hpp +66 -0
  87. data/rice/Symbol.ipp +44 -0
  88. data/rice/VM.cpp +92 -0
  89. data/rice/VM.hpp +32 -0
  90. data/rice/config.hpp +41 -0
  91. data/rice/config.hpp.in +40 -0
  92. data/rice/detail/Arguments.hpp +118 -0
  93. data/rice/detail/Auto_Function_Wrapper.hpp +829 -0
  94. data/rice/detail/Auto_Function_Wrapper.ipp +3391 -0
  95. data/rice/detail/Auto_Member_Function_Wrapper.hpp +828 -0
  96. data/rice/detail/Auto_Member_Function_Wrapper.ipp +2503 -0
  97. data/rice/detail/Caster.hpp +103 -0
  98. data/rice/detail/Exception_Handler.hpp +8 -0
  99. data/rice/detail/Exception_Handler.ipp +68 -0
  100. data/rice/detail/Exception_Handler_defn.hpp +96 -0
  101. data/rice/detail/Iterator.hpp +93 -0
  102. data/rice/detail/Not_Copyable.hpp +25 -0
  103. data/rice/detail/Wrapped_Function.hpp +33 -0
  104. data/rice/detail/cfp.hpp +24 -0
  105. data/rice/detail/cfp.ipp +51 -0
  106. data/rice/detail/check_ruby_type.cpp +27 -0
  107. data/rice/detail/check_ruby_type.hpp +23 -0
  108. data/rice/detail/creation_funcs.hpp +37 -0
  109. data/rice/detail/creation_funcs.ipp +36 -0
  110. data/rice/detail/default_allocation_func.hpp +23 -0
  111. data/rice/detail/default_allocation_func.ipp +11 -0
  112. data/rice/detail/define_method_and_auto_wrap.hpp +31 -0
  113. data/rice/detail/define_method_and_auto_wrap.ipp +30 -0
  114. data/rice/detail/demangle.cpp +56 -0
  115. data/rice/detail/demangle.hpp +19 -0
  116. data/rice/detail/env.hpp +19 -0
  117. data/rice/detail/from_ruby.hpp +43 -0
  118. data/rice/detail/from_ruby.ipp +60 -0
  119. data/rice/detail/method_data.cpp +159 -0
  120. data/rice/detail/method_data.hpp +21 -0
  121. data/rice/detail/mininode.cpp +1220 -0
  122. data/rice/detail/mininode.hpp +320 -0
  123. data/rice/detail/node.hpp +13 -0
  124. data/rice/detail/object_call.hpp +68 -0
  125. data/rice/detail/object_call.ipp +131 -0
  126. data/rice/detail/protect.cpp +29 -0
  127. data/rice/detail/protect.hpp +34 -0
  128. data/rice/detail/ruby.hpp +93 -0
  129. data/rice/detail/ruby_version_code.hpp +6 -0
  130. data/rice/detail/ruby_version_code.hpp.in +6 -0
  131. data/rice/detail/rubysig.hpp +19 -0
  132. data/rice/detail/st.hpp +60 -0
  133. data/rice/detail/to_ruby.hpp +22 -0
  134. data/rice/detail/to_ruby.ipp +36 -0
  135. data/rice/detail/traits.hpp +43 -0
  136. data/rice/detail/win32.hpp +16 -0
  137. data/rice/detail/wrap_function.hpp +341 -0
  138. data/rice/detail/wrap_function.ipp +514 -0
  139. data/rice/global_function.hpp +33 -0
  140. data/rice/global_function.ipp +22 -0
  141. data/rice/protect.hpp +91 -0
  142. data/rice/protect.ipp +1133 -0
  143. data/rice/ruby_mark.hpp +13 -0
  144. data/rice/ruby_try_catch.hpp +86 -0
  145. data/rice/rubypp.rb +97 -0
  146. data/rice/to_from_ruby.hpp +8 -0
  147. data/rice/to_from_ruby.ipp +294 -0
  148. data/rice/to_from_ruby_defn.hpp +71 -0
  149. data/ruby/Makefile.am +1 -0
  150. data/ruby/Makefile.in +497 -0
  151. data/ruby/lib/Makefile.am +3 -0
  152. data/ruby/lib/Makefile.in +373 -0
  153. data/ruby/lib/mkmf-rice.rb.in +216 -0
  154. data/ruby/lib/version.rb +3 -0
  155. data/ruby.ac +136 -0
  156. data/sample/Makefile.am +47 -0
  157. data/sample/Makefile.in +379 -0
  158. data/sample/enum/extconf.rb +3 -0
  159. data/sample/enum/sample_enum.cpp +54 -0
  160. data/sample/enum/test.rb +8 -0
  161. data/sample/inheritance/animals.cpp +98 -0
  162. data/sample/inheritance/extconf.rb +3 -0
  163. data/sample/inheritance/test.rb +7 -0
  164. data/sample/map/extconf.rb +3 -0
  165. data/sample/map/map.cpp +81 -0
  166. data/sample/map/test.rb +7 -0
  167. data/test/Makefile.am +78 -0
  168. data/test/Makefile.in +728 -0
  169. data/test/ext/Makefile.am +43 -0
  170. data/test/ext/Makefile.in +375 -0
  171. data/test/ext/t1/Foo.hpp +10 -0
  172. data/test/ext/t1/extconf.rb +2 -0
  173. data/test/ext/t1/t1.cpp +15 -0
  174. data/test/ext/t2/extconf.rb +2 -0
  175. data/test/ext/t2/t2.cpp +11 -0
  176. data/test/test_Address_Registration_Guard.cpp +43 -0
  177. data/test/test_Allocation_Strategies.cpp +77 -0
  178. data/test/test_Array.cpp +241 -0
  179. data/test/test_Builtin_Object.cpp +72 -0
  180. data/test/test_Class.cpp +498 -0
  181. data/test/test_Constructor.cpp +128 -0
  182. data/test/test_Critical_Guard.cpp +51 -0
  183. data/test/test_Data_Object.cpp +275 -0
  184. data/test/test_Data_Type.cpp +348 -0
  185. data/test/test_Director.cpp +301 -0
  186. data/test/test_Enum.cpp +195 -0
  187. data/test/test_Exception.cpp +46 -0
  188. data/test/test_Hash.cpp +195 -0
  189. data/test/test_Identifier.cpp +70 -0
  190. data/test/test_Jump_Tag.cpp +17 -0
  191. data/test/test_Memory_Management.cpp +50 -0
  192. data/test/test_Module.cpp +481 -0
  193. data/test/test_Object.cpp +148 -0
  194. data/test/test_String.cpp +94 -0
  195. data/test/test_Struct.cpp +192 -0
  196. data/test/test_Symbol.cpp +63 -0
  197. data/test/test_To_From_Ruby.cpp +277 -0
  198. data/test/test_VM.cpp +26 -0
  199. data/test/test_global_functions.cpp +114 -0
  200. data/test/test_rice.rb +43 -0
  201. data/test/unittest.cpp +136 -0
  202. data/test/unittest.hpp +292 -0
  203. metadata +289 -0
data/configure.ac ADDED
@@ -0,0 +1,52 @@
1
+ AC_INIT(rice, 1.1)
2
+ AC_CONFIG_SRCDIR(rice)
3
+ AM_INIT_AUTOMAKE
4
+
5
+ AM_CONFIG_HEADER(rice/config.hpp)
6
+
7
+ AC_LANG(C++)
8
+ AC_PROG_CXX
9
+ AC_PROG_RANLIB
10
+
11
+ RICE_CPPFLAGS="$CPPFLAGS"
12
+ AC_SUBST(RICE_CPPFLAGS)
13
+
14
+ RICE_LDFLAGS="$LDFLAGS"
15
+ AC_SUBST(RICE_LDFLAGS)
16
+
17
+ AC_MINGW32
18
+ if test x"${MINGW32}"x = xyesx; then
19
+ RICE_USING_MINGW32="true"
20
+ else
21
+ RICE_USING_MINGW32="false"
22
+ fi
23
+
24
+ AC_SUBST(RICE_USING_MINGW32)
25
+
26
+ m4_include(ruby.ac)
27
+ RB_INIT_RUBY
28
+
29
+ m4_include(doxygen.ac)
30
+ DX_HTML_FEATURE(ON)
31
+ DX_CHM_FEATURE(OFF)
32
+ DX_CHI_FEATURE(OFF)
33
+ DX_MAN_FEATURE(OFF)
34
+ DX_RTF_FEATURE(OFF)
35
+ DX_XML_FEATURE(OFF)
36
+ DX_PDF_FEATURE(OFF)
37
+ DX_PS_FEATURE(OFF)
38
+ DX_INIT_DOXYGEN(rice, Doxyfile, doc)
39
+
40
+ RICE_SAMPLES="enum map inheritance"
41
+ AC_SUBST(RICE_SAMPLES)
42
+
43
+ RICE_ROOT=`pwd`
44
+ AC_SUBST(RICE_ROOT)
45
+
46
+ AC_CONFIG_FILES(Makefile rice/Makefile test/Makefile sample/Makefile
47
+ ruby/Makefile ruby/lib/Makefile test/ext/Makefile
48
+ ruby/lib/mkmf-rice.rb rice/detail/ruby_version_code.hpp)
49
+ AC_OUTPUT
50
+
51
+ dnl Work around a bug in older versions of Rubygems
52
+ chmod +x install-sh
data/depcomp ADDED
@@ -0,0 +1,584 @@
1
+ #! /bin/sh
2
+ # depcomp - compile a program generating dependencies as side-effects
3
+
4
+ scriptversion=2006-10-15.18
5
+
6
+ # Copyright (C) 1999, 2000, 2003, 2004, 2005, 2006 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
+ stripped=`echo "$object" | sed 's/\(.*\)\..*$/\1/'`
219
+ tmpdepfile="$stripped.u"
220
+ if test "$libtool" = yes; then
221
+ "$@" -Wc,-M
222
+ else
223
+ "$@" -M
224
+ fi
225
+ stat=$?
226
+
227
+ if test -f "$tmpdepfile"; then :
228
+ else
229
+ stripped=`echo "$stripped" | sed 's,^.*/,,'`
230
+ tmpdepfile="$stripped.u"
231
+ fi
232
+
233
+ if test $stat -eq 0; then :
234
+ else
235
+ rm -f "$tmpdepfile"
236
+ exit $stat
237
+ fi
238
+
239
+ if test -f "$tmpdepfile"; then
240
+ outname="$stripped.o"
241
+ # Each line is of the form `foo.o: dependent.h'.
242
+ # Do two passes, one to just change these to
243
+ # `$object: dependent.h' and one to simply `dependent.h:'.
244
+ sed -e "s,^$outname:,$object :," < "$tmpdepfile" > "$depfile"
245
+ sed -e "s,^$outname: \(.*\)$,\1:," < "$tmpdepfile" >> "$depfile"
246
+ else
247
+ # The sourcefile does not contain any dependencies, so just
248
+ # store a dummy comment line, to avoid errors with the Makefile
249
+ # "include basename.Plo" scheme.
250
+ echo "#dummy" > "$depfile"
251
+ fi
252
+ rm -f "$tmpdepfile"
253
+ ;;
254
+
255
+ icc)
256
+ # Intel's C compiler understands `-MD -MF file'. However on
257
+ # icc -MD -MF foo.d -c -o sub/foo.o sub/foo.c
258
+ # ICC 7.0 will fill foo.d with something like
259
+ # foo.o: sub/foo.c
260
+ # foo.o: sub/foo.h
261
+ # which is wrong. We want:
262
+ # sub/foo.o: sub/foo.c
263
+ # sub/foo.o: sub/foo.h
264
+ # sub/foo.c:
265
+ # sub/foo.h:
266
+ # ICC 7.1 will output
267
+ # foo.o: sub/foo.c sub/foo.h
268
+ # and will wrap long lines using \ :
269
+ # foo.o: sub/foo.c ... \
270
+ # sub/foo.h ... \
271
+ # ...
272
+
273
+ "$@" -MD -MF "$tmpdepfile"
274
+ stat=$?
275
+ if test $stat -eq 0; then :
276
+ else
277
+ rm -f "$tmpdepfile"
278
+ exit $stat
279
+ fi
280
+ rm -f "$depfile"
281
+ # Each line is of the form `foo.o: dependent.h',
282
+ # or `foo.o: dep1.h dep2.h \', or ` dep3.h dep4.h \'.
283
+ # Do two passes, one to just change these to
284
+ # `$object: dependent.h' and one to simply `dependent.h:'.
285
+ sed "s,^[^:]*:,$object :," < "$tmpdepfile" > "$depfile"
286
+ # Some versions of the HPUX 10.20 sed can't process this invocation
287
+ # correctly. Breaking it into two sed invocations is a workaround.
288
+ sed 's,^[^:]*: \(.*\)$,\1,;s/^\\$//;/^$/d;/:$/d' < "$tmpdepfile" |
289
+ sed -e 's/$/ :/' >> "$depfile"
290
+ rm -f "$tmpdepfile"
291
+ ;;
292
+
293
+ hp2)
294
+ # The "hp" stanza above does not work with aCC (C++) and HP's ia64
295
+ # compilers, which have integrated preprocessors. The correct option
296
+ # to use with these is +Maked; it writes dependencies to a file named
297
+ # 'foo.d', which lands next to the object file, wherever that
298
+ # happens to be.
299
+ # Much of this is similar to the tru64 case; see comments there.
300
+ dir=`echo "$object" | sed -e 's|/[^/]*$|/|'`
301
+ test "x$dir" = "x$object" && dir=
302
+ base=`echo "$object" | sed -e 's|^.*/||' -e 's/\.o$//' -e 's/\.lo$//'`
303
+ if test "$libtool" = yes; then
304
+ tmpdepfile1=$dir$base.d
305
+ tmpdepfile2=$dir.libs/$base.d
306
+ "$@" -Wc,+Maked
307
+ else
308
+ tmpdepfile1=$dir$base.d
309
+ tmpdepfile2=$dir$base.d
310
+ "$@" +Maked
311
+ fi
312
+ stat=$?
313
+ if test $stat -eq 0; then :
314
+ else
315
+ rm -f "$tmpdepfile1" "$tmpdepfile2"
316
+ exit $stat
317
+ fi
318
+
319
+ for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2"
320
+ do
321
+ test -f "$tmpdepfile" && break
322
+ done
323
+ if test -f "$tmpdepfile"; then
324
+ sed -e "s,^.*\.[a-z]*:,$object:," "$tmpdepfile" > "$depfile"
325
+ # Add `dependent.h:' lines.
326
+ sed -ne '2,${; s/^ *//; s/ \\*$//; s/$/:/; p;}' "$tmpdepfile" >> "$depfile"
327
+ else
328
+ echo "#dummy" > "$depfile"
329
+ fi
330
+ rm -f "$tmpdepfile" "$tmpdepfile2"
331
+ ;;
332
+
333
+ tru64)
334
+ # The Tru64 compiler uses -MD to generate dependencies as a side
335
+ # effect. `cc -MD -o foo.o ...' puts the dependencies into `foo.o.d'.
336
+ # At least on Alpha/Redhat 6.1, Compaq CCC V6.2-504 seems to put
337
+ # dependencies in `foo.d' instead, so we check for that too.
338
+ # Subdirectories are respected.
339
+ dir=`echo "$object" | sed -e 's|/[^/]*$|/|'`
340
+ test "x$dir" = "x$object" && dir=
341
+ base=`echo "$object" | sed -e 's|^.*/||' -e 's/\.o$//' -e 's/\.lo$//'`
342
+
343
+ if test "$libtool" = yes; then
344
+ # With Tru64 cc, shared objects can also be used to make a
345
+ # static library. This mechanism is used in libtool 1.4 series to
346
+ # handle both shared and static libraries in a single compilation.
347
+ # With libtool 1.4, dependencies were output in $dir.libs/$base.lo.d.
348
+ #
349
+ # With libtool 1.5 this exception was removed, and libtool now
350
+ # generates 2 separate objects for the 2 libraries. These two
351
+ # compilations output dependencies in $dir.libs/$base.o.d and
352
+ # in $dir$base.o.d. We have to check for both files, because
353
+ # one of the two compilations can be disabled. We should prefer
354
+ # $dir$base.o.d over $dir.libs/$base.o.d because the latter is
355
+ # automatically cleaned when .libs/ is deleted, while ignoring
356
+ # the former would cause a distcleancheck panic.
357
+ tmpdepfile1=$dir.libs/$base.lo.d # libtool 1.4
358
+ tmpdepfile2=$dir$base.o.d # libtool 1.5
359
+ tmpdepfile3=$dir.libs/$base.o.d # libtool 1.5
360
+ tmpdepfile4=$dir.libs/$base.d # Compaq CCC V6.2-504
361
+ "$@" -Wc,-MD
362
+ else
363
+ tmpdepfile1=$dir$base.o.d
364
+ tmpdepfile2=$dir$base.d
365
+ tmpdepfile3=$dir$base.d
366
+ tmpdepfile4=$dir$base.d
367
+ "$@" -MD
368
+ fi
369
+
370
+ stat=$?
371
+ if test $stat -eq 0; then :
372
+ else
373
+ rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" "$tmpdepfile4"
374
+ exit $stat
375
+ fi
376
+
377
+ for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" "$tmpdepfile4"
378
+ do
379
+ test -f "$tmpdepfile" && break
380
+ done
381
+ if test -f "$tmpdepfile"; then
382
+ sed -e "s,^.*\.[a-z]*:,$object:," < "$tmpdepfile" > "$depfile"
383
+ # That's a tab and a space in the [].
384
+ sed -e 's,^.*\.[a-z]*:[ ]*,,' -e 's,$,:,' < "$tmpdepfile" >> "$depfile"
385
+ else
386
+ echo "#dummy" > "$depfile"
387
+ fi
388
+ rm -f "$tmpdepfile"
389
+ ;;
390
+
391
+ #nosideeffect)
392
+ # This comment above is used by automake to tell side-effect
393
+ # dependency tracking mechanisms from slower ones.
394
+
395
+ dashmstdout)
396
+ # Important note: in order to support this mode, a compiler *must*
397
+ # always write the preprocessed file to stdout, regardless of -o.
398
+ "$@" || exit $?
399
+
400
+ # Remove the call to Libtool.
401
+ if test "$libtool" = yes; then
402
+ while test $1 != '--mode=compile'; do
403
+ shift
404
+ done
405
+ shift
406
+ fi
407
+
408
+ # Remove `-o $object'.
409
+ IFS=" "
410
+ for arg
411
+ do
412
+ case $arg in
413
+ -o)
414
+ shift
415
+ ;;
416
+ $object)
417
+ shift
418
+ ;;
419
+ *)
420
+ set fnord "$@" "$arg"
421
+ shift # fnord
422
+ shift # $arg
423
+ ;;
424
+ esac
425
+ done
426
+
427
+ test -z "$dashmflag" && dashmflag=-M
428
+ # Require at least two characters before searching for `:'
429
+ # in the target name. This is to cope with DOS-style filenames:
430
+ # a dependency such as `c:/foo/bar' could be seen as target `c' otherwise.
431
+ "$@" $dashmflag |
432
+ sed 's:^[ ]*[^: ][^:][^:]*\:[ ]*:'"$object"'\: :' > "$tmpdepfile"
433
+ rm -f "$depfile"
434
+ cat < "$tmpdepfile" > "$depfile"
435
+ tr ' ' '
436
+ ' < "$tmpdepfile" | \
437
+ ## Some versions of the HPUX 10.20 sed can't process this invocation
438
+ ## correctly. Breaking it into two sed invocations is a workaround.
439
+ sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile"
440
+ rm -f "$tmpdepfile"
441
+ ;;
442
+
443
+ dashXmstdout)
444
+ # This case only exists to satisfy depend.m4. It is never actually
445
+ # run, as this mode is specially recognized in the preamble.
446
+ exit 1
447
+ ;;
448
+
449
+ makedepend)
450
+ "$@" || exit $?
451
+ # Remove any Libtool call
452
+ if test "$libtool" = yes; then
453
+ while test $1 != '--mode=compile'; do
454
+ shift
455
+ done
456
+ shift
457
+ fi
458
+ # X makedepend
459
+ shift
460
+ cleared=no
461
+ for arg in "$@"; do
462
+ case $cleared in
463
+ no)
464
+ set ""; shift
465
+ cleared=yes ;;
466
+ esac
467
+ case "$arg" in
468
+ -D*|-I*)
469
+ set fnord "$@" "$arg"; shift ;;
470
+ # Strip any option that makedepend may not understand. Remove
471
+ # the object too, otherwise makedepend will parse it as a source file.
472
+ -*|$object)
473
+ ;;
474
+ *)
475
+ set fnord "$@" "$arg"; shift ;;
476
+ esac
477
+ done
478
+ obj_suffix="`echo $object | sed 's/^.*\././'`"
479
+ touch "$tmpdepfile"
480
+ ${MAKEDEPEND-makedepend} -o"$obj_suffix" -f"$tmpdepfile" "$@"
481
+ rm -f "$depfile"
482
+ cat < "$tmpdepfile" > "$depfile"
483
+ sed '1,2d' "$tmpdepfile" | tr ' ' '
484
+ ' | \
485
+ ## Some versions of the HPUX 10.20 sed can't process this invocation
486
+ ## correctly. Breaking it into two sed invocations is a workaround.
487
+ sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile"
488
+ rm -f "$tmpdepfile" "$tmpdepfile".bak
489
+ ;;
490
+
491
+ cpp)
492
+ # Important note: in order to support this mode, a compiler *must*
493
+ # always write the preprocessed file to stdout.
494
+ "$@" || exit $?
495
+
496
+ # Remove the call to Libtool.
497
+ if test "$libtool" = yes; then
498
+ while test $1 != '--mode=compile'; do
499
+ shift
500
+ done
501
+ shift
502
+ fi
503
+
504
+ # Remove `-o $object'.
505
+ IFS=" "
506
+ for arg
507
+ do
508
+ case $arg in
509
+ -o)
510
+ shift
511
+ ;;
512
+ $object)
513
+ shift
514
+ ;;
515
+ *)
516
+ set fnord "$@" "$arg"
517
+ shift # fnord
518
+ shift # $arg
519
+ ;;
520
+ esac
521
+ done
522
+
523
+ "$@" -E |
524
+ sed -n -e '/^# [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' \
525
+ -e '/^#line [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' |
526
+ sed '$ s: \\$::' > "$tmpdepfile"
527
+ rm -f "$depfile"
528
+ echo "$object : \\" > "$depfile"
529
+ cat < "$tmpdepfile" >> "$depfile"
530
+ sed < "$tmpdepfile" '/^$/d;s/^ //;s/ \\$//;s/$/ :/' >> "$depfile"
531
+ rm -f "$tmpdepfile"
532
+ ;;
533
+
534
+ msvisualcpp)
535
+ # Important note: in order to support this mode, a compiler *must*
536
+ # always write the preprocessed file to stdout, regardless of -o,
537
+ # because we must use -o when running libtool.
538
+ "$@" || exit $?
539
+ IFS=" "
540
+ for arg
541
+ do
542
+ case "$arg" in
543
+ "-Gm"|"/Gm"|"-Gi"|"/Gi"|"-ZI"|"/ZI")
544
+ set fnord "$@"
545
+ shift
546
+ shift
547
+ ;;
548
+ *)
549
+ set fnord "$@" "$arg"
550
+ shift
551
+ shift
552
+ ;;
553
+ esac
554
+ done
555
+ "$@" -E |
556
+ sed -n '/^#line [0-9][0-9]* "\([^"]*\)"/ s::echo "`cygpath -u \\"\1\\"`":p' | sort | uniq > "$tmpdepfile"
557
+ rm -f "$depfile"
558
+ echo "$object : \\" > "$depfile"
559
+ . "$tmpdepfile" | sed 's% %\\ %g' | sed -n '/^\(.*\)$/ s:: \1 \\:p' >> "$depfile"
560
+ echo " " >> "$depfile"
561
+ . "$tmpdepfile" | sed 's% %\\ %g' | sed -n '/^\(.*\)$/ s::\1\::p' >> "$depfile"
562
+ rm -f "$tmpdepfile"
563
+ ;;
564
+
565
+ none)
566
+ exec "$@"
567
+ ;;
568
+
569
+ *)
570
+ echo "Unknown depmode $depmode" 1>&2
571
+ exit 1
572
+ ;;
573
+ esac
574
+
575
+ exit 0
576
+
577
+ # Local Variables:
578
+ # mode: shell-script
579
+ # sh-indentation: 2
580
+ # eval: (add-hook 'write-file-hooks 'time-stamp)
581
+ # time-stamp-start: "scriptversion="
582
+ # time-stamp-format: "%:y-%02m-%02d.%02H"
583
+ # time-stamp-end: "$"
584
+ # End: