winegcc: Add support for Multiarch Architecture Specifiers (try 4)
André Hentschel
nerv at dawncrow.de
Wed Apr 17 15:43:37 CDT 2013
now with a little fix in main()
---
tools/winegcc/winegcc.c | 43 ++++++++++++++++++++++++++++++++++++++++++-
1 file changed, 42 insertions(+), 1 deletion(-)
diff --git a/tools/winegcc/winegcc.c b/tools/winegcc/winegcc.c
index 06aa200..f6b5ac4 100644
--- a/tools/winegcc/winegcc.c
+++ b/tools/winegcc/winegcc.c
@@ -363,7 +363,7 @@ static char *get_lib_dir( struct options *opts )
for (i = 0; i < sizeof(stdlibpath)/sizeof(stdlibpath[0]); i++)
{
- char *p, *buffer = xmalloc( strlen(stdlibpath[i]) + strlen(libwine) + 3 );
+ char *p, *buffer = xmalloc( strlen(stdlibpath[i]) + strlen(libwine) + strlen("x86_64-kfreebsd-gnu") + 1 );
strcpy( buffer, stdlibpath[i] );
p = buffer + strlen(buffer);
while (p > buffer && p[-1] == '/') p--;
@@ -375,12 +375,49 @@ static char *get_lib_dir( struct options *opts )
strcpy( p, "32" );
strcat( p, libwine );
if (check_platform( opts, buffer )) goto found;
+ switch(opts->target_cpu)
+ {
+ case CPU_x86:
+ strcpy( p, "/i386-linux-gnu" );
+ strcat( p, libwine );
+ if (check_platform( opts, buffer )) goto found;
+ strcpy( p, "/i386-kfreebsd-gnu" );
+ break;
+ case CPU_ARM:
+ strcpy( p, "/arm-linux-gnueabihf" );
+ strcat( p, libwine );
+ if (check_platform( opts, buffer )) goto found;
+ strcpy( p, "/arm-linux-gnueabi" );
+ strcat( p, libwine );
+ if (check_platform( opts, buffer )) goto found;
+ strcpy( p, "/arm-linux-gnu" );
+ break;
+ case CPU_POWERPC: strcpy( p, "/powerpc-linux-gnu" ); break;
+ default:
+ assert(0);
+ }
+ strcat( p, libwine );
+ if (check_platform( opts, buffer )) goto found;
}
if (opts->force_pointer_size == 8 || (!opts->force_pointer_size && (opts->target_cpu == CPU_x86_64 || opts->target_cpu == CPU_ARM64)))
{
strcpy( p, "64" );
strcat( p, libwine );
if (check_platform( opts, buffer )) goto found;
+ switch(opts->target_cpu)
+ {
+ case CPU_x86_64:
+ strcpy( p, "/x86_64-linux-gnu" );
+ strcat( p, libwine );
+ if (check_platform( opts, buffer )) goto found;
+ strcpy( p, "/x86_64-kfreebsd-gnu" );
+ break;
+ case CPU_ARM64: strcpy( p, "/aarch64-linux-gnu" ); break;
+ default:
+ assert(0);
+ }
+ strcat( p, libwine );
+ if (check_platform( opts, buffer )) goto found;
}
free( buffer );
continue;
@@ -1406,6 +1443,10 @@ int main(int argc, char **argv)
}
else if (strcmp("-m64", argv[i]) == 0)
{
+ if (opts.target_cpu == CPU_x86)
+ opts.target_cpu = CPU_x86_64;
+ else if (opts.target_cpu == CPU_ARM)
+ opts.target_cpu = CPU_ARM64;
opts.force_pointer_size = 8;
raw_linker_arg = 1;
}
--
1.7.10.4
More information about the wine-patches
mailing list