diff options
author | Thomas Vander Stichele <thomas@apestaart.org> | 2003-01-20 14:10:53 +0000 |
---|---|---|
committer | Thomas Vander Stichele <thomas@apestaart.org> | 2003-01-20 14:10:53 +0000 |
commit | 7cb2039e2b299bed4ea1dcd7acca3a9b6ea88347 (patch) | |
tree | ee6ac76544978e958ca529bc3770f0e4ec5423d0 /m4 | |
parent | bc8b71d0f48b1283b975913c841fa4f1326f2991 (diff) |
compiler check
Original commit message from CVS:
compiler check
Diffstat (limited to 'm4')
-rw-r--r-- | m4/as-compiler.m4 | 41 |
1 files changed, 41 insertions, 0 deletions
diff --git a/m4/as-compiler.m4 b/m4/as-compiler.m4 new file mode 100644 index 0000000..e0a2206 --- /dev/null +++ b/m4/as-compiler.m4 @@ -0,0 +1,41 @@ +dnl as-compiler.m4 0.0.1 +dnl autostars m4 macro for detection of compiler flavour +dnl +dnl thomas@apestaart.org + +dnl AS_COMPILER(COMPILER) +dnl will set COMPILER to +dnl - gcc +dnl - forte +dnl - (empty) if no guess could be made + +AC_DEFUN(AS_COMPILER, +[ + as_compiler= + AC_MSG_CHECKING(for compiler flavour) + + dnl is it gcc ? + if test "x$GCC" = "xyes"; then + as_compiler="gcc" + fi + + dnl is it forte ? + AC_TRY_RUN([ +int main +(int argc, char *argv[]) +{ +#ifdef __sun + return 0; +#else + return 1; +#endif +} + ], as_compiler="forte", ,) + + if test "x$as_compiler" = "x"; then + AC_MSG_RESULT([unknown !]) + else + AC_MSG_RESULT($as_compiler) + fi + [$1]=$as_compiler +]) |