[gimp/gimp-2-10] app, configure: add a --enable-win32-debug-console build option.



commit 1a2887894371c0344094cba600f48f9cec3ab101
Author: Jehan <jehan girinstud io>
Date:   Fri Aug 10 19:46:16 2018 +0200

    app, configure: add a --enable-win32-debug-console build option.
    
    Debugging stable versions under Windows is a pain because we don't have
    access to the standard outputs. The debug console is indeed only built
    on unstable builds. Let's make the debug console a separate build option
    to allow building stable versions for debug (obviously the default
    behavior when not configuring, is same as before, i.e. stable without
    console and unstable with console).

 app/main.c   |  2 +-
 configure.ac | 26 ++++++++++++++++++++++++++
 2 files changed, 27 insertions(+), 1 deletion(-)
---
diff --git a/app/main.c b/app/main.c
index dc36dfd892..b4507c94ca 100644
--- a/app/main.c
+++ b/app/main.c
@@ -395,7 +395,7 @@ main (int    argc,
   }
 #endif
 
-#ifdef GIMP_UNSTABLE
+#ifdef ENABLE_WIN32_DEBUG_CONSOLE
   gimp_open_console_window ();
 #endif
 
diff --git a/configure.ac b/configure.ac
index 854e1df916..8801183486 100644
--- a/configure.ac
+++ b/configure.ac
@@ -908,6 +908,31 @@ PKG_CHECK_MODULES(HARFBUZZ, harfbuzz >= harfbuzz_required_version,,
 PKG_CHECK_MODULES(GEXIV2, gexiv2 >= gexiv2_required_version,,
                  [add_deps_error([gexiv2 >= gexiv2_required_version])])
 
+#################################
+# Check for debug console (Win32)
+#################################
+
+AC_ARG_ENABLE(win32-debug-console,
+              [  --enable-win32-debug-console
+                          open a console when starting the program
+                          (default=auto)],,
+              enable_win32_debug_console=auto)
+
+AC_MSG_CHECKING([if GIMP should open a debug console at start])
+if test "x$platform_win32" != "xyes"; then
+   enable_win32_debug_console=no
+elif test "x$enable_win32_debug_console" != xno &&
+     test "x$enable_win32_debug_console" != xyes; then
+  # By default, we enable the debug console only for unstable builds.
+   enable_win32_debug_console=gimp_unstable
+fi
+
+if test "x$enable_win32_debug_console" = "xyes"; then
+  AC_DEFINE(ENABLE_WIN32_DEBUG_CONSOLE, 1,
+            [Define to 1 if GIMP should open a debug console at start])
+fi
+AC_MSG_RESULT([$enable_win32_debug_console])
+
 #####################
 # Check for Dr. Mingw
 #####################
@@ -2876,6 +2901,7 @@ Optional Features:
   Dr. Mingw (Win32):       $enable_drmingw
   Relocatable bundle:      $enable_relocatable_bundle
   Default ICC directory:   $with_icc_directory
+  Debug console (Win32):   $enable_win32_debug_console
 
 Optional Plug-Ins:
   Ascii Art:               $have_libaa


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]