projects
/
gnulib.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Make it possible to #define gcd to an alias.
[gnulib.git]
/
lib
/
csharpcomp.c
diff --git
a/lib/csharpcomp.c
b/lib/csharpcomp.c
index
2344a99
..
eed0d15
100644
(file)
--- a/
lib/csharpcomp.c
+++ b/
lib/csharpcomp.c
@@
-1,5
+1,5
@@
/* Compile a C# program.
/* Compile a C# program.
- Copyright (C) 2003-200
5
Free Software Foundation, Inc.
+ Copyright (C) 2003-200
6
Free Software Foundation, Inc.
Written by Bruno Haible <bruno@clisp.org>, 2003.
This program is free software; you can redistribute it and/or modify
Written by Bruno Haible <bruno@clisp.org>, 2003.
This program is free software; you can redistribute it and/or modify
@@
-16,9
+16,7
@@
along with this program; if not, write to the Free Software Foundation,
Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */
along with this program; if not, write to the Free Software Foundation,
Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */
-#ifdef HAVE_CONFIG_H
-# include <config.h>
-#endif
+#include <config.h>
#include <alloca.h>
/* Specification. */
#include <alloca.h>
/* Specification. */
@@
-129,9
+127,9
@@
compile_csharp_using_pnet (const char * const *sources,
for (i = 0; i < sources_count; i++)
{
const char *source_file = sources[i];
for (i = 0; i < sources_count; i++)
{
const char *source_file = sources[i];
- if (strlen (source_file) >=
9
- && memcmp (source_file + strlen (source_file) -
9, ".resource
",
-
9
) == 0)
+ if (strlen (source_file) >=
10
+ && memcmp (source_file + strlen (source_file) -
10, ".resources
",
+
10
) == 0)
{
char *option = (char *) xallocsa (12 + strlen (source_file) + 1);
{
char *option = (char *) xallocsa (12 + strlen (source_file) + 1);
@@
-214,34
+212,43
@@
compile_csharp_using_mono (const char * const *sources,
unsigned int i;
argc =
unsigned int i;
argc =
- 1 + (output_is_library ? 1 : 0) +
2 + 2 * libdir
s_count
- +
2 * libraries_count +
(debug ? 1 : 0) + sources_count;
+ 1 + (output_is_library ? 1 : 0) +
1 + libdirs_count + librarie
s_count
+ + (debug ? 1 : 0) + sources_count;
argv = (char **) xallocsa ((argc + 1) * sizeof (char *));
argp = argv;
*argp++ = "mcs";
if (output_is_library)
*argp++ = "-target:library";
argv = (char **) xallocsa ((argc + 1) * sizeof (char *));
argp = argv;
*argp++ = "mcs";
if (output_is_library)
*argp++ = "-target:library";
- *argp++ = "-o";
- *argp++ = (char *) output_file;
+ {
+ char *option = (char *) xallocsa (5 + strlen (output_file) + 1);
+ memcpy (option, "-out:", 5);
+ strcpy (option + 5, output_file);
+ *argp++ = option;
+ }
for (i = 0; i < libdirs_count; i++)
{
for (i = 0; i < libdirs_count; i++)
{
- *argp++ = "-L";
- *argp++ = (char *) libdirs[i];
+ char *option = (char *) xallocsa (5 + strlen (libdirs[i]) + 1);
+ memcpy (option, "-lib:", 5);
+ strcpy (option + 5, libdirs[i]);
+ *argp++ = option;
}
for (i = 0; i < libraries_count; i++)
{
}
for (i = 0; i < libraries_count; i++)
{
- *argp++ = "-r";
- *argp++ = (char *) libraries[i];
+ char *option = (char *) xallocsa (11 + strlen (libraries[i]) + 4 + 1);
+ memcpy (option, "-reference:", 11);
+ memcpy (option + 11, libraries[i], strlen (libraries[i]));
+ strcpy (option + 11 + strlen (libraries[i]), ".dll");
+ *argp++ = option;
}
if (debug)
}
if (debug)
- *argp++ = "-g";
+ *argp++ = "-
debu
g";
for (i = 0; i < sources_count; i++)
{
const char *source_file = sources[i];
for (i = 0; i < sources_count; i++)
{
const char *source_file = sources[i];
- if (strlen (source_file) >=
9
- && memcmp (source_file + strlen (source_file) -
9, ".resource
",
-
9
) == 0)
+ if (strlen (source_file) >=
10
+ && memcmp (source_file + strlen (source_file) -
10, ".resources
",
+
10
) == 0)
{
char *option = (char *) xallocsa (10 + strlen (source_file) + 1);
{
char *option = (char *) xallocsa (10 + strlen (source_file) + 1);
@@
-297,6
+304,11
@@
compile_csharp_using_mono (const char * const *sources,
/* Remove zombie process from process list, and retrieve exit status. */
exitstatus = wait_subprocess (child, "mcs", false, false, true, true);
/* Remove zombie process from process list, and retrieve exit status. */
exitstatus = wait_subprocess (child, "mcs", false, false, true, true);
+ for (i = 1 + (output_is_library ? 1 : 0);
+ i < 1 + (output_is_library ? 1 : 0)
+ + 1 + libdirs_count + libraries_count;
+ i++)
+ freesa (argv[i]);
for (i = 0; i < sources_count; i++)
if (argv[argc - sources_count + i] != sources[i])
freesa (argv[argc - sources_count + i]);
for (i = 0; i < sources_count; i++)
if (argv[argc - sources_count + i] != sources[i])
freesa (argv[argc - sources_count + i]);
@@
-417,9
+429,9
@@
compile_csharp_using_sscli (const char * const *sources,
for (i = 0; i < sources_count; i++)
{
const char *source_file = sources[i];
for (i = 0; i < sources_count; i++)
{
const char *source_file = sources[i];
- if (strlen (source_file) >=
9
- && memcmp (source_file + strlen (source_file) -
9, ".resource
",
-
9
) == 0)
+ if (strlen (source_file) >=
10
+ && memcmp (source_file + strlen (source_file) -
10, ".resources
",
+
10
) == 0)
{
char *option = (char *) xallocsa (10 + strlen (source_file) + 1);
{
char *option = (char *) xallocsa (10 + strlen (source_file) + 1);