Mods to take account of the different behaviour of the C# compilers and interpreters

git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@5064 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
William S Fulton 2003-09-01 23:31:52 +00:00
commit 8e1714a1d3
2 changed files with 25 additions and 10 deletions

View file

@ -5,6 +5,8 @@
LANGUAGE = csharp
SCRIPTSUFFIX = _runme.cs
INTERPRETER = @CSHARPCILINTERPRETER@
CSHARPPATHSEPARATOR = "@CSHARPPATHSEPARATOR@"
srcdir = @srcdir@
top_srcdir = @top_srcdir@/..
top_builddir = @top_builddir@../
@ -13,8 +15,6 @@ include $(srcdir)/../common.mk
# Overridden variables here
SWIGOPT = -I$(top_srcdir)/$(EXAMPLES)/$(TEST_SUITE) -package $*
#Target prefix cannot be used on Windows
#TARGETPREFIX = lib
# Rules for the different types of tests
%.cpptest:
@ -48,16 +48,17 @@ setup = \
# Note CSharp uses LD_LIBRARY_PATH under Unix, PATH under Cygwin/Windows and SHLIB_PATH on HPUX.
run_testcase = \
if [ -f $(srcdir)/$(SCRIPTPREFIX)$*$(SCRIPTSUFFIX) ]; then ( \
$(MAKE) -f $*/$(top_builddir)/$(EXAMPLES)/Makefile CSHARPFLAGS='-nologo -out:$*_runme.exe' CSHARPSRCS='$(srcdir)/$(SCRIPTPREFIX)$*$(SCRIPTSUFFIX) $*\\*.cs' csharp_compile; \
env LD_LIBRARY_PATH="$*:$$LD_LIBRARY_PATH" PATH="$*:$$PATH" SHLIB_PATH="$*:$$SHLIB_PATH" mono $*_runme.exe; ) \
$(MAKE) -f $*/$(top_builddir)/$(EXAMPLES)/Makefile \
CSHARPFLAGS='-nologo -out:$*_runme.exe' \
CSHARPSRCS='$(srcdir)/$(SCRIPTPREFIX)$*$(SCRIPTSUFFIX) \
$*$(CSHARPPATHSEPARATOR)*.cs' csharp_compile; \
env LD_LIBRARY_PATH="$*:$$LD_LIBRARY_PATH" PATH="$*:$$PATH" SHLIB_PATH="$*:$$SHLIB_PATH" $(INTERPRETER) $*_runme.exe; ) \
else ( \
cd $*; \
$(MAKE) -f $(top_builddir)/$(EXAMPLES)/Makefile CSHARPFLAGS='-nologo -t:module -out:$*.netmodule' CSHARPSRCS='*.cs' csharp_compile; ); \
$(MAKE) -f $(top_builddir)/$(EXAMPLES)/Makefile \
CSHARPFLAGS='-nologo -t:module -out:$*.netmodule' \
CSHARPSRCS='*.cs' csharp_compile; ); \
fi;
# Above works for Microsoft and Mono.
# For pnet use different path separator and use interpreter to run:
# $(MAKE) -f $*/$(top_builddir)/$(EXAMPLES)/Makefile CSHARPFLAGS='-nologo -out:$*_runme.exe' CSHARPSRCS='$*_runme.cs $*/*.cs' csharp_compile; \
# env LD_LIBRARY_PATH="$*:$$LD_LIBRARY_PATH" PATH="$*:$$PATH" SHLIB_PATH="$*:$$SHLIB_PATH" ilrun $*_runme.exe; ) \
# Clean: remove testcase directories
%.clean:

View file

@ -1211,11 +1211,24 @@ else
CSHARPCOMPILER="$CSHARPCOMPILERBIN"
fi
CSHARPPATHSEPARATOR="/"
if test -z "$CSHARPBIN" ; then
CSHARPCILINTERPRETER=""
if test "cscc" = "$CSHARPCOMPILER" ; then
AC_CHECK_PROGS(CSHARPCILINTERPRETER, ilrun)
else
CSHARPCILINTERPRETER=""
if test "mcs" = "$CSHARPCOMPILER"; then
# mono interpreter (ver 0.26 doesn't seem to work on Windows platforms)
case $host in
*-*-cygwin* | *-*-mingw*)
;;
*)AC_CHECK_PROGS(CSHARPCILINTERPRETER, mint);;
esac
else
if test "csc" = "$CSHARPCOMPILER"; then
CSHARPPATHSEPARATOR = "\\"
fi
fi
fi
else
CSHARPCILINTERPRETER="$CSHARPBIN"
@ -1240,6 +1253,7 @@ esac
AC_SUBST(CSHARPCILINTERPRETER)
AC_SUBST(CSHARPPATHSEPARATOR)
AC_SUBST(CSHARPCOMPILER)
AC_SUBST(CSHARPDYNAMICLINKING)
AC_SUBST(CSHARPLIBRARYPREFIX) # Is this going to be used?