dotgnu-pnet-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Dotgnu-pnet-commits] CVS: pnet madcow,NONE,1.1 .cvsignore,1.4,1.5 Chang


From: Rhys Weatherley <address@hidden>
Subject: [Dotgnu-pnet-commits] CVS: pnet madcow,NONE,1.1 .cvsignore,1.4,1.5 ChangeLog,1.1956,1.1957 HACKING,1.4,1.5 README,1.5,1.6
Date: Tue, 10 Dec 2002 02:16:03 -0500

Update of /cvsroot/dotgnu-pnet/pnet
In directory subversions:/tmp/cvs-serv14923

Modified Files:
        .cvsignore ChangeLog HACKING README 
Added Files:
        madcow 
Log Message:


Add the "madcow" script, for diagnosing common build problems.


--- NEW FILE ---
#!/bin/sh
#
# madcow - Attempt to diagnose Portable.NET build problems.
#
# Copyright (C) 2002  Southern Storm Software, Pty Ltd.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA

# Print the cow.
cow()
{
        echo ''
        echo '                    (__)'
        echo '                    (oo)'
        echo '                     \/-------\'
        echo '                      ||     | \'
        echo '                      ||---W||  *'
        echo ''
}

# Read a yes/no answer.
yesno()
{
        read LINE
        case "x$LINE" in
                xy|xyes|xY|x) return 0 ;;
                *) ;;
        esac
        return 1
}

# Abort the diagnostic process with an error message.
abort()
{
        echo "$*" >>"$LOG_FILE"
        DATEVAL=`date`
        echo '*** Diagnostics aborted at '"$DATEVAL"' ***' >>"$LOG_FILE"
        exit 0
}

# Write a message to the log file.
log()
{
        echo "$*" >>"$LOG_FILE"
}

# Run a command and log its output to the log file.
run()
{
        echo '*** Running:' $* '***' >>"$LOG_FILE"
        $* 2>&1 | tee -a "$LOG_FILE"
}

# Run a version-getting command.
runversion()
{
        echo '*** Running:' $* '***' >>"$LOG_FILE"
        $* >>"$LOG_FILE" 2>&1
        echo '' >>"$LOG_FILE"
}

# Print the banner.
cow
echo 'I am the Portable.NET Mad Cow diagnostic utility!'
echo ''
echo 'My purpose is to help you diagnose common build problems, and to'
echo 'create a log of activity that my masters can use to help you'
echo 'diagnose the problem further.'
echo ''
echo 'The final log will be written to the file "madcow.log".  Please'
echo 'send this file along with your bug report.'
echo ''
echo 'You may also want to look at the "HACKING" file for some advice'
echo 'from my masters as to how to build the system.'
echo ''

# Wait for the user to respond.
echo -n 'Press ENTER when you are ready to continue or Ctrl-C to quit ... '
read LINE
echo ''

# Are we in the right directory to start?
if test -f "include/il_engine.h" ; then
        :
else
        echo 'Whoops!  You need to be in the top-level "pnet" directory!'
        echo 'Please cd to that directory and run "./madcow" again.'
        echo ''
        exit 0
fi

# Does the user want to save the previous log file?
LOG_FILE="madcow.log"
if test -f "$LOG_FILE" ; then
        echo 'You already have a previous "madcow.log" file.  Do you want'
        echo -n 'me to save it as "madcow.bak" before I start? [y] '
        if yesno ; then
                mv "$LOG_FILE" "madcow.bak"
        fi
        echo ''
fi

# Dump some information about the build environment to "madcow.log".
DATEVAL=`date`
echo '*** Diagnostics started at '"$DATEVAL"' ***' >"$LOG_FILE"
echo '*** System: '`uname -a`' ***' >>"$LOG_FILE"
echo '*** User: '"$USER"' ***' >>"$LOG_FILE"
echo '*** Tool version information ***' >>"$LOG_FILE"
runversion autoconf --version
runversion automake --version
runversion gcc -v
runversion make -v
runversion gmake -v
runversion bison --version
runversion flex --version
echo '*** End of tool version information ***' >>"$LOG_FILE"

# Did the user remember to run auto_gen.sh on the CVS tree?
RAN_AUTOGEN=no
if test -f "include/il_config.h.in" ; then
        if test -f "configure" ; then
                if test -f "ilasm/Makefile.in" ; then
                        if test -f "aclocal.m4" ; then
                                RAN_AUTOGEN=yes
                        fi
                fi
        fi
fi
if test "x$RAN_AUTOGEN" = "xno" ; then
        echo '*** Did not run auto_gen.sh ***' >>"$LOG_FILE"
        echo 'It looks like you forgot to run "./auto_gen.sh" after checking'
        echo 'out the sources from the CVS server.  Do you want me to run'
        echo -n 'the "./auto_gen.sh" script for you now? [y] '
        if yesno ; then
                run ./auto_gen.sh
                echo ''
                RAN_AUTOGEN=no
                if test -f "include/il_config.h.in" ; then
                        if test -f "configure" ; then
                                if test -f "ilasm/Makefile.in" ; then
                                        if test -f "aclocal.m4" ; then
                                                RAN_AUTOGEN=yes
                                        fi
                                fi
                        fi
                fi
                if test "x$RAN_AUTOGEN" = "xno" ; then
                        echo ''
                        echo 'Hmmm ... there seems to still be something wrong 
with your'
                        echo 'system.  Maybe you do not have autoconf or 
automake installed?'
                        echo 'I cannot go any further at this time.  Bye!'
                        echo ''
                        abort '*** Died trying to run auto_gen.sh ***'
                fi
        else
                echo ''
                echo 'OK, that is probably the problem.  Run that script and'
                echo 'then retry your build.  Bye!'
                echo ''
                abort '*** The user chose not to run auto_gen.sh ***'
        fi
fi

# Figure out whether we should be using make or gmake.
MAKEVERSION=`make --version 2>&1`
case "$MAKEVERSION" in
        *GNU*) MAKE=make ;;
        *)      MAKEVERSION=`gmake --version 2>&1`
                case "$MAKEVERSION" in
                        *GNU*) MAKE=gmake
                                   log '*** Using gmake instead of make ***'
                                   echo 'Your "make" does not appear to be GNU 
compatible, but I did find "gmake"'
                                   echo 'on your system, so I am going to use 
that instead.'
                                   echo ''
                                   echo -n 'Press ENTER when you are ready to 
continue ... '
                                   read LINE
                                   echo '' ;;
                        *)         echo 'I could not find either "make" or 
"gmake" on your system, so I cannot'
                                   echo 'go any further, sorry.  Bye!'
                                   echo ''
                                   abort '*** Could not find make or gmake ***' 
;;
                esac
        ;;
esac

# Try to get the system back to a pristine state if they've already
# tried to do configures and builds before.
PRISTINE=yes
if test -f config.status ; then
        PRISTINE=no
fi
if test -f ilasm/Makefile ; then
        PRISTINE=no
fi
if test -f include/il_config.h ; then
        PRISTINE=no
fi
if test "x$PRISTINE" = "xno" ; then
        echo 'It looks like you tried to configure and build the system before.'
        echo 'I need to start with a pristine, pre-configure system to properly'
        echo 'diagnose what is wrong.  Do you want me to attempt to make the'
        echo -n 'system pristine? [y] '
        if yesno ; then
                log '*** Returning the system to a pristine state ***'
                echo ''
                echo -n 'Returning the system to a pristine state.  Please wait 
...'
                make distclean >/dev/null 2>&1
                rm -f config.status
                rm -f config.log
                echo ''
                echo ''
        else
                echo ''
                echo 'OK, you can re-run this script later in a clean CVS 
checkout'
                echo 'or a fresh downloaded version of the source if you wish.  
Bye!'
                echo ''
                abort '*** The user did not want to make the system pristine 
***'
        fi
fi

# Run "./configure".
echo 'I am now ready to run the "./configure" script to set up the'
echo 'source tree for your system.  If you think that you may need'
echo 'additional options for "./configure", then enter them now or'
echo -n 'just press ENTER: '
read CONFIGURE_OPTIONS
echo ''
run ./configure $CONFIGURE_OPTIONS
cow
echo -n 'How did that go?  Does everything look OK? [y] '
if yesno ; then
        echo ''
else
        echo ''
        echo 'Drat!  Well, send my masters the "madcow.log" file and they'
        echo 'will see if they can help you.  See the "HACKING" file for'
        echo 'information on how to contact them.'
        echo ''
        abort '*** The user thinks that the configure output is wrong ***'
fi

# Now build the system.
echo 'I am now ready to try to run "'"$MAKE"'" to build the source.'
echo -n 'Press ENTER when you are ready to continue ... '
read LINE
echo ''
run $MAKE -k

# Finalize the build log.
cow
echo -n 'How did that go?  Does everything look OK? [y] '
if yesno ; then
        echo ''
        echo 'Fantastic!  Looks like you are in business!  The final diagnostic'
        echo 'log is in "madcow.log" if you are interested.  Bye!'
        echo ''
        abort '*** The user thinks that the make succeeded ***'
else
        echo ''
        echo 'Drat!  Well, send my masters the "madcow.log" file and they'
        echo 'will see if they can help you.  See the "HACKING" file for'
        echo 'information on how to contact them.'
        echo ''
        abort '*** The user thinks that the make output is wrong ***'
fi
exit 0

Index: .cvsignore
===================================================================
RCS file: /cvsroot/dotgnu-pnet/pnet/.cvsignore,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -r1.4 -r1.5
*** .cvsignore  6 Dec 2002 09:55:25 -0000       1.4
--- .cvsignore  10 Dec 2002 07:16:01 -0000      1.5
***************
*** 9,10 ****
--- 9,12 ----
  aclocal.m4
  confdefs.h
+ madcow.log
+ madcow.bak

Index: ChangeLog
===================================================================
RCS file: /cvsroot/dotgnu-pnet/pnet/ChangeLog,v
retrieving revision 1.1956
retrieving revision 1.1957
diff -C2 -r1.1956 -r1.1957
*** ChangeLog   10 Dec 2002 05:04:39 -0000      1.1956
--- ChangeLog   10 Dec 2002 07:16:01 -0000      1.1957
***************
*** 8,11 ****
--- 8,14 ----
        layout and to dump information about the system and tool versions.
  
+       * .cvsignore, HACKING, README, madcow: add the "madcow" script,
+       for diagnosing common build problems.
+ 
  2002-12-10  Gopal.V  <address@hidden>
  

Index: HACKING
===================================================================
RCS file: /cvsroot/dotgnu-pnet/pnet/HACKING,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -r1.4 -r1.5
*** HACKING     20 Mar 2002 00:20:47 -0000      1.4
--- HACKING     10 Dec 2002 07:16:01 -0000      1.5
***************
*** 106,109 ****
--- 106,118 ----
  before submitting them.
  
+ If you would like some assistance building the code or you are having
+ problems, then run the Portable.NET Mad Cow diagnostic utility, which
+ will walk you through it one step at a time:
+ 
+       $ ./madcow
+ 
+ This script dumps out a "madcow.log" file which can help the Portable.NET
+ developers diagnose any build problems that you may be having.
+ 
  Standards
  ---------

Index: README
===================================================================
RCS file: /cvsroot/dotgnu-pnet/pnet/README,v
retrieving revision 1.5
retrieving revision 1.6
diff -C2 -r1.5 -r1.6
*** README      4 Jul 2002 12:51:33 -0000       1.5
--- README      10 Dec 2002 07:16:01 -0000      1.6
***************
*** 21,24 ****
--- 21,34 ----
      $ make
  
+ If you would like some assistance building the code or you are having
+ problems, then run the Portable.NET Mad Cow diagnostic utility, which
+ will walk you through it one step at a time:
+ 
+       $ cd pnet-VERSION
+       $ ./madcow
+ 
+ This script dumps out a "madcow.log" file which can help the Portable.NET
+ developers diagnose any build problems that you may be having.
+ 
  See the HACKING file in this directory for more information on
  building and contributing to Portable.NET.




reply via email to

[Prev in Thread] Current Thread [Next in Thread]