Imported Upstream version 4.6.0.125

Former-commit-id: a2155e9bd80020e49e72e86c44da02a8ac0e57a4
This commit is contained in:
Xamarin Public Jenkins (auto-signing)
2016-08-03 10:59:49 +00:00
parent a569aebcfd
commit e79aa3c0ed
17047 changed files with 3137615 additions and 392334 deletions

View File

@@ -1,167 +0,0 @@
2010-03-18 Zoltan Varga <vargaz@gmail.com>
* mkbundle.cs: Update after the mono.pc and libmono version bump.
2009-05-29 Steven Munroe <munroesj@us.ibm.com>
This patch is contributed under the terms of the MIT/X11 license
* template_main.c: Include string.h to define strchr, memcpy,
and strdup.
2009-05-12 Tor Lillqvist <tml@novell.com>
* template_main.c: Some small improvements on Windows: No need to
include <shellapi.h>, <windows.h> does it already. Don't use the
argc value as passed to main(), instead just let
CommandLineToArgvW() overwrite it. Free the buffer returned by
CommandLineToArgvW().
2009-05-12 Kornél Pál <kornelpal@gmail.com>
* TODO: Added notices about linking Mono statically.
2009-05-11 Tor Lillqvist <tml@novell.com>
* template_main.c: Enable passing options to the bundled Mono
interpreter through a MONO_BUNDLED_OPTIONS environment
variable. Requested in bug #495858.
Enable non-ASCII (arbitraty Unicode in fact) command-line
parameters to a mkbundled executable on Windows. Use
GetCommandLineW(), CommandLineToArgvW(), and then
g_utf16_to_utf8(). From bug #446172.
2009-03-15 Steven Munroe <munroesj@us.ibm.com>
This patch is contributed under the terms of the MIT/X11 license
* mkbundle.cs (WriteSymbol): Use .p2align 5 instead of .align 32
to get consistent results on all platforms.
2008-02-23 Marek Safar <marek.safar@gmail.com>
* mkbundle.cs: Close resources correctly when something goes wrong.
2007-10-19 Robert Jordan <robertj@gmx.net>
* mkbundle.cs (Execute): [Windows] since recently (?) cygwin's bash
doesn't strip CRLFs from ``-style command interpolation anymore.
The superfluous CRLF was breaking the gcc command line.
* mkbundle.cs (Execute): [Windows] set UseShellExecute = false to
prevent the creation of a new console windows.
2007-01-03 Tor Lillqvist <tml@novell.com>
Add the possibility to bundle also the machine.config file, from
#80305.
* mkbundle.cs: Add option --machine-config. Warn the user that a
bundled machine.config file should be checked that it doesn't
contain sensitive data like private machine keys.
If that option was used, write the contents of the machine.config
file to the asm output file, and write code to call
mono_register_machine_config() with the data to the C output file.
2006-11-29 Joshua Tauberer <jit@occams.info>
* mkbundle.cs: Added --nomain option to create the host.c file
without a main() function so that it can be used in libraries.
* Added: template_main.c, the template for the main() function.
* template(_z).c: Factored out the main() method bits and left
a mono_mkbundle_init() function which is called from main(),
or should be called by the user library.
2006-11-01 Robert Jordan <robertj@gmx.net>
* Makefile: Enable the NET_2_0 build.
2006-09-08 Robert Jordan <robertj@gmx.net>
* mkbundle.cs, TODO: The `-z' option is now supported under
Windows.
2006-09-05 Kornél Pál <kornelpal@gmail.com>
* TODO: Renamed mono-1.dll to mono.dll.
2005-12-29 Robert Jordan <robertj@gmx.net>
* mkbundle.cs, template.c, template_z.c: Added support for Windows.
2005-12-18 Alexandre Rocha Lima e Marcondes
<alexandre@psl-pr.softwarelivre.org>
* mkbundle.cs: Updated obsolete Alloc and Free (now its AllocHeap and
FreeHeap).
2005-12-01 Paolo Molaro <lupus@ximian.com>
* mkbundle.cs: add warning for --static. Handle --static for non-linux
systems.
2005-10-20 Miguel de Icaza <miguel@novell.com>
* mkbundle.cs: Deal with the fact that these were Linux-specific
flags.
2005-10-08 Gonzalo Paniagua Javier <gonzalo@ximian.com>
* TODO: remove obsolete stuff.
* mkbundle.cs: added -z option so that assemblies are deflated before
being embedded.
* template_z.c: template C code used when -z is used.
* Makefile: add new resource file.
Thu Jul 7 19:12:23 CEST 2005 Paolo Molaro <lupus@ximian.com>
* mkbundle.cs: link statically just libmono with --static
(fixes bug#75445).
2005-06-29 Miguel de Icaza <miguel@ximian.com>
* mkbundle.cs: Add support for OSX in the generated assembly
code.
2005-04-28 James Willcox <james@ximian.com>
* mkbundle.cs: Add --config-dir option
* template.c: same
2005-04-25 Gonzalo Paniagua Javier <gonzalo@ximian.com>
* mkbundle.cs: GetReferencedAssemblies () will not report CodeBase, so
load the assembly and get it from there. Fixes bug #74695.
2004-04-09 James Willcox <james@ximian.com>
* template.c: allocate the correct amount of memory for newargs
2005-04-08 Miguel de Icaza <miguel@novell.com>
* mkbundle.cs: Add support for bundling also a machine.config
2004-04-08 James Willcox <james@ximian.com>
* mkbundle.cs: add a --static flag for statically linking to libmono
Wed Mar 16 18:11:47 CET 2005 Paolo Molaro <lupus@ximian.com>
* template.c, mkbundle.cs: automatically bundle config files if found.
2004-12-07 Atsushi Enomoto <atsushi@ximian.com>
* Makefile : csc wanted ".dll" for -r:Mono.Posix.
2004-12-06 Raja R Harinath <rharinath@novell.com>
* Makefile (OTHER_RES): New. Add template.c.
(EXTRA_DISTFILES): New. Distribute resource files too.
2004-11-28 Miguel de Icaza <miguel@ximian.com>
* Actually delete the files at the end, now that the debugging
phase is over.

View File

@@ -11,6 +11,7 @@ RESOURCE_FILES = $(OTHER_RES)
LOCAL_MCS_FLAGS= $(OTHER_RES:%=-resource:%)
LOCAL_MCS_FLAGS += -d:STATIC,NO_SYMBOL_WRITER,NO_AUTHENTICODE
LIB_REFS = System.Xml System System.Core
EXTRA_DISTFILES = $(RESOURCE_FILES)

View File

@@ -42,6 +42,7 @@ class MakeBundle {
static string os_message = "";
static bool compress;
static bool nomain;
static string custom_main = null;
static bool? use_dos2unix = null;
static bool skip_scan;
static string ctor_func;
@@ -169,10 +170,6 @@ class MakeBundle {
case "--static":
static_link = true;
if (!quiet) {
Console.WriteLine ("Note that statically linking the LGPL Mono runtime has more licensing restrictions than dynamically linking.");
Console.WriteLine ("See http://www.mono-project.com/Licensing for details on licensing.");
}
break;
case "--config":
if (i+1 == top) {
@@ -207,6 +204,13 @@ class MakeBundle {
case "--nomain":
nomain = true;
break;
case "--custom-main":
if (i+1 == top) {
Help ();
return 1;
}
custom_main = args [++i];
break;
case "--style":
if (i+1 == top) {
Help ();
@@ -730,7 +734,7 @@ void mono_register_config_for_assembly (const char* assembly_name, cons
string template = s.ReadToEnd ();
tc.Write (template);
if (!nomain) {
if (!nomain && custom_main == null) {
Stream template_main_stream = System.Reflection.Assembly.GetAssembly (typeof(MakeBundle)).GetManifestResourceStream ("template_main.c");
StreamReader st = new StreamReader (template_main_stream);
string maintemplate = st.ReadToEnd ();
@@ -756,37 +760,79 @@ void mono_register_config_for_assembly (const char* assembly_name, cons
string compiler = GetEnv("CC", "cl.exe");
string winsdkPath = GetEnv("WINSDK", @"C:\Program Files (x86)\Windows Kits\8.1");
string vsPath = GetEnv("VSINCLUDE", @"C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC");
string vsPath = GetEnv("VSINCLUDE", @"C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC");
string monoPath = GetEnv("MONOPREFIX", @"C:\Program Files (x86)\Mono");
string[] includes = new string[] {winsdkPath + @"\Include\um", winsdkPath + @"\Include\shared", vsPath + @"\include", monoPath + @"\include\mono-2.0"};
string[] includes = new string[] {winsdkPath + @"\Include\um", winsdkPath + @"\Include\shared", vsPath + @"\include", monoPath + @"\include\mono-2.0", "." };
string[] libs = new string[] { winsdkPath + @"\Lib\winv6.3\um\x86" , vsPath + @"\lib" };
string monoFile;
var linkLibraries = new string[] { "kernel32.lib",
"version.lib",
"Ws2_32.lib",
"Mswsock.lib",
"Psapi.lib",
"shell32.lib",
"OleAut32.lib",
"ole32.lib",
"winmm.lib",
"user32.lib",
"libvcruntime.lib",
"advapi32.lib",
"OLDNAMES.lib",
"libucrt.lib" };
string glue_obj = "mkbundle_glue.obj";
string monoLib;
if (static_link)
monoLib = LocateFile (monoPath + @"\lib\monosgen-2.0-static.lib");
else {
Console.WriteLine ("WARNING: Dynamically linking the Mono runtime on Windows is not a tested option.");
monoLib = LocateFile (monoPath + @"\lib\monosgen-2.0.lib");
LocateFile (monoPath + @"\lib\monosgen-2.0.dll"); // in this case, the .lib is just the import library, and the .dll is also needed
}
var compilerArgs = new List<string>();
compilerArgs.Add("/MT");
foreach (string include in includes)
compilerArgs.Add(String.Format ("/I {0}", quote (include)));
if (static_link)
monoFile = LocateFile (monoPath + @"\lib\monosgen-2.0.lib");
if (!nomain || custom_main != null) {
compilerArgs.Add(quote(temp_c));
compilerArgs.Add(quote(temp_o));
if (custom_main != null)
compilerArgs.Add(quote(custom_main));
compilerArgs.Add(quote(monoLib));
compilerArgs.Add("/link");
compilerArgs.Add("/NODEFAULTLIB");
compilerArgs.Add("/SUBSYSTEM:windows");
compilerArgs.Add("/ENTRY:mainCRTStartup");
compilerArgs.AddRange(linkLibraries);
compilerArgs.Add("/out:"+ output);
string cl_cmd = String.Format("{0} {1}", compiler, String.Join(" ", compilerArgs.ToArray()));
Execute (cl_cmd);
}
else
monoFile = LocateFile (monoPath + @"\lib\monosgen-2.0.dll");
{
// we are just creating a .lib
compilerArgs.Add("/c"); // compile only
compilerArgs.Add(temp_c);
compilerArgs.Add(String.Format("/Fo" + glue_obj)); // .obj output name
compilerArgs.Add("/MD");
compilerArgs.Add(temp_c);
compilerArgs.Add(temp_o);
compilerArgs.Add("/link");
string cl_cmd = String.Format("{0} {1}", compiler, String.Join(" ", compilerArgs.ToArray()));
Execute (cl_cmd);
if (nomain)
compilerArgs.Add("/NOENTRY");
compilerArgs.Add("/DLL");
foreach (string lib in libs)
compilerArgs.Add(String.Format ("/LIBPATH:{0}", quote(lib)));
compilerArgs.Add (quote(monoFile));
string cl_cmd = String.Format("{0} {1}", compiler, String.Join(" ", compilerArgs.ToArray()));
Execute (cl_cmd);
string librarian = GetEnv ("LIB", "lib.exe");
var librarianArgs = new List<string> ();
librarianArgs.Add (String.Format ("/out:{0}.lib" + output));
librarianArgs.Add (temp_o);
librarianArgs.Add (glue_obj);
librarianArgs.Add (monoLib);
string lib_cmd = String.Format("{0} {1}", librarian, String.Join(" ", librarianArgs.ToArray()));
Execute (lib_cmd);
}
}
else
{
@@ -989,6 +1035,7 @@ void mono_register_config_for_assembly (const char* assembly_name, cons
" --keeptemp Keeps the temporary files\n" +
" --static Statically link to mono libs\n" +
" --nomain Don't include a main() function, for libraries\n" +
" --custom-main C Link the specified compilation unit (.c or .obj) with entry point/init code\n" +
" -z Compress the assemblies before embedding.\n" +
" --static-ctor ctor Add a constructor call to the supplied function.\n" +
" You need zlib development headers and libraries.\n");