Commit Graph

110 Commits

Author SHA1 Message Date
orbea
65e071e470 qb: Add c++ support for check_header. 2020-02-01 15:40:43 -08:00
Twinaphex
1521be8acb
Merge pull request #10007 from orbea/eval
qb: Move BUILD_DIRS to the correct function.
2020-01-15 08:21:05 +01:00
orbea
d41b7770c4 qb: Fix the qt configure check with older compilers. 2020-01-14 21:01:50 -08:00
orbea
0dbfd721b3 qb: Move BUILD_DIRS to the correct function. 2020-01-14 20:06:09 -08:00
orbea
04af898fe5 qb: Remove potentially unsafe uses of eval. 2020-01-14 14:30:28 -08:00
orbea
19e86a2b19 qb: Allow multi argument CC and CXX. 2020-01-13 09:41:14 -08:00
Bartłomiej Burdukiewicz
562bf11946 Fixed more compiler invokes in configure stage. 2020-01-07 15:38:15 +01:00
Bartłomiej Burdukiewicz
4ca5af4ac9 Fixed compiler invoke in configure stage. 2020-01-04 18:27:58 +01:00
orbea
b590d0a219 qb: Print ... earlier.
Its better if the ... is printed before the check in case of unexpected
errors where it will look better.
2019-11-01 08:37:27 -07:00
orbea
13cf3cdef2 qb: Refactor how config.h and config.mk are created.
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.
2019-07-28 07:59:41 -07:00
orbea
de7bf62f86 qb: Enable HAVE_SLANG, HAVE_GLSLANG and HAVE_SPRIV_CROSS dynamically.
May help issue https://github.com/libretro/RetroArch/issues/9160.
2019-07-21 15:10:02 -07:00
orbea
89a8202dc5 qb: Extend check_platform.
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.
2019-07-12 11:35:22 -07:00
orbea
4c7aa40a17 qb: Extend the check_enabled function.
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.
2019-06-19 22:49:16 -07:00
orbea
8922e96869 qb: Add check_platform.
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
2019-06-02 08:48:05 -07:00
nia
3be224989d qb.libs.sh: Use CFLAGS in header check. 2019-05-18 22:42:25 +01:00
Twinaphex
b0bfe1c9be
Revert "qb.libs.sh: Use $CFLAGS when searching for header files and macros." 2019-05-18 19:00:01 +02:00
nia
efcf6220b9 qb.libs.sh: Use $CFLAGS when searching for header files and macros.
Allows configuring with --enable-gl on systems with OpenGL outside the
standard compiler search path (assuming CFLAGS is set correctly...)
2019-05-18 17:17:59 +01:00
orbea
2586e727e7 qb: Fix the HAVE_OPENGLES check.
Not all systems have the appropriate pkgconfig files.

Fixes https://github.com/libretro/RetroArch/issues/8274
2019-02-13 09:51:49 -08:00
orbea
74cd5a067f qb: Use the correct compiler flags for check_lib. 2019-02-12 11:56:24 -08:00
orbea
f41e70ba11 qb: Minor clean up. 2019-02-11 17:52:34 -08:00
orbea
f6d8f2911d qb: Allow checking for multiple pkgconfig files. 2019-02-11 16:51:08 -08:00
orbea
769612c274 qb: Rework configure output. 2019-02-11 14:14:36 -08:00
orbea
b5e7992579 qb: Test for user set variables.
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.
2019-02-10 10:16:09 -08:00
orbea
fe28192438 qb: Init some variables. 2019-02-08 12:43:58 -08:00
orbea
7cd6c9cf60 qb: Check number of arguments for while loops.
This is less fragile and doesn't rely on unset variables.
2019-02-08 12:15:47 -08:00
orbea
9d6b1c3ea7 qb: Add support for CXX_BUILD to config.params.sh. 2019-02-07 15:46:27 -08:00
orbea
28ff4b391a Clean up white space. 2019-02-03 16:00:50 -08:00
orbea
f9ee57c40d qb: Fix configure arguments. 2019-01-31 13:06:12 -08:00
orbea
c88456a455 qb: Combine HAVE_VIDEO_PROCESSOR with HAVE_VIDEOPROCCESOR. 2019-01-30 12:28:58 -08:00
orbea
921104a4fb qb: Don't force threads for win32. 2019-01-30 07:22:32 -08:00
orbea
8e798405ad qb: Extend check_enabled.
This also disables vulkan support when threads are also disabled.

Fixes https://github.com/libretro/RetroArch/issues/8091
2019-01-29 17:06:49 -08:00
orbea
1a28b06935 qb: Workaround mali bug.
Some systems have egl libarries, but no pkgconfig file to find them.

Fixes https://github.com/libretro/RetroArch/issues/8114
2019-01-29 10:16:06 -08:00
orbea
d7d5bc58b2 qb: Create qb.init.sh. 2019-01-26 14:41:37 -08:00
orbea
63c7abef06 qb: Allow testing more than one version in check_pkgconf. 2019-01-25 15:04:29 -08:00
orbea
2cc6505997 qb: Fix HAVE_RETRO check. 2019-01-24 23:08:35 -08:00
orbea
0dc40a2d66 qb: Cleanup config.libs.sh. 2019-01-24 17:17:19 -08:00
orbea
fb6fe1a87c Makefile: Better respect CFLAGS and CXXFLAGS as environment variables.
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.
2018-12-30 17:17:19 -08:00
orbea
7e4723e37a qb: Minor cleanup.
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.
2018-12-21 08:32:01 -08:00
nia
1721bd07c4 Use the correct message when printing macro tests. 2018-12-21 14:23:13 +00:00
nia
3ef9bbb592 Add an AudioIO dirver for NetBSD and Solaris. 2018-12-21 14:15:30 +00:00
orbea
9be245ad75 qb: Extend check_header.
Now the check_header function can test any number of header files
instead of only four.
2018-12-14 19:16:20 -08:00
orbea
8f861d438b qb: Fix checking the CXX compiler
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.
2018-05-03 12:24:32 -07:00
orbea
237a705a82 qb: Always print CC and CXX variables if set. 2018-05-01 17:47:14 -07:00
Brad Parker
a1aefc901c Qt WIMP GUI 2018-04-30 14:33:05 -04:00
orbea
b67bb87c8d qb: Add --datarootdir to configure.
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.
2018-02-04 13:54:55 -08:00
orbea
cc26f4a88c qb: Don't overwrite defaults
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.
2018-01-20 09:27:02 -08:00
kwyxz
b9585df325 Update Haiku port to allow it to build again 2018-01-20 00:19:01 -08:00
orbea
e2b003a993 qb: Only look in /opt/vc/include if $HAVE_VIDEOCORE=yes. 2018-01-02 09:40:36 -08:00
orbea
48982de355 qb: Improve build without pkg-config. 2018-01-02 09:40:36 -08:00
orbea
a37d624967 qb: Improve the check_val function.
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.
2017-12-30 20:56:40 -08:00