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