From 63b8d47df583dfea3ee109e4840ee62cb8dfe3d2 Mon Sep 17 00:00:00 2001 From: trembyle Date: Wed, 30 Jun 2021 15:54:51 -0400 Subject: [PATCH] CONFIGURE: Enable building with Windows text console output Create a new flag --enable-windows-console to build with console output on MinGW. The default behavior will be to enable the console. The current plan is to continue to offer the users both options for release builds - ScummVM and ScummVM (noconsole). Whenever the text console is enabled, Windows console will be added by default. This is to prevent a situation where ScummVM will not load any visible debug console on hotkey or error. --- base/commandLine.cpp | 2 +- configure | 29 +++++++++++++++++++++++++++++ 2 files changed, 30 insertions(+), 1 deletion(-) diff --git a/base/commandLine.cpp b/base/commandLine.cpp index fb360116bb2..f84fa1265f2 100644 --- a/base/commandLine.cpp +++ b/base/commandLine.cpp @@ -71,7 +71,7 @@ static const char HELP_STRING[] = " -z, --list-games Display list of supported games and exit\n" " --list-all-games Display list of all detected games and exit\n" " -t, --list-targets Display list of configured targets and exit\n" - " --list-engines Display list of suppported engines and exit\n" + " --list-engines Display list of supported engines and exit\n" " --list-all-engines Display list of all detection engines and exit\n" " --list-debugflags=engine Display list of engine specified debugflags\n" " if engine=global or engine is not specified, then it will list global debugflags\n" diff --git a/configure b/configure index 803cf566928..ea13d51b249 100755 --- a/configure +++ b/configure @@ -221,6 +221,7 @@ _optimization_level= _default_optimization_level=-O2 _nuked_opl=yes _builtin_resources=yes +_windows_console=yes _windows_unicode=no # Default commands _ranlib=ranlib @@ -907,6 +908,8 @@ Optional Features: you are doing! --no-builtin-resources do not include additional resources (e.g. engine data, fonts) into the ScummVM binary + --enable-windows-console show console output on Windows (default) + --disable-windows-console do not show console output on Windows --enable-windows-unicode use Windows Unicode APIs --disable-windows-unicode use Windows ANSI APIs (default) @@ -1379,6 +1382,12 @@ for ac_option in $@; do --no-builtin-resources) _builtin_resources=no ;; + --enable-windows-console) + _windows_console=yes + ;; + --disable-windows-console) + _windows_console=no + ;; --enable-windows-unicode) _windows_unicode=yes ;; @@ -5960,6 +5969,21 @@ fi if test "$_text_console" = yes ; then echo_n ", text console" + if test "$_windows_console" = no ; then + case "$_host_os" in + mingw*) + _windows_console=yes + ;; + esac + fi +fi + +if test "$_windows_console" = yes ; then + case "$_host_os" in + mingw*) + echo_n ", Windows console" + ;; + esac fi if test "$_vkeybd" = yes ; then @@ -6037,6 +6061,11 @@ case $_host_os in if test "$_windows_unicode" = yes; then append_var DEFINES "-DUNICODE -D_UNICODE" fi + # SDL2 sets -mwindows flag by default in sdl2.pc + # We need to directly replace this in the SDL pkg-config + if test "$_windows_console" = yes; then + LIBS=`echo $LIBS | sed -e 's/-mconsole//g' -e 's/-mwindows//g'` + fi ;; riscos) append_var CXXFLAGS "-mno-poke-function-name"