tools/winebuild: add FreeBSD support (1/2) (RESEND) (fwd)

Gerald Pfeifer gerald at pfeifer.com
Mon Oct 5 16:24:01 CDT 2009


On Mon, 5 Oct 2009, Gerald Pfeifer wrote:
> Please find below the adjusted patch.

Thanks for applying the foundation part of this patchset, Alexandre!

Here is the second part which leverages the infrastructure and addresses
the bug report in http://www.freebsd.org/cgi/query-pr.cgi?pr=137999 .

If you prefer, I'll be happy to convert the code into a switch statement.
Just let me know!

Gerald

ChangeLog:                                                                      
Add support for PLATFORM_FREEBSD to get_ld_command. 

diff --git a/tools/winebuild/utils.c b/tools/winebuild/utils.c
index e0cd8bc..07bb7c8 100644
--- a/tools/winebuild/utils.c
+++ b/tools/winebuild/utils.c
@@ -297,9 +297,18 @@ const char *get_ld_command(void)
 
         if (force_pointer_size)
         {
-            const char *args = (target_platform == PLATFORM_APPLE) ?
-                ((force_pointer_size == 8) ? " -arch x86_64" : " -arch i386") :
-                ((force_pointer_size == 8) ? " -m elf_x86_64" : " -m elf_i386");
+            const char *args;
+
+            if (target_platform == PLATFORM_APPLE)
+                args = (force_pointer_size == 8) ? " -arch x86_64"
+                                                 : " -arch i386";
+            else if (target_platform == PLATFORM_FREEBSD)
+                args = (force_pointer_size == 8) ? " -m elf_x86_64"
+                                                 : " -m elf_i386_fbsd";
+            else
+                args = (force_pointer_size == 8) ? " -m elf_x86_64"
+                                                 : " -m elf_i386";
+
             ld_command = xrealloc( ld_command, strlen(ld_command) + strlen(args) + 1 );
             strcat( ld_command, args );
         }



More information about the wine-patches mailing list