[2/2] winegcc: Find winebuild.exe instead of winebuild on windows.

Dylan Smith dylan.ah.smith at gmail.com
Sat Aug 22 00:58:01 CDT 2009

When the winebuild directory is specified using the -B option, (stored in
opts->prefix) the winebuild executable is searched for using the path(s)
provided using this option.  Previously a file named exactly "winebuild"
was searched for in all cases, but building on windows would require that
"winebuild.exe" be searched for in the build directory.  This check is done
in the spawn function used to invoke winebuild from winegcc.
 tools/winegcc/winegcc.c |    7 ++++++-
 1 files changed, 6 insertions(+), 1 deletions(-)
-------------- next part --------------
diff --git a/tools/winegcc/winegcc.c b/tools/winegcc/winegcc.c
index 64b1f9a..83dba5d 100644
--- a/tools/winegcc/winegcc.c
+++ b/tools/winegcc/winegcc.c
@@ -226,10 +226,15 @@ static enum target_platform build_platform = PLATFORM_APPLE;
 static enum target_platform build_platform = PLATFORM_SOLARIS;
 #elif defined(_WIN32) || defined(_WIN64)
 static enum target_platform build_platform = PLATFORM_WINDOWS;
+#define WINEBUILD_EXT ".exe"
 static enum target_platform build_platform = PLATFORM_UNSPECIFIED;
 static void clean_temp_files(void)
     unsigned int i;
@@ -471,7 +476,7 @@ static strarray *get_winebuild_args(struct options *opts)
     const char* winebuild = getenv("WINEBUILD");
     strarray *spec_args = strarray_alloc();
-    if (!winebuild) winebuild = "winebuild";
+    if (!winebuild) winebuild = "winebuild" WINEBUILD_EXT;
     strarray_add( spec_args, winebuild );
     if (verbose) strarray_add( spec_args, "-v" );
     if (keep_generated) strarray_add( spec_args, "--save-temps" );

More information about the wine-patches mailing list