annotate lib/csharpexec.c @ 17160:72f4bab621be

fts: introduce FTS_VERBATIM This gives clients the option to disable stripping of trailing slashes from input path names during fts_open initialization. The recent change v0.0-7611-g3a9002d that made fts_open strip trailing slashes from input path names had a negative impact on findutils that relies on the old fts_open behavior to implement POSIX requirement that each path operand of the find utility shall be evaluated unaltered as it was provided, including all trailing slash characters. * lib/fts_.h (FTS_VERBATIM): New bit flag. (FTS_OPTIONMASK, FTS_NAMEONLY, FTS_STOP): Adjust. * lib/fts.c (fts_open): Honor it.
author Dmitry V. Levin <ldv@altlinux.org>
date Sun, 18 Nov 2012 04:40:18 +0400
parents 498a2211d839
children e542fd46ad6f
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
5902
95383b7d1b52 New module 'csharpexec'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
1 /* Execute a C# program.
16201
8250f2777afc maint: update all copyright year number ranges
Jim Meyering <meyering@redhat.com>
parents: 14079
diff changeset
2 Copyright (C) 2003-2012 Free Software Foundation, Inc.
5902
95383b7d1b52 New module 'csharpexec'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
3 Written by Bruno Haible <bruno@clisp.org>, 2003.
95383b7d1b52 New module 'csharpexec'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
4
9309
bbbbbf4cd1c5 Change copyright notice from GPLv2+ to GPLv3+.
Bruno Haible <bruno@clisp.org>
parents: 8948
diff changeset
5 This program is free software: you can redistribute it and/or modify
5902
95383b7d1b52 New module 'csharpexec'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
6 it under the terms of the GNU General Public License as published by
9309
bbbbbf4cd1c5 Change copyright notice from GPLv2+ to GPLv3+.
Bruno Haible <bruno@clisp.org>
parents: 8948
diff changeset
7 the Free Software Foundation; either version 3 of the License, or
bbbbbf4cd1c5 Change copyright notice from GPLv2+ to GPLv3+.
Bruno Haible <bruno@clisp.org>
parents: 8948
diff changeset
8 (at your option) any later version.
5902
95383b7d1b52 New module 'csharpexec'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
9
95383b7d1b52 New module 'csharpexec'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
10 This program is distributed in the hope that it will be useful,
95383b7d1b52 New module 'csharpexec'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
95383b7d1b52 New module 'csharpexec'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
95383b7d1b52 New module 'csharpexec'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
13 GNU General Public License for more details.
95383b7d1b52 New module 'csharpexec'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
14
95383b7d1b52 New module 'csharpexec'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
15 You should have received a copy of the GNU General Public License
9309
bbbbbf4cd1c5 Change copyright notice from GPLv2+ to GPLv3+.
Bruno Haible <bruno@clisp.org>
parents: 8948
diff changeset
16 along with this program. If not, see <http://www.gnu.org/licenses/>. */
5902
95383b7d1b52 New module 'csharpexec'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
17
7304
1c4ed7637c24 Include <config.h> unconditionally.
Bruno Haible <bruno@clisp.org>
parents: 7012
diff changeset
18 #include <config.h>
5902
95383b7d1b52 New module 'csharpexec'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
19 #include <alloca.h>
95383b7d1b52 New module 'csharpexec'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
20
95383b7d1b52 New module 'csharpexec'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
21 /* Specification. */
95383b7d1b52 New module 'csharpexec'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
22 #include "csharpexec.h"
95383b7d1b52 New module 'csharpexec'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
23
95383b7d1b52 New module 'csharpexec'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
24 #include <stdio.h>
95383b7d1b52 New module 'csharpexec'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
25 #include <stdlib.h>
95383b7d1b52 New module 'csharpexec'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
26
95383b7d1b52 New module 'csharpexec'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
27 #include "execute.h"
95383b7d1b52 New module 'csharpexec'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
28 #include "sh-quote.h"
8948
a162347a0232 Update after allocsa -> malloca renaming.
Bruno Haible <bruno@clisp.org>
parents: 7304
diff changeset
29 #include "xmalloca.h"
5902
95383b7d1b52 New module 'csharpexec'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
30 #include "error.h"
95383b7d1b52 New module 'csharpexec'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
31 #include "gettext.h"
95383b7d1b52 New module 'csharpexec'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
32
95383b7d1b52 New module 'csharpexec'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
33 /* Handling of MONO_PATH is just like Java CLASSPATH. */
95383b7d1b52 New module 'csharpexec'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
34 #define CLASSPATHVAR "MONO_PATH"
95383b7d1b52 New module 'csharpexec'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
35 #define new_classpath new_monopath
95383b7d1b52 New module 'csharpexec'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
36 #define set_classpath set_monopath
95383b7d1b52 New module 'csharpexec'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
37 #define reset_classpath reset_monopath
95383b7d1b52 New module 'csharpexec'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
38 #include "classpath.h"
95383b7d1b52 New module 'csharpexec'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
39 #include "classpath.c"
7012
268bfcec1a6f Update csharpexec module from GNU gettext.
Bruno Haible <bruno@clisp.org>
parents: 5902
diff changeset
40 #undef reset_classpath
268bfcec1a6f Update csharpexec module from GNU gettext.
Bruno Haible <bruno@clisp.org>
parents: 5902
diff changeset
41 #undef set_classpath
268bfcec1a6f Update csharpexec module from GNU gettext.
Bruno Haible <bruno@clisp.org>
parents: 5902
diff changeset
42 #undef new_classpath
268bfcec1a6f Update csharpexec module from GNU gettext.
Bruno Haible <bruno@clisp.org>
parents: 5902
diff changeset
43 #undef CLASSPATHVAR
268bfcec1a6f Update csharpexec module from GNU gettext.
Bruno Haible <bruno@clisp.org>
parents: 5902
diff changeset
44
268bfcec1a6f Update csharpexec module from GNU gettext.
Bruno Haible <bruno@clisp.org>
parents: 5902
diff changeset
45 /* Handling of clix' PATH variable is just like Java CLASSPATH. */
268bfcec1a6f Update csharpexec module from GNU gettext.
Bruno Haible <bruno@clisp.org>
parents: 5902
diff changeset
46 #if defined _WIN32 || defined __WIN32__ || defined __CYGWIN__
16214
ec738d6aeef5 Talk about "native Windows API", not "Win32".
Bruno Haible <bruno@clisp.org>
parents: 16201
diff changeset
47 /* Native Windows, Cygwin */
7012
268bfcec1a6f Update csharpexec module from GNU gettext.
Bruno Haible <bruno@clisp.org>
parents: 5902
diff changeset
48 #define CLASSPATHVAR "PATH"
268bfcec1a6f Update csharpexec module from GNU gettext.
Bruno Haible <bruno@clisp.org>
parents: 5902
diff changeset
49 #elif defined __APPLE__ && defined __MACH__
16935
498a2211d839 Write "Mac OS X" instead of "MacOS X".
Bruno Haible <bruno@clisp.org>
parents: 16214
diff changeset
50 /* Mac OS X */
7012
268bfcec1a6f Update csharpexec module from GNU gettext.
Bruno Haible <bruno@clisp.org>
parents: 5902
diff changeset
51 #define CLASSPATHVAR "DYLD_LIBRARY_PATH"
268bfcec1a6f Update csharpexec module from GNU gettext.
Bruno Haible <bruno@clisp.org>
parents: 5902
diff changeset
52 #else
268bfcec1a6f Update csharpexec module from GNU gettext.
Bruno Haible <bruno@clisp.org>
parents: 5902
diff changeset
53 /* Normal Unix */
268bfcec1a6f Update csharpexec module from GNU gettext.
Bruno Haible <bruno@clisp.org>
parents: 5902
diff changeset
54 #define CLASSPATHVAR "LD_LIBRARY_PATH"
268bfcec1a6f Update csharpexec module from GNU gettext.
Bruno Haible <bruno@clisp.org>
parents: 5902
diff changeset
55 #endif
268bfcec1a6f Update csharpexec module from GNU gettext.
Bruno Haible <bruno@clisp.org>
parents: 5902
diff changeset
56 #define new_classpath new_clixpath
268bfcec1a6f Update csharpexec module from GNU gettext.
Bruno Haible <bruno@clisp.org>
parents: 5902
diff changeset
57 #define set_classpath set_clixpath
268bfcec1a6f Update csharpexec module from GNU gettext.
Bruno Haible <bruno@clisp.org>
parents: 5902
diff changeset
58 #define reset_classpath reset_clixpath
268bfcec1a6f Update csharpexec module from GNU gettext.
Bruno Haible <bruno@clisp.org>
parents: 5902
diff changeset
59 #include "classpath.h"
268bfcec1a6f Update csharpexec module from GNU gettext.
Bruno Haible <bruno@clisp.org>
parents: 5902
diff changeset
60 #include "classpath.c"
268bfcec1a6f Update csharpexec module from GNU gettext.
Bruno Haible <bruno@clisp.org>
parents: 5902
diff changeset
61 #undef reset_classpath
268bfcec1a6f Update csharpexec module from GNU gettext.
Bruno Haible <bruno@clisp.org>
parents: 5902
diff changeset
62 #undef set_classpath
268bfcec1a6f Update csharpexec module from GNU gettext.
Bruno Haible <bruno@clisp.org>
parents: 5902
diff changeset
63 #undef new_classpath
268bfcec1a6f Update csharpexec module from GNU gettext.
Bruno Haible <bruno@clisp.org>
parents: 5902
diff changeset
64 #undef CLASSPATHVAR
5902
95383b7d1b52 New module 'csharpexec'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
65
95383b7d1b52 New module 'csharpexec'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
66 #define _(str) gettext (str)
95383b7d1b52 New module 'csharpexec'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
67
95383b7d1b52 New module 'csharpexec'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
68
95383b7d1b52 New module 'csharpexec'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
69 /* Survey of CIL interpreters.
95383b7d1b52 New module 'csharpexec'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
70
95383b7d1b52 New module 'csharpexec'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
71 Program from
95383b7d1b52 New module 'csharpexec'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
72
95383b7d1b52 New module 'csharpexec'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
73 ilrun pnet
95383b7d1b52 New module 'csharpexec'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
74 mono mono
7012
268bfcec1a6f Update csharpexec module from GNU gettext.
Bruno Haible <bruno@clisp.org>
parents: 5902
diff changeset
75 clix sscli
5902
95383b7d1b52 New module 'csharpexec'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
76
95383b7d1b52 New module 'csharpexec'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
77 With Mono, the MONO_PATH is a colon separated list of pathnames. (On
95383b7d1b52 New module 'csharpexec'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
78 Windows: semicolon separated list of pathnames.)
95383b7d1b52 New module 'csharpexec'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
79
95383b7d1b52 New module 'csharpexec'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
80 We try the CIL interpreters in the following order:
95383b7d1b52 New module 'csharpexec'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
81 1. "ilrun", because it is a completely free system.
95383b7d1b52 New module 'csharpexec'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
82 2. "mono", because it is a partially free system but doesn't integrate
95383b7d1b52 New module 'csharpexec'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
83 well with Unix.
7012
268bfcec1a6f Update csharpexec module from GNU gettext.
Bruno Haible <bruno@clisp.org>
parents: 5902
diff changeset
84 3. "clix", although it is not free, because it is a kind of "reference
268bfcec1a6f Update csharpexec module from GNU gettext.
Bruno Haible <bruno@clisp.org>
parents: 5902
diff changeset
85 implementation" of C#.
5902
95383b7d1b52 New module 'csharpexec'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
86 But the order can be changed through the --enable-csharp configuration
95383b7d1b52 New module 'csharpexec'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
87 option.
95383b7d1b52 New module 'csharpexec'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
88 */
95383b7d1b52 New module 'csharpexec'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
89
95383b7d1b52 New module 'csharpexec'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
90 static int
95383b7d1b52 New module 'csharpexec'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
91 execute_csharp_using_pnet (const char *assembly_path,
12421
e8d2c6fc33ad Use spaces for indentation, not tabs.
Bruno Haible <bruno@clisp.org>
parents: 10197
diff changeset
92 const char * const *libdirs,
e8d2c6fc33ad Use spaces for indentation, not tabs.
Bruno Haible <bruno@clisp.org>
parents: 10197
diff changeset
93 unsigned int libdirs_count,
e8d2c6fc33ad Use spaces for indentation, not tabs.
Bruno Haible <bruno@clisp.org>
parents: 10197
diff changeset
94 const char * const *args, unsigned int nargs,
e8d2c6fc33ad Use spaces for indentation, not tabs.
Bruno Haible <bruno@clisp.org>
parents: 10197
diff changeset
95 bool verbose, bool quiet,
e8d2c6fc33ad Use spaces for indentation, not tabs.
Bruno Haible <bruno@clisp.org>
parents: 10197
diff changeset
96 execute_fn *executer, void *private_data)
5902
95383b7d1b52 New module 'csharpexec'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
97 {
95383b7d1b52 New module 'csharpexec'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
98 static bool ilrun_tested;
95383b7d1b52 New module 'csharpexec'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
99 static bool ilrun_present;
95383b7d1b52 New module 'csharpexec'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
100
95383b7d1b52 New module 'csharpexec'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
101 if (!ilrun_tested)
95383b7d1b52 New module 'csharpexec'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
102 {
95383b7d1b52 New module 'csharpexec'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
103 /* Test for presence of ilrun:
12421
e8d2c6fc33ad Use spaces for indentation, not tabs.
Bruno Haible <bruno@clisp.org>
parents: 10197
diff changeset
104 "ilrun --version >/dev/null 2>/dev/null" */
5902
95383b7d1b52 New module 'csharpexec'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
105 char *argv[3];
95383b7d1b52 New module 'csharpexec'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
106 int exitstatus;
95383b7d1b52 New module 'csharpexec'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
107
95383b7d1b52 New module 'csharpexec'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
108 argv[0] = "ilrun";
95383b7d1b52 New module 'csharpexec'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
109 argv[1] = "--version";
95383b7d1b52 New module 'csharpexec'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
110 argv[2] = NULL;
95383b7d1b52 New module 'csharpexec'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
111 exitstatus = execute ("ilrun", "ilrun", argv, false, false, true, true,
12421
e8d2c6fc33ad Use spaces for indentation, not tabs.
Bruno Haible <bruno@clisp.org>
parents: 10197
diff changeset
112 true, false, NULL);
5902
95383b7d1b52 New module 'csharpexec'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
113 ilrun_present = (exitstatus == 0);
95383b7d1b52 New module 'csharpexec'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
114 ilrun_tested = true;
95383b7d1b52 New module 'csharpexec'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
115 }
95383b7d1b52 New module 'csharpexec'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
116
95383b7d1b52 New module 'csharpexec'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
117 if (ilrun_present)
95383b7d1b52 New module 'csharpexec'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
118 {
95383b7d1b52 New module 'csharpexec'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
119 unsigned int argc;
95383b7d1b52 New module 'csharpexec'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
120 char **argv;
95383b7d1b52 New module 'csharpexec'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
121 char **argp;
95383b7d1b52 New module 'csharpexec'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
122 unsigned int i;
95383b7d1b52 New module 'csharpexec'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
123 bool err;
95383b7d1b52 New module 'csharpexec'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
124
95383b7d1b52 New module 'csharpexec'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
125 argc = 1 + 2 * libdirs_count + 1 + nargs;
8948
a162347a0232 Update after allocsa -> malloca renaming.
Bruno Haible <bruno@clisp.org>
parents: 7304
diff changeset
126 argv = (char **) xmalloca ((argc + 1) * sizeof (char *));
5902
95383b7d1b52 New module 'csharpexec'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
127
95383b7d1b52 New module 'csharpexec'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
128 argp = argv;
95383b7d1b52 New module 'csharpexec'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
129 *argp++ = "ilrun";
95383b7d1b52 New module 'csharpexec'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
130 for (i = 0; i < libdirs_count; i++)
12421
e8d2c6fc33ad Use spaces for indentation, not tabs.
Bruno Haible <bruno@clisp.org>
parents: 10197
diff changeset
131 {
e8d2c6fc33ad Use spaces for indentation, not tabs.
Bruno Haible <bruno@clisp.org>
parents: 10197
diff changeset
132 *argp++ = "-L";
e8d2c6fc33ad Use spaces for indentation, not tabs.
Bruno Haible <bruno@clisp.org>
parents: 10197
diff changeset
133 *argp++ = (char *) libdirs[i];
e8d2c6fc33ad Use spaces for indentation, not tabs.
Bruno Haible <bruno@clisp.org>
parents: 10197
diff changeset
134 }
5902
95383b7d1b52 New module 'csharpexec'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
135 *argp++ = (char *) assembly_path;
95383b7d1b52 New module 'csharpexec'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
136 for (i = 0; i < nargs; i++)
12421
e8d2c6fc33ad Use spaces for indentation, not tabs.
Bruno Haible <bruno@clisp.org>
parents: 10197
diff changeset
137 *argp++ = (char *) args[i];
5902
95383b7d1b52 New module 'csharpexec'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
138 *argp = NULL;
95383b7d1b52 New module 'csharpexec'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
139 /* Ensure argv length was correctly calculated. */
95383b7d1b52 New module 'csharpexec'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
140 if (argp - argv != argc)
12421
e8d2c6fc33ad Use spaces for indentation, not tabs.
Bruno Haible <bruno@clisp.org>
parents: 10197
diff changeset
141 abort ();
5902
95383b7d1b52 New module 'csharpexec'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
142
95383b7d1b52 New module 'csharpexec'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
143 if (verbose)
12421
e8d2c6fc33ad Use spaces for indentation, not tabs.
Bruno Haible <bruno@clisp.org>
parents: 10197
diff changeset
144 {
e8d2c6fc33ad Use spaces for indentation, not tabs.
Bruno Haible <bruno@clisp.org>
parents: 10197
diff changeset
145 char *command = shell_quote_argv (argv);
e8d2c6fc33ad Use spaces for indentation, not tabs.
Bruno Haible <bruno@clisp.org>
parents: 10197
diff changeset
146 printf ("%s\n", command);
e8d2c6fc33ad Use spaces for indentation, not tabs.
Bruno Haible <bruno@clisp.org>
parents: 10197
diff changeset
147 free (command);
e8d2c6fc33ad Use spaces for indentation, not tabs.
Bruno Haible <bruno@clisp.org>
parents: 10197
diff changeset
148 }
5902
95383b7d1b52 New module 'csharpexec'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
149
95383b7d1b52 New module 'csharpexec'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
150 err = executer ("ilrun", "ilrun", argv, private_data);
95383b7d1b52 New module 'csharpexec'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
151
8948
a162347a0232 Update after allocsa -> malloca renaming.
Bruno Haible <bruno@clisp.org>
parents: 7304
diff changeset
152 freea (argv);
5902
95383b7d1b52 New module 'csharpexec'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
153
95383b7d1b52 New module 'csharpexec'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
154 return err;
95383b7d1b52 New module 'csharpexec'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
155 }
95383b7d1b52 New module 'csharpexec'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
156 else
95383b7d1b52 New module 'csharpexec'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
157 return -1;
95383b7d1b52 New module 'csharpexec'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
158 }
95383b7d1b52 New module 'csharpexec'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
159
95383b7d1b52 New module 'csharpexec'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
160 static int
95383b7d1b52 New module 'csharpexec'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
161 execute_csharp_using_mono (const char *assembly_path,
12421
e8d2c6fc33ad Use spaces for indentation, not tabs.
Bruno Haible <bruno@clisp.org>
parents: 10197
diff changeset
162 const char * const *libdirs,
e8d2c6fc33ad Use spaces for indentation, not tabs.
Bruno Haible <bruno@clisp.org>
parents: 10197
diff changeset
163 unsigned int libdirs_count,
e8d2c6fc33ad Use spaces for indentation, not tabs.
Bruno Haible <bruno@clisp.org>
parents: 10197
diff changeset
164 const char * const *args, unsigned int nargs,
e8d2c6fc33ad Use spaces for indentation, not tabs.
Bruno Haible <bruno@clisp.org>
parents: 10197
diff changeset
165 bool verbose, bool quiet,
e8d2c6fc33ad Use spaces for indentation, not tabs.
Bruno Haible <bruno@clisp.org>
parents: 10197
diff changeset
166 execute_fn *executer, void *private_data)
5902
95383b7d1b52 New module 'csharpexec'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
167 {
95383b7d1b52 New module 'csharpexec'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
168 static bool mono_tested;
95383b7d1b52 New module 'csharpexec'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
169 static bool mono_present;
95383b7d1b52 New module 'csharpexec'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
170
95383b7d1b52 New module 'csharpexec'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
171 if (!mono_tested)
95383b7d1b52 New module 'csharpexec'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
172 {
95383b7d1b52 New module 'csharpexec'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
173 /* Test for presence of mono:
12421
e8d2c6fc33ad Use spaces for indentation, not tabs.
Bruno Haible <bruno@clisp.org>
parents: 10197
diff changeset
174 "mono --version >/dev/null 2>/dev/null" */
5902
95383b7d1b52 New module 'csharpexec'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
175 char *argv[3];
95383b7d1b52 New module 'csharpexec'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
176 int exitstatus;
95383b7d1b52 New module 'csharpexec'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
177
95383b7d1b52 New module 'csharpexec'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
178 argv[0] = "mono";
95383b7d1b52 New module 'csharpexec'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
179 argv[1] = "--version";
95383b7d1b52 New module 'csharpexec'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
180 argv[2] = NULL;
95383b7d1b52 New module 'csharpexec'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
181 exitstatus = execute ("mono", "mono", argv, false, false, true, true,
12421
e8d2c6fc33ad Use spaces for indentation, not tabs.
Bruno Haible <bruno@clisp.org>
parents: 10197
diff changeset
182 true, false, NULL);
5902
95383b7d1b52 New module 'csharpexec'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
183 mono_present = (exitstatus == 0);
95383b7d1b52 New module 'csharpexec'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
184 mono_tested = true;
95383b7d1b52 New module 'csharpexec'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
185 }
95383b7d1b52 New module 'csharpexec'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
186
95383b7d1b52 New module 'csharpexec'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
187 if (mono_present)
95383b7d1b52 New module 'csharpexec'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
188 {
95383b7d1b52 New module 'csharpexec'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
189 char *old_monopath;
8948
a162347a0232 Update after allocsa -> malloca renaming.
Bruno Haible <bruno@clisp.org>
parents: 7304
diff changeset
190 char **argv = (char **) xmalloca ((2 + nargs + 1) * sizeof (char *));
5902
95383b7d1b52 New module 'csharpexec'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
191 unsigned int i;
95383b7d1b52 New module 'csharpexec'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
192 bool err;
95383b7d1b52 New module 'csharpexec'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
193
95383b7d1b52 New module 'csharpexec'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
194 /* Set MONO_PATH. */
95383b7d1b52 New module 'csharpexec'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
195 old_monopath = set_monopath (libdirs, libdirs_count, false, verbose);
95383b7d1b52 New module 'csharpexec'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
196
95383b7d1b52 New module 'csharpexec'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
197 argv[0] = "mono";
95383b7d1b52 New module 'csharpexec'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
198 argv[1] = (char *) assembly_path;
95383b7d1b52 New module 'csharpexec'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
199 for (i = 0; i <= nargs; i++)
12421
e8d2c6fc33ad Use spaces for indentation, not tabs.
Bruno Haible <bruno@clisp.org>
parents: 10197
diff changeset
200 argv[2 + i] = (char *) args[i];
5902
95383b7d1b52 New module 'csharpexec'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
201
95383b7d1b52 New module 'csharpexec'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
202 if (verbose)
12421
e8d2c6fc33ad Use spaces for indentation, not tabs.
Bruno Haible <bruno@clisp.org>
parents: 10197
diff changeset
203 {
e8d2c6fc33ad Use spaces for indentation, not tabs.
Bruno Haible <bruno@clisp.org>
parents: 10197
diff changeset
204 char *command = shell_quote_argv (argv);
e8d2c6fc33ad Use spaces for indentation, not tabs.
Bruno Haible <bruno@clisp.org>
parents: 10197
diff changeset
205 printf ("%s\n", command);
e8d2c6fc33ad Use spaces for indentation, not tabs.
Bruno Haible <bruno@clisp.org>
parents: 10197
diff changeset
206 free (command);
e8d2c6fc33ad Use spaces for indentation, not tabs.
Bruno Haible <bruno@clisp.org>
parents: 10197
diff changeset
207 }
5902
95383b7d1b52 New module 'csharpexec'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
208
95383b7d1b52 New module 'csharpexec'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
209 err = executer ("mono", "mono", argv, private_data);
95383b7d1b52 New module 'csharpexec'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
210
95383b7d1b52 New module 'csharpexec'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
211 /* Reset MONO_PATH. */
95383b7d1b52 New module 'csharpexec'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
212 reset_monopath (old_monopath);
95383b7d1b52 New module 'csharpexec'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
213
8948
a162347a0232 Update after allocsa -> malloca renaming.
Bruno Haible <bruno@clisp.org>
parents: 7304
diff changeset
214 freea (argv);
5902
95383b7d1b52 New module 'csharpexec'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
215
95383b7d1b52 New module 'csharpexec'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
216 return err;
95383b7d1b52 New module 'csharpexec'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
217 }
95383b7d1b52 New module 'csharpexec'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
218 else
95383b7d1b52 New module 'csharpexec'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
219 return -1;
95383b7d1b52 New module 'csharpexec'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
220 }
95383b7d1b52 New module 'csharpexec'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
221
7012
268bfcec1a6f Update csharpexec module from GNU gettext.
Bruno Haible <bruno@clisp.org>
parents: 5902
diff changeset
222 static int
268bfcec1a6f Update csharpexec module from GNU gettext.
Bruno Haible <bruno@clisp.org>
parents: 5902
diff changeset
223 execute_csharp_using_sscli (const char *assembly_path,
12421
e8d2c6fc33ad Use spaces for indentation, not tabs.
Bruno Haible <bruno@clisp.org>
parents: 10197
diff changeset
224 const char * const *libdirs,
e8d2c6fc33ad Use spaces for indentation, not tabs.
Bruno Haible <bruno@clisp.org>
parents: 10197
diff changeset
225 unsigned int libdirs_count,
e8d2c6fc33ad Use spaces for indentation, not tabs.
Bruno Haible <bruno@clisp.org>
parents: 10197
diff changeset
226 const char * const *args, unsigned int nargs,
e8d2c6fc33ad Use spaces for indentation, not tabs.
Bruno Haible <bruno@clisp.org>
parents: 10197
diff changeset
227 bool verbose, bool quiet,
e8d2c6fc33ad Use spaces for indentation, not tabs.
Bruno Haible <bruno@clisp.org>
parents: 10197
diff changeset
228 execute_fn *executer, void *private_data)
7012
268bfcec1a6f Update csharpexec module from GNU gettext.
Bruno Haible <bruno@clisp.org>
parents: 5902
diff changeset
229 {
268bfcec1a6f Update csharpexec module from GNU gettext.
Bruno Haible <bruno@clisp.org>
parents: 5902
diff changeset
230 static bool clix_tested;
268bfcec1a6f Update csharpexec module from GNU gettext.
Bruno Haible <bruno@clisp.org>
parents: 5902
diff changeset
231 static bool clix_present;
268bfcec1a6f Update csharpexec module from GNU gettext.
Bruno Haible <bruno@clisp.org>
parents: 5902
diff changeset
232
268bfcec1a6f Update csharpexec module from GNU gettext.
Bruno Haible <bruno@clisp.org>
parents: 5902
diff changeset
233 if (!clix_tested)
268bfcec1a6f Update csharpexec module from GNU gettext.
Bruno Haible <bruno@clisp.org>
parents: 5902
diff changeset
234 {
268bfcec1a6f Update csharpexec module from GNU gettext.
Bruno Haible <bruno@clisp.org>
parents: 5902
diff changeset
235 /* Test for presence of clix:
12421
e8d2c6fc33ad Use spaces for indentation, not tabs.
Bruno Haible <bruno@clisp.org>
parents: 10197
diff changeset
236 "clix >/dev/null 2>/dev/null ; test $? = 1" */
7012
268bfcec1a6f Update csharpexec module from GNU gettext.
Bruno Haible <bruno@clisp.org>
parents: 5902
diff changeset
237 char *argv[2];
268bfcec1a6f Update csharpexec module from GNU gettext.
Bruno Haible <bruno@clisp.org>
parents: 5902
diff changeset
238 int exitstatus;
268bfcec1a6f Update csharpexec module from GNU gettext.
Bruno Haible <bruno@clisp.org>
parents: 5902
diff changeset
239
268bfcec1a6f Update csharpexec module from GNU gettext.
Bruno Haible <bruno@clisp.org>
parents: 5902
diff changeset
240 argv[0] = "clix";
268bfcec1a6f Update csharpexec module from GNU gettext.
Bruno Haible <bruno@clisp.org>
parents: 5902
diff changeset
241 argv[1] = NULL;
268bfcec1a6f Update csharpexec module from GNU gettext.
Bruno Haible <bruno@clisp.org>
parents: 5902
diff changeset
242 exitstatus = execute ("clix", "clix", argv, false, false, true, true,
12421
e8d2c6fc33ad Use spaces for indentation, not tabs.
Bruno Haible <bruno@clisp.org>
parents: 10197
diff changeset
243 true, false, NULL);
7012
268bfcec1a6f Update csharpexec module from GNU gettext.
Bruno Haible <bruno@clisp.org>
parents: 5902
diff changeset
244 clix_present = (exitstatus == 0 || exitstatus == 1);
268bfcec1a6f Update csharpexec module from GNU gettext.
Bruno Haible <bruno@clisp.org>
parents: 5902
diff changeset
245 clix_tested = true;
268bfcec1a6f Update csharpexec module from GNU gettext.
Bruno Haible <bruno@clisp.org>
parents: 5902
diff changeset
246 }
268bfcec1a6f Update csharpexec module from GNU gettext.
Bruno Haible <bruno@clisp.org>
parents: 5902
diff changeset
247
268bfcec1a6f Update csharpexec module from GNU gettext.
Bruno Haible <bruno@clisp.org>
parents: 5902
diff changeset
248 if (clix_present)
268bfcec1a6f Update csharpexec module from GNU gettext.
Bruno Haible <bruno@clisp.org>
parents: 5902
diff changeset
249 {
268bfcec1a6f Update csharpexec module from GNU gettext.
Bruno Haible <bruno@clisp.org>
parents: 5902
diff changeset
250 char *old_clixpath;
8948
a162347a0232 Update after allocsa -> malloca renaming.
Bruno Haible <bruno@clisp.org>
parents: 7304
diff changeset
251 char **argv = (char **) xmalloca ((2 + nargs + 1) * sizeof (char *));
7012
268bfcec1a6f Update csharpexec module from GNU gettext.
Bruno Haible <bruno@clisp.org>
parents: 5902
diff changeset
252 unsigned int i;
268bfcec1a6f Update csharpexec module from GNU gettext.
Bruno Haible <bruno@clisp.org>
parents: 5902
diff changeset
253 bool err;
268bfcec1a6f Update csharpexec module from GNU gettext.
Bruno Haible <bruno@clisp.org>
parents: 5902
diff changeset
254
268bfcec1a6f Update csharpexec module from GNU gettext.
Bruno Haible <bruno@clisp.org>
parents: 5902
diff changeset
255 /* Set clix' PATH variable. */
268bfcec1a6f Update csharpexec module from GNU gettext.
Bruno Haible <bruno@clisp.org>
parents: 5902
diff changeset
256 old_clixpath = set_clixpath (libdirs, libdirs_count, false, verbose);
268bfcec1a6f Update csharpexec module from GNU gettext.
Bruno Haible <bruno@clisp.org>
parents: 5902
diff changeset
257
268bfcec1a6f Update csharpexec module from GNU gettext.
Bruno Haible <bruno@clisp.org>
parents: 5902
diff changeset
258 argv[0] = "clix";
268bfcec1a6f Update csharpexec module from GNU gettext.
Bruno Haible <bruno@clisp.org>
parents: 5902
diff changeset
259 argv[1] = (char *) assembly_path;
268bfcec1a6f Update csharpexec module from GNU gettext.
Bruno Haible <bruno@clisp.org>
parents: 5902
diff changeset
260 for (i = 0; i <= nargs; i++)
12421
e8d2c6fc33ad Use spaces for indentation, not tabs.
Bruno Haible <bruno@clisp.org>
parents: 10197
diff changeset
261 argv[2 + i] = (char *) args[i];
7012
268bfcec1a6f Update csharpexec module from GNU gettext.
Bruno Haible <bruno@clisp.org>
parents: 5902
diff changeset
262
268bfcec1a6f Update csharpexec module from GNU gettext.
Bruno Haible <bruno@clisp.org>
parents: 5902
diff changeset
263 if (verbose)
12421
e8d2c6fc33ad Use spaces for indentation, not tabs.
Bruno Haible <bruno@clisp.org>
parents: 10197
diff changeset
264 {
e8d2c6fc33ad Use spaces for indentation, not tabs.
Bruno Haible <bruno@clisp.org>
parents: 10197
diff changeset
265 char *command = shell_quote_argv (argv);
e8d2c6fc33ad Use spaces for indentation, not tabs.
Bruno Haible <bruno@clisp.org>
parents: 10197
diff changeset
266 printf ("%s\n", command);
e8d2c6fc33ad Use spaces for indentation, not tabs.
Bruno Haible <bruno@clisp.org>
parents: 10197
diff changeset
267 free (command);
e8d2c6fc33ad Use spaces for indentation, not tabs.
Bruno Haible <bruno@clisp.org>
parents: 10197
diff changeset
268 }
7012
268bfcec1a6f Update csharpexec module from GNU gettext.
Bruno Haible <bruno@clisp.org>
parents: 5902
diff changeset
269
268bfcec1a6f Update csharpexec module from GNU gettext.
Bruno Haible <bruno@clisp.org>
parents: 5902
diff changeset
270 err = executer ("clix", "clix", argv, private_data);
268bfcec1a6f Update csharpexec module from GNU gettext.
Bruno Haible <bruno@clisp.org>
parents: 5902
diff changeset
271
268bfcec1a6f Update csharpexec module from GNU gettext.
Bruno Haible <bruno@clisp.org>
parents: 5902
diff changeset
272 /* Reset clix' PATH variable. */
268bfcec1a6f Update csharpexec module from GNU gettext.
Bruno Haible <bruno@clisp.org>
parents: 5902
diff changeset
273 reset_clixpath (old_clixpath);
268bfcec1a6f Update csharpexec module from GNU gettext.
Bruno Haible <bruno@clisp.org>
parents: 5902
diff changeset
274
8948
a162347a0232 Update after allocsa -> malloca renaming.
Bruno Haible <bruno@clisp.org>
parents: 7304
diff changeset
275 freea (argv);
7012
268bfcec1a6f Update csharpexec module from GNU gettext.
Bruno Haible <bruno@clisp.org>
parents: 5902
diff changeset
276
268bfcec1a6f Update csharpexec module from GNU gettext.
Bruno Haible <bruno@clisp.org>
parents: 5902
diff changeset
277 return err;
268bfcec1a6f Update csharpexec module from GNU gettext.
Bruno Haible <bruno@clisp.org>
parents: 5902
diff changeset
278 }
268bfcec1a6f Update csharpexec module from GNU gettext.
Bruno Haible <bruno@clisp.org>
parents: 5902
diff changeset
279 else
268bfcec1a6f Update csharpexec module from GNU gettext.
Bruno Haible <bruno@clisp.org>
parents: 5902
diff changeset
280 return -1;
268bfcec1a6f Update csharpexec module from GNU gettext.
Bruno Haible <bruno@clisp.org>
parents: 5902
diff changeset
281 }
268bfcec1a6f Update csharpexec module from GNU gettext.
Bruno Haible <bruno@clisp.org>
parents: 5902
diff changeset
282
5902
95383b7d1b52 New module 'csharpexec'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
283 bool
95383b7d1b52 New module 'csharpexec'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
284 execute_csharp_program (const char *assembly_path,
12421
e8d2c6fc33ad Use spaces for indentation, not tabs.
Bruno Haible <bruno@clisp.org>
parents: 10197
diff changeset
285 const char * const *libdirs,
e8d2c6fc33ad Use spaces for indentation, not tabs.
Bruno Haible <bruno@clisp.org>
parents: 10197
diff changeset
286 unsigned int libdirs_count,
e8d2c6fc33ad Use spaces for indentation, not tabs.
Bruno Haible <bruno@clisp.org>
parents: 10197
diff changeset
287 const char * const *args,
e8d2c6fc33ad Use spaces for indentation, not tabs.
Bruno Haible <bruno@clisp.org>
parents: 10197
diff changeset
288 bool verbose, bool quiet,
e8d2c6fc33ad Use spaces for indentation, not tabs.
Bruno Haible <bruno@clisp.org>
parents: 10197
diff changeset
289 execute_fn *executer, void *private_data)
5902
95383b7d1b52 New module 'csharpexec'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
290 {
95383b7d1b52 New module 'csharpexec'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
291 unsigned int nargs;
95383b7d1b52 New module 'csharpexec'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
292 int result;
95383b7d1b52 New module 'csharpexec'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
293
95383b7d1b52 New module 'csharpexec'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
294 /* Count args. */
95383b7d1b52 New module 'csharpexec'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
295 {
95383b7d1b52 New module 'csharpexec'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
296 const char * const *arg;
95383b7d1b52 New module 'csharpexec'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
297
95383b7d1b52 New module 'csharpexec'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
298 for (nargs = 0, arg = args; *arg != NULL; nargs++, arg++)
95383b7d1b52 New module 'csharpexec'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
299 ;
95383b7d1b52 New module 'csharpexec'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
300 }
95383b7d1b52 New module 'csharpexec'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
301
95383b7d1b52 New module 'csharpexec'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
302 /* First try the C# implementation specified through --enable-csharp. */
95383b7d1b52 New module 'csharpexec'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
303 #if CSHARP_CHOICE_PNET
95383b7d1b52 New module 'csharpexec'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
304 result = execute_csharp_using_pnet (assembly_path, libdirs, libdirs_count,
12421
e8d2c6fc33ad Use spaces for indentation, not tabs.
Bruno Haible <bruno@clisp.org>
parents: 10197
diff changeset
305 args, nargs, verbose, quiet,
e8d2c6fc33ad Use spaces for indentation, not tabs.
Bruno Haible <bruno@clisp.org>
parents: 10197
diff changeset
306 executer, private_data);
5902
95383b7d1b52 New module 'csharpexec'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
307 if (result >= 0)
95383b7d1b52 New module 'csharpexec'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
308 return (bool) result;
95383b7d1b52 New module 'csharpexec'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
309 #endif
95383b7d1b52 New module 'csharpexec'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
310
95383b7d1b52 New module 'csharpexec'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
311 #if CSHARP_CHOICE_MONO
95383b7d1b52 New module 'csharpexec'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
312 result = execute_csharp_using_mono (assembly_path, libdirs, libdirs_count,
12421
e8d2c6fc33ad Use spaces for indentation, not tabs.
Bruno Haible <bruno@clisp.org>
parents: 10197
diff changeset
313 args, nargs, verbose, quiet,
e8d2c6fc33ad Use spaces for indentation, not tabs.
Bruno Haible <bruno@clisp.org>
parents: 10197
diff changeset
314 executer, private_data);
5902
95383b7d1b52 New module 'csharpexec'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
315 if (result >= 0)
95383b7d1b52 New module 'csharpexec'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
316 return (bool) result;
95383b7d1b52 New module 'csharpexec'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
317 #endif
95383b7d1b52 New module 'csharpexec'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
318
95383b7d1b52 New module 'csharpexec'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
319 /* Then try the remaining C# implementations in our standard order. */
95383b7d1b52 New module 'csharpexec'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
320 #if !CSHARP_CHOICE_PNET
95383b7d1b52 New module 'csharpexec'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
321 result = execute_csharp_using_pnet (assembly_path, libdirs, libdirs_count,
12421
e8d2c6fc33ad Use spaces for indentation, not tabs.
Bruno Haible <bruno@clisp.org>
parents: 10197
diff changeset
322 args, nargs, verbose, quiet,
e8d2c6fc33ad Use spaces for indentation, not tabs.
Bruno Haible <bruno@clisp.org>
parents: 10197
diff changeset
323 executer, private_data);
5902
95383b7d1b52 New module 'csharpexec'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
324 if (result >= 0)
95383b7d1b52 New module 'csharpexec'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
325 return (bool) result;
95383b7d1b52 New module 'csharpexec'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
326 #endif
95383b7d1b52 New module 'csharpexec'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
327
95383b7d1b52 New module 'csharpexec'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
328 #if !CSHARP_CHOICE_MONO
95383b7d1b52 New module 'csharpexec'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
329 result = execute_csharp_using_mono (assembly_path, libdirs, libdirs_count,
12421
e8d2c6fc33ad Use spaces for indentation, not tabs.
Bruno Haible <bruno@clisp.org>
parents: 10197
diff changeset
330 args, nargs, verbose, quiet,
e8d2c6fc33ad Use spaces for indentation, not tabs.
Bruno Haible <bruno@clisp.org>
parents: 10197
diff changeset
331 executer, private_data);
5902
95383b7d1b52 New module 'csharpexec'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
332 if (result >= 0)
95383b7d1b52 New module 'csharpexec'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
333 return (bool) result;
95383b7d1b52 New module 'csharpexec'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
334 #endif
95383b7d1b52 New module 'csharpexec'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
335
7012
268bfcec1a6f Update csharpexec module from GNU gettext.
Bruno Haible <bruno@clisp.org>
parents: 5902
diff changeset
336 result = execute_csharp_using_sscli (assembly_path, libdirs, libdirs_count,
12421
e8d2c6fc33ad Use spaces for indentation, not tabs.
Bruno Haible <bruno@clisp.org>
parents: 10197
diff changeset
337 args, nargs, verbose, quiet,
e8d2c6fc33ad Use spaces for indentation, not tabs.
Bruno Haible <bruno@clisp.org>
parents: 10197
diff changeset
338 executer, private_data);
7012
268bfcec1a6f Update csharpexec module from GNU gettext.
Bruno Haible <bruno@clisp.org>
parents: 5902
diff changeset
339 if (result >= 0)
268bfcec1a6f Update csharpexec module from GNU gettext.
Bruno Haible <bruno@clisp.org>
parents: 5902
diff changeset
340 return (bool) result;
268bfcec1a6f Update csharpexec module from GNU gettext.
Bruno Haible <bruno@clisp.org>
parents: 5902
diff changeset
341
5902
95383b7d1b52 New module 'csharpexec'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
342 if (!quiet)
95383b7d1b52 New module 'csharpexec'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
343 error (0, 0, _("C# virtual machine not found, try installing pnet"));
95383b7d1b52 New module 'csharpexec'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
344 return true;
95383b7d1b52 New module 'csharpexec'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
345 }