Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[build error] opengl enabled, but sdl configured with opengl disabled #689

Closed
spyjoshx opened this issue Jan 5, 2023 · 10 comments · Fixed by #720
Closed

[build error] opengl enabled, but sdl configured with opengl disabled #689

spyjoshx opened this issue Jan 5, 2023 · 10 comments · Fixed by #720

Comments

@spyjoshx
Copy link

spyjoshx commented Jan 5, 2023

OS: Fedora 37 (GNOME) x86_64
I installed the packages in INSTALL.txt (SLD_image-devel was not found, but was listed as optional so I ignored) and ran scons, but it stopped with the following full output:

scons: Reading SConscript files ...
===== D1X-Rebirth v0.61.0 0.60.0-beta2-696-gd2e190ec3d5e d2e190ec3d5e6257e82773e331e467bd20545cf7 =====
===== D2X-Rebirth v0.61.0 0.60.0-beta2-696-gd2e190ec3d5e d2e190ec3d5e6257e82773e331e467bd20545cf7 =====
DXX-Archive.3: compiling on 'linux'/'x86_64' for 'linux' into build/
DXX-Archive.3: checking version of C++ compiler 'g++' ... 'g++ (GCC) 12.2.1 20221121 (Red Hat 12.2.1-4)'
DXX-Archive.3: checking path to assembler ... b'as'
DXX-Archive.3: checking version of assembler b'as' ... 'GNU assembler version 2.38-25.fc37'
DXX-Archive.3: checking path to linker ... b'ld'
DXX-Archive.3: checking version of linker b'ld' ... 'GNU ld version 2.38-25.fc37'
DXX-Archive.3: CHOST: None
DXX-Archive.3: CXX: 'g++'
DXX-Archive.3: CPPDEFINES: [('PHYSFS_DEPRECATED', '')]
DXX-Archive.3: CPPPATH: ['common/include', 'common/main', '.', 'build/']
DXX-Archive.3: CPPFLAGS: ['-Wno-sign-compare']
DXX-Archive.3: CXXFLAGS: ['-g', '-O2', '-ftabstop=4', '-Wall', '-Werror=extra', '-Werror=format=2', '-Werror=missing-braces', '-Werror=missing-include-dirs', '-Werror=uninitialized', '-Werror=undef', '-Werror=pointer-arith', '-Werror=cast-qual', '-Werror=missing-declarations', '-Werror=vla', '-pthread', '-funsigned-char']
DXX-Archive.3: LIBS: None
DXX-Archive.3: LINKFLAGS: []
DXX-Archive.3: $CCACHE_PREFIX: None
DXX-Archive.3: $DISTCC_HOSTS: None
DXX-Archive.3: checking whether C++ compiler and linker work...yes
DXX-Archive.3: checking whether C++ compiler accepts -std=gnu++20...yes
DXX-Archive.3: checking endian to use...little
DXX-Archive.3: checking whether to enable word alignment fixups...no
DXX-Archive.3: building with OpenGL
DXX-Archive.3: checking whether to enable release options...yes
DXX-Archive.3: checking whether to enable memory allocation tracking...no
DXX-Archive.3: checking whether to enable level editor...no
DXX-Archive.3: checking whether to enable IPv6 support...no
DXX-Archive.3: checking whether to enable multiplayer over UDP...yes
DXX-Archive.3: checking whether to enable UDP game tracker...yes
DXX-Archive.3: checking how to handle ADL MIDI...disabled
DXX-Archive.3: checking how to format screenshots...png
DXX-Archive.3: checking libpng pkg-config libpng
DXX-Archive.3: using pkg-config at discovered path /usr/bin/pkg-config
DXX-Archive.3: reading libpng version from ('/usr/bin/pkg-config', '--modversion', 'libpng')
DXX-Archive.3: libpng version: b'1.6.37'
DXX-Archive.3: reading libpng settings from ('/usr/bin/pkg-config', '--cflags', '--libs', 'libpng')
DXX-Archive.3: libpng settings: {'CPPPATH': ['/usr/include/libpng16'], 'LIBS': ['png16', 'z']}
DXX-Archive.3: checking for usable library png...yes
DXX-Archive.3: checking physfs pkg-config physfs
DXX-Archive.3: reading physfs version from ('/usr/bin/pkg-config', '--modversion', 'physfs')
DXX-Archive.3: physfs version: b'3.0.2'
DXX-Archive.3: reading physfs settings from ('/usr/bin/pkg-config', '--cflags', '--libs', 'physfs')
DXX-Archive.3: physfs settings: {'LIBPATH': ['/usr/lib'], 'LIBS': ['physfs']}
DXX-Archive.3: checking for usable library physfs...yes
DXX-Archive.3: checking for usable library ['GL', 'GLU']...yes
DXX-Archive.3: checking SDL pkg-config sdl
DXX-Archive.3: reading sdl version from ('/usr/bin/pkg-config', '--modversion', 'sdl')
DXX-Archive.3: SDL version: b'1.2.60'
DXX-Archive.3: reading SDL settings from ('/usr/bin/pkg-config', '--cflags', '--libs', 'sdl')
DXX-Archive.3: SDL settings: {'CPPDEFINES': [['_GNU_SOURCE', '1'], '_REENTRANT'], 'CPPPATH': ['/usr/include/SDL'], 'LIBS': ['SDL']}
DXX-Archive.3: checking whether to enable joystick support...yes
DXX-Archive.3: checking for usable library SDL with OpenGL...no
DXX-Archive.3: checking for usable header SDL.h...no
DXX-Archive.3: checking whether compiler can parse header SDL.h...yes
DXX-Archive.3: checking for usable library SDL without OpenGL...yes
scons: *** Rebirth configured with OpenGL enabled, but SDL configured with OpenGL disabled.  Disable Rebirth OpenGL or install an SDL with OpenGL enabled.  See build/sconf.log for details.  Stop.

