Commit d24503fe authored by Jacek Caban's avatar Jacek Caban Committed by Alexandre Julliard

winebuild: Check more target components for platform string.

Fixes parsing llvm style mingw target *-pc-windows-gnu. Signed-off-by: 's avatarJacek Caban <jacek@codeweavers.com> Signed-off-by: 's avatarAlexandre Julliard <julliard@winehq.org>
parent f37c55d7
...@@ -197,7 +197,7 @@ static void set_subsystem( const char *subsystem, DLLSPEC *spec ) ...@@ -197,7 +197,7 @@ static void set_subsystem( const char *subsystem, DLLSPEC *spec )
static void set_target( const char *target ) static void set_target( const char *target )
{ {
unsigned int i; unsigned int i;
char *p, *platform, *spec = xstrdup( target ); char *p, *spec = xstrdup( target );
/* target specification is in the form CPU-MANUFACTURER-OS or CPU-MANUFACTURER-KERNEL-OS */ /* target specification is in the form CPU-MANUFACTURER-OS or CPU-MANUFACTURER-KERNEL-OS */
...@@ -213,13 +213,11 @@ static void set_target( const char *target ) ...@@ -213,13 +213,11 @@ static void set_target( const char *target )
cpu = get_cpu_from_name( spec ); cpu = get_cpu_from_name( spec );
if (cpu == -1) fatal_error( "Unrecognized CPU '%s'\n", spec ); if (cpu == -1) fatal_error( "Unrecognized CPU '%s'\n", spec );
target_cpu = cpu; target_cpu = cpu;
platform = p;
if ((p = strrchr( p, '-' ))) platform = p + 1;
} }
else if (!strcmp( spec, "mingw32" )) else if (!strcmp( spec, "mingw32" ))
{ {
target_cpu = CPU_x86; target_cpu = CPU_x86;
platform = spec; p = spec;
} }
else else
fatal_error( "Invalid target specification '%s'\n", target ); fatal_error( "Invalid target specification '%s'\n", target );
...@@ -227,14 +225,19 @@ static void set_target( const char *target ) ...@@ -227,14 +225,19 @@ static void set_target( const char *target )
/* get the OS part */ /* get the OS part */
target_platform = PLATFORM_UNSPECIFIED; /* default value */ target_platform = PLATFORM_UNSPECIFIED; /* default value */
for (;;)
{
for (i = 0; i < ARRAY_SIZE(platform_names); i++) for (i = 0; i < ARRAY_SIZE(platform_names); i++)
{ {
if (!strncmp( platform_names[i].name, platform, strlen(platform_names[i].name) )) if (!strncmp( platform_names[i].name, p, strlen(platform_names[i].name) ))
{ {
target_platform = platform_names[i].platform; target_platform = platform_names[i].platform;
break; break;
} }
} }
if (target_platform != PLATFORM_UNSPECIFIED || !(p = strchr( p, '-' ))) break;
p++;
}
free( spec ); free( spec );
} }
......
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