diff --git a/backends/platform/sdl/win32/win32.cpp b/backends/platform/sdl/win32/win32.cpp index bb254786d52..0a6702b6d94 100644 --- a/backends/platform/sdl/win32/win32.cpp +++ b/backends/platform/sdl/win32/win32.cpp @@ -85,9 +85,11 @@ void OSystem_Win32::init() { // Initialize File System Factory _fsFactory = new WindowsFilesystemFactory(); - // Initialize task bar manager +#if defined(USE_TASKBAR) + // Initialize taskbar manager _taskbarManager = new Win32TaskbarManager(); ((Win32TaskbarManager *)_taskbarManager)->init(); +#endif // Invoke parent implementation of this method OSystem_SDL::init(); diff --git a/backends/taskbar/unity/unity-taskbar.cpp b/backends/taskbar/unity/unity-taskbar.cpp index 98616a75878..4a074abca23 100644 --- a/backends/taskbar/unity/unity-taskbar.cpp +++ b/backends/taskbar/unity/unity-taskbar.cpp @@ -23,7 +23,7 @@ * */ -#if defined(UNIX) +#if defined(UNIX) && defined(USE_TASKBAR) #include "backends/taskbar/unity/unity-taskbar.h" diff --git a/backends/taskbar/unity/unity-taskbar.h b/backends/taskbar/unity/unity-taskbar.h index a49f369cac3..cd8efdaf2ac 100644 --- a/backends/taskbar/unity/unity-taskbar.h +++ b/backends/taskbar/unity/unity-taskbar.h @@ -26,7 +26,7 @@ #ifndef BACKEND_UNITY_TASKBAR_H #define BACKEND_UNITY_TASKBAR_H -#if defined(UNIX) +#if defined(UNIX) && defined(USE_TASKBAR) #include "common/str.h" #include "common/taskbar.h" diff --git a/backends/taskbar/win32/win32-taskbar.cpp b/backends/taskbar/win32/win32-taskbar.cpp index 768bf5b64ec..91c4e2399c2 100644 --- a/backends/taskbar/win32/win32-taskbar.cpp +++ b/backends/taskbar/win32/win32-taskbar.cpp @@ -23,7 +23,7 @@ * */ -#if defined(WIN32) +#if defined(WIN32) && defined(USE_TASKBAR) // Needed for taskbar functions #if defined(__GNUC__) diff --git a/backends/taskbar/win32/win32-taskbar.h b/backends/taskbar/win32/win32-taskbar.h index f9ce9c16fc6..7d963c19ca1 100644 --- a/backends/taskbar/win32/win32-taskbar.h +++ b/backends/taskbar/win32/win32-taskbar.h @@ -26,7 +26,7 @@ #ifndef BACKEND_WIN32_TASKBAR_H #define BACKEND_WIN32_TASKBAR_H -#if defined(WIN32) +#if defined(WIN32) && defined(USE_TASKBAR) #include "common/str.h" #include "common/taskbar.h" diff --git a/configure b/configure index cb06643b34d..fca8791b408 100755 --- a/configure +++ b/configure @@ -138,6 +138,7 @@ _fluidsynth=auto _opengl=auto _opengles=auto _readline=auto +_taskbar=auto # Default option behaviour yes/no _debug_build=auto _release_build=auto @@ -771,6 +772,9 @@ Optional Libraries: --with-readline-prefix=DIR Prefix where readline is installed (optional) --disable-readline disable readline support in text console [autodetect] + --with-unity-prefix=DIR Prefix where libunity is installed (optional) + --disable-unity disable unity[autodetect] + Some influential environment variables: LDFLAGS linker flags, e.g. -L if you have libraries in a nonstandard directory @@ -818,6 +822,8 @@ for ac_option in $@; do --disable-fluidsynth) _fluidsynth=no ;; --enable-readline) _readline=yes ;; --disable-readline) _readline=no ;; + --enable-taskbar) _taskbar=yes ;; + --disable-taskbar) _taskbar=no ;; --enable-opengl) _opengl=yes ;; --disable-opengl) _opengl=no ;; --enable-verbose-build) _verbose_build=yes ;; @@ -893,6 +899,11 @@ for ac_option in $@; do READLINE_CFLAGS="-I$arg/include" READLINE_LIBS="-L$arg/lib" ;; + --with-unity-prefix=*) + arg=`echo $ac_option | cut -d '=' -f 2` + UNITY_CFLAGS="-I$arg/include" + UNITY_LIBS="-L$arg/lib" + ;; --with-opengl-prefix=*) arg=`echo $ac_option | cut -d '=' -f 2` OPENGL_CFLAGS="-I$arg/include" @@ -2920,6 +2931,25 @@ define_in_config_h_if_yes "$_readline" 'USE_READLINE' define_in_config_h_if_yes "$_text_console" 'USE_TEXT_CONSOLE_FOR_DEBUGGER' +# +# Check for Unity if taskbar integration is enabled +# +echocheck "taskbar" +if test "$_taskbar" = auto ; then + _taskbar=no + cat > $TMPC << EOF +#include +int main(void) { return 0; } +EOF + cc_check $UNITY_CFLAGS $UNITY_LIBS -lunity && _taskbar=yes +fi +if test "$_taskbar" = yes ; then + LIBS="$LIBS $UNITY_LIBS -lunity" + INCLUDES="$INCLUDES $UNITY_CFLAGS" +fi +define_in_config_h_if_yes "$_taskbar" 'USE_TASKBAR' +echo "$_taskbar" + # # Check for OpenGL (ES) # diff --git a/devtools/create_project/create_project.cpp b/devtools/create_project/create_project.cpp index aafbe7585b0..35d08561bf8 100644 --- a/devtools/create_project/create_project.cpp +++ b/devtools/create_project/create_project.cpp @@ -779,6 +779,7 @@ const Feature s_features[] = { { "mt32emu", "USE_MT32EMU", "", true, "integrated MT-32 emulator" }, { "nasm", "USE_NASM", "", true, "IA-32 assembly support" }, // This feature is special in the regard, that it needs additional handling. { "opengl", "USE_OPENGL", "opengl32", true, "OpenGL support" }, + { "taskbar", "USE_TASKBAR", "", true, "Taskbar integration support" }, { "translation", "USE_TRANSLATION", "", true, "Translation support" }, { "vkeybd", "ENABLE_VKEYBD", "", false, "Virtual keyboard support"}, { "langdetect", "USE_DETECTLANG", "", true, "System language detection support" } // This feature actually depends on "translation", there