Attaching sconf.log that the error mentions.
sconf.log

@vLKp
Copy link
Contributor

vLKp commented Jan 5, 2023

This test checks that your SDL headers define SDL_VIDEO_OPENGL, and exits with an error if that symbol is not defined. What options were specified when your SDL package was built? What is the content of /usr/include/SDL/SDL_config.h?

@spyjoshx
Copy link
Author

spyjoshx commented Jan 5, 2023

Unsure as to how my particular SDL package was built, as I just installed whatever the default one was with dnf. Attaching the contents of my SLD_config.h
header_contents.txt

@spyjoshx
Copy link
Author

spyjoshx commented Jan 5, 2023

update:
The above issue was fixed by switching to SDL2, and installing mesa-libGLU-devel, however, the build is now showing that it can't find SDL.h, which is definitely there in /usr/include/SDL2/SDL.h

@vLKp
Copy link
Contributor

vLKp commented Jan 5, 2023

That header appears to be owned by sdl12-compat-devel, which uses SDL2 to emulate SDL1. The header path I gave is appropriate when using real SDL1. When using SDL2, you need to follow that header through to the underlying platform-specific header:

#elif defined(__x86_64__)
#include "SDL_config-x86_64.h"

Native SDL2 is supported, and finds its headers on its own. If you need help with that, please provide the logs from the failed build.

@spyjoshx
Copy link
Author

spyjoshx commented Jan 9, 2023

Sorry for the late response. Here's my situation. I have both sld2 and dls12-compat installed, but it still says the header is missing. If it's officially supported, I guess I'd prefer to try native sdl2 just because I want to help test, but I don't see any documentation on how to build with it (or is scons supposed to automatically detect it? If it is, it's not working...).

@vLKp
Copy link
Contributor

vLKp commented Jan 9, 2023

Since SDL1 and SDL2 can be concurrently installed, SCons does not automatically pick one over the other. It presently defaults to SDL1, but you can pass sdl2=1 to scons to switch to SDL2.

@spyjoshx
Copy link
Author

spyjoshx commented Jan 9, 2023

Hmm... That's what I tried, but it's still telling me that it can't find SDL.h. sdl2=1 just goes after the scons command, right?

@vLKp
Copy link
Contributor

vLKp commented Jan 10, 2023

Yes.

@vLKp
Copy link
Contributor

vLKp commented Mar 25, 2023

A similar report from a Gentoo user is now listed in the Gentoo bug tracker at https://bugs.gentoo.org/show_bug.cgi?id=900212 . It does not provide the requisite log to confirm the problem, but that user also is using a package that uses SDL2 to emulate SDL1. I am inclined to consider this a bug in the emulation package, since it purports to work like SDL1, but does not behave like SDL1.

@vLKp
Copy link
Contributor

vLKp commented Jun 25, 2023

As I noted above, I consider this a bug in the emulation package. However, per the comment in @chewi's pull request #720, this appears to be by design in the emulation package. Therefore, I merged @chewi's change to bypass this check when using the emulation package.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants