Rust-SDL2 / rust-sdl2

SDL2 bindings for Rust
MIT License
2.72k stars 467 forks source link

Spaces in build path cause error on Windows with "bundled" feature #1032

Closed arctic-alpaca closed 3 years ago

arctic-alpaca commented 3 years ago

Hello, if the build path contains a space on Windows, the compilation stops with an error.

Error and backtrace

``` PS C:\Users\xyz\Desktop\orbtk\orbtk alpha4> cargo run --example widgets --release Compiling sdl2-sys v0.34.3 Compiling orbtk_utils v0.3.1-alpha4 (C:\Users\xyz\Desktop\orbtk\orbtk alpha4\crates\utils) Compiling orbtk_render v0.3.1-alpha4 (C:\Users\xyz\Desktop\orbtk\orbtk alpha4\crates\render) error: failed to run custom build command for `sdl2-sys v0.34.3` Caused by: process didn't exit successfully: `C:\Users\xyz\Desktop\orbtk\orbtk alpha4\target\release\build\sdl2-sys-baf766943513db9a\build-script-build` (exit code: 101) --- stdout running: "cmake" "C:\\Users\\xyz\\Desktop\\orbtk\\orbtk alpha4\\target\\release\\build\\sdl2-sys-69f493347dc9b3e8\\out\\SDL2-2.0.12" "-G" "MinGW Makefiles" "-DVIDEO_OPENGLES=OFF" "-DSDL_SHARED=OFF" "-DSDL_STATIC=ON" "-DCMAKE_INSTALL_PREFIX=C:\\Users\\xyz\\Desktop\\orbtk\\orbtk alpha4\\target\\release\\build\\sdl2-sys-69f493347dc9b3e8\\out" "-DCMAKE_C_FLAGS= -ffunction-sections -fdata-sections -m64" "-DCMAKE_CXX_FLAGS= -ffunction-sections -fdata-sections -m64" "-DCMAKE_ASM_FLAGS= -ffunction-sections -fdata-sections -m64" "-DCMAKE_BUILD_TYPE=release" -- -- SDL2 was configured with the following options: -- -- Platform: Windows-10.0.18363 -- 64-bit: TRUE -- Compiler: C:/msys64/mingw64/bin/gcc.exe -- -- Subsystems: -- Atomic: ON -- Audio: ON -- Video: ON -- Render: ON -- Events: ON -- Joystick: ON -- Haptic: ON -- Power: ON -- Threads: ON -- Timers: ON -- File: ON -- Loadso: ON -- CPUinfo: ON -- Filesystem: ON -- Dlopen: ON -- Sensor: ON -- -- Options: -- 3DNOW (Wanted: ON): OFF -- ALSA (Wanted: OFF): OFF -- ALSA_SHARED (Wanted: OFF): OFF -- ALTIVEC (Wanted: ON): OFF -- ARMNEON (Wanted: ON): OFF -- ARMSIMD (Wanted: ON): OFF -- ARTS (Wanted: OFF): OFF -- ARTS_SHARED (Wanted: OFF): OFF -- ASSEMBLY (Wanted: ON): ON -- ASSERTIONS (Wanted: auto): auto -- BACKGROUNDING_SIGNAL (Wanted: OFF): OFF -- CLOCK_GETTIME (Wanted: OFF): OFF -- DIRECTFB_SHARED (Wanted: OFF): OFF -- DIRECTX (Wanted: ON): OFF -- DISKAUDIO (Wanted: ON): ON -- DUMMYAUDIO (Wanted: ON): ON -- ESD (Wanted: OFF): OFF -- ESD_SHARED (Wanted: OFF): OFF -- FOREGROUNDING_SIGNAL (Wanted: OFF): OFF -- FUSIONSOUND (Wanted: OFF): OFF -- FUSIONSOUND_SHARED (Wanted: OFF): OFF -- GCC_ATOMICS (Wanted: ON): OFF -- HIDAPI (Wanted: ON): ON -- INPUT_TSLIB (Wanted: OFF): OFF -- JACK (Wanted: OFF): OFF -- JACK_SHARED (Wanted: OFF): OFF -- KMSDRM_SHARED (Wanted: OFF): OFF -- LIBC (Wanted: ON): ON -- LIBSAMPLERATE (Wanted: OFF): OFF -- LIBSAMPLERATE_SHARED (Wanted: OFF): OFF -- MMX (Wanted: ON): OFF -- NAS (Wanted: OFF): OFF -- NAS_SHARED (Wanted: OFF): OFF -- OSS (Wanted: OFF): OFF -- PTHREADS (Wanted: OFF): OFF -- PTHREADS_SEM (Wanted: OFF): OFF -- PULSEAUDIO (Wanted: OFF): OFF -- PULSEAUDIO_SHARED (Wanted: OFF): OFF -- RENDER_D3D (Wanted: ON): OFF -- RENDER_METAL (Wanted: OFF): OFF -- RPATH (Wanted: OFF): OFF -- SDL_DLOPEN (Wanted: ON): OFF -- SDL_STATIC_PIC (Wanted: OFF): OFF -- SDL_TEST (Wanted: OFF): OFF -- SNDIO (Wanted: OFF): OFF -- SNDIO_SHARED (Wanted: OFF): OFF -- SSE (Wanted: ON): OFF -- SSE2 (Wanted: ON): OFF -- SSE3 (Wanted: ON): OFF -- SSEMATH (Wanted: ON): OFF -- VIDEO_COCOA (Wanted: OFF): OFF -- VIDEO_DIRECTFB (Wanted: OFF): OFF -- VIDEO_DUMMY (Wanted: ON): ON -- VIDEO_KMSDRM (Wanted: OFF): OFF -- VIDEO_METAL (Wanted: OFF): OFF -- VIDEO_OFFSCREEN (Wanted: OFF): OFF -- VIDEO_OPENGL (Wanted: ON): ON -- VIDEO_OPENGLES (Wanted: OFF): OFF -- VIDEO_RPI (Wanted: OFF): OFF -- VIDEO_VIVANTE (Wanted: OFF): OFF -- VIDEO_VULKAN (Wanted: ON): ON -- VIDEO_WAYLAND (Wanted: OFF): OFF -- VIDEO_WAYLAND_QT_TOUCH (Wanted: OFF): OFF -- VIDEO_X11 (Wanted: OFF): OFF -- VIDEO_X11_XCURSOR (Wanted: OFF): OFF -- VIDEO_X11_XINERAMA (Wanted: OFF): OFF -- VIDEO_X11_XINPUT (Wanted: OFF): OFF -- VIDEO_X11_XRANDR (Wanted: OFF): OFF -- VIDEO_X11_XSCRNSAVER (Wanted: OFF): OFF -- VIDEO_X11_XSHAPE (Wanted: OFF): OFF -- VIDEO_X11_XVM (Wanted: OFF): OFF -- WASAPI (Wanted: ON): OFF -- WAYLAND_SHARED (Wanted: OFF): OFF -- X11_SHARED (Wanted: OFF): OFF -- -- CFLAGS: -ffunction-sections -fdata-sections -m64 -idirafter C:/Users/xyz/Desktop/orbtk/orbtk alpha4/target/release/build/sdl2-sys-69f493347dc9b3e8/out/SDL2-2.0.12/src/video/khronos -IC:/Users/xyz/Desktop/orbtk/orbtk alpha4/target/release/build/sdl2-sys-69f493347dc9b3e8/out/SDL2-2.0.12/src/hidapi/hidapi -- EXTRA_CFLAGS: -- EXTRA_LDFLAGS: -mwindows -- EXTRA_LIBS: user32;gdi32;winmm;imm32;ole32;oleaut32;version;uuid;advapi32;setupapi;shell32;mingw32 -- -- Build Shared Library: OFF -- Build Static Library: ON -- Build Static Library with Position Independent Code: OFF -- -- Configuring done -- Generating done -- Build files have been written to: C:/Users/xyz/Desktop/orbtk/orbtk alpha4/target/release/build/sdl2-sys-69f493347dc9b3e8/out/build running: "cmake" "--build" "." "--target" "install" "--config" "release" "--" [ 1%] Building C object CMakeFiles/SDL2main.dir/src/main/windows/SDL_windows_main.c.obj [ 1%] Building C object CMakeFiles/SDL2-static.dir/src/SDL.c.obj [ 1%] Building C object CMakeFiles/SDL2-static.dir/src/SDL_dataqueue.c.obj [ 3%] Building C object CMakeFiles/SDL2-static.dir/src/SDL_error.c.obj [ 3%] Building C object CMakeFiles/SDL2-static.dir/src/SDL_assert.c.obj [ 4%] Building C object CMakeFiles/SDL2-static.dir/src/SDL_hints.c.obj [ 5%] Building C object CMakeFiles/SDL2-static.dir/src/atomic/SDL_atomic.c.obj [ 5%] Building C object CMakeFiles/SDL2-static.dir/src/SDL_log.c.obj [ 5%] Building C object CMakeFiles/SDL2-static.dir/src/audio/SDL_audio.c.obj [ 8%] Building C object CMakeFiles/SDL2-static.dir/src/audio/SDL_audiotypecvt.c.obj [ 8%] Building C object CMakeFiles/SDL2-static.dir/src/atomic/SDL_spinlock.c.obj [ 8%] Building C object CMakeFiles/SDL2-static.dir/src/audio/SDL_audiocvt.c.obj [ 8%] Building C object CMakeFiles/SDL2-static.dir/src/audio/SDL_audiodev.c.obj --- stderr gcc.exe: error: alpha4/target/release/build/sdl2-sys-69f493347dc9b3e8/out/SDL2-2.0.12/src/video/khronos: No such file or directory gcc.exe: error: alpha4/target/release/build/sdl2-sys-69f493347dc9b3e8/out/SDL2-2.0.12/src/hidapi/hidapi: No such file or directory mingw32-make[2]: *** [CMakeFiles\SDL2main.dir\build.make:83: CMakeFiles/SDL2main.dir/src/main/windows/SDL_windows_main.c.obj] Error 1 mingw32-make[1]: *** [CMakeFiles\Makefile2:152: CMakeFiles/SDL2main.dir/all] Error 2 mingw32-make[1]: *** Waiting for unfinished jobs.... gcc.exe: error: alpha4/target/release/build/sdl2-sys-69f493347dc9b3e8/out/SDL2-2.0.12/src/video/khronos: No such file or directory gcc.exe: error: alpha4/target/release/build/sdl2-sys-69f493347dc9b3e8/out/SDL2-2.0.12/src/hidapi/hidapi: No such file or directory gcc.exe: error: alpha4/target/release/build/sdl2-sys-69f493347dc9b3e8/out/SDL2-2.0.12/src/video/khronos: No such file or directory gcc.exe: error: alpha4/target/release/build/sdl2-sys-69f493347dc9b3e8/out/SDL2-2.0.12/src/hidapi/hidapi: No such file or directory gcc.exe: error: alpha4/target/release/build/sdl2-sys-69f493347dc9b3e8/out/SDL2-2.0.12/src/video/khronos: No such file or directory gcc.exe: error: alpha4/target/release/build/sdl2-sys-69f493347dc9b3e8/out/SDL2-2.0.12/src/hidapi/hidapi: No such file or directory mingw32-make[2]: *** [CMakeFiles\SDL2-static.dir\build.make:83: CMakeFiles/SDL2-static.dir/src/SDL.c.obj] Error 1 mingw32-make[2]: *** Waiting for unfinished jobs.... mingw32-make[2]: *** [CMakeFiles\SDL2-static.dir\build.make:111: CMakeFiles/SDL2-static.dir/src/SDL_dataqueue.c.obj] Error 1 gcc.exe: error: alpha4/target/release/build/sdl2-sys-69f493347dc9b3e8/out/SDL2-2.0.12/src/video/khronos: No such file or directory gcc.exe: error: alpha4/target/release/build/sdl2-sys-69f493347dc9b3e8/out/SDL2-2.0.12/src/hidapi/hidapi: No such file or directory gcc.exe: error: alpha4/target/release/build/sdl2-sys-69f493347dc9b3e8/out/SDL2-2.0.12/src/video/khronos: No such file or directory gcc.exe: error: alpha4/target/release/build/sdl2-sys-69f493347dc9b3e8/out/SDL2-2.0.12/src/hidapi/hidapi: No such file or directory gcc.exe: error: alpha4/target/release/build/sdl2-sys-69f493347dc9b3e8/out/SDL2-2.0.12/src/video/khronos: No such file or directory mingw32-make[2]: *** [CMakeFiles\SDL2-static.dir\build.make:125: CMakeFiles/SDL2-static.dir/src/SDL_error.c.obj] Error 1 gcc.exe: error: alpha4/target/release/build/sdl2-sys-69f493347dc9b3e8/out/SDL2-2.0.12/src/hidapi/hidapi: No such file or directory mingw32-make[2]: *** [CMakeFiles\SDL2-static.dir\build.make:97: CMakeFiles/SDL2-static.dir/src/SDL_assert.c.obj] Error 1 mingw32-make[2]: *** [CMakeFiles\SDL2-static.dir\build.make:167: CMakeFiles/SDL2-static.dir/src/atomic/SDL_atomic.c.obj] Error 1 mingw32-make[2]: *** [CMakeFiles\SDL2-static.dir\build.make:139: CMakeFiles/SDL2-static.dir/src/SDL_hints.c.obj] Error 1 gcc.exe: error: alpha4/target/release/build/sdl2-sys-69f493347dc9b3e8/out/SDL2-2.0.12/src/video/khronos: No such file or directory gcc.exe: error: alpha4/target/release/build/sdl2-sys-69f493347dc9b3e8/out/SDL2-2.0.12/src/video/khronos: No such file or directory gcc.exe: error: alpha4/target/release/build/sdl2-sys-69f493347dc9b3e8/out/SDL2-2.0.12/src/hidapi/hidapi: No such file or directory gcc.exe: error: alpha4/target/release/build/sdl2-sys-69f493347dc9b3e8/out/SDL2-2.0.12/src/hidapi/hidapi: No such file or directory gcc.exe: error: alpha4/target/release/build/sdl2-sys-69f493347dc9b3e8/out/SDL2-2.0.12/src/video/khronos: No such file or directory gcc.exe: error: alpha4/target/release/build/sdl2-sys-69f493347dc9b3e8/out/SDL2-2.0.12/src/hidapi/hidapi: No such file or directory mingw32-make[2]: *** [CMakeFiles\SDL2-static.dir\build.make:153: CMakeFiles/SDL2-static.dir/src/SDL_log.c.obj] Error 1 gcc.exe: error: alpha4/target/release/build/sdl2-sys-69f493347dc9b3e8/out/SDL2-2.0.12/src/video/khronos: No such file or directory gcc.exe: error: alpha4/target/release/build/sdl2-sys-69f493347dc9b3e8/out/SDL2-2.0.12/src/hidapi/hidapi: No such file or directory mingw32-make[2]: *** [CMakeFiles\SDL2-static.dir\build.make:195: CMakeFiles/SDL2-static.dir/src/audio/SDL_audio.c.obj] Error 1 mingw32-make[2]: *** [CMakeFiles\SDL2-static.dir\build.make:223: CMakeFiles/SDL2-static.dir/src/audio/SDL_audiodev.c.obj] Error 1 gcc.exe: error: alpha4/target/release/build/sdl2-sys-69f493347dc9b3e8/out/SDL2-2.0.12/src/video/khronos: No such file or directory gcc.exe: error: alpha4/target/release/build/sdl2-sys-69f493347dc9b3e8/out/SDL2-2.0.12/src/hidapi/hidapi: No such file or directory mingw32-make[2]: *** [CMakeFiles\SDL2-static.dir\build.make:181: CMakeFiles/SDL2-static.dir/src/atomic/SDL_spinlock.c.obj] Error 1 mingw32-make[2]: *** [CMakeFiles\SDL2-static.dir\build.make:209: CMakeFiles/SDL2-static.dir/src/audio/SDL_audiocvt.c.obj] Error 1 gcc.exe: error: alpha4/target/release/build/sdl2-sys-69f493347dc9b3e8/out/SDL2-2.0.12/src/video/khronos: No such file or directory gcc.exe: error: alpha4/target/release/build/sdl2-sys-69f493347dc9b3e8/out/SDL2-2.0.12/src/hidapi/hidapi: No such file or directory mingw32-make[2]: *** [CMakeFiles\SDL2-static.dir\build.make:237: CMakeFiles/SDL2-static.dir/src/audio/SDL_audiotypecvt.c.obj] Error 1 mingw32-make[1]: *** [CMakeFiles\Makefile2:125: CMakeFiles/SDL2-static.dir/all] Error 2 mingw32-make: *** [Makefile:149: all] Error 2 thread 'main' panicked at ' command did not execute successfully, got: exit code: 2 build script failed, must exit now', C:\Users\xyz\.cargo\registry\src\github.com-1ecc6299db9ec823\cmake-0.1.44\src\lib.rs:885:5 stack backtrace: 0: 0x5ba84b - backtrace::backtrace::dbghelp::trace::ha09940ef4b8fd9a2 at C:\Users\runneradmin\.cargo\registry\src\github.com-1ecc6299db9ec823\backtrace-0.3.46\src\backtrace/dbghelp.rs:88 1: 0x5ba84b - backtrace::backtrace::trace_unsynchronized::h19d7d1b30f96fe6c at C:\Users\runneradmin\.cargo\registry\src\github.com-1ecc6299db9ec823\backtrace-0.3.46\src\backtrace/mod.rs:66 2: 0x5ba84b - std::sys_common::backtrace::_print_fmt::hf038dfff95c497df at src\libstd\sys_common/backtrace.rs:78 3: 0x5ba84b - ::fmt::he2295693089d2e8c at src\libstd\sys_common/backtrace.rs:59 4: 0x5e61ec - core::fmt::write::h2e7468e40976ea37 at src\libcore\fmt/mod.rs:1076 5: 0x5abee9 - std::io::Write::write_fmt::hef3158223e737cb6 at src\libstd\io/mod.rs:1537 6: 0x5bf080 - std::sys_common::backtrace::_print::he4a39cb956ba394d at src\libstd\sys_common/backtrace.rs:62 7: 0x5bf080 - std::sys_common::backtrace::print::h38d45a7d7a4d1f02 at src\libstd\sys_common/backtrace.rs:49 8: 0x5bf080 - std::panicking::default_hook::{{closure}}::hfcc0d2f90e4d71be at src\libstd/panicking.rs:198 9: 0x5bed09 - std::panicking::default_hook::h7e61c8ee936a661d at src\libstd/panicking.rs:217 10: 0x5bf7bd - std::panicking::rust_panic_with_hook::h8b0608bd552a3d13 at src\libstd/panicking.rs:526 11: 0x5bf3d4 - rust_begin_unwind at src\libstd/panicking.rs:437 12: 0x5bf34c - std::panicking::begin_panic_fmt::h4fc915ffaaf5e9d9 at src\libstd/panicking.rs:391 13: 0x5570a6 - cmake::fail::h4c1f206f8ccc64d1 14: 0x556c95 - cmake::run::h7b8ebc88858b1aa8 15: 0x5553ae - cmake::Config::build::h1fa870119a6299af 16: 0x406394 - build_script_build::main::h2ff9620570826204 17: 0x40a076 - std::rt::lang_start::{{closure}}::h809b966f0182ed68 18: 0x5bfa7c - std::rt::lang_start_internal::{{closure}}::hcfe58f53feea7233 at src\libstd/rt.rs:52 19: 0x5bfa7c - std::panicking::try::do_call::hc4163588b8559d85 at src\libstd/panicking.rs:348 20: 0x5bfa7c - std::panicking::try::h310a3be58418d841 at src\libstd/panicking.rs:325 21: 0x5bfa7c - std::panic::catch_unwind::h52728a6ebc96df5e at src\libstd/panic.rs:394 22: 0x5bfa7c - std::rt::lang_start_internal::ha1701ac7d300255b at src\libstd/rt.rs:51 23: 0x408278 - main 24: 0x4013c1 - __tmainCRTStartup at D:/mingwbuild/mingw-w64-crt-git/src/mingw-w64/mingw-w64-crt/crt/crtexe.c:335 25: 0x4014f6 - mainCRTStartup at D:/mingwbuild/mingw-w64-crt-git/src/mingw-w64/mingw-w64-crt/crt/crtexe.c:219 26: 0x7ffc82f07bd4 - units_search 27: 0x7ffc8400ce51 - units_search ```

