Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix: sdl2-config would always be detected as present #8145

Merged
merged 1 commit into from May 13, 2020

Conversation

@matthijskooijman
Copy link
Contributor

@matthijskooijman matthijskooijman commented May 12, 2020

The presence of sdl2-config is used go determine whether to look for
sdl2 first, or just sdl1. However, when sdl2-config is not present,
which returns an empty string. Due to lack of quoting, this produces
[ -x ], rather than [ -x "" ] and it turns out the former actually
has a succesful exit status for some reason.

This was not a problem when just running configure, because it would
then just fail to detect sdl2 and fall back to sdl1. However, when
passing --with-sdl (without specifying a version), this would only
attempt to detect sdl2, even when sdl2-config was not present, but sdl1
is.

Adding quotes makes the check work as intended.

The presence of sdl2-config is used go determine whether to look for
sdl2 first, or just sdl1. However, when sdl2-config is *not* present,
`which` returns an empty string. Due to lack of quoting, this produces
`[ -x ]`, rather than `[ -x "" ]` and it turns out the former actually
has a succesful exit status for some reason.

This was not a problem when just running configure, because it would
then just fail to detect sdl2 and fall back to sdl1. However, when
passing `--with-sdl` (without specifying a version), this would only
attempt to detect sdl2, even when sdl2-config was not present, but sdl1
is.

Adding quotes makes the check work as intended.
Copy link
Member

@LordAro LordAro left a comment

would be fixed by cmake, which is planned to be used for the next major release, but whatever :)

@LordAro LordAro merged commit 2d5869f into OpenTTD:master May 13, 2020
8 checks passed
SFrijters added a commit to SFrijters/nixpkgs that referenced this issue Jun 4, 2020
A bug in the upstream configure script was fixed (OpenTTD/OpenTTD#8145),
which means we now need `which` available during the build.
jonringer added a commit to NixOS/nixpkgs that referenced this issue Jun 4, 2020
A bug in the upstream configure script was fixed (OpenTTD/OpenTTD#8145),
which means we now need `which` available during the build.
dtzWill added a commit to dtzWill/nixpkgs that referenced this issue Jun 5, 2020
A bug in the upstream configure script was fixed (OpenTTD/OpenTTD#8145),
which means we now need `which` available during the build.

(cherry picked from commit 87dc127)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

2 participants