File: makevcdist.pl

package info (click to toggle)
gnugo 3.8-5
  • links: PTS
  • area: main
  • in suites: wheezy
  • size: 17,372 kB
  • sloc: ansic: 56,445; perl: 3,771; lisp: 2,789; sh: 730; makefile: 701; python: 682; awk: 113; sed: 22
file content (110 lines) | stat: -rwxr-xr-x 2,355 bytes parent folder | download | duplicates (7)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
#!/usr/bin/perl
# This script morphs config.h.in into config.vcin

use strict;
use warnings;

my %defaults =
 ( CHINESE_RULES => 0,
   RESIGNATION_ALLOWED => 1,
   HASHING_SCHEME => 2,
   DEFAULT_LEVEL => 10,
   DEFAULT_MEMORY => 8,
   ENABLE_SOCKET_SUPPORT => 1,
   ALTERNATE_CONNECTIONS => 1,
   SEMEAI_NODE_LIMIT => 500,
   OWL_NODE_LIMIT => 1000,
   EXPERIMENTAL_SEMEAI => 1,
   EXPERIMENTAL_OWL_EXT => 0,
   EXPERIMENTAL_CONNECTIONS => 1,
   LARGE_SCALE => 0,
   GRID_OPT => 1,
   OWL_THREATS => 0,
   USE_BREAK_IN => 1,
   COSMIC_GNUGO => 0,
   ORACLE => 0,
   USE_VALGRIND => 0,
   READLINE => 0);

my @skip = qw/
  GNU_PACKAGE 
  SIZEOF_INT 
  SIZEOF_LONG 
  GNUGO_PATH
  PACKAGE
  SIZEOF_INT
  SIZEOF_LONG
  const
  ANSI_COLOR
  TERMINFO
  VERSION
  TIME_WITH_SYS_TIME
  /;

open (CONFIGH, "config.h.in") or
      die "Couldn't open config.h.in: $!";
  
open (CONFIGVC, ">config.vcin")  or
      die "Couldn't overwrite config.vcin: $!";
  
print CONFIGVC 
q%/* This is the Microsoft Visual C++ version of config.h        *
 * Replace the distributed config.h with this file             *
 * See config.h.in for comments on the meanings of most of the *
 * defines.  This file is autogenerated.  Do not modify it.    *
 * See instead, the perl script makevcdist.pl                  */

#define HAVE_CRTDBG_H 1
#define HAVE_WINSOCK_IO_H 1
#define HAVE__VSNPRINTF 1

%;

  
my $comment = "";  
while (<CONFIGH>) {
  s/\s*$//ms;
  if (/^\s*$/) { next; }
  if (m@^/[*].*@) {
    $comment = $_;
    next;
  }
  if (/\*\/\s*$/) {
    $comment .= "\n$_";
    next;
  }
  if (/HAVE_/) { next; }
  if (! /^#undef\s+([^ ]*)\s*$/ms) {
    warn "Don't understand: $_";
    next;
  }
  my $define = $1;
  if (!defined($defaults{$define})) {
    my $found =0;
    foreach (@skip) {$found = 1 if $_ eq $define;}
    warn "Unknown define: $define" unless $found;
    next;
  }
  print CONFIGVC "$comment\n";
  print CONFIGVC "#define $define $defaults{$define}\n\n";
}

print CONFIGVC
q%
/* Version number of package */
#define PACKAGE "gnugo"

/* The concatenation of the strings "GNU ", and PACKAGE.  */
#define GNU_PACKAGE "GNU " PACKAGE

/* The number of bytes in a int.  */
#define SIZEOF_INT 4

/* The number of bytes in a long.  */
#define SIZEOF_LONG 4

/* Version number of package */
#define VERSION "@VERSION@"

#pragma warning(disable: 4244 4305)
%;