applied patch, various tweaks to pander to pod2man tantrums
authorIlya Zakharevich <ilya@math.berkeley.edu>
Mon, 6 Jul 1998 22:47:30 +0000 (18:47 -0400)
committerGurusamy Sarathy <gsar@cpan.org>
Wed, 8 Jul 1998 02:07:48 +0000 (02:07 +0000)
Message-Id: <199807070247.WAA10677@monk.mps.ohio-state.edu>
Subject: [PATCH 5.004_70] CONFIGPM

p4raw-id: //depot/perl@1362

Porting/Glossary
configpm

index e2d91a9..0d99ae5 100644 (file)
@@ -136,11 +136,11 @@ cat (Loc.U):
 cc (cc.U):
        This variable holds the name of a command to execute a C compiler which
        can resolve multiple global references that happen to have the same
-       name.  Usual values are "cc", "Mcc", "cc -M", and "gcc".
+       name.  Usual values are 'cc', 'Mcc', 'cc -M', and 'gcc'.
 
 cccdlflags (dlsrc.U):
        This variable contains any special flags that might need to be
-       passed with cc -c to compile modules to be used to create a shared
+       passed with 'cc -c' to compile modules to be used to create a shared
        library that will be used for dynamic loading.  For hpux, this
        should be +z.  It is up to the makefile to use it.
 
@@ -1701,7 +1701,7 @@ lddlflags (dlsrc.U):
        This variable contains any special flags that might need to be
        passed to $ld to create a shared library suitable for dynamic
        loading.  It is up to the makefile to use it.  For hpux, it
-       should be -b.  For sunos 4.1, it is empty.
+       should be '-b'.  For sunos 4.1, it is empty.
 
 ldflags (ccflags.U):
        This variable contains any additional C loader flags desired by
@@ -1764,7 +1764,7 @@ lns (lns.U):
 
 locincpth (ccflags.U):
        This variable contains a list of additional directories to be
-       searched by the compiler.  The appropriate -I directives will
+       searched by the compiler.  The appropriate '-I' directives will
        be added to ccflags.  This is intended to simplify setting
        local directories from the Configure command line.
        It's not much, but it parallels the loclibpth stuff in libpth.U.
@@ -1827,7 +1827,7 @@ make_set_make (make.U):
        make_set_make='#'               # If your make program handles this for you,
        make_set_make="MAKE=$make"      # if it doesn't.
        I used a comment character so that we can distinguish a
-       'set' value (from a previous config.sh or Configure -D option)
+       'set' value (from a previous config.sh or Configure '-D' option)
        from an uncomputed value.
 
 mallocobj (mallocsrc.U):
@@ -1932,7 +1932,7 @@ myuname (Oldconfig.U):
        whole thing is then lower-cased.
 
 n (n.U):
-       This variable contains the -n flag if that is what causes the echo
+       This variable contains the '-n' flag if that is what causes the echo
        command to suppress newline.  Otherwise it is null.  Correct usage is
            $echo $n "prompt for a question: $c".
 
@@ -2170,9 +2170,9 @@ sh (sh.U):
        /bin/sh, though it's possible that some systems will have /bin/ksh,
        /bin/pdksh, /bin/ash, /bin/bash, or even something such as
        D:/bin/sh.exe.
-       This unit comes before Options.U, so you can't set sh with a -D
+       This unit comes before Options.U, so you can't set sh with a '-D'
        option, though you can override this (and startsh)
-       with -O -Dsh=/bin/whatever -Dstartsh=whatever
+       with '-O -Dsh=/bin/whatever -Dstartsh=whatever'
 
 shar (Loc.U):
        This variable is defined but not used by Configure.
@@ -2275,7 +2275,7 @@ so (so.U):
        (also known as shared objects) on the system. Usually set to 'so'.
 
 sockethdr (d_socket.U):
-       This variable has any cpp -I flags needed for socket support.
+       This variable has any cpp '-I' flags needed for socket support.
 
 socketlib (d_socket.U):
        This variable has the names of any libraries needed for socket support.
@@ -2292,7 +2292,7 @@ spackage (package.U):
 
 spitshell (spitshell.U):
        This variable contains the command necessary to spit out a runnable
-       shell on this system.  It is either cat or a grep -v for # comments.
+       shell on this system.  It is either cat or a grep '-v' for # comments.
 
 split (models.U):
        This variable contains a flag which will tell the C compiler and loader
index 2b8d982..971af7f 100755 (executable)
--- a/configpm
+++ b/configpm
@@ -288,37 +288,56 @@ some of the variables described below, or may have extraneous variables
 specific to that particular port.  See the port specific documentation
 in such cases.
 
-=over 4
-
 ENDOFTAIL
 
 open(GLOS, "<$glossary") or die "Can't open $glossary: $!";
+%seen = ();
+$text = 0;
+$/ = '';
+
+sub process {
+  s/\A(\w*)\s+\(([\w.]+)\):\s*\n(\t?)/=item C<$1>\n\nFrom F<$2>:\n\n/m;
+  my $c = substr $1, 0, 1;
+  unless ($seen{$c}++) {
+    print CONFIG <<EOF if $text;
+=back
 
-my ($var,$unit,$indentpara);
-my $text = "";
-while (<GLOS>) {
-    if (/^\s*(.*)\s*\(\s*(.+\.U)\s*\):\s*$/) {
-       print CONFIG "\n=item $var\n\n$text\n" if $var and $text;
-        ($var,$unit,$text) = ($1,$2,"");
-    }
-    else {
-        # bite off exactly one tab-width
-        s/^([ ]{8}|[ ]{0,7}\t)//;
-
-       # indented stuff starts a separate paragraph
-       if (/^\s/) {
-           $text .= "\n" unless $indentpara;
-           $indentpara = 1;
-       }
-       else {
-           $text .= "\n" if $indentpara;
-           $indentpara = 0;
-       }
-       $text .= $_;
-    }
+EOF
+    print CONFIG <<EOF;
+=head2 $c
+
+=over
+
+EOF
+    $text = 1;
+  }
+  s/n't/n\00t/g;               # leave can't, won't etc untouched
+  s/^\t\s+(.*)/\n\t$1\n/gm;    # Indented lines ===> paragraphs
+  s/^(?<!\n\n)\t(.*)/$1/gm;    # Not indented lines ===> text
+  s{([\'\"])(?=[^\'\"\s]*[./][^\'\"\s]*\1)([^\'\"\s]+)\1}(F<$2>)g; # '.o'
+  s{([\'\"])([^\'\"\s]+)\1}(C<$2>)g; # "date" command
+  s{\'([A-Za-z_\- *=/]+)\'}(C<$1>)g; # 'ln -s'
+  s{
+     (?<! [\w./<\'\"] )                # Only standalone file names
+     (?! e \. g \. )           # Not e.g.
+     (?! \. \. \. )            # Not ...
+     (?! \d )                  # Not 5.004
+     ( [\w./]* [./] [\w./]* )  # Require . or / inside
+     (?<! \. (?= \s ) )                # Do not include trailing dot
+     (?! [\w/] )               # Include all of it
+   }
+   (F<$1>)xg;                  # /usr/local
+  s/((?<=\s)~\w*)/F<$1>/g;     # ~name
+  s/(?<![.<\'\"])\b([A-Z_]{2,})\b(?![\'\"])/C<$1>/g;   # UNISTD
+  s/(?<![.<\'\"])\b(?!the\b)(\w+)\s+macro\b/C<$1> macro/g; # FILE_cnt macro
+  s/n[\0]t/n't/g;              # undo can't, won't damage
 }
 
-print CONFIG "\n=item $var\n\n$text\n" if $var and $text;
+<GLOS>;                                # Skip the preamble
+while (<GLOS>) {
+  process;
+  print CONFIG;
+}
 
 print CONFIG <<'ENDOFTAIL';