[OpenAFS-devel] configure not honoring 'CC' environment variable
Troy Benjegerdes
hozer@hozed.org
Sun, 20 Mar 2005 09:45:51 -0600
> >>- It is a bad idea to assume that a user who sets CC on the command line
> >> "knows what they are doing" and expects to use that compiler to build
> >> the kernel module, because they probably don't know what they're doing
> >> wrt the kernel compiler issue, and if they do, they probably don't want
> >> to use that compiler for the kernel module.
> >
> >But to assume that /opt/SUNWspro/bin/cc is _the_ solution is not better.
>
> It's not great, but it's better than blindly using the CC that comes out of
> configure. I've said this twice already; I guess I need to say it again.
> You CANNOT TELL if the CC that came out of configure is one the user
> provided, or one that was selected by AC_PROG_CC. And AC_PROG_CC defaults
> to using gcc if it is on the user's path. So it is actually quite useless
> to use $(CC) for compiling the kernel module, ever. It would be better to
> have a KERNEL_CC or some such, which has a reasonable default if not set by
> the user.
>
> Also, I think your test is a little naive. It searches for a compiler,
> takes the first one it finds, and if that's not a good enough Solaris
> compiler it falls back on $save_CC, without ever trying the other things in
> the list. You need to try each thing in the list to see if it is good
> enough, and then take the first one that is.
If someone is trying to build afs from source, and NOT useing a
precompiled binary, they are probably smart enough to follow instructions
to rearrange their path so the compiler they want is first in the list.
Or if that fails, pass in CC.
KERNEL_CC seems a good solution for the kernel build.