[mpich-commits] [mpich] MPICH primary repository branch, master, updated. v3.1-20-gd384d9b

Service Account noreply at mpich.org
Thu Feb 27 09:56:54 CST 2014


This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "MPICH primary repository".

The branch, master has been updated
       via  d384d9bc1cd6a1449320dae33bdfd1161a7085ba (commit)
      from  2f432462eee87341428315ec08a6be398352f404 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
http://git.mpich.org/mpich.git/commitdiff/d384d9bc1cd6a1449320dae33bdfd1161a7085ba

commit d384d9bc1cd6a1449320dae33bdfd1161a7085ba
Author: Ken Raffenetti <raffenet at mcs.anl.gov>
Date:   Tue Feb 25 23:02:15 2014 -0600

    add back script to create html indexes for docs
    
    Create index.html files for the docs so they are easier to navigate.
    This restores functionality that was lost during the build system
    overhaul. Closes #1800
    
    Signed-off-by: Pavan Balaji <balaji at mcs.anl.gov>

diff --git a/.gitignore b/.gitignore
index b7619bf..712b03a 100644
--- a/.gitignore
+++ b/.gitignore
@@ -385,6 +385,7 @@ Makefile.am-stamp
 /maint/extractstates
 /maint/extractfixme
 /maint/structalign
+/maint/createhtmlindex
 
 # /src/
 
diff --git a/Makefile.am b/Makefile.am
index 42a76ff..7547f0d 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -350,6 +350,7 @@ htmldoc-local: $(mpi_sources:.c=.html-phony) $(doc1_src_txt:.txt=.html1-phony)
 		fi \
 	    fi \
 	done
+	$(srcdir)/maint/createhtmlindex -wwwroot=$(top_builddir)
 
 # install-man does not have a special "-local" target for some reason
 INSTALL_DATA_LOCAL_TARGETS += install-man-local
diff --git a/maint/configure.ac b/maint/configure.ac
index 11a94e2..bc44581 100644
--- a/maint/configure.ac
+++ b/maint/configure.ac
@@ -27,7 +27,7 @@ if test "$xargs_out" != "0" ; then
 fi
 AC_SUBST(XARGS_NODATA_OPT)
 
-AC_OUTPUT_COMMANDS([chmod a+x checkbuilds getcoverage genstates clmake f77tof90 extractstrings extractstates extractfixme createcoverage gcovmerge])
+AC_OUTPUT_COMMANDS([chmod a+x checkbuilds getcoverage genstates clmake f77tof90 extractstrings extractstates extractfixme createcoverage gcovmerge createhtmlindex])
 # We have to redefine the variables that autoconf always substitutes and that
 # are used in simplemake
 CFLAGS='@CFLAGS@'
@@ -38,4 +38,4 @@ CXXFLAGS='@CXXFLAGS@'
 # autoconf replacement.
 # Note that top_srcdir and srcdir are special cases (they must not
 # be changed in configure.ac because configure uses them to find other files)