Cobrand commented 3 years ago

Tested on Linux with a space in the parent folder, there is an issue too but it's a wildy different one:

--- stderr
  CMake Error at cmake/macros.cmake:28 (message):
    *** ERROR: Missing Xext.h, maybe you need to install the libxext-dev
Cobrand commented 3 years ago

Note that this should be a pretty "easy" issue to fix, some argument must have not been escaped properly somewhere in the cmake calls, in sdl2-sys/build.rs we just have to find where.

Cobrand commented 3 years ago

So I looked a bit at the code and noticed the Rust side of CMake always handles paths and never string, so I doubted the issue was coming from there. The only other option was an error upstream coming directly from the CMakeLists.txt file from SDL2.

And sure enough, when I try to compile SDL2 without Rust

With Space in parent folder

``` $ pwd /tmp/sd l2/SDL2-2.0.12 $ ./configure configure: WARNING: Libtool does not cope well with whitespace in `pwd` checking build system type... x86_64-pc-linux-gnu checking host system type... x86_64-pc-linux-gnu checking how to print strings... printf checking for gcc... gcc checking whether the C compiler works... yes checking for C compiler default output file name... a.out checking for suffix of executables... checking whether we are cross compiling... no checking for suffix of object files... o checking whether we are using the GNU C compiler... yes checking whether gcc accepts -g... yes checking for gcc option to accept ISO C89... none needed checking for a sed that does not truncate output... /usr/bin/sed checking for grep that handles long lines and -e... /usr/bin/grep checking for egrep... /usr/bin/grep -E checking for fgrep... /usr/bin/grep -F checking for ld used by gcc... /usr/bin/ld checking if the linker (/usr/bin/ld) is GNU ld... yes checking for BSD- or MS-compatible name lister (nm)... /usr/bin/nm -B checking the name lister (/usr/bin/nm -B) interface... BSD nm checking whether ln -s works... yes checking the maximum length of command line arguments... 1572864 checking whether the shell understands some XSI constructs... yes checking whether the shell understands "+="... yes checking how to convert x86_64-pc-linux-gnu file names to x86_64-pc-linux-gnu format... func_convert_file_noop checking how to convert x86_64-pc-linux-gnu file names to toolchain format... func_convert_file_noop checking for /usr/bin/ld option to reload object files... -r checking for objdump... objdump checking how to recognize dependent libraries... pass_all checking for dlltool... no checking how to associate runtime and link libraries... printf %s\n checking for ar... ar checking for archiver @FILE support... @ checking for strip... strip checking for ranlib... ranlib checking for gawk... gawk checking command to parse /usr/bin/nm -B output from gcc object... ok checking for sysroot... no checking for mt... no checking if : is a manifest tool... no checking how to run the C preprocessor... gcc -E checking for ANSI C header files... yes checking for sys/types.h... yes checking for sys/stat.h... yes checking for stdlib.h... yes checking for string.h... yes checking for memory.h... yes checking for strings.h... yes checking for inttypes.h... yes checking for stdint.h... yes checking for unistd.h... yes checking for dlfcn.h... yes checking for objdir... .libs checking if gcc supports -fno-rtti -fno-exceptions... no checking for gcc option to produce PIC... -fPIC -DPIC checking if gcc PIC flag -fPIC -DPIC works... yes checking if gcc static flag -static works... yes checking if gcc supports -c -o file.o... yes checking if gcc supports -c -o file.o... (cached) yes checking whether the gcc linker (/usr/bin/ld -m elf_x86_64) supports shared libraries... yes checking whether -lc should be explicitly linked in... no checking dynamic linker characteristics... GNU/Linux ld.so checking how to hardcode library paths into programs... immediate checking whether stripping libraries is possible... yes checking if libtool supports shared libraries... yes checking whether to build shared libraries... yes checking whether to build static libraries... yes checking for gcc... (cached) gcc checking whether we are using the GNU C compiler... (cached) yes checking whether gcc accepts -g... (cached) yes checking for gcc option to accept ISO C89... (cached) none needed checking for g++... g++ checking whether we are using the GNU C++ compiler... yes checking whether g++ accepts -g... yes checking how to run the C++ preprocessor... g++ -E checking for ld used by g++... /usr/bin/ld -m elf_x86_64 checking if the linker (/usr/bin/ld -m elf_x86_64) is GNU ld... yes checking whether the g++ linker (/usr/bin/ld -m elf_x86_64) supports shared libraries... yes checking for g++ option to produce PIC... -fPIC -DPIC checking if g++ PIC flag -fPIC -DPIC works... yes checking if g++ static flag -static works... yes checking if g++ supports -c -o file.o... yes checking if g++ supports -c -o file.o... (cached) yes checking whether the g++ linker (/usr/bin/ld -m elf_x86_64) supports shared libraries... yes checking dynamic linker characteristics... (cached) GNU/Linux ld.so checking how to hardcode library paths into programs... immediate checking for a BSD-compatible install... /usr/bin/install -c checking whether make sets $(MAKE)... yes checking for windres... no checking for pkg-config... /usr/bin/pkg-config checking pkg-config is at least version 0.9.0... yes ./configure: line 11795: test: too many arguments checking for an ANSI C-conforming const... no checking for inline... no checking for working volatile... no checking for GCC -MMD -MT option... no checking for linker option --no-undefined... no checking for linker option --dynamicbase... no checking for linker option --nxcompat... no checking for linker option --high-entropy-va... no checking for ANSI C header files... (cached) yes checking for sys/types.h... (cached) yes checking stdio.h usability... no checking stdio.h presence... no checking for stdio.h... no checking for stdlib.h... (cached) yes checking stddef.h usability... no checking stddef.h presence... no checking for stddef.h... no checking stdarg.h usability... no checking stdarg.h presence... no checking for stdarg.h... no checking malloc.h usability... no checking malloc.h presence... no checking for malloc.h... no checking for memory.h... (cached) yes checking for string.h... (cached) yes checking for strings.h... (cached) yes checking wchar.h usability... no checking wchar.h presence... no checking for wchar.h... no checking for inttypes.h... (cached) yes checking for stdint.h... (cached) yes checking limits.h usability... no checking limits.h presence... no checking for limits.h... no checking ctype.h usability... no checking ctype.h presence... no checking for ctype.h... no checking math.h usability... no checking math.h presence... no checking for math.h... no checking float.h usability... no checking float.h presence... no checking for float.h... no checking iconv.h usability... no checking iconv.h presence... no checking for iconv.h... no checking signal.h usability... no checking signal.h presence... no checking for signal.h... no checking for size_t... no checking for M_PI in math.h... no checking for working alloca.h... no checking for alloca... no checking whether `alloca.c' needs Cray hooks... no checking stack direction for C alloca... -1 checking for working memcmp... no checking for working strtod... no checking for pow... no checking for pow in -lm... no configure: WARNING: cannot find library containing definition of pow checking for mprotect... no checking for malloc... no checking for calloc... no checking for realloc... no checking for free... no checking for getenv... no checking for setenv... no checking for putenv... no checking for unsetenv... no checking for qsort... no checking for abs... no checking for bcopy... no checking for memset... no checking for memcpy... no checking for memmove... no checking for wcslen... no checking for wcslcpy... no checking for wcslcat... no checking for wcsdup... no checking for wcsstr... no checking for wcscmp... no checking for wcsncmp... no checking for strlen... no checking for strlcpy... no checking for strlcat... no checking for _strrev... no checking for _strupr... no checking for _strlwr... no checking for strchr... no checking for strrchr... no checking for strstr... no checking for strtok_r... no checking for itoa... no checking for _ltoa... no checking for _uitoa... no checking for _ultoa... no checking for strtol... no checking for strtoul... no checking for _i64toa... no checking for _ui64toa... no checking for strtoll... no checking for strtoull... no checking for atoi... no checking for atof... no checking for strcmp... no checking for strncmp... no checking for _stricmp... no checking for strcasecmp... no checking for _strnicmp... no checking for strncasecmp... no checking for vsscanf... no checking for vsnprintf... no checking for fopen64... no checking for fseeko... no checking for fseeko64... no checking for sigaction... no checking for setjmp... no checking for nanosleep... no checking for sysconf... no checking for sysctlbyname... no checking for getauxval... no checking for poll... no checking for _Exit... no checking for pow in -lm... (cached) no checking for acos... no checking for acosf... no checking for asin... no checking for asinf... no checking for atan... no checking for atanf... no checking for atan2... no checking for atan2f... no checking for ceil... no checking for ceilf... no checking for copysign... no checking for copysignf... no checking for cos... no checking for cosf... no checking for exp... no checking for expf... no checking for fabs... no checking for fabsf... no checking for floor... no checking for floorf... no checking for fmod... no checking for fmodf... no checking for log... no checking for logf... no checking for log10... no checking for log10f... no checking for pow... (cached) no checking for powf... no checking for scalbn... no checking for scalbnf... no checking for sin... no checking for sinf... no checking for sqrt... no checking for sqrtf... no checking for tan... no checking for tanf... no checking for iconv_open in -liconv... no checking for iconv... no checking for struct sigaction.sa_sigaction... no checking libunwind.h usability... no checking libunwind.h presence... no checking for libunwind.h... no checking for GCC builtin atomic operations... no checking for GCC -mmmx option... no checking for GCC -m3dnow option... no checking for GCC -msse option... no checking for GCC -msse2 option... no checking for GCC -msse3 option... no checking immintrin.h usability... no checking immintrin.h presence... no checking for immintrin.h... no checking for Altivec with GCC altivec.h and -maltivec option... no checking for Altivec with GCC -maltivec option... no checking for Altivec with GCC altivec.h and -faltivec option... no checking for Altivec with GCC -faltivec option... no checking for GCC -Wall option... no checking for GCC -fno-strict-aliasing option... no checking for GCC -fvisibility=hidden option... no checking for GCC -Wdeclaration-after-statement option... no checking for dlopen... no checking for ARM SIMD... no checking for OSS audio support... no checking for ALSA CFLAGS... checking for ALSA LDFLAGS... -lasound -lm -ldl -lpthread checking for libasound headers version >= 1.0.11... not present. checking for snd_ctl_open in -lasound... no checking for PULSEAUDIO... yes configure: WARNING: You must have SDL_LoadObject() support for dynamic PulseAudio loading checking for JACK... yes configure: WARNING: You must have SDL_LoadObject() support for dynamic JACK audio loading checking for artsc-config... no checking for esd-config... no checking for ESD - version >= 0.2.8... no *** The esd-config script installed by ESD could not be found *** If ESD was installed in PREFIX, make sure PREFIX/bin is in *** your path, or set the ESD_CONFIG environment variable to the *** full path to esd-config. checking audio/audiolib.h usability... no checking audio/audiolib.h presence... no checking for audio/audiolib.h... no checking for AuOpenServer in -laudio... no checking for NAS audio support... no checking sndio.h usability... no checking sndio.h presence... no checking for sndio.h... no checking for sio_open in -lsndio... no checking for sndio audio support... no checking samplerate.h usability... no checking samplerate.h presence... no checking for samplerate.h... no checking for RPI... no checking for Raspberry Pi... no checking for X... libraries /usr/lib, headers /usr/include checking whether -R must be followed by a space... neither works checking for dnet_ntoa in -ldnet... no checking for dnet_ntoa in -ldnet_stub... no checking for gethostbyname... no checking for gethostbyname in -lnsl... no checking for gethostbyname in -lbsd... no checking for connect... no checking for connect in -lsocket... no checking for remove... no checking for remove in -lposix... no checking for shmat... no checking for shmat in -lipc... no checking for IceConnectionNumber in -lICE... no checking for X11/extensions/Xext.h... no configure: error: *** Missing Xext.h, maybe you need to install the libxext-dev package? ```

