summaryrefslogtreecommitdiff
path: root/build-aux/csharpexec.sh.in
diff options
context:
space:
mode:
authorBruno Haible <bruno@clisp.org>2006-01-09 13:45:38 +0000
committerBruno Haible <bruno@clisp.org>2006-01-09 13:45:38 +0000
commit8efb8b5cc76ef494f66244265c6fdbe8abef0213 (patch)
tree199cd7521cac3403ff6838c3dec550c16fa4592f /build-aux/csharpexec.sh.in
parent2dcf5f3a5ae27935b816c20ff5f7d0762be68967 (diff)
downloadgnulib-8efb8b5cc76ef494f66244265c6fdbe8abef0213.tar.gz
Moved here from lib/csharpexec.sh.in.
Diffstat (limited to 'build-aux/csharpexec.sh.in')
-rw-r--r--build-aux/csharpexec.sh.in84
1 files changed, 84 insertions, 0 deletions
diff --git a/build-aux/csharpexec.sh.in b/build-aux/csharpexec.sh.in
new file mode 100644
index 0000000000..98694091dd
--- /dev/null
+++ b/build-aux/csharpexec.sh.in
@@ -0,0 +1,84 @@
+#!/bin/sh
+# Execute a C# program.
+
+# Copyright (C) 2003 Free Software Foundation, Inc.
+# Written by Bruno Haible <bruno@clisp.org>, 2003.
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2, or (at your option)
+# any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software Foundation,
+# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+
+# This uses the same choices as csharpexec.c, but instead of relying on the
+# environment settings at run time, it uses the environment variables
+# present at configuration time.
+#
+# This is a separate shell script, because the various C# interpreters have
+# different command line options.
+#
+# Usage: /bin/sh csharpexec.sh [OPTION] program.exe [ARGUMENTS]
+# Options:
+# -L DIRECTORY search for C# libraries also in DIRECTORY
+
+sed_quote_subst='s/\([|&;<>()$`"'"'"'*?[#~=% \\]\)/\\\1/g'
+options_ilrun=
+libdirs_mono=
+prog=
+while test $# != 0; do
+ case "$1" in
+ -L)
+ options_ilrun="$options_ilrun -L "`echo "$2" | sed -e "$sed_quote_subst"`
+ libdirs_mono="${libdirs_mono:+$libdirs_mono@MONO_PATH_SEPARATOR@}$2"
+ shift
+ ;;
+ -*)
+ echo "csharpexec: unknown option '$1'" 1>&2
+ exit 1
+ ;;
+ *)
+ prog="$1"
+ break
+ ;;
+ esac
+ shift
+done
+if test -z "$prog"; then
+ echo "csharpexec: no program specified" 1>&2
+ exit 1
+fi
+case "$prog" in
+ *.exe) ;;
+ *)
+ echo "csharpexec: program is not a .exe" 1>&2
+ exit 1
+ ;;
+esac
+
+if test -n "@HAVE_ILRUN@"; then
+ test -z "$CSHARP_VERBOSE" || echo ilrun $options_ilrun "$@"
+ exec ilrun $options_ilrun "$@"
+else
+ if test -n "@HAVE_MONO@"; then
+ CONF_MONO_PATH='@MONO_PATH@'
+ if test -n "$libdirs_mono"; then
+ MONO_PATH="$libdirs_mono${CONF_MONO_PATH:+@MONO_PATH_SEPARATOR@$CONF_MONO_PATH}"
+ else
+ MONO_PATH="$CONF_MONO_PATH"
+ fi
+ export MONO_PATH
+ test -z "$CSHARP_VERBOSE" || echo mono "$@"
+ exec mono "$@"
+ else
+ echo 'C# virtual machine not found, try installing pnet, then reconfigure' 1>&2
+ exit 1
+ fi
+fi