1 # csharpcomp.m4 serial 8
2 dnl Copyright (C) 2003-2005, 2007, 2009-2017 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_CSCC, 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_CSCC_IN_PATH], [cscc], [yes])
21 AC_CHECK_PROG([HAVE_MCS_IN_PATH], [mcs], [yes])
22 AC_CHECK_PROG([HAVE_CSC_IN_PATH], [csc], [yes])
23 popdef([AC_MSG_RESULT])dnl
24 popdef([AC_CHECKING])dnl
25 popdef([AC_MSG_CHECKING])dnl
26 for impl in "$CSHARP_CHOICE" pnet mono sscli no; do
29 if test -n "$HAVE_CSCC_IN_PATH" \
30 && cscc --version >/dev/null 2>/dev/null \
32 # See if pnetlib is well installed.
33 echo 'class ConfTest { static void Main() { } }' > conftest.cs
34 cscc -o conftest.exe conftest.cs 2>/dev/null
36 rm -f conftest.cs conftest.exe
45 if test -n "$HAVE_MCS_IN_PATH" \
46 && mcs --version >/dev/null 2>/dev/null \
47 && mcs --version 2>/dev/null | grep Mono >/dev/null; then
54 if test -n "$HAVE_CSC_IN_PATH" \
55 && csc -help >/dev/null 2>/dev/null \
56 && { if csc -help 2>/dev/null | grep -i chicken > /dev/null; then false; else true; fi; }; then
69 AC_MSG_RESULT([$ac_result])
73 dnl Provide a default for CSHARPCOMPFLAGS.
74 if test -z "${CSHARPCOMPFLAGS+set}"; then
75 CSHARPCOMPFLAGS="-O -g"
77 AC_SUBST([CSHARPCOMPFLAGS])