-AC_OUTPUT(checkbuilds getcoverage genstates clmake f77tof90 extractstrings extractstates extractfixme createcoverage gcovmerge)
+AC_OUTPUT(checkbuilds getcoverage genstates clmake f77tof90 extractstrings extractstates extractfixme createcoverage gcovmerge createhtmlindex)
diff --git a/maint/createhtmlindex.in b/maint/createhtmlindex.in
new file mode 100644
index 0000000..067d5a4
--- /dev/null
+++ b/maint/createhtmlindex.in
@@ -0,0 +1,168 @@
+#! @PERL@
+# -*- mode: perl; -*-
+#
+# Create an index of web pages for MPICH
+#
+# Default values
+# Root for the pages
+$WWWRoot=`pwd`;
+chop $WWWRoot;
+# Base address (installation address)
+# $URLBase = "http://";
+# End of line character (\r\n is DOS-friendly)
+$eol = "\r\n";
+# Number of colums in table of names
+$TableCols = 3;
+#
+# Process arguments for any changes
+foreach $_ (@ARGV) {
+    if (/-?(-[^=]*)=(.*)/) {
+	$argname = $1;
+	$argval  = $2;
+    }
+    else {
+	$argname = $1;
+	$argval  = "";
+    }
+    if ($argname =~ /-wwwroot/) {
+	$WWWRoot = $argval;
+    }
+    elsif ($argname =~ /-urlbase/) {
+	$URLBase = $argval;
+    }
+    elsif ($argname eq "-help") {
+	print STDOUT "createhtmlindex [ -wwwroot=directory ] [ -urlbase=base ]\n";
+	print STDOUT "Build the www index pages for MPICH.";
+	print STDOUT "This must be run in the root of an MPICH tree; it may\n
+be run in a VPATH directory after configuring.\n";
+	exit 1;
+    }
+    else {
+	print STDERR "Unknown argument $_\n";
+	exit 1;
+    }
+}
+
+# Create the main index
+open( OUTFD, ">$WWWRoot/www/index.html" ) ||
+    die "Cannot open $WWWRoot/www/index.html\n";
+
+&AddHeader( "Web pages for MPI and MPE" );
+
+print OUTFD "<H2>MPI Commands</H2>$eol";
+&AddDirectoryContents( "www", "www1" );
+
+print OUTFD "<H2>MPI Routines</H2>$eol";
+&AddDirectoryContents( "www", "www3" );
+
+#print OUTFD "<H2>MPE Routines</H2>$eol";
+#&AddDirectoryContents( "www", "www4" );
+
+&AddTrailer( );
+
+close( OUTFD );
+
+# Create the sectional indices
+open( OUTFD, ">$WWWRoot/www/www1/index.htm" ) ||
+    die "Cannot open $WWWRoot/www/www1/index.htm\n";
+
+&AddHeader( "Manpages for MPICH" );
+&AddDirectoryContents( "www/www1", "." );
+&AddTrailer( );
+close( OUTFD );
+
+open( OUTFD, ">$WWWRoot/www/www3/index.htm" ) ||
+    die "Cannot open $WWWRoot/www/www3/index.htm\n";
+
+&AddHeader( "Web pages for MPI Routines" );
+&AddDirectoryContents( "www/www3", "." );
+&AddTrailer( );
+close( OUTFD );
+
+# open( OUTFD, ">$WWWRoot/www/www4/index.htm" ) ||
+#     die "Cannot open $WWWRoot/www/www4/index.htm\n";
+
+# &AddHeader( "Web pages for MPE Routines" );
+# &AddDirectoryContents( "www/www4", "." );
+# &AddTrailer( );
+# close( OUTFD );
+
+
+0;
+# ---------------------------------------------------------------------------
+# Support routines.
+# All write to OUTFD and use $eol for end-of-line
+# ---------------------------------------------------------------------------
+sub AddHeader {
+    my $title = $_[0];
+    print OUTFD "<HTML>$eol<HEAD>$eol<TITLE>$title</TITLE>$eol";
+    print OUTFD "<!-- This file generated by createhtmlindex on $date -->$eol";
+    print OUTFD "</HEAD>$eol<BODY BGCOLOR=\"FFFFFF\">$eol";
+    print OUTFD "<H1>$title</H1>$eol";
+}
+
+sub AddTrailer {
+    print OUTFD "</BODY>$eol</HTML>$eol";
+}
+
+# Take all .htm and .html files and add them to the OUTFD file.
+# This works in two steps:
+# 1. Read and sort the contents of the directory into the array
+# @HTMLFiles
+# 2. Use the routine MakeHTMLTable to create a table with a given
+# number of columns, adding the links within the columns
+ at HTMLFiles = ();
+# Look in $1/$2 for files, but make links relative to $2
+sub AddDirectoryContents {
+    my $rootdir = $_[0];
+    my $dirname = $_[1];
+
+    # 1 Read the files
+    @HTMLFiles = ();
+    opendir DIR, "$rootdir/$dirname";
+    if ($dirname eq ".") {
+	$prefixname = "";
+    }
+    else {
+	$prefixname = "$dirname/";
+    }
+    while ($filename = readdir DIR) {
+	if ($filename =~ /index\.html?/) { next; }
+	if ($filename =~ /.*\.html?$/) {
+	    $HTMLFiles[$#HTMLFiles+1] = "$prefixname$filename";
+	}
+    }
+    closedir DIR;
+
+    @HTMLFiles = sort( @HTMLFiles );
+
+    # Format the table
+    &MakeHTMLTable;
+}
+# MakeHTMLTable takes an array of items and turns them into a table with
+# $TableCols columns.
+#
+sub MakeHTMLTable {
+    my $nvals = $#HTMLFiles;
+
+    my $nrows = int ( ($nvals + $TableCols - 1) / $TableCols );
+    print OUTFD "<TABLE>$eol";
+    for ($j=0; $j<$nrows; $j++) {
+	print OUTFD "<TR>";
+	for ($e=0; $e<$TableCols; $e++) {
+	    $filename = $HTMLFiles[$j + $e * $nrows];
+	    $linkname = $filename;
+	    $linkname =~ s/\.html?//;
+	    $linkname =~ s/.*\///;
+	    if ($filename ne "") {
+		$line = "<A HREF=\"$filename\">$linkname</A>";
+	    }
+	    else {
+		$line = "";
+	    }
+	    print OUTFD "<TD>$line</TD>$eol";
+	}
+	print OUTFD "</TR>$eol";
+    }
+    print OUTFD "</TABLE>$eol";
+}

-----------------------------------------------------------------------

Summary of changes:
 .gitignore               |    1 +
 Makefile.am              |    1 +
 maint/configure.ac       |    4 +-
 maint/createhtmlindex.in |  168 ++++++++++++++++++++++++++++++++++++++++++++++
 4 files changed, 172 insertions(+), 2 deletions(-)
 create mode 100644 maint/createhtmlindex.in


hooks/post-receive
-- 
MPICH primary repository


More information about the commits mailing list