Re: Why doesn't autoconf like our /bin/sh?
On Thu, May 29, 2008 at 12:04:41AM -0400, John Baldwin wrote: On Sunday 25 May 2008 11:45:37 am Stefan Farfeleder wrote: On Sun, May 25, 2008 at 09:06:47AM -0600, John E Hein wrote: FWIW, it seems bash and sh report line number differently. # grep -n ^ ~/tmp/ln 1:#!/bin/sh 2:echo f line: $LINENO 3:f() 4:{ 5:echo f line: $LINENO 6:} 7: 8:f 9:echo main line: $LINENO 10:f # /bin/sh ~/tmp/ln f line: 2 f line: 3 main line: 9 f line: 3 # bash ~/tmp/ln f line: 2 f line: 5 main line: 9 f line: 5 Yes, I know. I think it is a bug in bash as SUSv3 states: Set by the shell to a decimal number representing the current sequential line number (numbered starting with 1) within a script or function before it executes each command. Actually, the bash way seems more intuitive. And it does say the current sequentional line number within a ... function before it executes each command The within a function implies that this property goes inside of functions instead of forcing all commands in a function to use the starting line of the function which is what you are saying? I've started a thread about that on [EMAIL PROTECTED] ___ freebsd-hackers@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-hackers To unsubscribe, send any mail to [EMAIL PROTECTED]
Re: Why doesn't autoconf like our /bin/sh?
On Sunday 25 May 2008 11:45:37 am Stefan Farfeleder wrote: On Sun, May 25, 2008 at 09:06:47AM -0600, John E Hein wrote: FWIW, it seems bash and sh report line number differently. # grep -n ^ ~/tmp/ln 1:#!/bin/sh 2:echo f line: $LINENO 3:f() 4:{ 5:echo f line: $LINENO 6:} 7: 8:f 9:echo main line: $LINENO 10:f # /bin/sh ~/tmp/ln f line: 2 f line: 3 main line: 9 f line: 3 # bash ~/tmp/ln f line: 2 f line: 5 main line: 9 f line: 5 Yes, I know. I think it is a bug in bash as SUSv3 states: Set by the shell to a decimal number representing the current sequential line number (numbered starting with 1) within a script or function before it executes each command. Actually, the bash way seems more intuitive. And it does say the current sequentional line number within a ... function before it executes each command The within a function implies that this property goes inside of functions instead of forcing all commands in a function to use the starting line of the function which is what you are saying? -- John Baldwin ___ freebsd-hackers@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-hackers To unsubscribe, send any mail to [EMAIL PROTECTED]
Re: Why doesn't autoconf like our /bin/sh?
On Sun, May 25, 2008 at 09:06:47AM -0600, John E Hein wrote: FWIW, it seems bash and sh report line number differently. # grep -n ^ ~/tmp/ln 1:#!/bin/sh 2:echo f line: $LINENO 3:f() 4:{ 5:echo f line: $LINENO 6:} 7: 8:f 9:echo main line: $LINENO 10:f # /bin/sh ~/tmp/ln f line: 2 f line: 3 main line: 9 f line: 3 # bash ~/tmp/ln f line: 2 f line: 5 main line: 9 f line: 5 Yes, I know. I think it is a bug in bash as SUSv3 states: Set by the shell to a decimal number representing the current sequential line number (numbered starting with 1) within a script or function before it executes each command. Stefan ___ freebsd-hackers@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-hackers To unsubscribe, send any mail to [EMAIL PROTECTED]
Re: Why doesn't autoconf like our /bin/sh?
Stefan Farfeleder wrote at 17:45 +0200 on May 25, 2008: On Sun, May 25, 2008 at 09:06:47AM -0600, John E Hein wrote: FWIW, it seems bash and sh report line number differently. # grep -n ^ ~/tmp/ln 1:#!/bin/sh 2:echo f line: $LINENO 3:f() 4:{ 5:echo f line: $LINENO 6:} 7: 8:f 9:echo main line: $LINENO 10:f # /bin/sh ~/tmp/ln f line: 2 f line: 3 main line: 9 f line: 3 # bash ~/tmp/ln f line: 2 f line: 5 main line: 9 f line: 5 Yes, I know. I think it is a bug in bash as SUSv3 states: Set by the shell to a decimal number representing the current sequential line number (numbered starting with 1) within a script or function before it executes each command. Okay. Not knowing more context, I guess the 'or' (script or function) leaves things somewhat subject to interpretation. ___ freebsd-hackers@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-hackers To unsubscribe, send any mail to [EMAIL PROTECTED]
Re: Why doesn't autoconf like our /bin/sh?
Stefan Farfeleder wrote at 16:13 +0200 on May 16, 2008: On Fri, May 16, 2008 at 10:11:43AM -0400, Mike Meyer wrote: On Fri, 16 May 2008 09:44:33 +0200 Stefan Farfeleder [EMAIL PROTECTED] wrote: On Sun, Mar 09, 2008 at 03:27:12PM -0400, Mike Meyer wrote: I've stumbled on to an obscure problem with autoconf 2.61, and I'm not sure quite what to do with it. I've already sent mail to the autoconf folks, but I'd like to understand what's going on. The problem is that, on a FreeBSD system with only /bin/sh and the ports zsh as installed shells, if you have SHELL set to zsh when invoking the autoconf-generated configure script, the script produces a broken Makefile. It doesn't generate an error, it just complains that: Can you please retry? /bin/sh now supports expanding $LINENO which was often the reason for configure not liking it. Which branch, and how recently? HEAD and yesterday. FWIW, it seems bash and sh report line number differently. # grep -n ^ ~/tmp/ln 1:#!/bin/sh 2:echo f line: $LINENO 3:f() 4:{ 5:echo f line: $LINENO 6:} 7: 8:f 9:echo main line: $LINENO 10:f # /bin/sh ~/tmp/ln f line: 2 f line: 3 main line: 9 f line: 3 # bash ~/tmp/ln f line: 2 f line: 5 main line: 9 f line: 5 ___ freebsd-hackers@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-hackers To unsubscribe, send any mail to [EMAIL PROTECTED]
Re: Why doesn't autoconf like our /bin/sh?
On Fri, 16 May 2008 16:13:07 +0200 Stefan Farfeleder [EMAIL PROTECTED] wrote: On Fri, May 16, 2008 at 10:11:43AM -0400, Mike Meyer wrote: On Fri, 16 May 2008 09:44:33 +0200 Stefan Farfeleder [EMAIL PROTECTED] wrote: On Sun, Mar 09, 2008 at 03:27:12PM -0400, Mike Meyer wrote: I've stumbled on to an obscure problem with autoconf 2.61, and I'm not sure quite what to do with it. I've already sent mail to the autoconf folks, but I'd like to understand what's going on. The problem is that, on a FreeBSD system with only /bin/sh and the ports zsh as installed shells, if you have SHELL set to zsh when invoking the autoconf-generated configure script, the script produces a broken Makefile. It doesn't generate an error, it just complains that: Can you please retry? /bin/sh now supports expanding $LINENO which was often the reason for configure not liking it. And autoconf seems happy to use it. Thanks, mike ___ freebsd-hackers@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-hackers To unsubscribe, send any mail to [EMAIL PROTECTED]
Re: Why doesn't autoconf like our /bin/sh?
On Sun, Mar 09, 2008 at 03:27:12PM -0400, Mike Meyer wrote: I've stumbled on to an obscure problem with autoconf 2.61, and I'm not sure quite what to do with it. I've already sent mail to the autoconf folks, but I'd like to understand what's going on. The problem is that, on a FreeBSD system with only /bin/sh and the ports zsh as installed shells, if you have SHELL set to zsh when invoking the autoconf-generated configure script, the script produces a broken Makefile. It doesn't generate an error, it just complains that: Can you please retry? /bin/sh now supports expanding $LINENO which was often the reason for configure not liking it. Stefan ___ freebsd-hackers@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-hackers To unsubscribe, send any mail to [EMAIL PROTECTED]
Re: Why doesn't autoconf like our /bin/sh?
On Fri, 16 May 2008 09:44:33 +0200 Stefan Farfeleder [EMAIL PROTECTED] wrote: On Sun, Mar 09, 2008 at 03:27:12PM -0400, Mike Meyer wrote: I've stumbled on to an obscure problem with autoconf 2.61, and I'm not sure quite what to do with it. I've already sent mail to the autoconf folks, but I'd like to understand what's going on. The problem is that, on a FreeBSD system with only /bin/sh and the ports zsh as installed shells, if you have SHELL set to zsh when invoking the autoconf-generated configure script, the script produces a broken Makefile. It doesn't generate an error, it just complains that: Can you please retry? /bin/sh now supports expanding $LINENO which was often the reason for configure not liking it. Which branch, and how recently? mike -- Mike Meyer [EMAIL PROTECTED] http://www.mired.org/consulting.html Independent Network/Unix/Perforce consultant, email for more information. O ascii ribbon campaign - stop html mail - www.asciiribbon.org ___ freebsd-hackers@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-hackers To unsubscribe, send any mail to [EMAIL PROTECTED]
Re: Why doesn't autoconf like our /bin/sh?
On Fri, May 16, 2008 at 10:11:43AM -0400, Mike Meyer wrote: On Fri, 16 May 2008 09:44:33 +0200 Stefan Farfeleder [EMAIL PROTECTED] wrote: On Sun, Mar 09, 2008 at 03:27:12PM -0400, Mike Meyer wrote: I've stumbled on to an obscure problem with autoconf 2.61, and I'm not sure quite what to do with it. I've already sent mail to the autoconf folks, but I'd like to understand what's going on. The problem is that, on a FreeBSD system with only /bin/sh and the ports zsh as installed shells, if you have SHELL set to zsh when invoking the autoconf-generated configure script, the script produces a broken Makefile. It doesn't generate an error, it just complains that: Can you please retry? /bin/sh now supports expanding $LINENO which was often the reason for configure not liking it. Which branch, and how recently? HEAD and yesterday. ___ freebsd-hackers@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-hackers To unsubscribe, send any mail to [EMAIL PROTECTED]
Re: Why doesn't autoconf like our /bin/sh?
On Sun, Mar 09, 2008 at 03:27:12PM -0400, Mike Meyer wrote: I've stumbled on to an obscure problem with autoconf 2.61, and I'm not sure quite what to do with it. I've already sent mail to the autoconf folks, but I'd like to understand what's going on. Simplest explanation is that autotools are broken by design. After my recent experiences, I've come to the conclusion that they are designed to impede the portability of software. My question is, why doesn't the configure script just accept /bin/sh? Probably because it's not bash. -- Peter Jeremy Please excuse any delays as the result of my ISP's inability to implement an MTA that is either RFC2821-compliant or matches their claimed behaviour. pgp9LLuqHZOY4.pgp Description: PGP signature
Re: Why doesn't autoconf like our /bin/sh?
On Tue, Mar 11, 2008 at 07:08:20PM +1100, Peter Jeremy wrote: On Sun, Mar 09, 2008 at 03:27:12PM -0400, Mike Meyer wrote: I've stumbled on to an obscure problem with autoconf 2.61, and I'm not sure quite what to do with it. I've already sent mail to the autoconf folks, but I'd like to understand what's going on. Simplest explanation is that autotools are broken by design. After my recent experiences, I've come to the conclusion that they are designed to impede the portability of software. My question is, why doesn't the configure script just accept /bin/sh? Probably because it's not bash. This is also the reason why I install bash if I had linux-bash in my path, because it will use linux-bash instead of sh and starts finding linux things which it shouldn't for native builds. The native bash is in path befor the linix version so it at least uses a native compiled shell. -- B.Walterhttp://www.bwct.de http://www.fizon.de [EMAIL PROTECTED] [EMAIL PROTECTED][EMAIL PROTECTED] ___ freebsd-hackers@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-hackers To unsubscribe, send any mail to [EMAIL PROTECTED]
Re: Why doesn't autoconf like our /bin/sh?
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Mike Meyer wrote: I've stumbled on to an obscure problem with autoconf 2.61, and I'm not sure quite what to do with it. I've already sent mail to the autoconf folks, but I'd like to understand what's going on. The problem is that, on a FreeBSD system with only /bin/sh and the ports zsh as installed shells, if you have SHELL set to zsh when invoking the autoconf-generated configure script, the script produces a broken Makefile. It doesn't generate an error, it just complains that: as_func_failure succeeded. as_func_failure succeeded. No shell found that supports shell functions. Please tell [EMAIL PROTECTED] about your system, including any error possibly output before this message and then runs to completion, with no other indication of an error, and non in the config.log file either. This has happened on multiple different FreeBSD systems (including both 6-STABLE and 7-RELEASE), on multiple autoconf scripts (possibly from multiple versions of autoconf). Installing bash (or presumably any of the other shells that the configure script looks for) changes this, and it works fine. Setting SHELL to /bin/sh, or unsetting it, also solves this. And of course, if you build from ports, SHELL gets set to /bin/sh, so there isn't a problem at all (which probably has a lot to do with why I never noticed it before - the ports systems pretty much covers most of my needs). From poking at things it seems that autoconf isn't happy with /bin/sh for some reason, even though it works. With SHELL set to zsh, it then tries that - and again isn't happy. However, it's not so unhappy that it fails completely, so it tries to run with whatever shell it tried last. My question is, why doesn't the configure script just accept /bin/sh? After all, it's going to work. Is there an autoconf person who knows this one? The top of the configure script I just inspected (the one from print/libxslt) called out, on the top line: #!/bin/sh and so, as long as you do have a real shell there (which you have to have) should really work, BUT I know, from past experience, that many, many Linuxers, when told that their script doesn't work with any shell but Bash, will just tell you but why don't you run Bash? as if no one should ever run any other shell. I went to far, back when I ran Gentoo, to try to fix some broken scripts wrt non-bash usage, but no one really cared to fix that kind of thing. It's not going to be a proboem with configure, but it's possible that soome script called by configure is setting it's own shell. Configure probably needs, way up at the top, something like export SHELL=/bin/sh but don't hold your breath, and if Linuxers gave it a try, they'd probably want to peg it to bash, and that'd cause worse problems, because Linux and FreeBSD store bash in a different places. But if you're considering some holy war to try to convince Linux folks to correct this, DING DING, let me off at the next stop, please. Thanks, mike -BEGIN PGP SIGNATURE- Version: GnuPG v2.0.4 (FreeBSD) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQFH1GEnz62J6PPcoOkRAjiMAJ9NfsAKek+9Kjn+nY8cSrhwA1u1MgCeIry3 /T4m3hgOGlA3r2mgrj2Y8W4= =aJDf -END PGP SIGNATURE- ___ freebsd-hackers@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-hackers To unsubscribe, send any mail to [EMAIL PROTECTED]
Re: Why doesn't autoconf like our /bin/sh?
On Sun, 09 Mar 2008 18:13:59 -0400 Chuck Robey [EMAIL PROTECTED] wrote: -BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Mike Meyer wrote: I've stumbled on to an obscure problem with autoconf 2.61, and I'm not sure quite what to do with it. I've already sent mail to the autoconf folks, but I'd like to understand what's going on. The problem is that, on a FreeBSD system with only /bin/sh and the ports zsh as installed shells, if you have SHELL set to zsh when invoking the autoconf-generated configure script, the script produces a broken Makefile. It doesn't generate an error, it just complains that: as_func_failure succeeded. as_func_failure succeeded. No shell found that supports shell functions. Please tell [EMAIL PROTECTED] about your system, including any error possibly output before this message then runs to completion, with no other indication of an error, and non in the config.log file either. This has happened on multiple different FreeBSD systems (including both 6-STABLE and 7-RELEASE), on multiple autoconf scripts (possibly from multiple versions of autoconf). Installing bash (or presumably any of the other shells that the configure script looks for) changes this, and it works fine. Setting SHELL to /bin/sh, or unsetting it, also solves this. And of course, if you build from ports, SHELL gets set to /bin/sh, so there isn't a problem at all (which probably has a lot to do with why I never noticed it before - the ports systems pretty much covers most of my needs). From poking at things it seems that autoconf isn't happy with /bin/sh for some reason, even though it works. With SHELL set to zsh, it then tries that - and again isn't happy. However, it's not so unhappy that it fails completely, so it tries to run with whatever shell it tried last. My question is, why doesn't the configure script just accept /bin/sh? After all, it's going to work. Is there an autoconf person who knows this one? The top of the configure script I just inspected (the one from print/libxslt) called out, on the top line: #!/bin/sh and so, as long as you do have a real shell there (which you have to have) should really work, BUT I know, from past experience, that many, many Linuxers, when told that their script doesn't work with any shell but Bash, will just tell you but why don't you run Bash? as if no one should ever run any other shell. I went to far, back when I ran Gentoo, to try to fix some broken scripts wrt non-bash usage, but no one really cared to fix that kind of thing. It's not going to be a proboem with configure, but it's possible that soome script called by configure is setting it's own shell. Configure probably needs, way up at the top, something like export SHELL=/bin/sh but don't hold your breath, and if Linuxers gave it a try, they'd probably want to peg it to bash, and that'd cause worse problems, because Linux and FreeBSD store bash in a different places. I don't really think this is a bash vs. sh issue, as the point of the code that's failing is all about trying to figure out which of the available shell-like things will do the job it needs to do. If the autoconf folks were going to say just use bash, they'd skip all this magic, and just make the script a bash script (which would mean that bash couldn't use autoconf). Worse yet, said job verges on the impossible, so I can understand why the code is a bit fuzzy about what acceptable is. Shells apparently wind up in three classes: 1) Not usable - none of the shells discussed are put here. 2) Maybe usable - both sh and zsh are put here. 3) Definitely usable - bash gets put here. If a definitely usable shell is found, the search stops, and configure just uses it. If none of the shells are maybe usable, then configure stops and complains. Otherwise, we try the last shell that was maybe usable, and $SHELL is always the last one tried. So there are at *least* three things that could be considered broken, in that changing them would fix the problem I encountered. 1) Our /bin/sh isn't classified as Definitely usable. 2) zsh is Not usable. 3) zsh is classified as Maybe usable. #1 could be fixed on our side, if we understood why it wasn't usable. It could also be fixed by the autoconf folks. #2 has to be fixed by the zsh folks. #3 has to be fixed by the autoconf folks. But if you're considering some holy war to try to convince Linux folks to correct this, DING DING, let me off at the next stop, please. No, I'm not considering a holy war about this - I'm just curious as to what's going on. After that, we can call the jihad :-). mike -- Mike Meyer [EMAIL PROTECTED] http://www.mired.org/consulting.html Independent Network/Unix/Perforce consultant, email for more information. ___ freebsd-hackers@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-hackers To
Re: Why doesn't autoconf like our /bin/sh?
On Sun, Mar 09, 2008 at 07:40:50PM -0400, Mike Meyer wrote: 1) Our /bin/sh isn't classified as Definitely usable. 2) zsh is Not usable. 3) zsh is classified as Maybe usable. The third is definitely true. Joerg ___ freebsd-hackers@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-hackers To unsubscribe, send any mail to [EMAIL PROTECTED]
Why doesn't autoconf like zsh? (was: Why doesn't autoconf like our /bin/sh?)
On Sunday, 9 March 2008 at 15:27:12 -0400, Mike Meyer wrote: I've stumbled on to an obscure problem with autoconf 2.61, and I'm not sure quite what to do with it. I've already sent mail to the autoconf folks, but I'd like to understand what's going on. The problem is that, on a FreeBSD system with only /bin/sh and the ports zsh as installed shells, if you have SHELL set to zsh when invoking the autoconf-generated configure script, the script produces a broken Makefile. It doesn't generate an error, it just complains that: ... Setting SHELL to /bin/sh, or unsetting it, also solves this. This is pretty clear that this is a zsh issue, either because of bugs in zsh or (more likely, I'd guess) in autoconf. Greg -- See complete headers for address and phone numbers. pgpLIuVRXmxfW.pgp Description: PGP signature
Re: Why doesn't autoconf like our /bin/sh?
On Sun, 9 Mar 2008, Mike Meyer wrote: [...] So there are at *least* three things that could be considered broken, in that changing them would fix the problem I encountered. 1) Our /bin/sh isn't classified as Definitely usable. 2) zsh is Not usable. 3) zsh is classified as Maybe usable. #1 could be fixed on our side, if we understood why it wasn't usable. It could also be fixed by the autoconf folks. #2 has to be fixed by the zsh folks. #3 has to be fixed by the autoconf folks. Zsh has a large number of configuration settings that can make it more or less sh(1)-compatible. I've been bitten by SH_WORD_SPLIT, which defaults to being incompatible, IIRC. Since zsh is my interactive shell of preference, I spent a few minutes trying to reproduce your problems, but failed. Perhaps there is something in your .z* config files that make things go awry? $.02, /Mikko ___ freebsd-hackers@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-hackers To unsubscribe, send any mail to [EMAIL PROTECTED]
Re: Why doesn't autoconf like our /bin/sh?
On Sun, 9 Mar 2008 17:41:15 -0700 (PDT) Mikko Työläjärvi [EMAIL PROTECTED] wrote: On Sun, 9 Mar 2008, Mike Meyer wrote: [...] So there are at *least* three things that could be considered broken, in that changing them would fix the problem I encountered. 1) Our /bin/sh isn't classified as Definitely usable. 2) zsh is Not usable. 3) zsh is classified as Maybe usable. #1 could be fixed on our side, if we understood why it wasn't usable. It could also be fixed by the autoconf folks. #2 has to be fixed by the zsh folks. #3 has to be fixed by the autoconf folks. Zsh has a large number of configuration settings that can make it more or less sh(1)-compatible. I've been bitten by SH_WORD_SPLIT, which defaults to being incompatible, IIRC. Since zsh is my interactive shell of preference, I spent a few minutes trying to reproduce your problems, but failed. Perhaps there is something in your .z* config files that make things go awry? Note that to reproduce it, you must *not* have any shells installed that the configure script classifies as definitely usable. In particular, if you've got bash installed (and a number of ports will install it for you), the configure script finds that and will use it. Also, doing things through ports causes SHELL to be set to /bin/sh (normally, anway), and hence masks the problem. There seem to be a fwe things in my environment specific to zsh - other than all the completion stuff, of course, which shouldn't make any difference - MULTIOS, zsh, FPATH and extendedglob. Turning them all off doesn't make any difference. Thanks, mike -- Mike Meyer [EMAIL PROTECTED] http://www.mired.org/consulting.html Independent Network/Unix/Perforce consultant, email for more information. ___ freebsd-hackers@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-hackers To unsubscribe, send any mail to [EMAIL PROTECTED]