New module 'time', so that apps can include <time.h> as per
[gnulib.git] / m4 / csharpcomp.m4
1 # csharpcomp.m4 serial 6 (gettext-0.15)
2 dnl Copyright (C) 2003-2005 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.
6
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],
13 [
14   AC_REQUIRE([gt_CSHARP_CHOICE])
15   AC_MSG_CHECKING([for C[#] compiler])
16   HAVE_CSHARPCOMP=1
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
27     case "$impl" in
28       pnet)
29         if test -n "$HAVE_CSCC_IN_PATH" \
30            && cscc --version >/dev/null 2>/dev/null \
31            && (
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
35              error=$?
36              rm -f conftest.cs conftest.exe
37              exit $error
38             ); then
39           HAVE_CSCC=1
40           ac_result="cscc"
41           break
42         fi
43         ;;
44       mono)
45         if test -n "$HAVE_MCS_IN_PATH" \
46            && mcs --version >/dev/null 2>/dev/null; then
47           HAVE_MCS=1
48           ac_result="mcs"
49           break
50         fi
51         ;;
52       sscli)
53         if test -n "$HAVE_CSC_IN_PATH" \
54            && csc -help >/dev/null 2>/dev/null \
55            && { if csc -help 2>/dev/null | grep -i chicken > /dev/null; then false; else true; fi; }; then
56           HAVE_CSC=1
57           ac_result="csc"
58           break
59         fi
60         ;;
61       no)
62         HAVE_CSHARPCOMP=
63         ac_result="no"
64         break
65         ;;
66     esac
67   done
68   AC_MSG_RESULT([$ac_result])
69   AC_SUBST(HAVE_CSCC)
70   AC_SUBST(HAVE_MCS)
71   AC_SUBST(HAVE_CSC)
72   dnl Provide a default for CSHARPCOMPFLAGS.
73   if test -z "${CSHARPCOMPFLAGS+set}"; then
74     CSHARPCOMPFLAGS="-O -g"
75   fi
76   AC_SUBST(CSHARPCOMPFLAGS)
77 ])