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

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

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

@LordAro LordAro added the backport requested This PR should be backport to current release (RC / stable) label May 13, 2020
@LordAro LordAro merged commit 2d5869f into OpenTTD:master May 13, 2020
SFrijters added a commit to SFrijters/nixpkgs that referenced this pull request 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 pushed a commit to NixOS/nixpkgs that referenced this pull request 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 pushed a commit to dtzWill/nixpkgs that referenced this pull request 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)
@LordAro LordAro added backported This PR is backported to a current release (RC / stable) and removed backport requested This PR should be backport to current release (RC / stable) labels Jul 27, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backported This PR is backported to a current release (RC / stable)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants