Commit f0daa7e9 authored by Alexandre Julliard's avatar Alexandre Julliard

winegcc: Allow creating an executable with an arbitrary extension.

parent a6b91685
...@@ -552,21 +552,16 @@ static void build(struct options* opts) ...@@ -552,21 +552,16 @@ static void build(struct options* opts)
} }
/* generate app loader only for .exe */ /* generate app loader only for .exe */
if (opts->shared || strendswith(output_file, ".exe.so")) if (opts->shared || strendswith(output_file, ".so"))
generate_app_loader = 0; generate_app_loader = 0;
/* normalize the filename a bit: strip .so, ensure it has proper ext */ /* normalize the filename a bit: strip .so, ensure it has proper ext */
if (strendswith(output_file, ".so")) if (strendswith(output_file, ".so"))
output_file[strlen(output_file) - 3] = 0; output_file[strlen(output_file) - 3] = 0;
if (opts->shared) if ((output_name = strrchr(output_file, '/'))) output_name++;
{ else output_name = output_file;
if ((output_name = strrchr(output_file, '/'))) output_name++; if (!strchr(output_name, '.'))
else output_name = output_file; output_file = strmake("%s.%s", output_file, opts->shared ? "dll" : "exe");
if (!strchr(output_name, '.'))
output_file = strmake("%s.dll", output_file);
}
else if (!strendswith(output_file, ".exe"))
output_file = strmake("%s.exe", output_file);
/* get the filename from the path */ /* get the filename from the path */
if ((output_name = strrchr(output_file, '/'))) output_name++; if ((output_name = strrchr(output_file, '/'))) output_name++;
...@@ -798,10 +793,7 @@ static void build(struct options* opts) ...@@ -798,10 +793,7 @@ static void build(struct options* opts)
/* create the loader script */ /* create the loader script */
if (generate_app_loader) if (generate_app_loader)
{ create_file(output_file, 0755, app_loader_template, strmake("%s.so", output_name));
if (strendswith(output_file, ".exe")) output_file[strlen(output_file) - 4] = 0;
create_file(output_file, 0755, app_loader_template, strmake("%s.exe.so", output_name));
}
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment