1 # csharpcomp.m4 serial 9
2 dnl Copyright (C) 2003-2005, 2007, 2009-2020 Free Software Foundation, Inc.
3 dnl This file is free software; the Free Software Foundation
4 dnl gives unlimited permission to copy and/or distribute it,
5 dnl with or without modifications, as long as this notice is preserved.
7 # Prerequisites of csharpcomp.sh.
8 # Checks for a C# compiler.
9 # Sets at most one of HAVE_MCS, HAVE_CSC.
10 # Sets HAVE_CSHARPCOMP to nonempty if csharpcomp.sh will work.
11 # Also sets CSHARPCOMPFLAGS.
12 AC_DEFUN([gt_CSHARPCOMP],
14 AC_REQUIRE([gt_CSHARP_CHOICE])
15 AC_MSG_CHECKING([for C[#] compiler])
17 pushdef([AC_MSG_CHECKING],[:])dnl
18 pushdef([AC_CHECKING],[:])dnl
19 pushdef([AC_MSG_RESULT],[:])dnl
20 AC_CHECK_PROG([HAVE_MCS_IN_PATH], [mcs], [yes])
21 AC_CHECK_PROG([HAVE_CSC_IN_PATH], [csc], [yes])
22 popdef([AC_MSG_RESULT])dnl
23 popdef([AC_CHECKING])dnl
24 popdef([AC_MSG_CHECKING])dnl
25 for impl in "$CSHARP_CHOICE" mono sscli no; do
28 if test -n "$HAVE_MCS_IN_PATH" \
29 && mcs --version >/dev/null 2>/dev/null \
30 && mcs --version 2>/dev/null | grep Mono >/dev/null; then
37 if test -n "$HAVE_CSC_IN_PATH" \
38 && csc -help >/dev/null 2>/dev/null \
39 && { if csc -help 2>/dev/null | grep -i chicken > /dev/null; then false; else true; fi; }; then
52 AC_MSG_RESULT([$ac_result])
55 dnl Provide a default for CSHARPCOMPFLAGS.
56 if test -z "${CSHARPCOMPFLAGS+set}"; then
57 CSHARPCOMPFLAGS="-O -g"
59 AC_SUBST([CSHARPCOMPFLAGS])