X-Git-Url: https://git.sesse.net/?p=movit;a=blobdiff_plain;f=configure.ac;fp=configure.ac;h=79e99cadbaf0162dba9c83cf17968339ebed5261;hp=7b265b54b5b1be48edb001c43a35c8711275c692;hb=5ba8c08fc0ebf3afec0b2c094454dd702f1438a5;hpb=8ea03db1932e4a76f457e0ecdfe31a4c8be0e0eb diff --git a/configure.ac b/configure.ac index 7b265b5..79e99ca 100644 --- a/configure.ac +++ b/configure.ac @@ -9,15 +9,24 @@ AC_PROG_CXX PKG_CHECK_MODULES([Eigen3], [eigen3]) PKG_CHECK_MODULES([epoxy], [epoxy]) -# Needed for unit tests and the demo app. -PKG_CHECK_MODULES([SDL], [sdl]) +# Needed for unit tests and the demo app. We prefer SDL2 if possible, +# but can also use classic SDL. +with_SDL2=no +with_demo_app=yes +PKG_CHECK_MODULES([SDL2], [sdl2], [with_SDL2=yes], [ + PKG_CHECK_MODULES([SDL], [sdl]) +]) # These are only needed for the demo app. -with_demo_app=yes -PKG_CHECK_MODULES([SDL_image], [SDL_image], [], [with_demo_app=no; AC_MSG_WARN([SDL_image not found, demo program will not be built])]) +if test $with_SDL2 = "yes"; then + PKG_CHECK_MODULES([SDL2_image], [SDL2_image], [], [with_demo_app=no; AC_MSG_WARN([SDL2_image not found, demo program will not be built])]) +else + PKG_CHECK_MODULES([SDL_image], [SDL_image], [], [with_demo_app=no; AC_MSG_WARN([SDL_image not found, demo program will not be built])]) +fi PKG_CHECK_MODULES([libpng], [libpng12], [], [with_demo_app=no; AC_MSG_WARN([libpng12 not found, demo program will not be built])]) AC_SUBST([with_demo_app]) +AC_SUBST([with_SDL2]) AC_CONFIG_FILES([Makefile movit.pc]) AC_OUTPUT