/[pcre]/code/trunk/PrepareRelease
ViewVC logotype

Diff of /code/trunk/PrepareRelease

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 227 by ph10, Tue Aug 21 15:00:15 2007 UTC revision 1335 by ph10, Tue May 28 09:13:59 2013 UTC
# Line 4  Line 4 
4  # processing of the documentation, detrails files, and creates pcre.h.generic  # processing of the documentation, detrails files, and creates pcre.h.generic
5  # and config.h.generic (for use by builders who can't run ./configure).  # and config.h.generic (for use by builders who can't run ./configure).
6    
7  # You must run this script before runnning "make dist". It makes use of the  # You must run this script before runnning "make dist". If its first argument
8  # following files:  # is "doc", it stops after preparing the documentation. There are no other
9    # arguments. The script makes use of the following files:
10    
11  # 132html     A Perl script that converts a .1 or .3 man page into HTML. It  # 132html     A Perl script that converts a .1 or .3 man page into HTML. It
12  #             is called from MakeRelease. It "knows" the relevant troff  #             "knows" the relevant troff constructs that are used in the PCRE
13  #             constructs that are used in the PCRE man pages.  #             man pages.
14    
15    # CheckMan    A Perl script that checks man pages for typos in the mark up.
16    
17  # CleanTxt    A Perl script that cleans up the output of "nroff -man" by  # CleanTxt    A Perl script that cleans up the output of "nroff -man" by
18  #             removing backspaces and other redundant text so as to produce  #             removing backspaces and other redundant text so as to produce
# Line 22  Line 25 
25  #             when the HTML documentation is built. It works like this so that  #             when the HTML documentation is built. It works like this so that
26  #             doc/html can be deleted and re-created from scratch.  #             doc/html can be deleted and re-created from scratch.
27    
28    # README & NON-AUTOTOOLS-BUILD
29    #             These files are copied into the doc/html directory, with .txt
30    #             extensions so that they can by hyperlinked from the HTML
31    #             documentation, because some people just go to the HTML without
32    #             looking for text files.
33    
34    
35  # First, sort out the documentation  # First, sort out the documentation. Remove pcredemo.3 first because it won't
36    # pass the markup check (it is created below, using markup that none of the
37    # other pages use).
38    
39  cd doc  cd doc
40  echo Processing documentation  echo Processing documentation
41    
42    /bin/rm -f pcredemo.3
43    
44    # Check the remaining man pages
45    
46    perl ../CheckMan *.1 *.3
47    if [ $? != 0 ] ; then exit 1; fi
48    
49  # Make Text form of the documentation. It needs some mangling to make it  # Make Text form of the documentation. It needs some mangling to make it
50  # tidy for online reading. Concatenate all the .3 stuff, but omit the  # tidy for online reading. Concatenate all the .3 stuff, but omit the
51  # individual function pages.  # individual function pages.
# Line 37  cat <<End >pcre.txt Line 55  cat <<End >pcre.txt
55  This file contains a concatenation of the PCRE man pages, converted to plain  This file contains a concatenation of the PCRE man pages, converted to plain
56  text format for ease of searching with a text editor, or for use on systems  text format for ease of searching with a text editor, or for use on systems
57  that do not have a man page processor. The small individual files that give  that do not have a man page processor. The small individual files that give
58  synopses of each function in the library have not been included. There are  synopses of each function in the library have not been included. Neither has
59  separate text files for the pcregrep and pcretest commands.  the pcredemo program. There are separate text files for the pcregrep and
60    pcretest commands.
61  -----------------------------------------------------------------------------  -----------------------------------------------------------------------------
62    
63    
64  End  End
65    
66  echo "Making pcre.txt"  echo "Making pcre.txt"
67  for file in pcre pcrebuild pcrematching pcreapi pcrecallout pcrecompat \  for file in pcre pcre16 pcre32 pcrebuild pcrematching pcreapi pcrecallout \
68              pcrepattern pcresyntax pcrepartial pcreprecompile \              pcrecompat pcrepattern pcresyntax pcreunicode pcrejit pcrepartial \
69              pcreperform pcreposix pcrecpp pcresample pcrestack ; do              pcreprecompile pcreperform pcreposix pcrecpp pcresample \
70                pcrelimits pcrestack ; do
71    echo "  Processing $file.3"    echo "  Processing $file.3"
72    nroff -c -man $file.3 >$file.rawtxt    nroff -c -man $file.3 >$file.rawtxt
73    ../CleanTxt <$file.rawtxt >>pcre.txt    perl ../CleanTxt <$file.rawtxt >>pcre.txt
74    /bin/rm $file.rawtxt    /bin/rm $file.rawtxt
75    echo "------------------------------------------------------------------------------" >>pcre.txt    echo "------------------------------------------------------------------------------" >>pcre.txt
76    if [ "$file" != "pcresample" ] ; then    if [ "$file" != "pcresample" ] ; then
# Line 63  done Line 83  done
83  for file in pcretest pcregrep pcre-config ; do  for file in pcretest pcregrep pcre-config ; do
84    echo Making $file.txt    echo Making $file.txt
85    nroff -c -man $file.1 >$file.rawtxt    nroff -c -man $file.1 >$file.rawtxt
86    ../CleanTxt <$file.rawtxt >$file.txt    perl ../CleanTxt <$file.rawtxt >$file.txt
87    /bin/rm $file.rawtxt    /bin/rm $file.rawtxt
88  done  done
89    
90    
91    # Make pcredemo.3 from the pcredemo.c source file
92    
93    echo "Making pcredemo.3"
94    perl <<"END" >pcredemo.3
95      open(IN, "../pcredemo.c") || die "Failed to open pcredemo.c\n";
96      open(OUT, ">pcredemo.3") || die "Failed to open pcredemo.3\n";
97      print OUT ".\\\" Start example.\n" .
98                ".de EX\n" .
99                ".  nr mE \\\\n(.f\n" .
100                ".  nf\n" .
101                ".  nh\n" .
102                ".  ft CW\n" .
103                "..\n" .
104                ".\n" .
105                ".\n" .
106                ".\\\" End example.\n" .
107                ".de EE\n" .
108                ".  ft \\\\n(mE\n" .
109                ".  fi\n" .
110                ".  hy \\\\n(HY\n" .
111                "..\n" .
112                ".\n" .
113                ".EX\n" ;
114      while (<IN>)
115        {
116        s/\\/\\e/g;
117        print OUT;
118        }
119      print OUT ".EE\n";
120      close(IN);
121      close(OUT);
122    END
123    if [ $? != 0 ] ; then exit 1; fi
124    
125    
126  # Make HTML form of the documentation.  # Make HTML form of the documentation.
127    
128  echo "Making HTML documentation"  echo "Making HTML documentation"
129  /bin/rm html/*  /bin/rm html/*
130  cp index.html.src html/index.html  cp index.html.src html/index.html
131    cp ../README html/README.txt
132    cp ../NON-AUTOTOOLS-BUILD html/NON-AUTOTOOLS-BUILD.txt
133    
134  for file in *.1 ; do  for file in *.1 ; do
135    base=`basename $file .1`    base=`basename $file .1`
136    echo "  Making $base.html"    echo "  Making $base.html"
137    ../132html -toc $base <$file >html/$base.html    perl ../132html -toc $base <$file >html/$base.html
138  done  done
139    
140  # Exclude table of contents for function summaries. It seems that expr  # Exclude table of contents for function summaries. It seems that expr
141  # forces an anchored regex. Also exclude them for small pages that have  # forces an anchored regex. Also exclude them for small pages that have
142  # only one section.  # only one section.
143    
144  for file in *.3 ; do  for file in *.3 ; do
145    base=`basename $file .3`    base=`basename $file .3`
146    toc=-toc    toc=-toc
147    if [ `expr $base : '.*_'` -ne 0 ] ; then toc="" ; fi    if [ `expr $base : '.*_'` -ne 0 ] ; then toc="" ; fi
148    if [ "$base" = "pcresample" ] || \    if [ "$base" = "pcresample" ]  || \
149       [ "$base" = "pcrestack" ]  || \       [ "$base" = "pcrestack" ]   || \
150       [ "$base" = "pcrecompat" ] || \       [ "$base" = "pcrecompat" ]  || \
151       [ "$base" = "pcreperform" ] ; then       [ "$base" = "pcrelimits" ]  || \
152         [ "$base" = "pcreperform" ] || \
153         [ "$base" = "pcreunicode" ] ; then
154      toc=""      toc=""
155    fi    fi
156    echo "  Making $base.html"    echo "  Making $base.html"
157    ../132html $toc $base <$file >html/$base.html    perl ../132html $toc $base <$file >html/$base.html
158    if [ $? != 0 ] ; then exit 1; fi    if [ $? != 0 ] ; then exit 1; fi
159  done  done
160    
161  # End of documentation processing  # End of documentation processing; stop if only documentation required.
162    
163  cd ..  cd ..
164  echo Documentation done  echo Documentation done
165    if [ "$1" = "doc" ] ; then exit; fi
166    
167  # These files are detrailed; do not detrail the test data because there may be  # These files are detrailed; do not detrail the test data because there may be
168  # significant trailing spaces. The configure files are also omitted from the  # significant trailing spaces. Do not detrail RunTest.bat, because it has CRLF
169  # detrailing.  # line endings and the detrail script removes all trailing white space. The
170    # configure files are also omitted from the detrailing. We don't bother with
171    # those pcre[16|32]_xx files that just define COMPILE_PCRE16 and then #include the
172    # common file, because they aren't going to change.
173    
174  files="\  files="\
175    Makefile.am \    Makefile.am \
# Line 117  files="\ Line 181  files="\
181    AUTHORS \    AUTHORS \
182    NEWS \    NEWS \
183    NON-UNIX-USE \    NON-UNIX-USE \
184      NON-AUTOTOOLS-BUILD \
185    INSTALL \    INSTALL \
186    132html \    132html \
187    CleanTxt \    CleanTxt \
# Line 125  files="\ Line 190  files="\
190    CMakeLists.txt \    CMakeLists.txt \
191    RunGrepTest \    RunGrepTest \
192    RunTest \    RunTest \
   RunTest.bat \  
193    pcre-config.in \    pcre-config.in \
194    libpcre.pc.in \    libpcre.pc.in \
195      libpcre16.pc.in \
196      libpcre32.pc.in \
197      libpcreposix.pc.in \
198    libpcrecpp.pc.in \    libpcrecpp.pc.in \
   config.h \  
199    config.h.in \    config.h.in \
   pcre_printint.src \  
200    pcre_chartables.c.dist \    pcre_chartables.c.dist \
201    pcredemo.c \    pcredemo.c \
202    pcregrep.c \    pcregrep.c \
# Line 140  files="\ Line 205  files="\
205    pcreposix.c \    pcreposix.c \
206    pcreposix.h \    pcreposix.h \
207    pcre.h.in \    pcre.h.in \
208    pcre_internal.h    pcre_internal.h \
209      pcre_byte_order.c \
210    pcre_compile.c \    pcre_compile.c \
211    pcre_config.c \    pcre_config.c \
212    pcre_dfa_exec.c \    pcre_dfa_exec.c \
# Line 148  files="\ Line 214  files="\
214    pcre_fullinfo.c \    pcre_fullinfo.c \
215    pcre_get.c \    pcre_get.c \
216    pcre_globals.c \    pcre_globals.c \
217    pcre_info.c \    pcre_jit_compile.c \
218      pcre_jit_test.c \
219    pcre_maketables.c \    pcre_maketables.c \
220    pcre_newline.c \    pcre_newline.c \
221    pcre_ord2utf8.c \    pcre_ord2utf8.c \
222      pcre16_ord2utf16.c \
223      pcre32_ord2utf32.c \
224      pcre_printint.c \
225    pcre_refcount.c \    pcre_refcount.c \
226      pcre_string_utils.c \
227    pcre_study.c \    pcre_study.c \
228    pcre_tables.c \    pcre_tables.c \
   pcre_try_flipped.c \  
   pcre_ucp_searchfuncs.c \  
229    pcre_valid_utf8.c \    pcre_valid_utf8.c \
230    pcre_version.c \    pcre_version.c \
231    pcre_xclass.c \    pcre_xclass.c \
232      pcre16_utf16_utils.c \
233      pcre32_utf32_utils.c \
234      pcre16_valid_utf16.c \
235      pcre32_valid_utf32.c \
236    pcre_scanner.cc \    pcre_scanner.cc \
237    pcre_scanner.h \    pcre_scanner.h \
238    pcre_scanner_unittest.cc \    pcre_scanner_unittest.cc \
# Line 172  files="\ Line 245  files="\
245    pcre_stringpiece_unittest.cc \    pcre_stringpiece_unittest.cc \
246    perltest.pl \    perltest.pl \
247    ucp.h \    ucp.h \
   ucpinternal.h \  
   ucptable.h \  
248    makevp.bat \    makevp.bat \
249    pcre.def \    pcre.def \
250    libpcre.def \    libpcre.def \
251    libpcreposix.def"    libpcreposix.def"
252    
253  echo Detrailing  echo Detrailing
254  ./Detrail $files doc/p* doc/html/*  perl ./Detrail $files doc/p* doc/html/*
   
 echo Doing basic configure to get default pcre.h and config.h  
 # This is in case the caller has set aliases (as I do - PH)  
 unset cp ls mv rm  
 ./configure >/dev/null  
   
 echo Converting pcre.h and config.h to generic forms  
 cp -f pcre.h pcre.h.generic  
   
 perl <<'END'  
   open(IN, "<config.h") || die "Can't open config.h: $!\n";  
   open(OUT, ">config.h.generic") || die "Can't open config.h.generic: $!\n";  
   while (<IN>)  
     {  
     if (/^#define\s(?!PACKAGE)(\w+)/)  
       {  
       print OUT "#ifndef $1\n";  
       print OUT;  
       print OUT "#endif\n";  
       }  
     else  
       {  
       print OUT;  
       }  
     }  
   close IN;  
   close OUT;  
 END  
255    
256  echo Done  echo Done
257    

Legend:
Removed from v.227  
changed lines
  Added in v.1335

  ViewVC Help
Powered by ViewVC 1.1.5