#! /bin/sh
#
# Update all of the derived files
# For best performance, execute this in the top-level directory.
# There are some experimental features to allow it to be executed in
# subdirectories
#
# Eventually, we want to allow this script to be executed anywhere in the
# mpich tree.  This is not yet implemented.
error_summary=""
acVersion=unknown
at_top=no
if [ -d maint -a -s maint/simplemake.in ] ; then
    at_top=yes
fi
#
# Default choices
# depend choices are dynamic, static, no
do_depend=dynamic
do_codingcheck=yes
codecheck_args=""
do_geterrmsgs=yes
do_bindings=yes
do_f77=yes
use_patched_autoonf=no
do_build_configure=yes
#
# Extract the arguments intended for updatefiles.  Any others are
# given to simplemake.  
temp_args=""
for arg in "$@" ; do
    case $arg in 
    -echo)
	set -x
	;;
    -with-codecheck=*|--with-codecheck=*)
    do_codingcheck=yes
    codecheck_args=`echo "A$arg" | sed -e 's/.*=//'`
    ;;
    -with-codecheck|--with-codecheck)
    do_codingcheck=yes
    ;;
    -without-codecheck|--without-codecheck)
    do_codingcheck=no
    ;;

    -with-errmsgs|--with-errmsgs)
    do_geterrmsgs=yes
    ;;
    -without-errmsgs|--without-errmsgs)
    do_geterrmsgs=no
    ;;

    -with-bindings|--with-bindings)
    do_bindings=yes
    ;;
    -without-bindings|--without-bindings)
    do_bindings=no
    ;;

    -with-f77|--with-f77)
    do_f77=yes
    ;;
    -without-f77|--without-f77)
    do_f77=no
    ;;

    -with-patched-autoconf|--with-patched-autoconf)
    use_patched_autoonf=yes
    ;;
    -without-patched-autoconf|--without-patched-autoconf)
    use_patched_autoonf=no
    ;;

    -distrib)
    do_depend=no
    do_build_configure=no
    temp_args="$temp_args $arg"
    ;;

    -help|--help|-usage|--usage)
    cat <<EOF
    updatefiles [ --with-codecheck | --without-codecheck ] 
                [ args for simplemake ] 
    Update the files in the MPICH2 build tree.  This file builds the 
    configure files, creates the Makefile.in files (using the simplemake
    program), extracts the error messages, and performs basic coding checks.
    Coding checks may be suppressed with --without-codecheck .
EOF
    exit
    ;;
    *)
    temp_args="$temp_args $arg"
    ;;
    esac
done
# Reset the arguments.  Note that this doesn't handle arguments that contain
# blanks.  I hope that we don't need those.
set -- $temp_args
#
# Get the Autoconf macro files.  Note that this step is executed only if
# the confdb directory is not found
if [ $at_top = "yes" -a ! -d confdb ] ; then
    # setup to allow CVSROOT instead of an absolute directory path
    if [ -n "$CVSROOT" -a -d "$CVSROOT/fpmpi" ] ; then
        if [ ! -d CVS ] ; then
            cvs -q export -D now confdb
	else
            cvs -q checkout confdb
	fi
    elif [ -d /home/gropp/cvsMaster_z ] ; then 
        # export if doing a distribution build
        if [ ! -d CVS ] ; then
            cvs -q -d /home/gropp/cvsMaster_z export -D now confdb
	else
            cvs -q -d /home/gropp/cvsMaster_z checkout confdb
	fi
    else
        echo "Checkout confdb from /home/gropp/cvsMaster_z and rerun"
	exit 1
    fi
fi
#
if [ $at_top = "no" ] ; then
    echo "Must execute at top level directory for now"
    exit 1
fi
#
# Check that you have a working autoconf.  Autoconf 2.57 is not compatible with
# previous versions of autoconf (!!), even 2.52 (!!!).  
acIncDirFlag=-l
acVersion=ok
if test -d .tmp ; then rm -rf .tmp ; fi
if test -s .tmp ; then rm -f .tmp ; fi
if test ! -d .tmp ; then
    mkdir .tmp 2>&1 >/dev/null
fi
rm -f .tmp/configure.in
cat >.tmp/configure.in <<EOF
AC_PREREQ(2.57)
EOF
if (cd .tmp && autoconf >/dev/null 2>&1 ) ; then 
    cat <<EOF

