On Monday 19 March 2007 11:56, Andy Dougherty wrote:

> On Mon, 19 Mar 2007, chromatic wrote:

> > The heuristic for detecting a compiler is to invoke it with some sort of
> > help flag, where $cc contains the executable name of your compiler:
> >
> >     $cc -h
> >     $cc --help
> >     $cc /?
> >
> > If there's another option to pass to your compiler that causes it to do
> > nothing except exit with a successful error code, we can put it in there.
> > (Checking $ENV{PATH} and trying to divine the proper extension is another
> > option, but I like that one a little less.)

> In my opinion, that way lies madness.  Generating a list of options which
> all possible current and future compilers will accept is not only
> impossible, it's pointless.  It's also aggravating that there's no way to
> override it or tell Configure "Yes, cc is my compiler even though it's not
> in your list."
>
> The only way to tell for sure if you have a working compiler is to try to
> compile and run something.  After the user has been prompted for all the
> flags, simply try to compile and run a simple test program.  If it works,
> fine.  If it doesn't, then complain with an informative error message. (It
> may be appropriate to skip the 'run' step in a cross-compilation
> environment and hope that the user got the flags right if the compilation
> succeeds.)

What's the minimally-useful, cross-platform way to compile, link, and run:

        int main() {
                return 0;
        }

I'm happy to make the change, but I spent the weekend struggling to figure out 
how MSVC handles shared libraries, and I'm no longer sure that the easy 
approach is that easy.

-- c

Reply via email to