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

Diff of /code/trunk/PrepareRelease

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

revision 429 by ph10, Tue Sep 1 16:10:16 2009 UTC revision 1221 by ph10, Sun Nov 11 20:27:03 2012 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  #             "knows" the relevant troff constructs that are used in the PCRE  #             "knows" the relevant troff constructs that are used in the PCRE
13  #             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
19  #             a readable .txt file.  #             a readable .txt file.
# Line 23  Line 26 
26  #             doc/html can be deleted and re-created from scratch.  #             doc/html can be deleted and re-created from scratch.
27    
28    
29  # First, sort out the documentation  # First, sort out the documentation. Remove pcredemo.3 first because it won't
30    # pass the markup check (it is created below, using markup that none of the
31    # other pages use).
32    
33  cd doc  cd doc
34  echo Processing documentation  echo Processing documentation
35    
36    /bin/rm -f pcredemo.3
37    
38    # Check the remaining man pages
39    
40    perl ../CheckMan *.1 *.3
41    if [ $? != 0 ] ; then exit 1; fi
42    
43  # 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
44  # tidy for online reading. Concatenate all the .3 stuff, but omit the  # tidy for online reading. Concatenate all the .3 stuff, but omit the
45  # individual function pages.  # individual function pages.
# Line 37  cat <<End >pcre.txt Line 49  cat <<End >pcre.txt
49  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
50  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
51  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
52  synopses of each function in the library have not been included. Neither has  synopses of each function in the library have not been included. Neither has
53  the pcredemo program. There are separate text files for the pcregrep and  the pcredemo program. There are separate text files for the pcregrep and
54  pcretest commands.  pcretest commands.
55  -----------------------------------------------------------------------------  -----------------------------------------------------------------------------
# Line 46  pcretest commands. Line 58  pcretest commands.
58  End  End
59    
60  echo "Making pcre.txt"  echo "Making pcre.txt"
61  for file in pcre pcrebuild pcrematching pcreapi pcrecallout pcrecompat \  for file in pcre pcre16 pcre32 pcrebuild pcrematching pcreapi pcrecallout \
62              pcrepattern pcresyntax pcrepartial pcreprecompile \              pcrecompat pcrepattern pcresyntax pcreunicode pcrejit pcrepartial \
63              pcreperform pcreposix pcrecpp pcresample pcrestack ; do              pcreprecompile pcreperform pcreposix pcrecpp pcresample \
64                pcrelimits pcrestack ; do
65    echo "  Processing $file.3"    echo "  Processing $file.3"
66    nroff -c -man $file.3 >$file.rawtxt    nroff -c -man $file.3 >$file.rawtxt
67    ../CleanTxt <$file.rawtxt >>pcre.txt    perl ../CleanTxt <$file.rawtxt >>pcre.txt
68    /bin/rm $file.rawtxt    /bin/rm $file.rawtxt
69    echo "------------------------------------------------------------------------------" >>pcre.txt    echo "------------------------------------------------------------------------------" >>pcre.txt
70    if [ "$file" != "pcresample" ] ; then    if [ "$file" != "pcresample" ] ; then
# Line 64  done Line 77  done
77  for file in pcretest pcregrep pcre-config ; do  for file in pcretest pcregrep pcre-config ; do
78    echo Making $file.txt    echo Making $file.txt
79    nroff -c -man $file.1 >$file.rawtxt    nroff -c -man $file.1 >$file.rawtxt
80    ../CleanTxt <$file.rawtxt >$file.txt    perl ../CleanTxt <$file.rawtxt >$file.txt
81    /bin/rm $file.rawtxt    /bin/rm $file.rawtxt
82  done  done
83    
# Line 91  perl <<"END" >pcredemo.3 Line 104  perl <<"END" >pcredemo.3
104              ".  hy \\\\n(HY\n" .              ".  hy \\\\n(HY\n" .
105              "..\n" .              "..\n" .
106              ".\n" .              ".\n" .
107              ".EX\n" ;              ".EX\n" ;
108    while (<IN>)    while (<IN>)
109      {      {
110      s/\\/\\e/g;      s/\\/\\e/g;
# Line 99  perl <<"END" >pcredemo.3 Line 112  perl <<"END" >pcredemo.3
112      }      }
113    print OUT ".EE\n";    print OUT ".EE\n";
114    close(IN);    close(IN);
115    close(OUT);    close(OUT);
116  END  END
117  if [ $? != 0 ] ; then exit 1; fi  if [ $? != 0 ] ; then exit 1; fi
118    
# Line 113  cp index.html.src html/index.html Line 126  cp index.html.src html/index.html
126  for file in *.1 ; do  for file in *.1 ; do
127    base=`basename $file .1`    base=`basename $file .1`
128    echo "  Making $base.html"    echo "  Making $base.html"
129    ../132html -toc $base <$file >html/$base.html    perl ../132html -toc $base <$file >html/$base.html
130  done  done
131    
132  # Exclude table of contents for function summaries. It seems that expr  # Exclude table of contents for function summaries. It seems that expr
133  # forces an anchored regex. Also exclude them for small pages that have  # forces an anchored regex. Also exclude them for small pages that have
134  # only one section.  # only one section.
135    
136  for file in *.3 ; do  for file in *.3 ; do
137    base=`basename $file .3`    base=`basename $file .3`
138    toc=-toc    toc=-toc
139    if [ `expr $base : '.*_'` -ne 0 ] ; then toc="" ; fi    if [ `expr $base : '.*_'` -ne 0 ] ; then toc="" ; fi
140    if [ "$base" = "pcresample" ] || \    if [ "$base" = "pcresample" ]  || \
141       [ "$base" = "pcrestack" ]  || \       [ "$base" = "pcrestack" ]   || \
142       [ "$base" = "pcrecompat" ] || \       [ "$base" = "pcrecompat" ]  || \
143       [ "$base" = "pcreperform" ] ; then       [ "$base" = "pcrelimits" ]  || \
144         [ "$base" = "pcreperform" ] || \
145         [ "$base" = "pcreunicode" ] ; then
146      toc=""      toc=""
147    fi    fi
148    echo "  Making $base.html"    echo "  Making $base.html"
149    ../132html $toc $base <$file >html/$base.html    perl ../132html $toc $base <$file >html/$base.html
150    if [ $? != 0 ] ; then exit 1; fi    if [ $? != 0 ] ; then exit 1; fi
151  done  done
152    
153  # End of documentation processing  # End of documentation processing; stop if only documentation required.
154    
155  cd ..  cd ..
156  echo Documentation done  echo Documentation done
157    if [ "$1" = "doc" ] ; then exit; fi
158    
159  # 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
160  # significant trailing spaces. The configure files are also omitted from the  # significant trailing spaces. Do not detrail RunTest.bat, because it has CRLF
161  # detrailing.  # line endings and the detrail script removes all trailing white space. The
162    # configure files are also omitted from the detrailing. We don't bother with
163    # those pcre[16|32]_xx files that just define COMPILE_PCRE16 and then #include the
164    # common file, because they aren't going to change.
165    
166  files="\  files="\
167    Makefile.am \    Makefile.am \
# Line 153  files="\ Line 173  files="\
173    AUTHORS \    AUTHORS \
174    NEWS \    NEWS \
175    NON-UNIX-USE \    NON-UNIX-USE \
176      NON-AUTOTOOLS-BUILD \
177    INSTALL \    INSTALL \
178    132html \    132html \
179    CleanTxt \    CleanTxt \
# Line 161  files="\ Line 182  files="\
182    CMakeLists.txt \    CMakeLists.txt \
183    RunGrepTest \    RunGrepTest \
184    RunTest \    RunTest \
   RunTest.bat \  
