Re: config.sub breaks configuration on Solaris 10

2018-12-16 Thread Earnie

On 12/16/2018 4:53 PM, John Ericson wrote:
In GNU bash, -r, turns off special escape code handling. Configs don't 
have escape codes so it makes sense do this. Without that flag then, 
valid input stays valid, but some invalid input becomes valid too. So 
skipping that is unfortunate for GNU bash, but certainly makes sense for 
whatever odd shell you have.




The question that needs answered is what issue was being resolved by the 
addition of the -r?  The resolution here may need filters based on the 
build host.


--
Earnie

___
config-patches mailing list
config-patches@gnu.org
https://lists.gnu.org/mailman/listinfo/config-patches


Re: config.sub breaks configuration on Solaris 10

2018-12-16 Thread John Ericson
In GNU bash, -r, turns off special escape code handling. Configs don't have escape codes so it makes sense do this. Without that flag then, valid input stays valid, but some invalid input becomes valid too. So skipping that is unfortunate for GNU bash, but certainly makes sense for whatever odd shell you have.___
config-patches mailing list
config-patches@gnu.org
https://lists.gnu.org/mailman/listinfo/config-patches


Re: config.sub breaks configuration on Solaris 10

2018-12-16 Thread Bruno Haible
Ben Elliston wrote:
> > The same thing with traces shows where the problem occurs:
> 
> [...]
> 
> > + break 
> > IFS=-
> > + read -r field1 field2 field3 field4 
> > sun4
> > ../build-aux/config.sub: -r: is not an identifier
> 
> I don't know why we don't just drop -r in both instances in
> config.sub. I can't see why it should be necessary. The testsuite
> passes fine without them.

I don't know either. All I can see is that it was introduced on
2018-05-05:
https://git.savannah.gnu.org/gitweb/?p=config.git;a=commitdiff;h=65463c5913e38fff2d63958990263c7e4ad6ebee

Bruno


___
config-patches mailing list
config-patches@gnu.org
https://lists.gnu.org/mailman/listinfo/config-patches


Re: config.sub breaks configuration on Solaris 10

2018-12-16 Thread Ben Elliston
On Sun, Dec 16, 2018 at 10:03:27AM +0100, Bruno Haible wrote:

> The same thing with traces shows where the problem occurs:

[...]

> + break 
> IFS=-
> + read -r field1 field2 field3 field4 
> sun4
> ../build-aux/config.sub: -r: is not an identifier

I don't know why we don't just drop -r in both instances in
config.sub. I can't see why it should be necessary. The testsuite
passes fine without them.

Cheers, Ben


signature.asc
Description: PGP signature
___
config-patches mailing list
config-patches@gnu.org
https://lists.gnu.org/mailman/listinfo/config-patches


config.sub breaks configuration on Solaris 10

2018-12-16 Thread Bruno Haible
Hi,

This is a show-stopper: The current config.sub (since 2018-05-06) prevents
packages from being configured on Solaris 10.

I am testing the current grep snapshot
https://meyering.net/grep/grep-3.1.48-7eea.tar.xz
on Solaris 10/sparc, and the configuration fails like this:

 
checking for a BSD-compatible install... /opt/csw/bin/ginstall -c
checking whether build environment is sane... yes
checking for a thread-safe mkdir -p... /opt/csw/bin/gmkdir -p
checking for gawk... gawk
checking whether make sets $(MAKE)... yes
checking whether make supports nested variables... yes
checking whether make supports nested variables... (cached) yes
configure: error: cannot run /bin/sh ../build-aux/config.sub
 

When I look into the configure script, I see that it is running
  /bin/sh ../build-aux/config.sub sun4
and sees whether this succeeds or fails.

And indeed it fails:

 
$ /bin/sh ../build-aux/config.sub sun4
../build-aux/config.sub: -r: is not an identifier
 

The same thing with traces shows where the problem occurs:

 
$ /bin/sh -x ../build-aux/config.sub sun4
timestamp=2018-11-28
+ sed -e s,.*/,, 
+ echo ../build-aux/config.sub 
me=config.sub
usage=Usage: ../build-aux/config.sub [OPTION] CPU-MFR-OPSYS or ALIAS

Canonicalize a configuration name.

Options:
  -h, --help print this help, then exit
  -t, --time-stamp   print date of last modification, then exit
  -v, --version  print version number, then exit

Report bugs and patches to .
version=GNU config.sub (2018-11-28)

Copyright 1992-2018 Free Software Foundation, Inc.

This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
help=
Try `config.sub --help' for more information.
+ test 1 -gt 0 
+ break 
IFS=-
+ read -r field1 field2 field3 field4 
sun4
../build-aux/config.sub: -r: is not an identifier
 

The same issue has also been seen by other people:
http://mail-index.netbsd.org/pkgsrc-users/2018/10/05/msg027524.html

The attached patch fixes it for me.

Here's the ChangeLog entry, if you need one:


2018-12-16  Bruno Haible  

Fix fatal error on Solaris 10 with /bin/sh.
* config.sub (read_raw): New variable.
Use it in all 'read' commands.

diff --git a/build-aux/config.sub b/build-aux/config.sub
index 4670805..fd224f3 100755
--- a/build-aux/config.sub
+++ b/build-aux/config.sub
@@ -110,8 +110,16 @@ case $# in
 exit 1;;
 esac
 
+# Determine whether 'read' supports the '-r' flag.
+# /bin/sh on Solaris 10 does not.
+if (echo x | read -r f) 2>/dev/null; then
+  read_raw='-r'
+else
+  read_raw=
+fi
+
 # Split fields of configuration type
-IFS="-" read -r field1 field2 field3 field4 <___
config-patches mailing list
config-patches@gnu.org
https://lists.gnu.org/mailman/listinfo/config-patches