You either do not have autoconf in your path or you may have autoconf
version 2.57 or later.  Autoconf 2.57 is not compatible with previous
versions of autoconf, including autoconf 2.52 .  You can use
     autoconf --version
to see the version of autoconf (unfortunately, there is no standard 
format for the version output and it changes between autoconf versions).

This version of updatefiles attempts to workaround the incompatibilities
in autoconf 2.57, but problems remain.  In particular, you may run
into trouble if you need to execute 
    make configure
on a platform different that the one you ran $0 on.

EOF
    error_summary="$error_summary\
Your do not have a usable version of autoconf (either no version found\
or version 2.57 or later"
    acIncDirFlag=-B
    acVersion=2-57
fi
rm -rf .tmp

#
# Create the bindings if necessary 
if [ $do_bindings = "yes" ] ; then
    if [ $do_f77 = "yes" ] ; then
        if [ ! -s src/binding/f77/abortf.c ] ; then 
	    build_f77=yes
        elif find -name 'src/binding/f77/buildiface' -newer 'src/binding/f77/abortf.c' ; then
	    build_f77=yes
        else
	    build_f77=no
        fi
    else
        build_f77=no
    fi

    if [ $build_f77 = "yes" ] ; then
	echo "Building Fortran 77 interface"
	( cd src/binding/f77 && chmod a+x ./buildiface && ./buildiface )
    fi
    if [ ! -s src/binding/cxx/mpicxx.h ] ; then 
	build_cxx=yes
    elif find -name 'src/binding/cxx/buildiface' -newer 'src/binding/cxx/mpicxx.h' ; then
	build_cxx=yes
    else
	build_cxx=no
    fi
    if [ $build_cxx = "yes" ] ; then
	echo "Building C++ interface"
    #    File code still needs work
    #    if [ ! -d src/mpi/romio ] ; then
#	    otherarg="-noromio"
    #    fi
	( cd src/binding/cxx && chmod a+x ./buildiface &&
	  ./buildiface -nosep $otherarg )
    fi

    # Check for the f90 interface
    if [ ! -s src/binding/f90/mpi.f90 ] ; then 
	build_f90=yes
    elif find -name 'src/binding/f90/buildiface' -newer 'src/binding/f90/mpi.f90' ; then
	build_f90=yes
    else
	build_f90=no
    fi
    if [ $build_f90 = "yes" ] ; then
	echo "Building F90 interface"
	( cd src/binding/f90 && chmod a+x ./buildiface &&
	  ./buildiface $otherarg )
    fi
fi
#
# Capture the error messages
if [ ! -x maint/extracterrmsgs -a -s maint/extracterrmsgs ] ; then
    # grrr.  CVS doesn't maintain permissions correctly across Windows/Unix
    chmod a+x maint/extracterrmsgs
fi
if [ -x maint/extracterrmsgs -a $do_geterrmsgs = "yes" ] ; then
    echo "Extracting the error messages..."
    rm -rf .tmp
    rm -f .err
