intl/uconv/tools/genimpldefine.pl

changeset 0
6474c204b198
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/intl/uconv/tools/genimpldefine.pl	Wed Dec 31 06:09:35 2014 +0100
     1.3 @@ -0,0 +1,53 @@
     1.4 +#!/user/local/bin/perl
     1.5 +# -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
     1.6 +#
     1.7 +# This Source Code Form is subject to the terms of the Mozilla Public
     1.8 +# License, v. 2.0. If a copy of the MPL was not distributed with this
     1.9 +# file, You can obtain one at http://mozilla.org/MPL/2.0/.
    1.10 +
    1.11 +$name = "ucvlatin";
    1.12 +$dir = "./";
    1.13 +
    1.14 +sub printnpl()
    1.15 +{
    1.16 +$npl = <<END_OF_NPL;
    1.17 +/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
    1.18 +/* This Source Code Form is subject to the terms of the Mozilla Public
    1.19 + * License, v. 2.0. If a copy of the MPL was not distributed with this
    1.20 + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
    1.21 +END_OF_NPL
    1.22 +print   $npl;
    1.23 +}
    1.24 +
    1.25 +sub finddefine()
    1.26 +{
    1.27 +  my($classname, $definename) = (@_);
    1.28 +  $cmd = 'egrep ' . $classname .  ' ' . $dir . '*.h ' . $dir . '*.cpp | egrep "public" | egrep -v "Support[.]"' . '&> /dev/null';
    1.29 +  if( system($cmd)) {
    1.30 +    print   "\/\/ ";
    1.31 +  }
    1.32 +  print   "#define " . $definename . "\n";
    1.33 +}
    1.34 +
    1.35 +
    1.36 +
    1.37 +&printnpl();
    1.38 +print   "\n";
    1.39 +print   "#ifndef " . $name . "config_h__\n";
    1.40 +print   "#define " . $name . "config_h__\n";
    1.41 +print   "\n";
    1.42 +print   "\/* This file is generated by running mozilla/intl/uconv/tools/genimpldefine.pl on unix */\n";
    1.43 +
    1.44 +&finddefine( "nsBasicDecoderSupport", "IMPL_NSBASICDECODER");
    1.45 +&finddefine( "nsBufferDecoderSupport", "IMPL_NSBUFFERDECODER");
    1.46 +&finddefine( "nsTableDecoderSupport", "IMPL_NSTABLEDECODER");
    1.47 +&finddefine( "nsMultiTableDecoderSupport", "IMPL_NSMULTITABLEDECODER");
    1.48 +&finddefine( "nsOneByteDecoderSupport", "IMPL_NSONEBYTEDECODER");
    1.49 +&finddefine( "nsBasicEncoder", "IMPL_NSBASICENCODER");
    1.50 +&finddefine( "nsEncoderSupport", "IMPL_NSENCODER");
    1.51 +&finddefine( "nsTableEncoderSupport", "IMPL_NSTABLEENCODER");
    1.52 +&finddefine( "nsMultiTableEncoderSupport", "IMPL_NSMULTITABLEENCODER");
    1.53 +print   "\n";
    1.54 +print   "#include \"" . $name . "rules.h\"\n";
    1.55 +print   "\n";
    1.56 +print   "#endif \/*" . $name . "config_h__ *\/\n";

mercurial