libwine: Added support for executing wine binaries out of the build dir.

This commit is contained in:
Alexandre Julliard 2006-03-16 17:35:32 +01:00
parent 77b3b92eb2
commit bf566139d7
2 changed files with 14 additions and 2 deletions

View File

@ -598,7 +598,7 @@ static void start_server(void)
if (pid == -1) fatal_perror( "fork" );
if (!pid)
{
argv[0] = "wineserver";
argv[0] = "server/wineserver";
argv[1] = TRACE_ON(server) ? "-d" : NULL;
argv[2] = NULL;
wine_exec_wine_binary( argv[0], argv, getenv("WINESERVER") );
@ -797,7 +797,7 @@ static void create_config_dir(void)
{
const char *argv[6];
argv[0] = "wineprefixcreate";
argv[0] = "tools/wineprefixcreate";
argv[1] = "--quiet";
argv[2] = "--wait";
argv[3] = "--prefix";

View File

@ -427,6 +427,18 @@ void wine_exec_wine_binary( const char *name, char **argv, const char *env_var )
use_preloader = 1;
}
if ((ptr = strrchr( name, '/' )))
{
/* if we are in build dir and name contains a path, try that */
if (build_dir)
{
argv[0] = build_path( build_dir, name );
preloader_exec( argv, use_preloader );
free( argv[0] );
}
name = ptr + 1; /* get rid of path */
}
/* first, bin directory from the current libdir or argv0 */
if (bindir)
{