#    maint/extracterrmsgs `find src/mpi -name '*.c' -print` `find src/nameserv -name '*.c' -print` \
#        `find src/util -name '*.c' -print` `find src/binding -name '*.c' -print` src/include/*.h \
#	`find src/mpid -name '*.[ch]' -print` > .tmp 2>.err
    maint/extracterrmsgs src/mpi src/nameserv src/util src/binding \
        src/include/*.h src/mpid \
	`find src/mpid -name '*.h' -print` > .tmp 2>.err
    # (error here is ok)
    update_errdefs=yes
    if [ -s .err ] ; then 
       cat .err
       rm -f .err2
       grep -v "Warning:" .err > .err2
       if [ -s .err2 ] ; then
           echo "Because of errors in extracting error messages, the file"
           echo "src/mpi/errhan/defmsg.h was not updated."
	   error_summary="$error_summary\
Error message files in src/mpi/errhan were not updated."
           update_errdefs=no
	   rm -f .tmp
       fi
       rm -f .err .err2
    else
       # Incase it exists but has zero size
       rm -f .err
    fi
    if [ -s .tmp -a "$update_errdefs" = "yes" ] ; then
        mv .tmp src/mpi/errhan/defmsg.h
    fi
    if [ ! -s src/mpi/errhan/defmsg.h ] ; then
        echo "Creating a dummy defmsg.h file"
	cat > src/mpi/errhan/defmsg.h <<EOF
typedef struct { const char *short_name, *long_name; } msgpair;
static const int generic_msgs_len = 0;
static msgpair generic_err_msgs[] { {0, "no error catalog"}, };
static const int specific_msgs_len = 0;
static msgpair specific_err_msgs[] {  {0,0}, };
static int class_to_index[] = {
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0 }
EOF
    fi
fi
#
# Build scripts such as simplemake if necessary
made_simplemake=no
run_configure=no
if [ ! -x maint/configure ] ; then
    (cd maint && autoconf && rm -rf autom4te.cache )
elif find -name 'maint/configure.in' -newer 'maint/configure' ; then
    # The above relies on the Unix find command
    (cd maint && autoconf && rm -rf autom4te.cache)
fi
if [ ! -x maint/simplemake -o ! -x maint/getstates ] ; then
    run_configure=yes
fi
#
# The following relies on the Unix find command
if [ -s maint/simplemake ] ; then
    if find -name 'maint/simplemake.in' -newer 'maint/simplemake' ; then
        run_configure=yes
    fi
else
    run_configure=yes
fi
if [ -s maint/getstates ] ; then 
    if find -name 'maint/getstates.in' -newer 'maint/getstates' ; then
        run_configure=yes
    fi
else
    run_configure=yes
fi

if [ "$run_configure" = "yes" ] ; then
    (cd maint && ./configure)
    made_simplemake=yes
fi

# Run some of the simple codes
if [ -x maint/getstates ] ; then
    maint/getstates -outfile=src/util/logging/lwlog/lwstates.c \
                    -namefile=src/util/logging/lwlog/lwnames.h src
fi

#
if [ ! -x maint/simplemake ] ; then
    echo "Could not create simplemake"
    echo "You can copy simplemake.in to simplemake, replacing @PERL@ with the"
    echo "path to Perl (version5).  Make sure the resulting file has"
    echo "execute permissions set."
    exit 1
fi
#
if [ $made_simplemake != "no" ] ; then
    # Check that only the first line was changed:
    rm -f .t1 .t2
    sed -e 1d maint/simplemake.in > .t1
    sed -e 1d maint/simplemake > .t2
    if diff .t1 .t2 >/dev/null 2>&1 ; then
        :
    else
        echo "Something is wrong with simplemake; configure may have"
        echo "replaced variables that it should not have."
        diff .t1 .t2
        exit 1
    fi
    rm -f .t1 .t2
fi
#
# Create the Makefile.in files
# Make sure that these files exist so that the gcc dependency creation
# can work
rm_prepost=no
if [ ! -s src/include/mpidpre.h ] ; then
    rm_prepost=yes
fi
otherargs="$@"
# If there is no mpi.h file (and other files, but testing on mpi.h should
# be enough), don't generate the dependency information in the Makefiles
# with the static dependency target.  The new default in simplemake is
# dynamic dependency data
# Currently, the dependency generation relies on using gcc, so we may 
# want to test on that as well.
# 
# 
if [ $do_depend = static -a ! -s src/include/mpi.h ] ; then
    # Static dependencies require a mpi.h file
    echo "Turning off static generation of dependencies because there is no mpi.h file"
    do_depend=no
fi
if [ $do_depend = no ] ; then 
    otherargs="$otherargs -nodepend"
#else
#    # The next two files may be needed to build the dependency lists
#    touch src/include/mpidpre.h src/include/mpidpost.h
fi
# 
# autoconf 2.57 drastically changed the command line arguments.
# Up through 2.52, -l dir was the "localdir for searching"
# By 2.57, -l was no longer accepted, and -B dir or --prepend-include=DIR
# was used.  
# To make things more exciting, the format of autoconf --version has
# changed, making it very hard to automatically extract the version number
# so that programs like this can work around poor software engineering, 
# such as incompatible changes in a minor-numbered release.
#
# Just to make this even more interesting, the cygwin version of 
# autoconf selects a version.  But the code to so this causes --version 
# (and --help!) to fail unless there is a configure.in file in the current
# directory.  
#acversion=`autoconf --version | grep '[Aa]utoconf.*[0-9]' | \
#    sed -e 's/.*(0-9\.[0-9]*).*/\1/'`
if maint/simplemake -common=maint/makedefs \
    -docnamedefs='${master_top_srcdir}/maint/docnotes' \
    -autoconf="$acIncDirFlag ROOTDIR/confdb" \
    -libdir='${MPILIBNAME}'=ROOTDIR/lib $otherargs \
    Makefile.sm ; then
    :
