root/mpich2/branches/dev/kumudb/confdb/aclocal_csharp.m4 @ 4870

Revision 4870, 2.3 KB (checked in by kumudb, 5 months ago)

Merge from trunk to kumudb r4748:r4869

Line 
1dnl
2dnl An initial attempt at macros for C#. 
3dnl Mostly contains information on where C# may be located and
4dnl the suffix
5dnl
6dnl The C# compiler under Windows is called csc.exe and the
7dnl suffix is cs
8dnl On my laptop, csc.exe is in
9dnl c:/WINDOWS/Microsoft.NET/Framework/v1.1.4322/csc.exe
10dnl in general, in Framework/vx.x.x/csc.exe .
11dnl How can we get the most recent version?
12dnl Important options:
13dnl   /target:exe (console executable (default))
14dnl   /target:winexe (Windows executable)
15dnl   /target:library
16dnl   /target:module
17dnl   /debug
18dnl   /optimize
19dnl   /unsafe   (allow unsafe code)
20AC_DEFUN([PAC_LANG_CSHARP],
21[AC_REQUIRE([PAC_PROG_CSHARP])
22define([AC_LANG], [CSHARP])dnl
23ac_ext=$pac_cv_csharp_ext
24ac_compile='${CSHARP-csc} -c $CSFLAGS conftest.$ac_ext 1>&AC_FD_CC'
25ac_link='${CSHARP-csc} -o conftest${ac_exeext} $CSFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&AC_FD_CC'
26dnl cross_compiling no longer maintained by autoconf as part of the
27dnl AC_LANG changes.  If we set it here, a later AC_LANG may not
28dnl restore it (in the case where one compiler claims to be a cross compiler
29dnl and another does not)
30dnl cross_compiling=$pac_cv_prog_csharp_cross
31])
32AC_DEFUN([PAC_PROG_CSHARP],[
33if test -z "$CSHARP" ; then
34    AC_CHECK_PROGS(CSHARP,csc)
35    test -z "$CSHARP" && AC_MSG_WARN([no acceptable C# compiler found in \$PATH])
36fi
37dnl if test -n "$CSHARP" ; then
38dnl      PAC_PROG_CSHARP_WORKS
39dnl fi
40dnl Cache these so we don't need to change in and out of csharp mode
41ac_csharpext=$pac_cv_csharp_ext
42ac_csharpcompile='${CSHARP-csc} -c $CSFLAGS conftest.$ac_csharpext 1>&AC_FD_CC'
43ac_csharplink='${CSHARP-csc} -o conftest${ac_exeext} $CSFLAGS $LDFLAGS conftest.$ac_csharpext $LIBS 1>&AC_FD_CC'
44# Check for problems with Intel efc compiler, if the compiler works
45if test "$pac_cv_prog_csharp_works" = yes ; then
46    cat > conftest.$ac_csharpext <<EOF
47        program main
48        end
49EOF
50    pac_msg=`$CSHARP -o conftest $CSFLAGS $LDFLAGS conftest.$ac_csharpext $LIBS 2>&1 | grep 'bfd assertion fail'`
51    if test -n "$pac_msg" ; then
52        pac_msg=`$CSHARP -o conftest $CSFLAGS $LDFLAGS conftest.$ac_csharpext -i_dynamic $LIBS 2>&1 | grep 'bfd assertion fail'`
53        if test -z "$pac_msg" ; then LDFLAGS="-i_dynamic" ; fi
54        # There should really be csharplinker flags rather than generic ldflags.
55    fi
56fi
57])
Note: See TracBrowser for help on using the browser.