ANNOUNCEMENT: Live Wireshark University & Allegro Packets online APAC Wireshark Training Session
April 17th, 2024 | 14:30-16:00 SGT (UTC+8) | Online

Wireshark-dev: Re: [Wireshark-dev] --without-gtk3 doesn't imply --with-qt

From: Jeff Morriss <jeff.morriss.ws@xxxxxxxxx>
Date: Wed, 26 Nov 2014 09:49:57 -0500
On 11/25/14 22:46, Guy Harris wrote:

On Nov 25, 2014, at 7:09 PM, Jeff Morriss <jeff.morriss.ws@xxxxxxxxx> wrote:

On 11/25/2014 06:09 PM, Stephen Fisher wrote:
I decided to stop building my local Wireshark with GTK3 support by
adding --without-gtk3 (or --with-gtk3=no) assuming that this would still
imply that I wanted it built with qt (--with-qt or --with-qt=yes), since
they both default to yes, but the current logic in configure.ac doesn't
account for disabling just one and I get this error:

configure: error: Neither Qt nor GTK+ 2.12.0 or later are available, so
Wireshark can't be compiled

Does anyone see a problem with me changing configure.ac to default to
--with-qt when --with-gtk3=no?

Well the default in master should be Qt=yes, Gtk3=yes.

Currently, it isn't - it's Qt=no, Gtk=GTK3.

Hmm, if I just do ./configure I get both the Qt and Gtk3 UIs. This comment seems to confirm that intent:

                #
                # No GUI toolkit was explicitly specified; pick Qt and GTK+ 3.
                #
                with_qt=yes
                with_gtk3=yes


If you use --without-gtk3 (without other options) does that mean:

1) use gtk2 instead of gtk3 (failing if gtk2 is not found)
2) (or) try to use gtk2 if it's there
3) (or) don't use gtk at all?

I'd vote for 3) - meaning, with the change I asked about, Qt=yes, Gtk=no.

Sure.

What about if you give --without-gtk2 (without other options)?

I'd vote for "OK, you said don't use GTK+ 2, so I'll happily use GTK+ 3" - meaning, with the change I asked about, Qt=yes, Gtk=GTK3.

In that case "--without-gtk2" (by itself) is, in fact, meaningless since Qt=yes, Gtk3=yes is the default behavior. That may be OK but I figured I'd point it out.

The rules that make sense to me are:

No --with{out}-gtk{n} options, or just --with-gtk3: Gtk=GTK3

Just --with-gtk2: Gtk=GTK2

--with-gtk2 plus --with-gtk3: configure: error: Both GTK+ 2 and GTK+ 3 were specified; choose one but not both (which is what we fail with now)

--without-gtk3 or --without-gtk2 or both: Gtk=no

Do this or do the above where --without-gtk2 implies gtk3=yes?

--without-gtk2 and --with-gtk3: Gtk=GTK3

--without-gtk3 and --with-gtk2: Gtk=GTK2

--without-gtk3 and --with-gtk3, or --without-gtk2 and --with-gtk2: live with what autoconf does, which is "believe the last --with{out}-gtk2 or --with{out}-gtk3 argument you were passed"

And none of those options would affect the Qt build - that's controlled solely by --with{out}-qt.