else
    echo "Simplemake step failed!"
    exit 1
fi
#
# Create the configure files and run autoheader
# Eventually, make this a test for find available.  Perhaps
# find . -name configure.in > /dev/null 2>&1
# The problem is that even though cygnus has find, the DOS find
# is identified first.  We probably need a test for this case
find . -name 'configure.in' >/dev/null 2>&1
if [ $? = 0 ] ; then has_unix_find=yes ; else has_unix_find=no ; fi
# if [ $? = 0 ] ; then .. code with find
if [ "$has_unix_find" = "yes" -a "$do_build_configure" = "yes" ] ; then
    for dir in `find . -name 'configure.in' -print` ; do
        dir=`dirname $dir`
	#echo $dir
	if [ $dir = "./src/binding/f77" -a $do_f77 != yes ] ; then
	    # Skip building the f77 configure (it requires special 
	    # support because of bugs in the Fortran support in 
	    # various releases of autoconf)
	    continue
	fi
	if [ -s $dir/Makefile.in ] ; then 
            #echo "Found $dir/configure.in"
	    #
	    # Check for known problems
	    fixEndEOFBug=no
#\( 
#		! -x "/home/gropp/bin/linux/autoconf" -o ... \)
	    if [ $dir = "./src/binding/f77" -a \
		$use_patched_autoonf = no ] ; then
		# We need a *patched*, version 2.13 form of autoconf
		# Version 2.62 breaks the Fortran 90 extensions
		# to TRY_COMPILE, and stock 2.13 generates bogus 
		# code for language FORTRAN.

		# See if autoconf works
		rm -rf .ctmp
		mkdir .ctmp
		cd .ctmp
		cat >>configure.in <<EOF
AC_INIT(configure.in)
AC_LANG_FORTRAN77
AC_TRY_COMPILE(,[integer a],a=1,a=0)
EOF
		autoconf
  	        cd ..
		# The bug is that the EOF doesn't go onto the next line
		if grep endEOF .ctmp/configure >/dev/null 2>&1 ; then
		    echo " "
   echo "+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++"
		    echo "The available version of configure has a bug"
		    echo "in handling Fortran programs and should not be used."
		    echo "This bug is an improper placement of the EOF"
		    echo "token used to implement AC_TRY_COMPILE for Fortran."
		    echo "A patch for this version is available in "
		    echo "maint/ac2.13.diff ."
		    echo "A workaround will be attempted, but fixing "
		    echo "autoconf is a better solution."
   echo "+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++"
		    echo " "
		    error_summary="$error_summary\
Your version of autoconf cannot properly handle Fortran.  See the diff \
in maint/ac2.13.diff for a possible patch.  updatefiles attempted a workaround."
		    fixEndEOFBug=yes
		fi
                rm -rf .ctmp
	    fi
#	    if [ -s "$dir/configure2.in" ] ; then
	        # There is a version 1 and version 2 configure in this
	        # directory.  
	        if [ $dir = "./src/mpi/romio" ] ; then
		    echo $dir
#  		    if [ $acVersion = "2-57" ] ; then
#  			echo "Working around hideous bug in autoheader 2.57..."
#  	            # Note that the 2.57 autoheader *ignores* the command-line
#  	            # argument (!)  Yes, this is very badly broken.
#  		    # Also note that aclocal tends to read *everything* in the 
#  		    # include directory, rather than processing the files. 
#  		    # This breaks the handling of the different autoconf
#  		    # versions by the macros in that directory
#  		        if [ -s $dir/configure.in ] ; then
#  			    mv -f $dir/configure.in $dir/configure.in.orig
#  			fi
#  			cp -f $dir/configure2.in $dir/configure.in
#   		        (cd $dir && \
#  		        autoheader $acIncDirFlag ../../../confdb ; \
#  		        autoconf $acIncDirFlag ../../../confdb )
#  			if [ -s $dir/configure.in.orig ] ; then
#  			    mv -f $dir/configure.in.orig $dir/configure.in
#  			fi
#  		    else
		        # Using an explicit acIncDirFlag will force
		        # a consistent choice of autoconf
		        (cd $dir && autoheader $acIncDirFlag . && \
			autoconf $acIncDirFlag . && rm -rf autom4te.cache )