Without Space in parent folder

``` $ pwd /tmp/sdl2/SDL2-2.0.12 $ ./configure checking build system type... x86_64-pc-linux-gnu checking host system type... x86_64-pc-linux-gnu checking how to print strings... printf checking for gcc... gcc checking whether the C compiler works... yes checking for C compiler default output file name... a.out checking for suffix of executables... checking whether we are cross compiling... no checking for suffix of object files... o checking whether we are using the GNU C compiler... yes checking whether gcc accepts -g... yes checking for gcc option to accept ISO C89... none needed checking for a sed that does not truncate output... /usr/bin/sed checking for grep that handles long lines and -e... /usr/bin/grep checking for egrep... /usr/bin/grep -E checking for fgrep... /usr/bin/grep -F checking for ld used by gcc... /usr/bin/ld checking if the linker (/usr/bin/ld) is GNU ld... yes checking for BSD- or MS-compatible name lister (nm)... /usr/bin/nm -B checking the name lister (/usr/bin/nm -B) interface... BSD nm checking whether ln -s works... yes checking the maximum length of command line arguments... 1572864 checking whether the shell understands some XSI constructs... yes checking whether the shell understands "+="... yes checking how to convert x86_64-pc-linux-gnu file names to x86_64-pc-linux-gnu format... func_convert_file_noop checking how to convert x86_64-pc-linux-gnu file names to toolchain format... func_convert_file_noop checking for /usr/bin/ld option to reload object files... -r checking for objdump... objdump checking how to recognize dependent libraries... pass_all checking for dlltool... no checking how to associate runtime and link libraries... printf %s\n checking for ar... ar checking for archiver @FILE support... @ checking for strip... strip checking for ranlib... ranlib checking for gawk... gawk checking command to parse /usr/bin/nm -B output from gcc object... ok checking for sysroot... no checking for mt... no checking if : is a manifest tool... no checking how to run the C preprocessor... gcc -E checking for ANSI C header files... yes checking for sys/types.h... yes checking for sys/stat.h... yes checking for stdlib.h... yes checking for string.h... yes checking for memory.h... yes checking for strings.h... yes checking for inttypes.h... yes checking for stdint.h... yes checking for unistd.h... yes checking for dlfcn.h... yes checking for objdir... .libs checking if gcc supports -fno-rtti -fno-exceptions... no checking for gcc option to produce PIC... -fPIC -DPIC checking if gcc PIC flag -fPIC -DPIC works... yes checking if gcc static flag -static works... yes checking if gcc supports -c -o file.o... yes checking if gcc supports -c -o file.o... (cached) yes checking whether the gcc linker (/usr/bin/ld -m elf_x86_64) supports shared libraries... yes checking whether -lc should be explicitly linked in... no checking dynamic linker characteristics... GNU/Linux ld.so checking how to hardcode library paths into programs... immediate checking whether stripping libraries is possible... yes checking if libtool supports shared libraries... yes checking whether to build shared libraries... yes checking whether to build static libraries... yes checking for gcc... (cached) gcc checking whether we are using the GNU C compiler... (cached) yes checking whether gcc accepts -g... (cached) yes checking for gcc option to accept ISO C89... (cached) none needed checking for g++... g++ checking whether we are using the GNU C++ compiler... yes checking whether g++ accepts -g... yes checking how to run the C++ preprocessor... g++ -E checking for ld used by g++... /usr/bin/ld -m elf_x86_64 checking if the linker (/usr/bin/ld -m elf_x86_64) is GNU ld... yes checking whether the g++ linker (/usr/bin/ld -m elf_x86_64) supports shared libraries... yes checking for g++ option to produce PIC... -fPIC -DPIC checking if g++ PIC flag -fPIC -DPIC works... yes checking if g++ static flag -static works... yes checking if g++ supports -c -o file.o... yes checking if g++ supports -c -o file.o... (cached) yes checking whether the g++ linker (/usr/bin/ld -m elf_x86_64) supports shared libraries... yes checking dynamic linker characteristics... (cached) GNU/Linux ld.so checking how to hardcode library paths into programs... immediate checking for a BSD-compatible install... /usr/bin/install -c checking whether make sets $(MAKE)... yes checking for windres... no checking for pkg-config... /usr/bin/pkg-config checking pkg-config is at least version 0.9.0... yes checking for an ANSI C-conforming const... yes checking for inline... inline checking for working volatile... yes checking for GCC -MMD -MT option... yes checking for linker option --no-undefined... yes checking for linker option --dynamicbase... no checking for linker option --nxcompat... no checking for linker option --high-entropy-va... no checking for ANSI C header files... (cached) yes checking for sys/types.h... (cached) yes checking stdio.h usability... yes checking stdio.h presence... yes checking for stdio.h... yes checking for stdlib.h... (cached) yes checking stddef.h usability... yes checking stddef.h presence... yes checking for stddef.h... yes checking stdarg.h usability... yes checking stdarg.h presence... yes checking for stdarg.h... yes checking malloc.h usability... yes checking malloc.h presence... yes checking for malloc.h... yes checking for memory.h... (cached) yes checking for string.h... (cached) yes checking for strings.h... (cached) yes checking wchar.h usability... yes checking wchar.h presence... yes checking for wchar.h... yes checking for inttypes.h... (cached) yes checking for stdint.h... (cached) yes checking limits.h usability... yes checking limits.h presence... yes checking for limits.h... yes checking ctype.h usability... yes checking ctype.h presence... yes checking for ctype.h... yes checking math.h usability... yes checking math.h presence... yes checking for math.h... yes checking float.h usability... yes checking float.h presence... yes checking for float.h... yes checking iconv.h usability... yes checking iconv.h presence... yes checking for iconv.h... yes checking signal.h usability... yes checking signal.h presence... yes checking for signal.h... yes checking for size_t... yes checking for M_PI in math.h... yes checking for working alloca.h... yes checking for alloca... yes checking for working memcmp... yes checking for working strtod... yes checking for mprotect... yes checking for malloc... yes checking for calloc... yes checking for realloc... yes checking for free... yes checking for getenv... yes checking for setenv... yes checking for putenv... yes checking for unsetenv... yes checking for qsort... yes checking for abs... yes checking for bcopy... yes checking for memset... yes checking for memcpy... yes checking for memmove... yes checking for wcslen... yes checking for wcslcpy... no checking for wcslcat... no checking for wcsdup... yes checking for wcsstr... yes checking for wcscmp... yes checking for wcsncmp... yes checking for strlen... yes checking for strlcpy... no checking for strlcat... no checking for _strrev... no checking for _strupr... no checking for _strlwr... no checking for strchr... yes checking for strrchr... yes checking for strstr... yes checking for strtok_r... yes checking for itoa... no checking for _ltoa... no checking for _uitoa... no checking for _ultoa... no checking for strtol... yes checking for strtoul... yes checking for _i64toa... no checking for _ui64toa... no checking for strtoll... yes checking for strtoull... yes checking for atoi... yes checking for atof... yes checking for strcmp... yes checking for strncmp... yes checking for _stricmp... no checking for strcasecmp... yes checking for _strnicmp... no checking for strncasecmp... yes checking for vsscanf... yes checking for vsnprintf... yes checking for fopen64... yes checking for fseeko... yes checking for fseeko64... yes checking for sigaction... yes checking for setjmp... yes checking for nanosleep... yes checking for sysconf... yes checking for sysctlbyname... no checking for getauxval... yes checking for poll... yes checking for _Exit... yes checking for pow in -lm... yes checking for acos... yes checking for acosf... yes checking for asin... yes checking for asinf... yes checking for atan... yes checking for atanf... yes checking for atan2... yes checking for atan2f... yes checking for ceil... yes checking for ceilf... yes checking for copysign... yes checking for copysignf... yes checking for cos... yes checking for cosf... yes checking for exp... yes checking for expf... yes checking for fabs... yes checking for fabsf... yes checking for floor... yes checking for floorf... yes checking for fmod... yes checking for fmodf... yes checking for log... yes checking for logf... yes checking for log10... yes checking for log10f... yes checking for pow... yes checking for powf... yes checking for scalbn... yes checking for scalbnf... yes checking for sin... yes checking for sinf... yes checking for sqrt... yes checking for sqrtf... yes checking for tan... yes checking for tanf... yes checking for iconv_open in -liconv... no checking for iconv... yes checking for struct sigaction.sa_sigaction... yes checking libunwind.h usability... yes checking libunwind.h presence... yes checking for libunwind.h... yes checking for GCC builtin atomic operations... yes checking for GCC -mmmx option... yes checking for GCC -m3dnow option... yes checking for GCC -msse option... yes checking for GCC -msse2 option... yes checking for GCC -msse3 option... yes checking immintrin.h usability... yes checking immintrin.h presence... yes checking for immintrin.h... yes checking for Altivec with GCC altivec.h and -maltivec option... no checking for Altivec with GCC -maltivec option... no checking for Altivec with GCC altivec.h and -faltivec option... no checking for Altivec with GCC -faltivec option... no checking for GCC -Wall option... yes checking for necessary GCC -Wno-multichar option... no checking for GCC -fno-strict-aliasing option... yes checking for GCC -fvisibility=hidden option... yes checking for GCC -Wdeclaration-after-statement option... yes checking for dlopen... yes checking for dlopen in -lc... no checking for dlopen in -ldl... yes checking for ARM SIMD... no checking for OSS audio support... yes checking for ALSA CFLAGS... checking for ALSA LDFLAGS... -lasound -lm -ldl -lpthread checking for libasound headers version >= 1.0.11... found. checking for snd_ctl_open in -lasound... yes -- dynamic libasound -> libasound.so.2 checking for PULSEAUDIO... yes -- dynamic libpulse-simple -> libpulse-simple.so.0 checking for JACK... yes -- dynamic libjack -> libjack.so.0 checking for artsc-config... no checking for esd-config... no checking for ESD - version >= 0.2.8... no *** The esd-config script installed by ESD could not be found *** If ESD was installed in PREFIX, make sure PREFIX/bin is in *** your path, or set the ESD_CONFIG environment variable to the *** full path to esd-config. checking audio/audiolib.h usability... no checking audio/audiolib.h presence... no checking for audio/audiolib.h... no checking for AuOpenServer in -laudio... no checking for NAS audio support... no checking sndio.h usability... yes checking sndio.h presence... yes checking for sndio.h... yes checking for sio_open in -lsndio... yes checking for sndio audio support... yes -- dynamic libsndio -> libsndio.so.7.0 checking samplerate.h usability... yes checking samplerate.h presence... yes checking for samplerate.h... yes -- dynamic libsamplerate -> libsamplerate.so.0 checking for RPI... no checking for Raspberry Pi... no checking for X... libraries , headers checking for gethostbyname... yes checking for connect... yes checking for remove... yes checking for shmat... yes checking for IceConnectionNumber in -lICE... yes checking for X11/extensions/Xext.h... yes -- dynamic libX11 -> libX11.so.6 -- dynamic libX11ext -> libXext.so.6 checking for const parameter to XextAddDisplay... yes checking for XGenericEvent... yes checking for XkbKeycodeToKeysym in -lX11... yes checking for X11/Xcursor/Xcursor.h... yes -- dynamic libXcursor -> libXcursor.so.1 checking for X11/extensions/Xdbe.h... yes checking for X11/extensions/Xinerama.h... yes -- dynamic libXinerama -> libXinerama.so.1 checking for X11/extensions/XInput2.h... yes -- dynamic libXi -> libXi.so.6 checking for xinput2 multitouch... yes -- dynamic libXrandr -> libXrandr.so.2 checking for X11/extensions/scrnsaver.h... yes -- dynamic libXss -> libXss.so.1 checking for X11/extensions/shape.h... yes checking for X11/extensions/xf86vmode.h... yes -- dynamic libXxf86vm -> libXxf86vm.so.1 checking for OpenGL (GLX) support... yes checking for EGL support... yes checking for OpenGL ES v1 headers... no checking for OpenGL ES v2 headers... yes checking for Wayland support... yes -- dynamic libwayland-client -> libwayland-client.so.0 -- dynamic libwayland-egl -> libwayland-egl.so.1 -- dynamic libwayland-cursor -> libwayland-cursor.so.0 -- dynamic libxkbcommon -> libxkbcommon.so.0 checking for Linux 2.4 unified input interface... yes checking libudev.h usability... yes checking libudev.h presence... yes checking for libudev.h... yes -- dynamic udev -> libudev.so.1 checking for DBUS... yes checking dbus/dbus.h usability... yes checking dbus/dbus.h presence... no configure: WARNING: dbus/dbus.h: accepted by the compiler, rejected by the preprocessor! configure: WARNING: dbus/dbus.h: proceeding with the compiler's result checking for dbus/dbus.h... yes checking for IBUS... yes checking ibus-1.0/ibus.h usability... yes checking ibus-1.0/ibus.h presence... no configure: WARNING: ibus-1.0/ibus.h: accepted by the compiler, rejected by the preprocessor! configure: WARNING: ibus-1.0/ibus.h: proceeding with the compiler's result checking for ibus-1.0/ibus.h... yes checking sys/inotify.h usability... yes checking sys/inotify.h presence... yes checking for sys/inotify.h... yes checking for FCITX... yes checking fcitx/frontend.h usability... yes checking fcitx/frontend.h presence... yes checking for fcitx/frontend.h... yes checking for Linux kd.h... yes checking for Touchscreen library support... yes checking for pthreads... yes checking for recursive mutexes... yes checking for pthread semaphores... yes checking for sem_timedwait... yes checking for pthread_np.h... no checking for pthread_setname_np... yes checking for pthread_set_name_np... no checking for clock_gettime in -lrt... yes checking linux/version.h usability... yes checking linux/version.h presence... yes checking for linux/version.h... yes checking for Vivante VDK API... no checking for Vivante FB API... no checking whether to install sdl2-config... yes checking for linker option --enable-new-dtags... yes configure: creating ./config.status config.status: creating Makefile config.status: creating sdl2-config config.status: creating sdl2-config.cmake config.status: creating sdl2-config-version.cmake config.status: creating SDL2.spec config.status: creating sdl2.pc config.status: creating include/SDL_config.h config.status: executing libtool commands config.status: executing sdl2_config commands config.status: executing summary commands SDL2 Configure Summary: Building Shared Libraries Building Static Libraries Enabled modules : atomic audio video render events joystick haptic sensor power filesystem threads timers file loadso cpuinfo assembly Assembly Math : mmx 3dnow sse sse2 sse3 Audio drivers : disk dummy oss alsa(dynamic) pulse(dynamic) jack(dynamic) sndio(dynamic) Video drivers : dummy x11(dynamic) opengl opengl_es2 vulkan wayland(dynamic) X11 libraries : xcursor xdbe xinerama xinput2 xinput2_multitouch xrandr xscrnsaver xshape xvidmode Input drivers : linuxev linuxkd ts Using libsamplerate : YES Using libudev : YES Using dbus : YES Using ime : YES Using ibus : YES Using fcitx : YES ```

So unfortunately, the error comes from the CMakeLists.txt file itself, we can't do anything about it here, it needs to be fixed upstream directly in the SDL2 repos.