185    pcre-config.in \    pcre-config.in \
186    libpcre.pc.in \    libpcre.pc.in \
187      libpcre16.pc.in \
188      libpcre32.pc.in \
189    libpcreposix.pc.in \    libpcreposix.pc.in \
190    libpcrecpp.pc.in \    libpcrecpp.pc.in \
191    config.h.in \    config.h.in \
   pcre_printint.src \  
192    pcre_chartables.c.dist \    pcre_chartables.c.dist \
193    pcredemo.c \    pcredemo.c \
194    pcregrep.c \    pcregrep.c \
# Line 176  files="\ Line 197  files="\
197    pcreposix.c \    pcreposix.c \
198    pcreposix.h \    pcreposix.h \
199    pcre.h.in \    pcre.h.in \
200    pcre_internal.h    pcre_internal.h \
201      pcre_byte_order.c \
202    pcre_compile.c \    pcre_compile.c \
203    pcre_config.c \    pcre_config.c \
204    pcre_dfa_exec.c \    pcre_dfa_exec.c \
# Line 184  files="\ Line 206  files="\
206    pcre_fullinfo.c \    pcre_fullinfo.c \
207    pcre_get.c \    pcre_get.c \
208    pcre_globals.c \    pcre_globals.c \
209    pcre_info.c \    pcre_jit_compile.c \
210      pcre_jit_test.c \
211    pcre_maketables.c \    pcre_maketables.c \
212    pcre_newline.c \    pcre_newline.c \
213    pcre_ord2utf8.c \    pcre_ord2utf8.c \
214      pcre16_ord2utf16.c \
215      pcre32_ord2utf32.c \
216      pcre_printint.c \
217    pcre_refcount.c \    pcre_refcount.c \
218      pcre_string_utils.c \
219    pcre_study.c \    pcre_study.c \
220    pcre_tables.c \    pcre_tables.c \
   pcre_try_flipped.c \  
221    pcre_ucp_searchfuncs.c \    pcre_ucp_searchfuncs.c \
222    pcre_valid_utf8.c \    pcre_valid_utf8.c \
223    pcre_version.c \    pcre_version.c \
224    pcre_xclass.c \    pcre_xclass.c \
225      pcre16_utf16_utils.c \
226      pcre32_utf32_utils.c \
227      pcre16_valid_utf16.c \
228      pcre32_valid_utf32.c \
229    pcre_scanner.cc \    pcre_scanner.cc \
230    pcre_scanner.h \    pcre_scanner.h \
231    pcre_scanner_unittest.cc \    pcre_scanner_unittest.cc \
# Line 216  files="\ Line 246  files="\
246    libpcreposix.def"    libpcreposix.def"
247    
248  echo Detrailing  echo Detrailing
249  ./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  
250    
251  echo Done  echo Done
252    

Legend:
Removed from v.429  
changed lines
  Added in v.1221

  ViewVC Help
Powered by ViewVC 1.1.5