#		        (cd $dir && \
#		         autoheader $acIncDirFlag ../../../confdb configure2.in > adio/include/romioconf.h.in ; \
#		         autoconf $acIncDirFlag ../../../confdb configure2.in > configure )
#		     fi
#		fi
	            if grep 'mpi2-other/info/Makefile \\
' $dir/configure 2>&1 >/dev/null ; then 
		        fixBackWhackCtrlMBug=yes
                    fi
	            # Add other tests here (sigh) as necessary
	            if [ $fixBackWhackCtrlMBug = yes ] ; then
		         rm -f c.tmp 
		        sed -e '/"\\
/d' -e 's/\\
//g' $dir/configure > c.tmp
		        rm -f $dir/configure
		        mv c.tmp $dir/configure
	            fi
	            continue
	        elif [ $dir = "./src/mpe" ] ; then
		    # Use acIncDirFlag to ensure that a consistent
		    # choice of autoconf is made by systems that 
		    # support 2.1x and 2.57+
		    echo $dir
		    (cd $dir && autoheader $acIncDirFlag . && \
		    autoconf $acIncDirFlag . )
		    continue
	    fi
	    # First, check for a configure target in Makefile.in
	    if grep 'configure:' $dir/Makefile.in >/dev/null 2>&1 ; then
 	        # The make -q checks whether the target is upto date first;
	        # if it isn't, we remake it.
                (cd $dir && rm -f mf.tmp ; \
	        sed -e 's%^SHELL[ 	]*=.*%SHELL = /bin/sh%' \
		    -e "s%@srcdir@%.%g" \
		    -e '/include .deps/d' \
		    -e '/@SET_MAKE@/d' Makefile.in > mf.tmp ;\
		    if make -q -f mf.tmp configure >/dev/null 2>&1 ; then \
                : ; else \
	        echo "Found $dir/configure.in" ; \
	        make -f mf.tmp configure ; fi ; rm -f mf.tmp  \
	        )
            else 
		if [ -x $dir/makeconfigure ] ; then
		    echo "Using makeconfigure in $dir"
		    (cd $dir && ./makeconfigure )
		else
		    # Check for old 1.7 configure files (in MPE, at least for
		    # now)
		    if egrep 'AC_ARG|AC_CHECK_FUNCS' $dir/configure.in >/dev/null 2>&1 ; then
		        echo "Trying simple autoheader/autoconf in $dir"
		        (cd $dir && autoheader $acIncDirFlag . && \
			autoconf $acIncDirFlag . )
		    else
		        # Try autoconf-1.7; accepts failures gracefully
		        echo "Trying simple autoconf using 1.7 in $dir"
			(cd $dir && autoconf-1.7)
		    fi
		fi
            fi
	    if [ $fixEndEOFBug = yes ] ; then
		if grep endEOF $dir/configure >/dev/null 2>&1 ; then
		    echo "Fixing endEOF error in generated configure"
		    rm -f c.tmp
 		    sed 's/endEOF/end\
EOF/g' $dir/configure > c.tmp
		    mv -f c.tmp $dir/configure
		    chmod a+x $dir/configure
		fi
	    fi
	    #
            # Under cygwin, sometimes (?) configure ends up containing \^M
	    # (that's <ctrl>-M).  We may need to add this sed step
	    # sed -e '/"\
"/d' -e 's/\
//g'
	    # (the first removes case statements on \^M, the second
	    # removes the \^M from the ac_config_files statement
	    fixBackWhackCtrlMBug=no
	    if [ ! -s $dir/configure ] ; then 
		echo "PANIC: Could not make configure from configure.in"
		echo "In directory $dir"
		exit 1
	    elif grep 'src/Makefile \\ src' $dir/configure 2>&1 >/dev/null ; then 
		fixBackWhackCtrlMBug=yes
	    elif grep 'src/Makefile \\
 src' $dir/configure 2>&1 >/dev/null ; then 
		fixBackWhackCtrlMBug=yes
	    elif grep 'attr/Makefile \\ util' $dir/configure 2>&1 >/dev/null ; then 
		fixBackWhackCtrlMBug=yes
	    elif grep 'attr/Makefile \\
' $dir/configure 2>&1 >/dev/null ; then 
		fixBackWhackCtrlMBug=yes
	    elif grep 'mpi2-other/info/Makefile \\
