New module 'csharpexec'.
[gnulib.git] / m4 / csharpexec.m4
1 # csharpexec.m4 serial 2 (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 csharpexec.sh.
8 # gt_CSHARPEXEC or gt_CSHARPEXEC(testexecutable, its-directory)
9 # Sets HAVE_CSHARPEXEC to nonempty if csharpexec.sh will work.
10
11 AC_DEFUN([gt_CSHARPEXEC],
12 [
13   AC_REQUIRE([gt_CSHARP_CHOICE])
14   AC_MSG_CHECKING([for C[#] program execution engine])
15   AC_EGREP_CPP(yes, [
16 #if defined _WIN32 || defined __WIN32__ || defined __EMX__ || defined __DJGPP__
17   yes
18 #endif
19 ], MONO_PATH_SEPARATOR=';', MONO_PATH_SEPARATOR=':')
20   HAVE_CSHARPEXEC=1
21   pushdef([AC_MSG_CHECKING],[:])dnl
22   pushdef([AC_CHECKING],[:])dnl
23   pushdef([AC_MSG_RESULT],[:])dnl
24   AC_CHECK_PROG(HAVE_ILRUN_IN_PATH, ilrun, yes)
25   AC_CHECK_PROG(HAVE_MONO_IN_PATH, mono, yes)
26   popdef([AC_MSG_RESULT])dnl
27   popdef([AC_CHECKING])dnl
28   popdef([AC_MSG_CHECKING])dnl
29   for impl in "$CSHARP_CHOICE" pnet mono no; do
30     case "$impl" in
31       pnet)
32         if test -n "$HAVE_ILRUN_IN_PATH" \
33            && ilrun --version >/dev/null 2>/dev/null \
34            ifelse([$1], , , [&& ilrun $2/$1 >/dev/null 2>/dev/null]); then
35           HAVE_ILRUN=1
36           ac_result="ilrun"
37           break
38         fi
39         ;;
40       mono)
41         if test -n "$HAVE_MONO_IN_PATH" \
42            && mono --version >/dev/null 2>/dev/null \
43            ifelse([$1], , , [&& mono $2/$1 >/dev/null 2>/dev/null]); then
44           HAVE_MONO=1
45           ac_result="mono"
46           break
47         fi
48         ;;
49       no)
50         HAVE_CSHARPEXEC=
51         ac_result="no"
52         break
53         ;;
54     esac
55   done
56   AC_MSG_RESULT([$ac_result])
57   AC_SUBST(MONO_PATH)
58   AC_SUBST(MONO_PATH_SEPARATOR)
59   AC_SUBST(HAVE_ILRUN)
60   AC_SUBST(HAVE_MONO)
61 ])