]> asedeno.scripts.mit.edu Git - PuTTY.git/commitdiff
Include the compile-time GTK version in the build info.
authorSimon Tatham <anakin@pobox.com>
Wed, 15 Feb 2017 19:29:05 +0000 (19:29 +0000)
committerSimon Tatham <anakin@pobox.com>
Wed, 15 Feb 2017 19:32:42 +0000 (19:32 +0000)
It's obvious to the trained eye whether GTK PuTTY was compiled against
GTK2 or GTK3, but the untrained eye would probably appreciate a little
help, and even the trained eye probably can't tell GTK 3.18 from 3.19
at a glance :-)

Recipe
misc.c
unix/gtkmisc.c
unix/unix.h
unix/uxnogtk.c [new file with mode: 0644]

diff --git a/Recipe b/Recipe
index 9d011f5acaa1bc0ee74ee8f5cb193b49b61ca45d..21f7971ce5d791242cd0f7248c90c810e61b745d 100644 (file)
--- a/Recipe
+++ b/Recipe
@@ -319,17 +319,17 @@ puttytel : [X] GTKTERM uxmisc misc ldisc settings uxsel U_BE_NOSSH
         + nogss gtkmain
 
 plink    : [U] uxplink uxcons NONSSH UXSSH U_BE_ALL logging UXMISC uxsignal
-         + ux_x11 noterm
+         + ux_x11 noterm uxnogtk
 
 PUTTYGEN_UNIX = sshrsag sshdssg sshprime sshdes sshbn sshmd5 version
          + sshrand uxnoise sshsha misc sshrsa sshdss uxcons uxstore uxmisc
          + sshpubk sshaes sshsh256 sshsh512 IMPORT puttygen.res time tree234
-         + uxgen notiming conf sshecc sshecdsag
+         + uxgen notiming conf sshecc sshecdsag uxnogtk
 puttygen : [U] cmdgen PUTTYGEN_UNIX
 cgtest   : [UT] cgtest PUTTYGEN_UNIX
 
-pscp     : [U] pscp uxsftp uxcons UXSSH BE_SSH SFTP wildcard UXMISC
-psftp    : [U] psftp uxsftp uxcons UXSSH BE_SSH SFTP wildcard UXMISC
+pscp     : [U] pscp uxsftp uxcons UXSSH BE_SSH SFTP wildcard UXMISC uxnogtk
+psftp    : [U] psftp uxsftp uxcons UXSSH BE_SSH SFTP wildcard UXMISC uxnogtk
 
 pageant  : [X] uxpgnt uxagentc aqsync pageant sshrsa sshpubk sshdes sshbn
         + sshmd5 version tree234 misc sshaes sshsha sshdss sshsh256 sshsh512
@@ -345,8 +345,8 @@ puttyapp : [XT] GTKTERM uxmisc misc ldisc settings uxsel U_BE_ALL uxstore
 osxlaunch : [UT] osxlaunch
 
 fuzzterm : [UT] UXTERM CHARSET misc version uxmisc uxucs fuzzterm time settings
-        + uxstore be_none
-testbn   : [UT] testbn sshbn misc version conf tree234 uxmisc
+        + uxstore be_none uxnogtk
+testbn   : [UT] testbn sshbn misc version conf tree234 uxmisc uxnogtk
 testbn   : [C] testbn sshbn misc version conf tree234 winmisc LIBS
 
 # ----------------------------------------------------------------------
diff --git a/misc.c b/misc.c
index 391ea1ba06eb86b7ecefa6e5a598a4447635e600..6cc817103b5a105d625bd76f6846b6a8326a47d1 100644 (file)
--- a/misc.c
+++ b/misc.c
@@ -1183,6 +1183,17 @@ char *buildinfo(const char *newline)
     strbuf_catf(buf, " (_MSC_VER=%d)", (int)_MSC_VER);
 #endif
 
+#ifdef BUILDINFO_GTK
+    {
+        char *gtk_buildinfo = buildinfo_gtk_version();
+        if (gtk_buildinfo) {
+            strbuf_catf(buf, "%sCompiled against GTK version %s",
+                        newline, gtk_buildinfo);
+            sfree(gtk_buildinfo);
+        }
+    }
+#endif
+
 #ifdef NO_SECURITY
     strbuf_catf(buf, "%sBuild option: NO_SECURITY", newline);
 #endif
index 6ee68be2e87b6d861635b4b4938636a3af29f650..23f26d07facf607ccf85482454c7daf7ba266672 100644 (file)
@@ -200,3 +200,9 @@ void our_dialog_add_to_content_area(GtkWindow *dlg, GtkWidget *w,
          w, expand, fill, padding);
 #endif
 }
+
+char *buildinfo_gtk_version(void)
+{
+    return dupprintf("%d.%d.%d",
+                     GTK_MAJOR_VERSION, GTK_MINOR_VERSION, GTK_MICRO_VERSION);
+}
index cf297db3d90bbd8173d366f6513b0ba90bee4112..ea848d3744ace1499ffb514e61d19db00c2db658 100644 (file)
 #define DEFAULT_CLIPBOARD GDK_SELECTION_CLIPBOARD /* OS X has no PRIMARY */
 
 #define BUILDINFO_PLATFORM "OS X (GTK)"
+#define BUILDINFO_GTK
 
 #elif defined NOT_X_WINDOWS
 
 #define BUILDINFO_PLATFORM "Unix (pure GTK)"
+#define BUILDINFO_GTK
 
 #else
 
 #define BUILDINFO_PLATFORM "Unix (GTK + X11)"
+#define BUILDINFO_GTK
 
 #endif
 
+char *buildinfo_gtk_version(void);
+
 struct Filename {
     char *path;
 };
diff --git a/unix/uxnogtk.c b/unix/uxnogtk.c
new file mode 100644 (file)
index 0000000..c9028eb
--- /dev/null
@@ -0,0 +1,11 @@
+/*
+ * uxnogtk.c: link into non-GUI Unix programs so that they can tell
+ * buildinfo about a lack of GTK.
+ */
+
+#include "putty.h"
+
+char *buildinfo_gtk_version(void)
+{
+    return NULL;
+}