diff --git a/config.m4 b/config.m4 index e781c23..65a792f 100644 --- a/config.m4 +++ b/config.m4 @@ -36,20 +36,24 @@ if test "$PHP_SDL" != "no"; then fi dnl }}} + AC_MSG_CHECKING(for SDL2 library) + if test "$PHP_SDL" == "yes"; then - AC_PATH_PROG(SDL2_CONFIG, sdl2-config, no) + PKG_CHECK_MODULES([SDL2], [sdl2 < 3.0]) + PHP_EVAL_INCLINE($SDL2_CFLAGS) + PHP_EVAL_LIBLINE($SDL2_LIBS, SDL_SHARED_LIBADD) + SDL2_VERSION=`$PKG_CONFIG --modversion sdl2` + AC_MSG_RESULT(using SDL2 version $SDL2_VERSION) else SDL2_CONFIG="$PHP_SDL" - fi - - AC_MSG_CHECKING(for SDL2 library) - if test -x "$SDL2_CONFIG" ; then - SDL2_VERSION=`$SDL2_CONFIG --version` - AC_MSG_RESULT(using SDL2 version $SDL2_VERSION) - PHP_EVAL_INCLINE(`$SDL2_CONFIG --cflags`) - PHP_EVAL_LIBLINE(`$SDL2_CONFIG --libs`, SDL_SHARED_LIBADD) - else - AC_MSG_ERROR(Cannot find sdl2-config) + if test -x "$SDL2_CONFIG" ; then + SDL2_VERSION=`$SDL2_CONFIG --version` + AC_MSG_RESULT(using SDL2 version $SDL2_VERSION) + PHP_EVAL_INCLINE(`$SDL2_CONFIG --cflags`) + PHP_EVAL_LIBLINE(`$SDL2_CONFIG --libs`, SDL_SHARED_LIBADD) + else + AC_MSG_ERROR(Cannot find sdl2-config) + fi fi PHP_SUBST(SDL_SHARED_LIBADD) @@ -70,7 +74,7 @@ if test "$PHP_SDL" != "no"; then src/messagebox.c \ src/mouse.c \ src/mutex.c \ - src/php_sdl.c \ + php_sdl.c \ src/pixels.c \ src/platform.c \ src/power.c \ diff --git a/package.xml b/package.xml index a3e3615..5d7b20e 100644 --- a/package.xml +++ b/package.xml @@ -39,9 +39,9 @@ + + - - @@ -245,7 +245,7 @@ PHP - Fix undefined symbol (sdl_window_to_zval) - - Tidy up GL context creation + - Tidy up GL context creation diff --git a/src/php_sdl.c b/php_sdl.c similarity index 97% rename from src/php_sdl.c rename to php_sdl.c index cadb867..36fa695 100644 --- a/src/php_sdl.c +++ b/php_sdl.c @@ -17,30 +17,30 @@ #include "php_sdl.h" -#include "blendmode.h" -#include "cpuinfo.h" -#include "error.h" -#include "event.h" -#include "filesystem.h" -#include "glcontext.h" -#include "keyboard.h" -#include "messagebox.h" -#include "mouse.h" -#include "mutex.h" -#include "platform.h" -#include "power.h" -#include "pixels.h" -#include "rect.h" -#include "render.h" -#include "rwops.h" -#include "sdl.h" -#include "shape.h" -#include "surface.h" -#include "timer.h" -#include "version.h" -#include "video.h" -#include "window.h" -#include "joystick.h" +#include "src/blendmode.h" +#include "src/cpuinfo.h" +#include "src/error.h" +#include "src/event.h" +#include "src/filesystem.h" +#include "src/glcontext.h" +#include "src/keyboard.h" +#include "src/messagebox.h" +#include "src/mouse.h" +#include "src/mutex.h" +#include "src/platform.h" +#include "src/power.h" +#include "src/pixels.h" +#include "src/rect.h" +#include "src/render.h" +#include "src/rwops.h" +#include "src/sdl.h" +#include "src/shape.h" +#include "src/surface.h" +#include "src/timer.h" +#include "src/version.h" +#include "src/video.h" +#include "src/window.h" +#include "src/joystick.h" #ifdef COMPILE_DL_SDL ZEND_GET_MODULE(sdl) diff --git a/src/php_sdl.h b/php_sdl.h similarity index 100% rename from src/php_sdl.h rename to php_sdl.h