This also avoids mixing binaries of multiple WINE installations.
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=40245 Signed-off-by: Andre Heider a.heider@gmail.com --- tools/winegcc/Makefile.in | 1 + tools/winegcc/winegcc.c | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-)
diff --git a/tools/winegcc/Makefile.in b/tools/winegcc/Makefile.in index daeb91be1e..d39249d70f 100644 --- a/tools/winegcc/Makefile.in +++ b/tools/winegcc/Makefile.in @@ -10,6 +10,7 @@ C_SRCS = \
winegcc_EXTRADEFS = \ -DINCLUDEDIR=""${includedir}"" \ + -DBINDIR=""${bindir}"" \ -DDLLDIR=""${dlldir}"" \ -DLIBDIR=""${libdir}"" \ -DCC=""$(CC)"" \ diff --git a/tools/winegcc/winegcc.c b/tools/winegcc/winegcc.c index 5136cf3365..87fd661b3f 100644 --- a/tools/winegcc/winegcc.c +++ b/tools/winegcc/winegcc.c @@ -733,7 +733,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 = BINDIR "/winebuild"; strarray_add( spec_args, winebuild ); if (verbose) strarray_add( spec_args, "-v" ); if (keep_generated) strarray_add( spec_args, "--save-temps" );
Andre Heider a.heider@gmail.com writes:
This also avoids mixing binaries of multiple WINE installations.
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=40245 Signed-off-by: Andre Heider a.heider@gmail.com
tools/winegcc/Makefile.in | 1 + tools/winegcc/winegcc.c | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-)
Using the path of winegcc from argv[0] may be a better choice.
On 23/11/2018 21:02, Alexandre Julliard wrote:
Andre Heider a.heider@gmail.com writes:
This also avoids mixing binaries of multiple WINE installations.
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=40245 Signed-off-by: Andre Heider a.heider@gmail.com
tools/winegcc/Makefile.in | 1 + tools/winegcc/winegcc.c | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-)
Using the path of winegcc from argv[0] may be a better choice.
That may get too fragile, distros do some crazy stuff.
On debian, winegcc looks like this:
/usr/bin/winegcc -> /etc/alternatives/winegcc /etc/alternatives/winegcc -> /usr/bin/winegcc-stable cat /usr/bin/winegcc-stable
#!/bin/sh -e
name=$(basename $0 | cut -d- -f1)
# wineg++ fails to find winebuild in Wine's bindir # See https://bugs.winehq.org/show_bug.cgi?id=40245 if test -z "$WINEBUILD"; then export WINEBUILD="/usr/lib/wine/winebuild" fi
exec /usr/lib/wine/$name $@
winebuild is similar, just without the wrapper script.
So there's `winegcc` using debian's alternatives system, but you can use `winegcc-stable` or `winegcc-development` too.
Picturing a patch which works in those cases too won't win a beauty contest :)
winegcc with my patch won't find winebuild if you move the prefix, but if one really wants to go down that road, there's still WINEBUILD to fix it up.
Regards, Andre
Andre Heider a.heider@gmail.com writes:
On 23/11/2018 21:02, Alexandre Julliard wrote:
Andre Heider a.heider@gmail.com writes:
This also avoids mixing binaries of multiple WINE installations.
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=40245 Signed-off-by: Andre Heider a.heider@gmail.com
tools/winegcc/Makefile.in | 1 + tools/winegcc/winegcc.c | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-)
Using the path of winegcc from argv[0] may be a better choice.
That may get too fragile, distros do some crazy stuff.
On debian, winegcc looks like this:
/usr/bin/winegcc -> /etc/alternatives/winegcc /etc/alternatives/winegcc -> /usr/bin/winegcc-stable cat /usr/bin/winegcc-stable
#!/bin/sh -e
name=$(basename $0 | cut -d- -f1)
# wineg++ fails to find winebuild in Wine's bindir # See https://bugs.winehq.org/show_bug.cgi?id=40245 if test -z "$WINEBUILD"; then export WINEBUILD="/usr/lib/wine/winebuild" fi
exec /usr/lib/wine/$name $@
winebuild is similar, just without the wrapper script.
So there's `winegcc` using debian's alternatives system, but you can use `winegcc-stable` or `winegcc-development` too.
Picturing a patch which works in those cases too won't win a beauty contest :)
Obviously it can't work in all cases, it just seems to me that it's more likely to do the right thing. If winegcc is installed in bindir both are equivalent, and if it's installed somewhere else, using bindir would be worse. You could also try argv[0] first and then fall back to bindir.