207c49207c104a3c713d53cb90617df62790477f
[p5sagit/p5-mst-13.2.git] / patchlevel.h
1 /*    patchlevel.h
2  *
3  *    Copyright (C) 1993, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
4  *    2003, 2004, 2005, 2006, 2007, 2008, 2009, by Larry Wall and others
5  *
6  *    You may distribute under the terms of either the GNU General Public
7  *    License or the Artistic License, as specified in the README file.
8  *
9  */
10
11 #ifndef __PATCHLEVEL_H_INCLUDED__
12
13 /* do not adjust the whitespace! Configure expects the numbers to be
14  * exactly on the third column */
15
16 #define PERL_REVISION   5               /* age */
17 #define PERL_VERSION    11              /* epoch */
18 #define PERL_SUBVERSION 0               /* generation */
19
20 #define PERL_VERSION_STRING     STRINGIFY(PERL_REVISION) "." \
21                                 STRINGIFY(PERL_VERSION) "." \
22                                 STRINGIFY(PERL_SUBVERSION)
23
24 /* The following numbers describe the earliest compatible version of
25    Perl ("compatibility" here being defined as sufficient binary/API
26    compatibility to run XS code built with the older version).
27    Normally this should not change across maintenance releases.
28
29    Note that this only refers to an out-of-the-box build.  Many non-default
30    options such as usemultiplicity tend to break binary compatibility
31    more often.
32
33    This is used by Configure et al to figure out 
34    PERL_INC_VERSION_LIST, which lists version libraries
35    to include in @INC.  See INSTALL for how this works.
36 */
37 #define PERL_API_REVISION       5       /* Adjust manually as needed.  */
38 #define PERL_API_VERSION        11      /* Adjust manually as needed.  */
39 #define PERL_API_SUBVERSION     0       /* Adjust manually as needed.  */
40 /*
41    XXX Note:  The selection of non-default Configure options, such
42    as -Duselonglong may invalidate these settings.  Currently, Configure
43    does not adequately test for this.   A.D.  Jan 13, 2000
44 */
45
46 #define __PATCHLEVEL_H_INCLUDED__
47 #endif
48
49 /*
50         local_patches -- list of locally applied less-than-subversion patches.
51         If you're distributing such a patch, please give it a name and a
52         one-line description, placed just before the last NULL in the array
53         below.  If your patch fixes a bug in the perlbug database, please
54         mention the bugid.  If your patch *IS* dependent on a prior patch,
55         please place your applied patch line after its dependencies. This
56         will help tracking of patch dependencies.
57
58         Please either use 'diff --unified=0' if your diff supports
59         that or edit the hunk of the diff output which adds your patch
60         to this list, to remove context lines which would give patch
61         problems. For instance, if the original context diff is
62
63            *** patchlevel.h.orig        <date here>
64            --- patchlevel.h     <date here>
65            *** 38,43 ***
66            --- 38,44 ---
67                 ,"FOO1235 - some patch"
68                 ,"BAR3141 - another patch"
69                 ,"BAZ2718 - and another patch"
70            +    ,"MINE001 - my new patch"
71                 ,NULL
72              };
73         
74         please change it to 
75            *** patchlevel.h.orig        <date here>
76            --- patchlevel.h     <date here>
77            *** 41,43 ***
78            --- 41,44 ---
79            +    ,"MINE001 - my new patch"
80                 ,NULL
81              };
82         
83         (Note changes to line numbers as well as removal of context lines.)
84         This will prevent patch from choking if someone has previously
85         applied different patches than you.
86
87         History has shown that nobody distributes patches that also
88         modify patchlevel.h. Do it yourself. The following perl
89         program can be used to add a comment to patchlevel.h:
90
91 #!perl
92 die "Usage: perl -x patchlevel.h comment ..." unless @ARGV;
93 open PLIN, "patchlevel.h" or die "Couldn't open patchlevel.h : $!";
94 open PLOUT, ">patchlevel.new" or die "Couldn't write on patchlevel.new : $!";
95 my $seen=0;
96 while (<PLIN>) {
97     if (/\t,NULL/ and $seen) {
98        while (my $c = shift @ARGV){
99             print PLOUT qq{\t,"$c"\n};
100        }
101     }
102     $seen++ if /local_patches\[\]/;
103     print PLOUT;
104 }
105 close PLOUT or die "Couldn't close filehandle writing to patchlevel.new : $!";
106 close PLIN or die "Couldn't close filehandle reading from patchlevel.h : $!";
107 close DATA; # needed to allow unlink to work win32.
108 unlink "patchlevel.bak" or warn "Couldn't unlink patchlevel.bak : $!"
109   if -e "patchlevel.bak";
110 rename "patchlevel.h", "patchlevel.bak" or
111   die "Couldn't rename patchlevel.h to patchlevel.bak : $!";
112 rename "patchlevel.new", "patchlevel.h" or
113   die "Couldn't rename patchlevel.new to patchlevel.h : $!";
114 __END__
115
116 Please keep empty lines below so that context diffs of this file do
117 not ever collect the lines belonging to local_patches() into the same
118 hunk.
119
120  */
121
122 #if !defined(PERL_PATCHLEVEL_H_IMPLICIT) && !defined(LOCAL_PATCH_COUNT)
123 #  if defined(PERL_IS_MINIPERL)
124 #    define PERL_PATCHNUM "UNKNOWN-miniperl"
125 #    define PERL_GIT_UNCOMMITTED_CHANGES ,"UNKNOWN"
126 #    define PERL_GIT_UNPUSHED_COMMITS /*leave-this-comment*/
127 #  elif defined(PERL_MICRO)
128 #    define PERL_PATCHNUM "UNKNOWN-microperl"
129 #    define PERL_GIT_UNCOMMITTED_CHANGES ,"UNKNOWN"
130 #    define PERL_GIT_UNPUSHED_COMMITS /*leave-this-comment*/
131 #  else
132 #include "git_version.h"
133 #  endif
134 static const char * const local_patches[] = {
135         NULL
136         PERL_GIT_UNPUSHED_COMMITS       /* do not remove this line */
137         PERL_GIT_UNCOMMITTED_CHANGES    /* do not remove this line */
138         ,NULL
139 };
140
141
142
143 /* Initial space prevents this variable from being inserted in config.sh  */
144 #  define       LOCAL_PATCH_COUNT       \
145         ((int)(sizeof(local_patches)/sizeof(local_patches[0])-2))
146
147 /* the old terms of reference, add them only when explicitly included */
148 #define PATCHLEVEL              PERL_VERSION
149 #undef  SUBVERSION              /* OS/390 has a SUBVERSION in a system header */
150 #define SUBVERSION              PERL_SUBVERSION
151 #endif