mirror of
https://github.com/Mercury-Language/mercury.git
synced 2026-04-29 16:24:43 +00:00
Branches: main, 11.07 Support using clang as a C compiler with Mercury -- currently only tested on Mac OS X. Clean up the handling of C compilers in the configure script. configure.in: Improve this script's ability to distinguish between different types of C compiler. In particular, ensure that a clear distinction is maintained between clang and gcc. Fix an old XXX: don't rely on pattern matching on the value of $CC to determine the C compiler type. This is particularly error prone now since one compiler is named "clang" and another "cl". Set optimization and warning flags for clang. (XXX this is currently very conservative; we need to go through them and work out what good defaults might be.) Don't link against libgcc if we are using clang. (XXX I don't think this is really necessary for gcc either in the great majority of cases.) Mark spots that still need updating with "XXX CLANG"; I will look into these separately. aclocal.m4: Add a new macro that determines the C compiler type based on what builtin macros are defined -- unlike AC_PROG_CC this macro correctly distinguishes between gcc and clang. Add two new macros that determine version information for clang and for Visual C. scripts/mgnuc.in: scripts/ml.in: Handle clang README.MacOS: Mention that clang can be used with Mercury on Mac OS X.