winegcc: Allow creating an executable with an arbitrary extension.

This commit is contained in:
Alexandre Julliard 2009-02-23 17:18:19 +01:00
parent a6b91685b7
commit f0daa7e9b0
1 changed files with 6 additions and 14 deletions

View File

@ -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++; if ((output_name = strrchr(output_file, '/'))) output_name++;
else output_name = output_file; else output_name = output_file;
if (!strchr(output_name, '.')) if (!strchr(output_name, '.'))
output_file = strmake("%s.dll", output_file); output_file = strmake("%s.%s", output_file, opts->shared ? "dll" : "exe");
}
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)
/* 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));
}
} }