Discussion:
config.guess problem with pgcc
Thomas Jahns
2014-08-20 15:47:27 UTC
Permalink
Hello,

I've found and fixed a problem where pgcc -E translates its input to contain
extra spaces. Since config.guess expects the preprocessor output to be a well
formed shell variable assignment, I've added some sed code to ensure this.

Please consider the attached patch for inclusion in autoconf.

Regards, Thomas
Eric Blake
2014-08-20 16:10:38 UTC
Permalink
Post by Thomas Jahns
Hello,
I've found and fixed a problem where pgcc -E translates its input to contain
extra spaces. Since config.guess expects the preprocessor output to be a well
formed shell variable assignment, I've added some sed code to ensure this.
Please consider the attached patch for inclusion in autoconf.
Regards, Thomas
- eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^LIBC'`
+ eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | sed -n '/^LIBC/{s/LIBC *= *\(.*\)$/LIBC='"'"'\1'"'"'/;p;}'`
Thanks for the patch. We like to keep to 80-column lines where possible;
also, that sed expression is rather verbose, when compared to the
equivalent:

eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null \
| sed -n 's/^LIBC *= */LIBC=/p'`

I'll apply the shortened version in your name, if you agree that it
still works.
--
Eric Blake eblake redhat com +1-919-301-3266
Libvirt virtualization library http://libvirt.org
Thomas Jahns
2014-08-20 16:15:05 UTC
Permalink
Hello Eric,
Post by Eric Blake
- eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^LIBC'` + eval
`$CC_FOR_BUILD -E $dummy.c 2>/dev/null | sed -n '/^LIBC/{s/LIBC *=
*\(.*\)$/LIBC='"'"'\1'"'"'/;p;}'`
Thanks for the patch. We like to keep to 80-column lines where possible;
also, that sed expression is rather verbose, when compared to the
eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null \ | sed -n 's/^LIBC *=
*/LIBC=/p'`
I'll apply the shortened version in your name, if you agree that it still
works.
I'm okay with that. I verified that your shorter version still works as intended.

Regards, Thomas
--
Thomas Jahns
DKRZ GmbH, Department: Application software

Deutsches Klimarechenzentrum
Bundesstraße 45a
D-20146 Hamburg

Phone: +49-40-460094-151
Fax: +49-40-460094-270
Email: Thomas Jahns <***@dkrz.de>
Eric Blake
2014-08-20 17:04:52 UTC
Permalink
Post by Thomas Jahns
Hello Eric,
Post by Eric Blake
- eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^LIBC'` + eval
`$CC_FOR_BUILD -E $dummy.c 2>/dev/null | sed -n '/^LIBC/{s/LIBC *=
*\(.*\)$/LIBC='"'"'\1'"'"'/;p;}'`
Thanks for the patch. We like to keep to 80-column lines where possible;
also, that sed expression is rather verbose, when compared to the
eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null \ | sed -n 's/^LIBC *=
*/LIBC=/p'`
I'll apply the shortened version in your name, if you agree that it still
works.
I'm okay with that. I verified that your shorter version still works as intended.
Oops, I totally overlooked what file you were patching. Autoconf
doesn't maintain config.guess; you'll probably want to resubmit the
patch upstream to config-patches (cc'd), as mentioned in the header of
that file. Once it is upstream, the next autoconf release will
automatically pick up the latest copy of that file.
--
Eric Blake eblake redhat com +1-919-301-3266
Libvirt virtualization library http://libvirt.org
Ben Elliston
2014-08-21 02:03:45 UTC
Permalink
Post by Eric Blake
Oops, I totally overlooked what file you were patching. Autoconf
doesn't maintain config.guess; you'll probably want to resubmit the
patch upstream to config-patches (cc'd), as mentioned in the header
of that file. Once it is upstream, the next autoconf release will
automatically pick up the latest copy of that file.
I am pretty sure a similar patch has already been applied to the
master revision of config.guess:

commit 6947a35648e577c2e3a12d5c88d488c6ea94e1c0
Author: Urs Janssen <***@akk.org>
Date: Wed Feb 12 22:13:37 2014 +1100

* config.guess (Linux|GNU|GNU/*): Strip extraneous whitespace
inserted by the preprocessor (eg, pgcc -E).

Cheers, Ben

Loading...