' $dir/configure 2>&1 >/dev/null ; then 
		fixBackWhackCtrlMBug=yes
            fi
	    # Add other tests here (sigh) as necessary
	    if [ $fixBackWhackCtrlMBug = yes ] ; then
		rm -f c.tmp 
		sed -e '/"\\
/d' -e 's/\\
//g' $dir/configure > c.tmp
		rm -f $dir/configure
		mv c.tmp $dir/configure
	    fi
        fi
    done
elif [ "$has_unix_find" = no ] ; then
    echo "You need to install find (in findutils)"
    exit 1
else 
    echo "Skipping creation of configure files"
fi
if [ $rm_prepost = yes ] ; then
    rm -f src/include/mpidpre.h src/include/mpidpost.h
fi
#
if [ ! -x maint/codingcheck -a -s maint/codingcheck ] ; then
    # Fix CVS limitation with file modes (updates from Windows loses x bit)
    chmod +x maint/codingcheck
fi
if [ -x maint/codingcheck -a $do_codingcheck = "yes" ] ; then
    echo ""
    echo "Running coding check"
    echo ""
    # codingcheck now understands directories.
    # skip *only* files provided by an outside source
    # vipl.h is probably ok, even though copyrighted.  Question:
    # Should there be three versions or just one?
    #
    # 9/2/03 - Added src/mpid/mm to the skip list because it is not
    # under active development.  We'll need to either remove it from the
    # distribution or remove it from the exemption list before the
    # 1.0 release.
    # Added pm/mpd/pmitest.c .  This should be moved to a test directory
    # in the 1.0 release
    # Added pm/smpd, solely to reduce the number of warnings .  This should be 
    # fixed in the 1.0 release.  Also added pmi/smpd
    # Added pmi/winmpd, solely to reduce the number of warnings .  This 
    # should be fixed in the 1.0 release.
    # Added util/logging/dlog because dlog is deprecated.  This should
    # either be fixed or removed in the 1.0 release
    maint/codingcheck -skipfile=./src/pmi/winmpd/crypt.c \
		      -skipfile=./src/pmi/winmpd/crypt.h \
		      -skipfile=./src/pm/winmpd/crypt.h \
		      -skipfile=./src/pm/winmpd/crypt \
		      -skipfile=./src/pm/winmpd/spmd/crypt.c \
		      -skipfile=./src/pm/winmpd/spmd/des.h \
		      -skipfile=./src/pmi/winmpd/des.c \
		      -skipfile=./src/pmi/winmpd/des.h \
                      -skipfile=./src/pm/smpd/crypt.c \
		      -skipfile=./src/pm/smpd/crypt.h \
		      -skipfile=./src/pm/smpd/des.c \
		      -skipfile=./src/pm/smpd/des.h \
		      -skipfile=./src/pm/mpd/proxy.c \
		      -skipfile=./src/pm/mpd/sigcatcher.c \
		      -skipfile=./src/pm/mpd/sleeploop.c \
		      -skipfile=./src/pm/mpd/infloop.c \
		      -skipfile=./src/pm/mpd/pmitest.c \
		      -skipfile=./src/pm/mpd/exittest_nompi.c \
		      -skipfile=./src/mpid/mm/include/vipl.h \
		      -skipfile=./src/mpid/mm/src/via/vipl.h \
		      -skipfile=./src/mpid/mm/src/viardma/vipl.h \
		      -skipfile=./src/mpi/romio/adio/sgi/mpi3.1/mpi.h \
		      -skipfile=./src/mpi/romio/adio/sgi/mpi3.1/mpif.h \
	 	      -skipfile=./src/mpi/romio/adio/include/mpisgi2.h \
		      -skipfile=./src/util/slog2sdk \
		      -skipfile=./src/mpe \
		      -skipfile=./src/mpe/include \
		      -skipfile=./src/mpid/mm \
		      -skipfile=./src/pm/smpd \
		      -skipfile=./src/pmi/smpd \
		      -skipfile=./src/pmi/winmpd \
		      -skipfile=./src/util/logging/dlog \
		      -skipfile=./src/util/logging/dlog2slog \
			$codecheck_args src
fi
if [ -n "$error_summary" ] ; then
    echo " "
    echo "Problems encountered while running updatefiles"
    echo "These may cause problems when configuring or building MPICH2"
    echo "$error_summary"
fi
