libretro / RetroArch

Cross-platform, sophisticated frontend for the libretro API. Licensed GPLv3.
http://www.libretro.com
GNU General Public License v3.0
10.18k stars 1.82k forks source link

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

Open ginobean opened 3 years ago

ginobean commented 3 years ago

First and foremost consider this:

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

Environment information

DaBiggestBozo commented 1 week ago

I had this issue and it fixed when I switched to 32bit with no modifications. Anyone know why?