Subject: bug#7833: automake uses two different values for DejaGNU srcdir

From: Stefano Lattarini <[email-masked]>
Date: Thu, 13 Jan 2011 22:04:27 +0100

On Thursday 13 January 2011, Ian Lance wrote:
> Stefano Lattarini <[email-masked]> writes:
> 
> > Relative (as I expected):
> >
> >   $ cat dejagnu-srcdir-is-absolute.dir/site.exp 
> >   ## these variables are automatically generated by make ##
> >   # Do not edit here.  If you wish to override these values
> >   # edit the last section
> >   set srcdir .
> >   set objdir /home/stefano/src/automake/tests/dejagnu-srcdir-is-absolute.dir
> >   ## All variables above are generated by configure. Do Not Edit ##
> >
> > But then, why the testcase suceeds?  I would expect it to fail!
> 
> 1) Does it matter?
>
IMHO yes (a little).  Today I set out to fix this simple bug, but first
I wanted to write a testcase to expose it.  Well, I haven't been able to
do so!

> It seems clear to me that if automake is going to specify the srcdir
> in two different ways, that the two ways should use the same value.
>
I agree with this.

> 2) DejaGNU is a horrible program and the problem is subtle, even more
> subtle than I thought.  DejaGNU loads site.exp, then uses the current
> value of $srcdir to find and run the tool init script.  That is where it
> was going wrong for me.  After that, it reprocesses the command line
> options, setting srcdir back to what it was before.  If you create a
> file "lib/tcl.exp" and add a line
>     send_user "tcl.exp: $srcdir\n"
> you will see that while executing tcl.exp, srcdir is ".".
>
Thanks for this explanation!  I will use it to fix my testcase.

Regards,
  Stefano