|
1 #!/user/local/bin/perl |
|
2 # -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- |
|
3 # |
|
4 # This Source Code Form is subject to the terms of the Mozilla Public |
|
5 # License, v. 2.0. If a copy of the MPL was not distributed with this |
|
6 # file, You can obtain one at http://mozilla.org/MPL/2.0/. |
|
7 |
|
8 $name = "ucvlatin"; |
|
9 $dir = "./"; |
|
10 |
|
11 sub printnpl() |
|
12 { |
|
13 $npl = <<END_OF_NPL; |
|
14 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ |
|
15 /* This Source Code Form is subject to the terms of the Mozilla Public |
|
16 * License, v. 2.0. If a copy of the MPL was not distributed with this |
|
17 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ |
|
18 END_OF_NPL |
|
19 print $npl; |
|
20 } |
|
21 |
|
22 sub finddefine() |
|
23 { |
|
24 my($classname, $definename) = (@_); |
|
25 $cmd = 'egrep ' . $classname . ' ' . $dir . '*.h ' . $dir . '*.cpp | egrep "public" | egrep -v "Support[.]"' . '&> /dev/null'; |
|
26 if( system($cmd)) { |
|
27 print "\/\/ "; |
|
28 } |
|
29 print "#define " . $definename . "\n"; |
|
30 } |
|
31 |
|
32 |
|
33 |
|
34 &printnpl(); |
|
35 print "\n"; |
|
36 print "#ifndef " . $name . "config_h__\n"; |
|
37 print "#define " . $name . "config_h__\n"; |
|
38 print "\n"; |
|
39 print "\/* This file is generated by running mozilla/intl/uconv/tools/genimpldefine.pl on unix */\n"; |
|
40 |
|
41 &finddefine( "nsBasicDecoderSupport", "IMPL_NSBASICDECODER"); |
|
42 &finddefine( "nsBufferDecoderSupport", "IMPL_NSBUFFERDECODER"); |
|
43 &finddefine( "nsTableDecoderSupport", "IMPL_NSTABLEDECODER"); |
|
44 &finddefine( "nsMultiTableDecoderSupport", "IMPL_NSMULTITABLEDECODER"); |
|
45 &finddefine( "nsOneByteDecoderSupport", "IMPL_NSONEBYTEDECODER"); |
|
46 &finddefine( "nsBasicEncoder", "IMPL_NSBASICENCODER"); |
|
47 &finddefine( "nsEncoderSupport", "IMPL_NSENCODER"); |
|
48 &finddefine( "nsTableEncoderSupport", "IMPL_NSTABLEENCODER"); |
|
49 &finddefine( "nsMultiTableEncoderSupport", "IMPL_NSMULTITABLEENCODER"); |
|
50 print "\n"; |
|
51 print "#include \"" . $name . "rules.h\"\n"; |
|
52 print "\n"; |
|
53 print "#endif \/*" . $name . "config_h__ *\/\n"; |