bug-dejagnu
[Top][All Lists]
Advanced

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

[Bug-dejagnu] [PATCH] A swarm of simple patches against dejagnu-20010126


From: Nix
Subject: [Bug-dejagnu] [PATCH] A swarm of simple patches against dejagnu-20010126
Date: 27 Jun 2001 20:47:41 +0100
User-agent: Gnus/5.0808 (Gnus v5.8.8) XEmacs/21.4 (Developer-Friendly Unix APIs)

[Cc:ed to the DejaGnu maintainer on the offchance that some of it might
 still apply; the stuff outside of the dejagnu/ directory will not,
 of course, because DejaGnu itself doesn't include Tcl, expect-5.26
 and all the rest of it.]

These patches fix a few niggles in DejaGnu.

- The means used to locate the dejagnu expect scripts in runtest
  is, as the source memorably puts it, reliant upon `a very weak
  assumption' (which broke for me); so this patch gets autoconf to
  generate runtest (substituting in the known path to the expect
  scripts) and mark it executable. (The weakest part of the
  patch is the part which makes runtest executable; this should
  probably be done from the makefile and autoconf-probe for
  chmod, so that things still work if it is not there. I'll be
  happy to rework that bit.)

- config/unix.exp is careful to set the LD_LIBRARY_PATH to that
  which the tests requested; but it seems to assume that
  LD_LIBRARY_PATH was empty beforehand, replacing it rather than
  appending to it, and discarding it afterwards. This can lead to
  massive numbers of test failures if your LD_LIBRARY_PATH
  contains things which the tests need to run on this particular
  system, but which are not necessarily needed elsewhere.

- The Cygnus configure script doesn't use site-config files.

- One of the autoconf-generated configure scripts (in expect/testsuite)
  sincludes aclocal.m4 from its parent directory; this makes
  autoconf-2.13 crash, and makes no sense in any case.

Here are the pieces, one after another. I've snipped the generated
configure, scripts even though the regeneration is in the changelog,
because they bloat the patch unnecessarily.

dejagnu/runtest should be manually renamed to dejagnu/runtest.in before
this patch is applied; I didn't include the renaming because it would
bloat the patch overmuch.

2001-06-25  Nix  <address@hidden>

        * config/unix.exp: Respect the LD_LIBRARY_PATH and SHLIB_PATH
        in the environment.

        * runtest: Rename to indicate autoconfiscation.
        * runtest.in: Get @pkgdatadir@ directly from configure rather than
        from the @bindir@; compute runtest.exp location from that, but
        still try $execpath for in-source-tree execution.
        Remove commented-out $rootme.
        * configure.in: Generate runtest and make it executable.
        * configure: Regenerated.

diff -durN 20010126-orig/dejagnu/config/unix.exp 
20010126/dejagnu/config/unix.exp
--- 20010126-orig/dejagnu/config/unix.exp       Tue Jun 26 22:01:40 2001
+++ 20010126/dejagnu/config/unix.exp    Tue Jun 26 22:05:36 2001
@@ -64,10 +64,18 @@
        }
 
         if [info exists ld_library_path] {
-            setenv LD_LIBRARY_PATH $ld_library_path                 
+            if { [getenv LD_LIBRARY_PATH] != "" } {
+                set old_ld_library_path [getenv LD_LIBRARY_PATH]
+            }
+
+            if { [getenv SHLIB_PATH] != "" } {
+                set old_shlib_path [getenv SHLIB_PATH]
+            }
+
+            setenv LD_LIBRARY_PATH $ld_library_path
             setenv SHLIB_PATH $ld_library_path
         }
- 
+
        set id [remote_spawn $dest "$command" "readonly"];
        if { $id < 0 } {
            set output "remote_spawn failed"
@@ -82,8 +90,18 @@
        # fix in the first place; this just tries to minimize the resulting
        # crap.)
        if [info exists ld_library_path] {
-           unsetenv LD_LIBRARY_PATH
-           unsetenv SHLIB_PATH
+            if [info exists old_ld_library_path] {
+                setenv LD_LIBRARY_PATH $old_ld_library_path
+                unset old_ld_library_path
+            } else {
+                unsetenv LD_LIBRARY_PATH
+            }
+            if [info exists old_shlib_path] {
+                setenv SHLIB_PATH $old_shlib_path
+                unset old_shlib_path
+            } else {
+                unsetenv SHLIB_PATH
+            }
        }
     } else { 
        set remotefile "/tmp/[file tail $prog].[pid]"
diff -durN 20010126-orig/dejagnu/configure.in 20010126/dejagnu/configure.in
--- 20010126-orig/dejagnu/configure.in  Tue Jun 26 22:01:40 2001
+++ 20010126/dejagnu/configure.in       Tue Jun 26 22:05:36 2001
@@ -20,5 +20,7 @@
 
 AC_CONFIG_SUBDIRS(example/calc)
 
-AC_OUTPUT(Makefile doc/Makefile example/Makefile testsuite/Makefile)
+AC_OUTPUT(Makefile runtest doc/Makefile example/Makefile testsuite/Makefile)
 
+chmod +x runtest

diff -durN 20010126-orig/dejagnu/runtest.in 20010126/dejagnu/runtest.in
--- 20010126-orig/dejagnu/runtest.in    Tue Jun 26 22:01:40 2001
+++ 20010126/dejagnu/runtest.in Tue Jun 26 22:05:36 2001
@@ -3,12 +3,22 @@
 # runtest -- basically all this script does is find the proper expect
 #           shell and then run DejaGnu.
 #
-# Written by Rob Savoye <address@hidden>
+# Originally written by Rob Savoye <address@hidden>
 #
 
 #
+# Prefixes and paths.
+#
+
address@hidden@
address@hidden@
address@hidden@
address@hidden@/@PACKAGE@
+
+#
 # Get the execution path to this script and the current directory.
 #
+
 mypath=${0-.}
 if expr ${mypath} : '.*/.*' > /dev/null
 then
@@ -27,7 +37,6 @@
     IFS="$save_ifs"
 fi
 execpath=`echo ${mypath} | sed  -e 's@/[^/]*$@@'`
-# rootme=`pwd`
 
 #
 # get the name by which runtest was invoked and extract the config triplet
@@ -43,13 +52,13 @@
 #
 # Find the right expect binary to use. If a variable EXPECT exists,
 # it takes precedence over all other tests. Otherwise look for a freshly
-# built one, and then use one in the path.
+# built one, and then use the one in the binary directory.
 #
 if [ x"$EXPECT" != x ] ; then
   expectbin=$EXPECT
 else
-  if [ -x "$execpath/expect" ] ; then
-    expectbin=$execpath/expect
+  if [ -x "$bindir/expect" ] ; then
+    expectbin=$bindir/expect
   else
       expectbin=expect
     fi
@@ -84,19 +93,10 @@
 fi
 
 #
-# find runtest.exp. First we look in it's installed location, otherwise
-# start if from the source tree.
-#
-# runtest.exp is found in (autoconf-configure-set) @datadir@, but
-# $execpath is @address@hidden  We're assuming that 
-#
-# @datadir@ == @bindir@/../share
-# or
-# @datadir@ == @bindir@/../../share
-#
-# which is a very weak assumption
+# Find runtest.exp. First, look in the source tree (assumed == execpath),
+# otherwise use the installed location.
 #
-for i in `echo ${execpath} | sed  -e 's@/[^/]*$@/share/dejagnu@'` `echo 
${execpath} | sed  -e 's@/[^/]*/[^/]*$@/share/dejagnu@'` $execpath ; do
+for i in $execpath $pkgdatadir; do
     if expr $verbose \> 1 > /dev/null ; then
        echo Looking for $i/runtest.exp.
     fi  


The patch to expect; I'd be glad if someone could say why on earth this
was done; there *must* have been a reason...

        * configure.in: Revert flee's patch; do not sinclude
        aclocal.m4.

diff -durN 20010126-orig/expect/testsuite/configure.in 
20010126/expect/testsuite/configure.in
--- 20010126-orig/expect/testsuite/configure.in Tue Jun 26 22:01:44 2001
+++ 20010126/expect/testsuite/configure.in      Tue Jun 26 22:05:36 2001
@@ -1,5 +1,4 @@
 dnl Process this file with autoconf to produce a configure script.
-sinclude(../aclocal.m4)
 AC_INIT(exp_test.c)
 
 CY_AC_PATH_TCLCONFIG


The patch to the Cygnus configure script:

        * configure: Use site-config file.
        Set the prefix and exec_prefix to NONE around the site-config call
        if not explicitly set.
        Default exec_prefix as soon as possible.

diff -durN 20010126-orig/configure 20010126/configure
--- 20010126-orig/configure     Tue Jun 26 22:01:40 2001
+++ 20010126/configure  Tue Jun 26 22:05:35 2001
@@ -516,6 +516,33 @@
        exit 1
 fi
 
+# default exec_prefix
+case "${exec_prefixoption}" in
+"") exec_prefix="\$(prefix)" ;;
+*) ;;
+esac
+
+# Make the prefix and exec_prefix act like they do in autoconf-generated 
scripts,
+# with a value at site-config time of NONE if they have not been explicitly 
set.
+
+if [ "x$CONFIG_SITE" != "x" ]; then
+       if [ "x$prefixoption" = "x" ]; then
+               _save_prefix=$prefix
+               prefix=NONE
+       fi
+       if [ "x$exec_prefixoption" = "x" ]; then
+               _save_exec_prefix=$exec_prefix
+               exec_prefix=NONE
+       fi
+       . $CONFIG_SITE
+       if [ "x$prefixoption" = "x" -a "x$prefix" = "xNONE" ]; then
+               prefix=$_save_prefix
+       fi
+       if [ "x$exec_prefixoption" = "x" -a "x$exec_prefix" = "xNONE" ]; then
+               exec_prefix=$_save_exec_prefix
+       fi
+fi
+
 configsub=`echo ${progname} | sed 's/configure$/config.sub/'`
 moveifchange=`echo ${progname} | sed 's/configure$/move-if-change/'`
 ## the sed command below emulates the dirname command
@@ -577,12 +604,6 @@
         fi
 esac
 
-# default exec_prefix
-case "${exec_prefixoption}" in
-"") exec_prefix="\$(prefix)" ;;
-*) ;;
-esac
-
 # Define the trigger file to make sure configure will re-run whenever
 # the gcc version number changes.
 if [ "${with_gcc_version_trigger+set}" = set ]; then

-- 
`This will immediately become a flamewar.' --- Mark Mitchell



reply via email to

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