* 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.
Currently RetroArch will install assets for xmb, materialui and ozone
unconditionally.
This change will now only install assets when RetroArch is compiled
with support for the relevant menu driver. This also exposes assets
from the nuklear and zarch menu drivers which are still disabled by
default.
This uses safer quoting and removes an unneeded use of printf.
Fixes the following shellcheck warning.
In qb/qb.libs.sh line 143:
if [ $3 ]; then
^-- SC2086: Double quote to prevent globbing and word splitting.
v2: Remove redundant conditional.
C89 builds are only used for the qb build system currently and these are
already checked in qb/config.params.sh.
Additionally the HAVE_NETWORKING check is handled with qb/config.lib.sh
where HAVE_SSL and HAVE_BUILTINMBEDTLS are disabled if networking is
also disabled. The other build systems should never define HAVE_SSL or
HAVE_BUILTINMBEDTLS without HAVE_NETWORKING. Also there are no other
build systems that rely on Makefile.common using this yet.
This does the following.
1. Fixes checking if the CXX compiler works on platforms other than windows.
2. Turns the error when the CXX compiler is missing or doesn't work into a warning.
3. Adds HAVE_CC and HAVE_CXX.
4. Only adds CC and CXX to config.mk when HAVE_CC or HAVE_CXX are true.
5. Disables Qt companion, Vulkan, CXX_BUILD and NEED_CXX_LINKER if HAVE_CXX is false.
6. Explicitly errors when the CXX compiler is broken or missing and Qt or vulkan support is enabled.
7. No longer explicitly links with the CXX compiler on windows since this should no longer be needed.
This also adds the function `check_enabled` to `qb/qb.lib.sh` which
can be used to dynamically disable any libraries that require C++
support.
By default 'make install' will now install the following 2-3 files
to $(DESTDIR)$(SHARE_DIR)/doc/retroarch which by default is
/usr/local/share/doc/retroarch.
COPYING
README.md
and if media/assets exists it will install:
media/assets/COPYING to COPYING.assets
Users will be able to configure this install path with.
./configure --docdir=PATH
For example:
./configure --docdir=/usr/doc/RetroArch-1.7.0
This allows a user to use --datarootdir=PATH to configure the
share directory used for pixmaps, desktop files, man pages and assets.
By default this will be '/usr/local/share'. Assets and man page install
paths can still be configured with:
--with-man_dir=PATH
and
--with-assets_dir=PATH
Some operating systems like Haiku use unconventional install paths
and this should allow them to configure their build correctly.
Haiku really should use the configure flags provided, that is why they exists.
In this case.
./configure \
--global-config-dir=$PREFIX/settings
--with-assets_dir=$PREFIX/data
--with-mand_dir=$PREFIX/documentation/man
Changing the defaults just makes the script more complicated for no good reason.
The check_lib function does not seem able to detect vulkan on windows,
this replaces a hack in Makefile.common that does the same, but while allowing
C89_BUILD=1 and --disable-vulkan to work.
LD retroarch
obj-unix/./libretro-common/net/net_natt.o: In function `natt_open_port':
/RetroArch/libretro-common/net/net_natt.c:120: undefined reference to `UPNP_AddAnyPortMapping'
/RetroArch/libretro-common/net/net_natt.c:133: undefined reference to `UPNP_GetExternalIPAddress'
/RetroArch/libretro-common/net/net_natt.c:126: undefined reference to `UPNP_AddPortMapping'
obj-unix/./libretro-common/net/net_natt.o: In function `natt_init':
/RetroArch/libretro-common/net/net_natt.c:61: undefined reference to `upnpDiscover'
/RetroArch/libretro-common/net/net_natt.c:74: undefined reference to `miniwget'
/RetroArch/libretro-common/net/net_natt.c:77: undefined reference to `parserootdesc'
/RetroArch/libretro-common/net/net_natt.c:79: undefined reference to `GetUPNPUrls'
/RetroArch/libretro-common/net/net_natt.c:81: undefined reference to `freeUPNPDevlist'
collect2: error: ld returned 1 exit status
make: *** [Makefile:159: retroarch] Error 1
This is a proof of concept for the fallback path without pkg-config.
As jack is something often not installed by default it demonstrates
that when pkg-config exists and the dependency doesn't the check_val
function in qb/qb.libs.sh will redundantly check -ljack and as expected,
fail. It also shows that when pkg-config is not installed and jack is
enabled with --enable-jack it will bail and print a configure error.
This accomplishes two things for the fallback path without pkg-config.
1. If --disable-foo is passed to configure it will explicitly skip
check_val. This has the benefit of reducing checks in
qb/config.libs.sh which are easy to break due to human error.
2. When a fallback path exists and --enable-foo is passed to configure,
but fails due to the missing -lfoo check_val will now bail and print
a configure error. However --enable-foo will still be ignored if
there is no fallback path and pkg-config is not installed.
One issue with this is that if pkg-config is installed and the package
foo is not, it will still check if -lfoo works. As not all pkg-config
implemenations can be trusted to work even if they exist this seems
unavoidable.
This resolves an issue where the default freebsd compiler does not
include /usr/local/include which contains important headers such as
GL/gl.h and results in the check_header function failing to find them.
Unfortunately pkg-config/pkgconf will not work here for two reasons.
1. It does not seem able to actually check for gl.h which RetroArch
explicitly needs.
2. Not all systems have a pkg-config implementation so we will still
have to fall back to checking for gl.h...
Fixes https://github.com/libretro/RetroArch/issues/5958