This is a potential security issue.
The problem is that config.h and config.mk are populated with
all variables prefixed with 'HAVE_' from the user's environment.
Example:
$ HAVE_FOO=yes ./configure
$ grep FOO config.mk
HAVE_FOO = 1
$ grep FOO config.h
#define HAVE_FOO 1
After this commit these files will only use variables set by
qb configure process and not from the user's environment. This
issue could result in hard to diagnose undefined behavior or
maybe worse?
The user should experience no change in behavior, but
developers should be more careful about setting 'HAVE_'
variables manually.
Unless the FOO variable is used by check_enabled ($2 only),
check_platform, check_lib, check_pkgconf, check_header,
check_macro or check_switch functions it should be set at
least once by the new add_opt function. The first argument
should be 'FOO' which matches the HAVE_FOO variable and the
second argument should contain 'auto', 'no' or 'yes'.
Example:
add_opt FOO yes
When in doubt its safe to use add_opt. This will also fix a
few potential issues where configure arguments used by the
user are ignored.
When the second argument is not set the FOO variable will only
be used to populate config.h and config.mk with its current
value. This should only be done in qb/qb.libs.sh in functions
that set 'HAVE_' variables.
This extends the check_platform function to support checking more
than one OS for each feature.
This also adds the match helper function to qb.init.sh to compare
one variable against a list of variables.
This extends the check_enabled function to be able to check more than
one feature. In the case of RPNG it depends on either the builtin or
system zlib, but if the system zlib was not available while the builtin
zlib was it would still be disabled erroneously.
Now it will only be disabled if both the system and builtin zlib are
disabled.
Some systems may have egl libraries, but not egl headers which
will result in failing to build EGL support.
Also OpenGLES2 also required EGL support so lets make that clear.
This allows enabling and disabling features for platforms
more robustly.
Fixes https://github.com/libretro/RetroArch/issues/8777
v2: Fix D3D configure checks.
v3: Cleanup.
v4: Update Makefile.msvc and Makefile.win
This is the correct change to prefer the builtin zlib.
Revert "(QB) Bake in zlib by default, make zlib as dynamic library dependency"
This reverts commit 2713e792ca.
Revert "(QB) Change behavior - if HAVE_ZLIB = no, that doesn't mean"
This reverts commit f66fe5e16b.
HAVE_BUILTINZLIB will also be set to no implicitly. It will still
try to use the baked in zlib. If you want to build without any zlib
support entirely, you now need to do this -
./configure --disable-zlib --disable-builtinzlib
* qb: Fix OpenGLES build.
The gl core video driver requires at least OpenGLES 3 and
OpenGL 1 is not compatible with OpenGLES 2 or 3.
* travis: Test OpenGLES builds on linux.
Menu widgets must also be disabled with --disable-menu, now
configure will do so or error if --disable-menu and
--enable-menu_widgets are explicitly used.
This driver should sunset the old gl2 driver, but that driver will
likely live on to support really ancient and terrible GL stacks.
All the worst legacy cruft has been ripped out, and it's almost a decent
backend now.
Requirements for slang are GL 3.2+ or GLES3.
Some shaders require features which are not directly compatible with
GLES2 or legacy GL.
This driver shares a lot of concepts from the Vulkan driver.
The slang shader stack and SPIRV-Cross are used to implement the shader
spec, and the menu shaders are also shared with Vulkan.
This fixes issues where if both check_header and check_lib are used
it would set HAVE_FOO=yes and then result in a configure failure
when check_lib failed. This was also implemented for the other functions
to avoid similar issues.
* travis: Enable building qt for linux.
* qb: Set QT_SELECT for moc and qtchooser.
This should have no effect on systems where qtchooser is not used.
Fixes https://github.com/libretro/RetroArch/issues/8028
* qb: Actually disable c++ features if there is no c++ compiler.
Now this warning actually does something.
Warning: A working C++ compiler was not found, C++ features will be disabled.
This moves the check for a Qt5 moc into its own file, qb.moc.sh which
is executed at the end of the script to avoid the direct dependency on
pkg-config. Now instead it depends on the QT5CORE_CFLAGS and
QT5CORE_LIBS variables set in config.lib.sh. These should always be set
if HAVE_QT=yes.
This also creates a new qb.make.sh file to ensure that the config.mk and
config.h files are created at the end of the configure script.
This adds '--disable-menu' which will disable all of the menu drivers
including Qt. This will also allow disabling only rgui and not the other
menu drivers.
Fixes:
retroarch.c: In function ‘runloop_check_state’:
retroarch.c:2593:20: warning: variable ‘seq’ set but not used [-Wunused-but-set-variable]
static uint64_t seq = 0;
^~~
Also fixes a crash on startup with '--disable-rgui'.
Thread 1 "retroarch" received signal SIGSEGV, Segmentation fault.
0x0000000000529f52 in strlcpy_retro__ (dest=0x7fffffffbb17 "treaming_toggle",
source=0x1 <error: Cannot access memory at address 0x1>, size=250)
at libretro-common/compat/compat_strl.c:38
38 while (--n && (*dest++ = *source++)) src_size++;
(gdb) bt
dest=0x7fffffffbb17 "treaming_toggle",
source=0x1 <error: Cannot access memory at address 0x1>, size=250)
at libretro-common/compat/compat_strl.c:38
size=250) at libretro-common/compat/compat_strl.c:60
out_path=0x7fffffffbb10 "input_", dir=0x94b460 "input", path=0x0,
delim=95 '_', size=256) at libretro-common/file/file_path.c:964
prefix=0x94b460 "input", btn=0x0, bind=0x151e180 <input_autoconf_binds+4672>)
at input/input_driver.c:2483
binds=0x151cf40 <input_autoconf_binds>) at tasks/task_autodetect.c:172
params=0x26adb40, task=0x26b74f0) at tasks/task_autodetect.c:252
params=0x26adb40, task=0x26b74f0) at tasks/task_autodetect.c:393
at tasks/task_autodetect.c:851
at libretro-common/queues/task_queue.c:182
at libretro-common/queues/task_queue.c:609
at frontend/frontend.c:146
at frontend/frontend.c:170
Fixes https://github.com/libretro/RetroArch/issues/7893
This fixes a few subtle problems with passing CFLAGS and CXXFLAGS as
environment variables for configure.
First it will now only add these variables to config.mk when they are
actually set. If they are unset then the default optimizations in the
Makefile are set. This avoids passing more than one conflicting
optimization level to the compiler.
Next all CFLAGS are added to CXXFLAGS to avoid issues with forgetting to
set both CFLAGS and CXXFLAGS. This results in the cxx compiler getting
passed several redundant optimization levels when both the CFLAGS and
CXXFLAGS environment variabls are used. Now these uses of CFLAGS in
Makefile.common are set to DEF_FLAGS. This allows adding $(DEF_FLAGS)
to the CXXFLAGS variable without adding redundant flags from CFLAGS.
v2: Update other build files.