Okay, so here are my thoughts on this.
The first thing is: compilers are generally not relocatable precisely
because of issues like this. There are a bunch of historical assumptions
made about the relationships between various directories that get in the
way. In this case we actually have three distinct problems:
1. Locating the origin on the BitC executable
2. Deciding when to override information about LIBDIR and INCDIR that may
have been provided at configure time
3. Deciding whether to include or exclude the "usual" locations in
/usr/{lib,include} for the BitC compiler.
4. Deciding whether to include/exclude the "usual" locations in
/usr/{lib,include} for the C compiler.
Matters are further complicated by the fact that the BitC front end relies,
in some cases, on the fact that a .bita and a corresponding .c will in some
cases be found in the same directory, and that the search path pun will find
the right C library at the right time when it is later processed by the
linker.
I am willing to abandon hope for perverse assignments of LIBDIR and INCDIR
in the face of package relocation. The user can always fall back on
specifying these explicitly, so the real issue is what to do about [2].
It seems to me that if the *discovered location* of the bitcc executable
matches the location specified to configure, then we should assume that the
value of LIBDIR provided by configure are correct.The reason we need to do
this is that we need to be able to honor perverse uses of configure when the
package is *not* relocated.
Similarly, we should not mess about with LIBDIR when we are unable to
determine the installed location of bitcc. Don't mess when you don't know.
But when bitcc has been relocated, and we are able to determine the
installed location, then we should do the following:
- If nostdlib has been given, don't bother with any of this. Otherwise:
- Compute the corresponding relocated location LIBDIR
- Append this to SystemDirs, but only if does not match the statically
known standard location of LIBDIR. Note that this must be done even if the
user has specified --system.
Does this seem plausible? If so, I can make the change.
_______________________________________________
bitc-dev mailing list
[email protected]
http://www.coyotos.org/mailman/listinfo/bitc-dev