config.guess Linux overhaul

2000-12-06 Thread Ben Elliston

It's that time again.  The config.guess script is losing on GNU/Linux and
this time, I'm going to fix it.

Background: on many GNU/Linux systems, config.guess uses the output of `ld
--help' to determine which architecture, object file format and C library
version the build system uses.  The script loses because it assumes that the
primary configuration will appear first in the `supported emulations:'
printed by ld(1).

This is flawed because a) this is not a meaningful constraint and b) some
distributions, such as Caldera OpenLinux, provide a linker that has support
for linking in many, many environments (like coff-z8k, if that grabs you!).

Instead, I am seeking to replace this cruft with a cleaner and more portable
alternative.  After much deliberation, the best I have come up with is to
use file(1) from GNU fileutils, which is *very* likely to be present on
every GNU/Linux system.  The one drawback here is that it doesn't help me
determine the version of libc installed on the system--and there may even be
multiple versions.  Which is the "primary"?  The one that the current C
compiler will link against?

Comments, please.

Ben





Re: config.guess Linux overhaul

2000-12-06 Thread Alexandre Oliva

On Dec  6, 2000, Ben Elliston [EMAIL PROTECTED] wrote:

 Background: on many GNU/Linux systems, config.guess uses the output of `ld
 --help' to determine which architecture, object file format and C library
 version the build system uses.

 Instead, I am seeking to replace this cruft with a cleaner and more portable
 alternative.  After much deliberation, the best I have come up with is to
 use file(1) from GNU fileutils, which is *very* likely to be present on
 every GNU/Linux system.

Not really.  Libtool has gone down that path, and I regret that
immensely.  Every week or so, we get a bogus bug report about `file'
not being present or not printing what we expected it to print,
because of translations, modified magic files, etc.  Please don't
propagate the same mistake to config.guess.

Can't you just rely upon `uname -m' on GNU/Linux, at least for the
architecture.  WRT object file format and C library version, is there
any reason why testing for __ELF__ and __GLIBC__ isn't enough?

-- 
Alexandre Oliva   Enjoy Guarana', see http://www.ic.unicamp.br/~oliva/
Red Hat GCC Developer  aoliva@{cygnus.com, redhat.com}
CS PhD student at IC-Unicampoliva@{lsd.ic.unicamp.br, gnu.org}
Free Software Evangelist*Please* write to mailing lists, not to me