File tree Expand file tree Collapse file tree 13 files changed +171
-1406
lines changed Expand file tree Collapse file tree 13 files changed +171
-1406
lines changed Original file line number Diff line number Diff line change @@ -145,6 +145,7 @@ if env["builtin_sdl"]:
145145 "thread/pthread/SDL_systls.c" ,
146146 "timer/unix/SDL_systimer.c" ,
147147 ]
148+ env_sdl .Prepend (CPPPATH = [thirdparty_dir + "core/linux" ])
148149
149150 elif env ["platform" ] == "macos" :
150151 env_sdl .Append (CPPDEFINES = ["SDL_PLATFORM_MACOS" ])
Original file line number Diff line number Diff line change 9292#define HAVE_UNSETENV 1
9393#endif
9494
95- // TODO: handle dynamic loading with SOWRAP_ENABLED
96-
97- // (even though DBus can also be loaded with SOWRAP_ENABLED, we load it
98- // statically regardless of SOWRAP_ENABLED, because otherwise SDL won't compile)
9995#ifdef DBUS_ENABLED
10096#define HAVE_DBUS_DBUS_H 1
97+ #define SDL_USE_LIBDBUS 1
98+ // SOWRAP_ENABLED is handled in thirdparty/sdl/core/linux/SDL_dbus.c
10199#endif
102100
103- #if defined( UDEV_ENABLED ) && !defined( SOWRAP_ENABLED )
101+ #ifdef UDEV_ENABLED
104102#define HAVE_LIBUDEV_H 1
103+ #define SDL_USE_LIBUDEV
104+ #ifdef SOWRAP_ENABLED
105+ #define SDL_UDEV_DYNAMIC "libudev.so.1"
106+ #endif
105107#endif
106108
107109#define SDL_LOADSO_DLOPEN 1
Original file line number Diff line number Diff line change @@ -31,10 +31,6 @@ if env["fontconfig"]:
3131 if env ["use_sowrap" ]:
3232 common_linuxbsd .append ("fontconfig-so_wrap.c" )
3333
34- if env ["udev" ]:
35- if env ["use_sowrap" ]:
36- common_linuxbsd .append ("libudev-so_wrap.c" )
37-
3834if env ["dbus" ]:
3935 if env ["use_sowrap" ]:
4036 common_linuxbsd .append ("dbus-so_wrap.c" )
Original file line number Diff line number Diff line change @@ -380,7 +380,6 @@ def configure(env: "SConsEnvironment"):
380380 env .Append (CPPDEFINES = ["XKB_ENABLED" ])
381381
382382 if platform .system () == "Linux" :
383- env .Append (CPPDEFINES = ["JOYDEV_ENABLED" ])
384383 if env ["udev" ]:
385384 if not env ["use_sowrap" ]:
386385 if os .system ("pkg-config --exists libudev" ) == 0 : # 0 means found
Load Diff This file was deleted.
Load Diff This file was deleted.
Original file line number Diff line number Diff line change @@ -971,6 +971,7 @@ Patches:
971971- ` 0002-msvc-constants-fpstrict.patch ` (GH-106218 )
972972- ` 0003-std-include.patch ` (GH-108144 )
973973- ` 0004-errno-include.patch ` (GH-108354 )
974+ - ` 0005-fix-libudev-dbus.patch ` (GH-108373 )
974975
975976The SDL source code folder includes ` hidapi ` library inside of folder ` thirdparty/sdl/hidapi/ ` .
976977Its version and license is described in this file under ` hidapi ` .
Original file line number Diff line number Diff line change @@ -97,15 +97,18 @@ static bool LoadDBUSSyms(void)
9797
9898static void UnloadDBUSLibrary (void )
9999{
100+ #ifdef SOWRAP_ENABLED // Godot build system constant
100101 if (dbus_handle ) {
101102 SDL_UnloadObject (dbus_handle );
102103 dbus_handle = NULL ;
103104 }
105+ #endif
104106}
105107
106108static bool LoadDBUSLibrary (void )
107109{
108110 bool result = true;
111+ #ifdef SOWRAP_ENABLED // Godot build system constant
109112 if (!dbus_handle ) {
110113 dbus_handle = SDL_LoadObject (dbus_library );
111114 if (!dbus_handle ) {
@@ -118,6 +121,9 @@ static bool LoadDBUSLibrary(void)
118121 }
119122 }
120123 }
124+ #else
125+ result = LoadDBUSSyms ();
126+ #endif
121127 return result ;
122128}
123129
Original file line number Diff line number Diff line change 3838
3939static const char * SDL_UDEV_LIBS [] = { "libudev.so.1" , "libudev.so.0" };
4040
41- static SDL_UDEV_PrivateData * _this = NULL ;
41+ SDL_UDEV_PrivateData * SDL_UDEV_PrivateData_this = NULL ;
42+ #define _this SDL_UDEV_PrivateData_this
4243
4344static bool SDL_UDEV_load_sym (const char * fn , void * * addr );
4445static bool SDL_UDEV_load_syms (void );
Original file line number Diff line number Diff line change 3030#define SDL_USE_LIBUDEV 1
3131#endif
3232
33- #include <libudev.h>
33+ //#include <libudev.h>
34+ #include "thirdparty/linuxbsd_headers/udev/libudev.h"
3435#include <sys/time.h>
3536#include <sys/types.h>
3637
You can’t perform that action at this time.
0 commit comments