Stefano Lattarini <stefano.lattar...@gmail.com> 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? 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. 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 ".". Ian