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

Gerald Pfeifer gerald at pfeifer.com
Wed Oct 7 16:40:44 CDT 2009


On Tue, 6 Oct 2009, Alexandre Julliard wrote:
>> If you prefer, I'll be happy to convert the code into a switch statement.
>> Just let me know!
> That would certainly be more elegant.

Your wish is my command. :-)

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..6008ef4 100644
--- a/tools/winebuild/utils.c
+++ b/tools/winebuild/utils.c
@@ -297,9 +297,23 @@ 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;
+
+            switch (target_platform)
+            {
+                case PLATFORM_APPLE:
+                    args = (force_pointer_size == 8) ? " -arch x86_64"
+                                                     : " -arch i386";
+                    break;
+                case PLATFORM_FREEBSD:
+                    args = (force_pointer_size == 8) ? " -m elf_x86_64"
+                                                     : " -m elf_i386_fbsd";
+                    break;
+                default:
+                    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-devel mailing list