This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
gcc/configure.in assembler search
- From: Nathanael Nerode <neroden at twcny dot rr dot com>
- To: gcc at gcc dot gnu dot org
- Date: Fri, 14 Mar 2003 15:38:42 -0500
- Subject: gcc/configure.in assembler search
- References: <20030314050936.GA575@doctormoo> <20030314145632.GA9795@nevyn.them.org> <3E722EB6.2000700@twcny.rr.com> <20030314193733.GA28228@nevyn.them.org> <3E723044.90406@twcny.rr.com> <20030314194925.GA6111@nevyn.them.org>
So, why are we looking for the assembler in such an incredibly baroque
manner?
(Note that, according to previous discussion, the assembler we're
looking for is:
* if host=build, the assembler which the newly built GCC's driver will drive
* if host!=build, a hopefully 'work-alike' build->target assembler
)
Searching for a build->target assembler would normally be done (at any
rate, this is how I would do it) by something like (in pseudocode):
if AS_FOR_TARGET is defined, use it
else if AS is defined and host=target, use it
else if ${target-alias}-as is in the path, use it
else if build=target and 'as' is in the path, use it
Searching for a host->target assembler would go along the lines of:
if --with-as= is specified, use it
otherwise, if build=host, use the build->target assembler as found above
otherwise, make a reasonable guess
The code in gcc/configure.in is a *lot* more complicated than this.
The comments seem to indicate that it's based on the idea of searching
the same places the installed 'gcc' driver will search, in the same
order. First of all, it doesn't seem to actually *do* this (something
to do with MD_EXEC_PREFIX, which is mysterious to me). Second, this
indicates that the gcc driver has search paths hardcoded somewhere which
I haven't found (which this is supposed to coordinate with). Third, the
scheme for what names to search for (as? $program_prefix-as? as | sed
$program_transform_name?) are completely cryptic.
What are we trying to do here? I suspect that if build!=host, we don't
need to duplicate the search pattern of the GCC driver. I also suspect
that if build=host, we should but we aren't.
Rrowr. Help wanted.
--Nathanael