libretro / libretro/RetroArch

retroarch/configure script erroneously states: "Cannot find a C99 compatible compiler."

Open
#12,384 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

compilation
Dominant language
C
Stars
14.1k
Forks
2.2k
Avg merge
7h 35m
Merged PRs (30d)
51

Description

First and foremost consider this:

  • Only RetroArch bugs should be filed here. Not core bugs or game bugs
  • This is not a forum or a help section, this is strictly developer oriented

Description

Under Ubuntu 20, Linux, x86_64,

cd libretro-super/retroarch
Attempted to run: ./configure

[Description of the bug]

The configure script died prematurely with the following error message: "Cannot find a C99 compatible compiler."

Expected behavior

I expected the configure script to be able to run to completion. Was able to verify that the version of gcc on my computer did support the -std=gnu99 and -std=c99 switches, but for some reason the configure script was complaining that these checks had failed.

I narrowed the failure point to this line, in libretro-super/retroarch/qb/qb.libs.sh
$(printf %s "$BUILD_DIRS $CFLAGS $3 -Werror $LDFLAGS")

This was yielding two arguments, '-std=gnu99 -Werror' that were being seen as ONE argument by the C compiler executable, thus causing the entire statement to be misinterpreted/mishandled by the configure script.

Interestingly, changing the shell used, by changing the first line of the configure script from:

#!/bin/sh
to either
#!/bin/bash
or
#!/usr/bin/env bash

FIXED the issue. Or, at the configure seemed to run to completion.

The solution may be to simply update ALL of your configure scripts, from using 'sh' shell to using 'bash' shell, by changing the
initial shebang line of each script, that specifies #!/bin/sh

Version/Commit

You can find this information under Information/System Information
475213aa0a

  • RetroArch: [version/commit]
    475213aa0a
Environment information
  • OS: [The operating system you're running]
    Ubuntu Linux 20.04.2 LTS

  • Compiler: [In case you are running local builds]
    gcc

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing ./configure under Ubuntu 20.04.2 with commit 475213aa0a, then read the configure script and the cited line in libretro-super/retroarch/qb/qb.libs.sh, comparing behavior under sh and bash. Done means the script correctly recognizes the available C99 compiler and runs to completion without requiring an unsupported shell change.

Written by the indexing model from the issue text.

Assessment

Tech stack
c, shell
Domain
build-system
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.