charguess 1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (135) hide show
  1. data/History.txt +4 -0
  2. data/Manifest.txt +134 -0
  3. data/PostInstall.txt +7 -0
  4. data/README.rdoc +26 -0
  5. data/Rakefile +25 -0
  6. data/ext/charguess/charguess.c +29 -0
  7. data/ext/charguess/extconf.rb +11 -0
  8. data/ext/libcharguess/cpp/.deps/EUCJPProber.Plo +1 -0
  9. data/ext/libcharguess/cpp/.deps/EUCJPProber.Po +87 -0
  10. data/ext/libcharguess/cpp/.deps/EUCKRProber.Plo +1 -0
  11. data/ext/libcharguess/cpp/.deps/EUCKRProber.Po +85 -0
  12. data/ext/libcharguess/cpp/.deps/EUCTWProber.Plo +1 -0
  13. data/ext/libcharguess/cpp/.deps/EUCTWProber.Po +85 -0
  14. data/ext/libcharguess/cpp/.deps/EscCharsetProber.Plo +1 -0
  15. data/ext/libcharguess/cpp/.deps/EscCharsetProber.Po +83 -0
  16. data/ext/libcharguess/cpp/.deps/EscSM.Plo +1 -0
  17. data/ext/libcharguess/cpp/.deps/EscSM.Po +77 -0
  18. data/ext/libcharguess/cpp/.deps/GB2312Prober.Plo +1 -0
  19. data/ext/libcharguess/cpp/.deps/GB2312Prober.Po +85 -0
  20. data/ext/libcharguess/cpp/.deps/LangBulgarianModel.Plo +1 -0
  21. data/ext/libcharguess/cpp/.deps/LangBulgarianModel.Po +78 -0
  22. data/ext/libcharguess/cpp/.deps/LangCyrillicModel.Plo +1 -0
  23. data/ext/libcharguess/cpp/.deps/LangCyrillicModel.Po +78 -0
  24. data/ext/libcharguess/cpp/.deps/LangGreekModel.Plo +1 -0
  25. data/ext/libcharguess/cpp/.deps/LangGreekModel.Po +78 -0
  26. data/ext/libcharguess/cpp/.deps/LangHungarianModel.Plo +1 -0
  27. data/ext/libcharguess/cpp/.deps/LangHungarianModel.Po +78 -0
  28. data/ext/libcharguess/cpp/.deps/LangThaiModel.Plo +1 -0
  29. data/ext/libcharguess/cpp/.deps/LangThaiModel.Po +78 -0
  30. data/ext/libcharguess/cpp/.deps/Latin1Prober.Plo +1 -0
  31. data/ext/libcharguess/cpp/.deps/Latin1Prober.Po +78 -0
  32. data/ext/libcharguess/cpp/.deps/MBCSGroupProber.Plo +1 -0
  33. data/ext/libcharguess/cpp/.deps/MBCSGroupProber.Po +102 -0
  34. data/ext/libcharguess/cpp/.deps/MBCSSM.Plo +1 -0
  35. data/ext/libcharguess/cpp/.deps/MBCSSM.Po +77 -0
  36. data/ext/libcharguess/cpp/.deps/SBCSGroupProber.Plo +1 -0
  37. data/ext/libcharguess/cpp/.deps/SBCSGroupProber.Po +80 -0
  38. data/ext/libcharguess/cpp/.deps/SBCharsetProber.Plo +1 -0
  39. data/ext/libcharguess/cpp/.deps/SBCharsetProber.Po +78 -0
  40. data/ext/libcharguess/cpp/.deps/SJISProber.Plo +1 -0
  41. data/ext/libcharguess/cpp/.deps/SJISProber.Po +86 -0
  42. data/ext/libcharguess/cpp/.deps/UTF8Prober.Plo +1 -0
  43. data/ext/libcharguess/cpp/.deps/UTF8Prober.Po +82 -0
  44. data/ext/libcharguess/cpp/.deps/big5Prober.Plo +1 -0
  45. data/ext/libcharguess/cpp/.deps/big5Prober.Po +84 -0
  46. data/ext/libcharguess/cpp/.deps/charDistribution.Plo +1 -0
  47. data/ext/libcharguess/cpp/.deps/charDistribution.Po +87 -0
  48. data/ext/libcharguess/cpp/.deps/chardet.Plo +1 -0
  49. data/ext/libcharguess/cpp/.deps/chardet.Po +84 -0
  50. data/ext/libcharguess/cpp/.deps/charguess.Po +77 -0
  51. data/ext/libcharguess/cpp/.deps/jpCntx.Plo +1 -0
  52. data/ext/libcharguess/cpp/.deps/jpCntx.Po +75 -0
  53. data/ext/libcharguess/cpp/.deps/universal.Plo +1 -0
  54. data/ext/libcharguess/cpp/.deps/universal.Po +111 -0
  55. data/ext/libcharguess/cpp/AUTHORS +3 -0
  56. data/ext/libcharguess/cpp/Big5Freq.tab +928 -0
  57. data/ext/libcharguess/cpp/COPYING +340 -0
  58. data/ext/libcharguess/cpp/COPYRIGHT +20 -0
  59. data/ext/libcharguess/cpp/ChangeLog +0 -0
  60. data/ext/libcharguess/cpp/EUCJPProber.cpp +80 -0
  61. data/ext/libcharguess/cpp/EUCJPProber.h +58 -0
  62. data/ext/libcharguess/cpp/EUCKRFreq.tab +615 -0
  63. data/ext/libcharguess/cpp/EUCKRProber.cpp +80 -0
  64. data/ext/libcharguess/cpp/EUCKRProber.h +54 -0
  65. data/ext/libcharguess/cpp/EUCTWFreq.tab +448 -0
  66. data/ext/libcharguess/cpp/EUCTWProber.cpp +79 -0
  67. data/ext/libcharguess/cpp/EUCTWProber.h +53 -0
  68. data/ext/libcharguess/cpp/EscCharsetProber.cpp +89 -0
  69. data/ext/libcharguess/cpp/EscCharsetProber.h +49 -0
  70. data/ext/libcharguess/cpp/EscSM.cpp +244 -0
  71. data/ext/libcharguess/cpp/GB2312Freq.tab +476 -0
  72. data/ext/libcharguess/cpp/GB2312Prober.cpp +84 -0
  73. data/ext/libcharguess/cpp/GB2312Prober.h +56 -0
  74. data/ext/libcharguess/cpp/INSTALL +229 -0
  75. data/ext/libcharguess/cpp/JISFreq.tab +574 -0
  76. data/ext/libcharguess/cpp/LICENSE +504 -0
  77. data/ext/libcharguess/cpp/LangBulgarianModel.cpp +230 -0
  78. data/ext/libcharguess/cpp/LangCyrillicModel.cpp +340 -0
  79. data/ext/libcharguess/cpp/LangGreekModel.cpp +229 -0
  80. data/ext/libcharguess/cpp/LangHungarianModel.cpp +228 -0
  81. data/ext/libcharguess/cpp/LangThaiModel.cpp +206 -0
  82. data/ext/libcharguess/cpp/Latin1Prober.cpp +190 -0
  83. data/ext/libcharguess/cpp/Latin1Prober.h +49 -0
  84. data/ext/libcharguess/cpp/MBCSGroupProber.cpp +186 -0
  85. data/ext/libcharguess/cpp/MBCSGroupProber.h +58 -0
  86. data/ext/libcharguess/cpp/MBCSSM.cpp +610 -0
  87. data/ext/libcharguess/cpp/Makefile.am +45 -0
  88. data/ext/libcharguess/cpp/Makefile.in +608 -0
  89. data/ext/libcharguess/cpp/NEWS +0 -0
  90. data/ext/libcharguess/cpp/README +0 -0
  91. data/ext/libcharguess/cpp/SBCSGroupProber.cpp +244 -0
  92. data/ext/libcharguess/cpp/SBCSGroupProber.h +54 -0
  93. data/ext/libcharguess/cpp/SBCharsetProber.cpp +100 -0
  94. data/ext/libcharguess/cpp/SBCharsetProber.h +89 -0
  95. data/ext/libcharguess/cpp/SJISProber.cpp +86 -0
  96. data/ext/libcharguess/cpp/SJISProber.h +60 -0
  97. data/ext/libcharguess/cpp/UTF8Prober.cpp +75 -0
  98. data/ext/libcharguess/cpp/UTF8Prober.h +46 -0
  99. data/ext/libcharguess/cpp/aclocal.m4 +1008 -0
  100. data/ext/libcharguess/cpp/autogen.sh +153 -0
  101. data/ext/libcharguess/cpp/big5Prober.cpp +76 -0
  102. data/ext/libcharguess/cpp/big5Prober.h +53 -0
  103. data/ext/libcharguess/cpp/charDistribution.cpp +90 -0
  104. data/ext/libcharguess/cpp/charDistribution.h +219 -0
  105. data/ext/libcharguess/cpp/charguess.cpp +56 -0
  106. data/ext/libcharguess/cpp/charguess.h +23 -0
  107. data/ext/libcharguess/cpp/charsetProber.h +50 -0
  108. data/ext/libcharguess/cpp/codingStateMachine.h +92 -0
  109. data/ext/libcharguess/cpp/config.h +36 -0
  110. data/ext/libcharguess/cpp/config.h.in +35 -0
  111. data/ext/libcharguess/cpp/config.status +1075 -0
  112. data/ext/libcharguess/cpp/configure +5226 -0
  113. data/ext/libcharguess/cpp/configure.in +49 -0
  114. data/ext/libcharguess/cpp/depcomp +472 -0
  115. data/ext/libcharguess/cpp/fix_copyright +32 -0
  116. data/ext/libcharguess/cpp/install-sh +294 -0
  117. data/ext/libcharguess/cpp/jpCntx.cpp +194 -0
  118. data/ext/libcharguess/cpp/jpCntx.h +100 -0
  119. data/ext/libcharguess/cpp/missing +336 -0
  120. data/ext/libcharguess/cpp/mkinstalldirs +111 -0
  121. data/ext/libcharguess/cpp/pkgInt.h +72 -0
  122. data/ext/libcharguess/cpp/stamp-h1 +1 -0
  123. data/ext/libcharguess/cpp/test/test.cpp +78 -0
  124. data/ext/libcharguess/cpp/types.h +41 -0
  125. data/ext/libcharguess/cpp/universal.cpp +273 -0
  126. data/ext/libcharguess/cpp/universal.h +65 -0
  127. data/script/console +9 -0
  128. data/script/destroy +14 -0
  129. data/script/generate +14 -0
  130. data/tasks/extconf/charguess.rake +47 -0
  131. data/tasks/extconf.rake +13 -0
  132. data/test/test_charguess.rb +7 -0
  133. data/test/test_charguess_extn.rb +10 -0
  134. data/test/test_helper.rb +3 -0
  135. metadata +219 -0
@@ -0,0 +1,49 @@
1
+ dnl Process this file with autoconf to produce a configure script.
2
+ dnl (GNU Autoconf) 2.57
3
+
4
+
5
+ AC_INIT(configure.in)
6
+
7
+ dnl Delete the old cache
8
+ rm -f config.cache
9
+
10
+ AM_INIT_AUTOMAKE(libcharguess, 1.0b)
11
+ AM_MAINTAINER_MODE
12
+ AM_CONFIG_HEADER(config.h)
13
+
14
+ # AC_ISC_POSIX
15
+ AC_PROG_CC
16
+ AC_PROG_CPP
17
+ AC_PROG_CXX
18
+ AM_PROG_CC_STDC
19
+ AC_HEADER_STDC
20
+ AC_PROG_RANLIB
21
+ # AC_PROG_YACC
22
+ AC_C_INLINE
23
+ AC_C_CONST
24
+
25
+ # ALL_LINGUAS="es fr nl"
26
+ # AM_GLIB_GNU_GETTEXT
27
+
28
+
29
+ dnl ---------------------------------------------------------------------------
30
+ dnl Check configure command line options
31
+ dnl ---------------------------------------------------------------------------
32
+
33
+ dnl Set PACKAGE_SOURCE_DIR in config.h.
34
+ packagesrcdir=`cd $srcdir && pwd`
35
+ AC_DEFINE_UNQUOTED(PACKAGE_SOURCE_DIR,
36
+ "${packagesrcdir}",
37
+ [Define which directory should be used for package source.])
38
+
39
+ dnl Use -Wall if we have gcc.
40
+ changequote(,)dnl
41
+ if test "x$GCC" = "xyes"; then
42
+ case " $CFLAGS " in
43
+ *[\ \ ]-Wall[\ \ ]*) ;;
44
+ *) CFLAGS="$CFLAGS -Wall" ;;
45
+ esac
46
+ fi
47
+ changequote([,])dnl
48
+
49
+ AC_OUTPUT( Makefile )
@@ -0,0 +1,472 @@
1
+ #! /bin/sh
2
+
3
+ # depcomp - compile a program generating dependencies as side-effects
4
+ # Copyright 1999, 2000 Free Software Foundation, Inc.
5
+
6
+ # This program is free software; you can redistribute it and/or modify
7
+ # it under the terms of the GNU General Public License as published by
8
+ # the Free Software Foundation; either version 2, or (at your option)
9
+ # any later version.
10
+
11
+ # This program is distributed in the hope that it will be useful,
12
+ # but WITHOUT ANY WARRANTY; without even the implied warranty of
13
+ # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14
+ # GNU General Public License for more details.
15
+
16
+ # You should have received a copy of the GNU General Public License
17
+ # along with this program; if not, write to the Free Software
18
+ # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
19
+ # 02111-1307, USA.
20
+
21
+ # As a special exception to the GNU General Public License, if you
22
+ # distribute this file as part of a program that contains a
23
+ # configuration script generated by Autoconf, you may include it under
24
+ # the same distribution terms that you use for the rest of that program.
25
+
26
+ # Originally written by Alexandre Oliva <oliva@dcc.unicamp.br>.
27
+
28
+ if test -z "$depmode" || test -z "$source" || test -z "$object"; then
29
+ echo "depcomp: Variables source, object and depmode must be set" 1>&2
30
+ exit 1
31
+ fi
32
+ # `libtool' can also be set to `yes' or `no'.
33
+
34
+ if test -z "$depfile"; then
35
+ base=`echo "$object" | sed -e 's,^.*/,,' -e 's,\.\([^.]*\)$,.P\1,'`
36
+ dir=`echo "$object" | sed 's,/.*$,/,'`
37
+ if test "$dir" = "$object"; then
38
+ dir=
39
+ fi
40
+ # FIXME: should be _deps on DOS.
41
+ depfile="$dir.deps/$base"
42
+ fi
43
+
44
+ tmpdepfile=${tmpdepfile-`echo "$depfile" | sed 's/\.\([^.]*\)$/.T\1/'`}
45
+
46
+ rm -f "$tmpdepfile"
47
+
48
+ # Some modes work just like other modes, but use different flags. We
49
+ # parameterize here, but still list the modes in the big case below,
50
+ # to make depend.m4 easier to write. Note that we *cannot* use a case
51
+ # here, because this file can only contain one case statement.
52
+ if test "$depmode" = hp; then
53
+ # HP compiler uses -M and no extra arg.
54
+ gccflag=-M
55
+ depmode=gcc
56
+ fi
57
+
58
+ if test "$depmode" = dashXmstdout; then
59
+ # This is just like dashmstdout with a different argument.
60
+ dashmflag=-xM
61
+ depmode=dashmstdout
62
+ fi
63
+
64
+ case "$depmode" in
65
+ gcc3)
66
+ ## gcc 3 implements dependency tracking that does exactly what
67
+ ## we want. Yay! Note: for some reason libtool 1.4 doesn't like
68
+ ## it if -MD -MP comes after the -MF stuff. Hmm.
69
+ "$@" -MT "$object" -MD -MP -MF "$tmpdepfile"
70
+ stat=$?
71
+ if test $stat -eq 0; then :
72
+ else
73
+ rm -f "$tmpdepfile"
74
+ exit $stat
75
+ fi
76
+ mv "$tmpdepfile" "$depfile"
77
+ ;;
78
+
79
+ gcc)
80
+ ## There are various ways to get dependency output from gcc. Here's
81
+ ## why we pick this rather obscure method:
82
+ ## - Don't want to use -MD because we'd like the dependencies to end
83
+ ## up in a subdir. Having to rename by hand is ugly.
84
+ ## (We might end up doing this anyway to support other compilers.)
85
+ ## - The DEPENDENCIES_OUTPUT environment variable makes gcc act like
86
+ ## -MM, not -M (despite what the docs say).
87
+ ## - Using -M directly means running the compiler twice (even worse
88
+ ## than renaming).
89
+ if test -z "$gccflag"; then
90
+ gccflag=-MD,
91
+ fi
92
+ "$@" -Wp,"$gccflag$tmpdepfile"
93
+ stat=$?
94
+ if test $stat -eq 0; then :
95
+ else
96
+ rm -f "$tmpdepfile"
97
+ exit $stat
98
+ fi
99
+ rm -f "$depfile"
100
+ echo "$object : \\" > "$depfile"
101
+ alpha=ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz
102
+ ## The second -e expression handles DOS-style file names with drive letters.
103
+ sed -e 's/^[^:]*: / /' \
104
+ -e 's/^['$alpha']:\/[^:]*: / /' < "$tmpdepfile" >> "$depfile"
105
+ ## This next piece of magic avoids the `deleted header file' problem.
106
+ ## The problem is that when a header file which appears in a .P file
107
+ ## is deleted, the dependency causes make to die (because there is
108
+ ## typically no way to rebuild the header). We avoid this by adding
109
+ ## dummy dependencies for each header file. Too bad gcc doesn't do
110
+ ## this for us directly.
111
+ tr ' ' '
112
+ ' < "$tmpdepfile" |
113
+ ## Some versions of gcc put a space before the `:'. On the theory
114
+ ## that the space means something, we add a space to the output as
115
+ ## well.
116
+ ## Some versions of the HPUX 10.20 sed can't process this invocation
117
+ ## correctly. Breaking it into two sed invocations is a workaround.
118
+ sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile"
119
+ rm -f "$tmpdepfile"
120
+ ;;
121
+
122
+ hp)
123
+ # This case exists only to let depend.m4 do its work. It works by
124
+ # looking at the text of this script. This case will never be run,
125
+ # since it is checked for above.
126
+ exit 1
127
+ ;;
128
+
129
+ sgi)
130
+ if test "$libtool" = yes; then
131
+ "$@" "-Wp,-MDupdate,$tmpdepfile"
132
+ else
133
+ "$@" -MDupdate "$tmpdepfile"
134
+ fi
135
+ stat=$?
136
+ if test $stat -eq 0; then :
137
+ else
138
+ rm -f "$tmpdepfile"
139
+ exit $stat
140
+ fi
141
+ rm -f "$depfile"
142
+
143
+ if test -f "$tmpdepfile"; then # yes, the sourcefile depend on other files
144
+ echo "$object : \\" > "$depfile"
145
+
146
+ # Clip off the initial element (the dependent). Don't try to be
147
+ # clever and replace this with sed code, as IRIX sed won't handle
148
+ # lines with more than a fixed number of characters (4096 in
149
+ # IRIX 6.2 sed, 8192 in IRIX 6.5). We also remove comment lines;
150
+ # the IRIX cc adds comments like `#:fec' to the end of the
151
+ # dependency line.
152
+ tr ' ' '
153
+ ' < "$tmpdepfile" \
154
+ | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' | \
155
+ tr '
156
+ ' ' ' >> $depfile
157
+ echo >> $depfile
158
+
159
+ # The second pass generates a dummy entry for each header file.
160
+ tr ' ' '
161
+ ' < "$tmpdepfile" \
162
+ | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' -e 's/$/:/' \
163
+ >> $depfile
164
+ else
165
+ # The sourcefile does not contain any dependencies, so just
166
+ # store a dummy comment line, to avoid errors with the Makefile
167
+ # "include basename.Plo" scheme.
168
+ echo "#dummy" > "$depfile"
169
+ fi
170
+ rm -f "$tmpdepfile"
171
+ ;;
172
+
173
+ aix)
174
+ # The C for AIX Compiler uses -M and outputs the dependencies
175
+ # in a .u file. This file always lives in the current directory.
176
+ # Also, the AIX compiler puts `$object:' at the start of each line;
177
+ # $object doesn't have directory information.
178
+ stripped=`echo "$object" | sed -e 's,^.*/,,' -e 's/\(.*\)\..*$/\1/'`
179
+ tmpdepfile="$stripped.u"
180
+ outname="$stripped.o"
181
+ if test "$libtool" = yes; then
182
+ "$@" -Wc,-M
183
+ else
184
+ "$@" -M
185
+ fi
186
+
187
+ stat=$?
188
+ if test $stat -eq 0; then :
189
+ else
190
+ rm -f "$tmpdepfile"
191
+ exit $stat
192
+ fi
193
+
194
+ if test -f "$tmpdepfile"; then
195
+ # Each line is of the form `foo.o: dependent.h'.
196
+ # Do two passes, one to just change these to
197
+ # `$object: dependent.h' and one to simply `dependent.h:'.
198
+ sed -e "s,^$outname:,$object :," < "$tmpdepfile" > "$depfile"
199
+ sed -e "s,^$outname: \(.*\)$,\1:," < "$tmpdepfile" >> "$depfile"
200
+ else
201
+ # The sourcefile does not contain any dependencies, so just
202
+ # store a dummy comment line, to avoid errors with the Makefile
203
+ # "include basename.Plo" scheme.
204
+ echo "#dummy" > "$depfile"
205
+ fi
206
+ rm -f "$tmpdepfile"
207
+ ;;
208
+
209
+ icc)
210
+ # Intel's C compiler understands `-MD -MF file'. However on
211
+ # icc -MD -MF foo.d -c -o sub/foo.o sub/foo.c
212
+ # ICC 7.0 will fill foo.d with something like
213
+ # foo.o: sub/foo.c
214
+ # foo.o: sub/foo.h
215
+ # which is wrong. We want:
216
+ # sub/foo.o: sub/foo.c
217
+ # sub/foo.o: sub/foo.h
218
+ # sub/foo.c:
219
+ # sub/foo.h:
220
+ # ICC 7.1 will output
221
+ # foo.o: sub/foo.c sub/foo.h
222
+ # and will wrap long lines using \ :
223
+ # foo.o: sub/foo.c ... \
224
+ # sub/foo.h ... \
225
+ # ...
226
+
227
+ "$@" -MD -MF "$tmpdepfile"
228
+ stat=$?
229
+ if test $stat -eq 0; then :
230
+ else
231
+ rm -f "$tmpdepfile"
232
+ exit $stat
233
+ fi
234
+ rm -f "$depfile"
235
+ # Each line is of the form `foo.o: dependent.h',
236
+ # or `foo.o: dep1.h dep2.h \', or ` dep3.h dep4.h \'.
237
+ # Do two passes, one to just change these to
238
+ # `$object: dependent.h' and one to simply `dependent.h:'.
239
+ sed "s,^[^:]*:,$object :," < "$tmpdepfile" > "$depfile"
240
+ # Some versions of the HPUX 10.20 sed can't process this invocation
241
+ # correctly. Breaking it into two sed invocations is a workaround.
242
+ sed 's,^[^:]*: \(.*\)$,\1,;s/^\\$//;/^$/d;/:$/d' < "$tmpdepfile" |
243
+ sed -e 's/$/ :/' >> "$depfile"
244
+ rm -f "$tmpdepfile"
245
+ ;;
246
+
247
+ tru64)
248
+ # The Tru64 compiler uses -MD to generate dependencies as a side
249
+ # effect. `cc -MD -o foo.o ...' puts the dependencies into `foo.o.d'.
250
+ # At least on Alpha/Redhat 6.1, Compaq CCC V6.2-504 seems to put
251
+ # dependencies in `foo.d' instead, so we check for that too.
252
+ # Subdirectories are respected.
253
+ dir=`echo "$object" | sed -e 's|/[^/]*$|/|'`
254
+ test "x$dir" = "x$object" && dir=
255
+ base=`echo "$object" | sed -e 's|^.*/||' -e 's/\.o$//' -e 's/\.lo$//'`
256
+
257
+ if test "$libtool" = yes; then
258
+ tmpdepfile1="$dir.libs/$base.lo.d"
259
+ tmpdepfile2="$dir.libs/$base.d"
260
+ "$@" -Wc,-MD
261
+ else
262
+ tmpdepfile1="$dir$base.o.d"
263
+ tmpdepfile2="$dir$base.d"
264
+ "$@" -MD
265
+ fi
266
+
267
+ stat=$?
268
+ if test $stat -eq 0; then :
269
+ else
270
+ rm -f "$tmpdepfile1" "$tmpdepfile2"
271
+ exit $stat
272
+ fi
273
+
274
+ if test -f "$tmpdepfile1"; then
275
+ tmpdepfile="$tmpdepfile1"
276
+ else
277
+ tmpdepfile="$tmpdepfile2"
278
+ fi
279
+ if test -f "$tmpdepfile"; then
280
+ sed -e "s,^.*\.[a-z]*:,$object:," < "$tmpdepfile" > "$depfile"
281
+ # That's a space and a tab in the [].
282
+ sed -e 's,^.*\.[a-z]*:[ ]*,,' -e 's,$,:,' < "$tmpdepfile" >> "$depfile"
283
+ else
284
+ echo "#dummy" > "$depfile"
285
+ fi
286
+ rm -f "$tmpdepfile"
287
+ ;;
288
+
289
+ #nosideeffect)
290
+ # This comment above is used by automake to tell side-effect
291
+ # dependency tracking mechanisms from slower ones.
292
+
293
+ dashmstdout)
294
+ # Important note: in order to support this mode, a compiler *must*
295
+ # always write the proprocessed file to stdout, regardless of -o.
296
+ "$@" || exit $?
297
+
298
+ # Remove the call to Libtool.
299
+ if test "$libtool" = yes; then
300
+ while test $1 != '--mode=compile'; do
301
+ shift
302
+ done
303
+ shift
304
+ fi
305
+
306
+ # Remove `-o $object'.
307
+ IFS=" "
308
+ for arg
309
+ do
310
+ case $arg in
311
+ -o)
312
+ shift
313
+ ;;
314
+ $object)
315
+ shift
316
+ ;;
317
+ *)
318
+ set fnord "$@" "$arg"
319
+ shift # fnord
320
+ shift # $arg
321
+ ;;
322
+ esac
323
+ done
324
+
325
+ test -z "$dashmflag" && dashmflag=-M
326
+ # Require at least two characters before searching for `:'
327
+ # in the target name. This is to cope with DOS-style filenames:
328
+ # a dependency such as `c:/foo/bar' could be seen as target `c' otherwise.
329
+ "$@" $dashmflag |
330
+ sed 's:^[ ]*[^: ][^:][^:]*\:[ ]*:'"$object"'\: :' > "$tmpdepfile"
331
+ rm -f "$depfile"
332
+ cat < "$tmpdepfile" > "$depfile"
333
+ tr ' ' '
334
+ ' < "$tmpdepfile" | \
335
+ ## Some versions of the HPUX 10.20 sed can't process this invocation
336
+ ## correctly. Breaking it into two sed invocations is a workaround.
337
+ sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile"
338
+ rm -f "$tmpdepfile"
339
+ ;;
340
+
341
+ dashXmstdout)
342
+ # This case only exists to satisfy depend.m4. It is never actually
343
+ # run, as this mode is specially recognized in the preamble.
344
+ exit 1
345
+ ;;
346
+
347
+ makedepend)
348
+ "$@" || exit $?
349
+ # Remove any Libtool call
350
+ if test "$libtool" = yes; then
351
+ while test $1 != '--mode=compile'; do
352
+ shift
353
+ done
354
+ shift
355
+ fi
356
+ # X makedepend
357
+ shift
358
+ cleared=no
359
+ for arg in "$@"; do
360
+ case $cleared in
361
+ no)
362
+ set ""; shift
363
+ cleared=yes ;;
364
+ esac
365
+ case "$arg" in
366
+ -D*|-I*)
367
+ set fnord "$@" "$arg"; shift ;;
368
+ # Strip any option that makedepend may not understand. Remove
369
+ # the object too, otherwise makedepend will parse it as a source file.
370
+ -*|$object)
371
+ ;;
372
+ *)
373
+ set fnord "$@" "$arg"; shift ;;
374
+ esac
375
+ done
376
+ obj_suffix="`echo $object | sed 's/^.*\././'`"
377
+ touch "$tmpdepfile"
378
+ ${MAKEDEPEND-makedepend} -o"$obj_suffix" -f"$tmpdepfile" "$@"
379
+ rm -f "$depfile"
380
+ cat < "$tmpdepfile" > "$depfile"
381
+ sed '1,2d' "$tmpdepfile" | tr ' ' '
382
+ ' | \
383
+ ## Some versions of the HPUX 10.20 sed can't process this invocation
384
+ ## correctly. Breaking it into two sed invocations is a workaround.
385
+ sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile"
386
+ rm -f "$tmpdepfile" "$tmpdepfile".bak
387
+ ;;
388
+
389
+ cpp)
390
+ # Important note: in order to support this mode, a compiler *must*
391
+ # always write the proprocessed file to stdout.
392
+ "$@" || exit $?
393
+
394
+ # Remove the call to Libtool.
395
+ if test "$libtool" = yes; then
396
+ while test $1 != '--mode=compile'; do
397
+ shift
398
+ done
399
+ shift
400
+ fi
401
+
402
+ # Remove `-o $object'.
403
+ IFS=" "
404
+ for arg
405
+ do
406
+ case $arg in
407
+ -o)
408
+ shift
409
+ ;;
410
+ $object)
411
+ shift
412
+ ;;
413
+ *)
414
+ set fnord "$@" "$arg"
415
+ shift # fnord
416
+ shift # $arg
417
+ ;;
418
+ esac
419
+ done
420
+
421
+ "$@" -E |
422
+ sed -n '/^# [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' |
423
+ sed '$ s: \\$::' > "$tmpdepfile"
424
+ rm -f "$depfile"
425
+ echo "$object : \\" > "$depfile"
426
+ cat < "$tmpdepfile" >> "$depfile"
427
+ sed < "$tmpdepfile" '/^$/d;s/^ //;s/ \\$//;s/$/ :/' >> "$depfile"
428
+ rm -f "$tmpdepfile"
429
+ ;;
430
+
431
+ msvisualcpp)
432
+ # Important note: in order to support this mode, a compiler *must*
433
+ # always write the proprocessed file to stdout, regardless of -o,
434
+ # because we must use -o when running libtool.
435
+ "$@" || exit $?
436
+ IFS=" "
437
+ for arg
438
+ do
439
+ case "$arg" in
440
+ "-Gm"|"/Gm"|"-Gi"|"/Gi"|"-ZI"|"/ZI")
441
+ set fnord "$@"
442
+ shift
443
+ shift
444
+ ;;
445
+ *)
446
+ set fnord "$@" "$arg"
447
+ shift
448
+ shift
449
+ ;;
450
+ esac
451
+ done
452
+ "$@" -E |
453
+ sed -n '/^#line [0-9][0-9]* "\([^"]*\)"/ s::echo "`cygpath -u \\"\1\\"`":p' | sort | uniq > "$tmpdepfile"
454
+ rm -f "$depfile"
455
+ echo "$object : \\" > "$depfile"
456
+ . "$tmpdepfile" | sed 's% %\\ %g' | sed -n '/^\(.*\)$/ s:: \1 \\:p' >> "$depfile"
457
+ echo " " >> "$depfile"
458
+ . "$tmpdepfile" | sed 's% %\\ %g' | sed -n '/^\(.*\)$/ s::\1\::p' >> "$depfile"
459
+ rm -f "$tmpdepfile"
460
+ ;;
461
+
462
+ none)
463
+ exec "$@"
464
+ ;;
465
+
466
+ *)
467
+ echo "Unknown depmode $depmode" 1>&2
468
+ exit 1
469
+ ;;
470
+ esac
471
+
472
+ exit 0
@@ -0,0 +1,32 @@
1
+ #!/usr/bin/perl
2
+ eval 'exec perl5 -S $0 ${1+"$@"}'
3
+ if $running_under_some_shell;
4
+
5
+ my @DEVS = (
6
+ "Mozilla",
7
+ "St�phane Corb�",
8
+ );
9
+
10
+ my $COPYRIGHT = "Copyright \\(c\\)";
11
+ $^I = '';
12
+
13
+ my $year = 1900 + (localtime(time))[5];
14
+
15
+ while (<>) {
16
+ my $found = 0;
17
+ if (/$COPYRIGHT/o) {
18
+ foreach my $dev (@DEVS) {
19
+ $found++ if /$dev/;
20
+ last if $found;
21
+ }
22
+ }
23
+ if ($found) {
24
+ if (/$COPYRIGHT (\d+),/o) {
25
+ s/^(.*?$COPYRIGHT \d+),/$1-$year,/o if $year > $1;
26
+ } elsif (/$COPYRIGHT \d+-(\d+),/o) {
27
+ s/^(.*?$COPYRIGHT \d+)-\d+,/$1-$year,/o if $year > $1;
28
+ }
29
+ }
30
+ print;
31
+ }
32
+