Re: configure cd'ing to home

2010-07-26 Thread Eric Blake
[adding bug-automake]

On 07/23/2010 05:31 PM, Sam Silla wrote:
 Hi,

 I'm getting the following error:

  cd   /bin/sh ./config.status Makefile
 /bin/sh: ./config.status: No such file or directory

 It seems the configure file is changing directories to home, which isn't
 correct. Any ideas what's wrong? I'm guessing the srcdir variable isn't
 being set properly.

Which package was this where you encountered the problem?  Perhaps it is
a problem specific to that package?

At any rate, I think the problem is more likely to be in automake than
in autoconf, since this is a case of bad quoting in the Makefile, which
is not under autoconf's control.

In particular, I note that automake generates the following:

cd $(top_builddir)  $(SHELL) ./config.status $@
$(am__depfiles_maybe);; \

If, for some reason, $(top_builddir) didn't get defined correctly, then
that would explain your symptoms.  Automake could protect itself a bit
better by using

cd '$(top_builddir)'  ...

since cd will succeed but cd '' will fail, but that still doesn't
explain the root cause for $(top_builddir) not expanding correctly.

Or maybe the package you are compiling didn't use automake, and it is a
bug in their hand-written Makefile.in?

-- 
Eric Blake   ebl...@redhat.com+1-801-349-2682
Libvirt virtualization library http://libvirt.org



signature.asc
Description: OpenPGP digital signature
___
Autoconf mailing list
Autoconf@gnu.org
http://lists.gnu.org/mailman/listinfo/autoconf


Re: configure cd'ing to home

2010-07-26 Thread Eric Blake
On 07/26/2010 07:40 AM, Eric Blake wrote:
 cd '$(top_builddir)'  ...
 
 since cd will succeed but cd '' will fail, but that still doesn't
 explain the root cause for $(top_builddir) not expanding correctly.

Scratch that - bash 4.1, zsh, and dash all share the same bug:

$ bash -c 'cd '; echo $?
0

ksh93 is even worse - it changes to the home directory anyways.

Of all the shells I tested, _only_ Solaris /bin/sh errored out!

$ cd /tmp
$ /bin/sh -c 'cd ; echo $?; pwd'
/bin/sh: null directory
$ echo $?
1

Looks like a gotcha to document in the autoconf manual.

-- 
Eric Blake   ebl...@redhat.com+1-801-349-2682
Libvirt virtualization library http://libvirt.org



signature.asc
Description: OpenPGP digital signature
___
Autoconf mailing list
Autoconf@gnu.org
http://lists.gnu.org/mailman/listinfo/autoconf


Re: configure cd'ing to home

2010-07-26 Thread Ralf Wildenhues
Hi Sam,

* Sam Silla wrote on Sat, Jul 24, 2010 at 01:31:27AM CEST:
 I'm getting the following error:
 
  cd   /bin/sh ./config.status Makefile
 /bin/sh: ./config.status: No such file or directory
 
 It seems the configure file is changing directories to home, which isn't
 correct. Any ideas what's wrong? I'm guessing the srcdir variable isn't
 being set properly.

Well, what exactly did you type to get the above ('make -e' by chance?)
and what is
  grep ^top_srcdir Makefile
  grep ^top_srcdir source_tree/Makefile.am
?

Which autoconf version (./config.status --version), automake version (head
Makefile), and make version do you use?

It could help to see the above happen with
  make SHELL=/bin/sh -x

Cheers,
Ralf

___
Autoconf mailing list
Autoconf@gnu.org
http://lists.gnu.org/mailman/listinfo/autoconf