Boost logo

Boost-Build :

From: William E. Kempf (wekempf_at_[hidden])
Date: 2003-03-06 10:30:30


Steven Knight said:
>> Vladimir Prus <ghost_at_[hidden]> writes:
>>
>> > Oops! The '.c' extension should be recognized for C files!
>>
>> It wouldn't surprise me if some people like this:
>>
>> .c -> C
>> .C -> C++
>
> FWIW:
>
> Yes, this is the norm for a lot of projects on case-sensitive systems
> (Linux/UNIX/POSIX), so SCons chooses between the C and C++ compilers for
> a given .c or .C source file like you indicate above.
>
> Of course, there's no real distinction between .c and .C on
> case-insensitive systems like Win32, so on those, SCons assumes both
> want to use the C compiler. C++ users have to use .cpp or .cc or .cxx
> or their upper-case counterparts.

Why? Win32 may be case-insensitive, but it *IS* case-aware. You can
continue to make the distinction between .c and .C here, the only
restriction is that it will be impossible to have foo.c and foo.C in the
same directory (which would be a bad idea in any event, and not likely to
happen in real projects). You'd only have to take the approach you have
on systems that are not case-aware.

> The different behaviors make for a little more explanation in the
> documentation, but seem to match most closely people's default
> expectations for their operating system(s).
>
> IIRC, we chose these rules for SCons because they match the behavior of
> GNU Make (among other de facto standards).

Well, gcc for one behaves as I describe above, so I'm a little surprised
that GNU Make differs?

There are issues with native tools, however, which are not likely to make
a distinction in this regard. For instance, cl fails with the same test I
tried for gcc, assuming C compilation for .C files.

-- 
William E. Kempf
 

Boost-Build list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk