Description
If I enable gtk3 but disable appindicator support, the build fails with
libtool: link: cc -I/usr/local/include/glib-2.0 -I/usr/local/lib/glib-2.0/include -I/usr/local/include -I/usr/local/include/gio-unix-2.0 -I/usr/local/include -I/usr/local/include/glib-2.0 -I/usr/local/lib/glib-2.0/include -I/usr/local/include -I/usr/local/include/glib-2.0 -I/usr/local/lib/glib-2.0/include -I/usr/local/include/gtk-3.0 -I/usr/local/include/pango-1.0 -I/usr/local/include -I/usr/local/include/cairo -I/usr/local/include/gdk-pixbuf-2.0 -I/usr/local/include/at-spi2-atk/2.0 -I/usr/local/include/at-spi-2.0 -I/usr/local/include/atk-1.0 -I/usr/local/libdata/pkgconfig/../../include/dbus-1.0 -I/usr/local/libdata/pkgconfig/../../lib/dbus-1.0/include -I/usr/local/include/libepoll-shim -I/usr/local/include/fribidi -D_THREAD_SAFE -I/usr/local/include/pixman-1 -I/usr/local/include/harfbuzz -I/usr/local/include/freetype2 -I/usr/local/include/libpng16 -I/usr/local/include/gio-unix-2.0 -I/usr/local/include/glib-2.0 -I/usr/local/lib/glib-2.0/include -DG_LOG_DOMAIN=\"IBUS\" -DBINDIR=\"/usr/local/bin\" -DPKGDATADIR=\"/usr/local/share/ibus\" -DIBUS_DISABLE_DEPRECATED -Wno-unused-variable -Wno-unused-but-set-variable -Wno-unused-function -I/usr/local/include -D_THREAD_SAFE -I/usr/local/include -I/usr/local/include/gdk-pixbuf-2.0 -I/usr/local/include/glib-2.0 -I/usr/local/lib/glib-2.0/include -O2 -pipe -fstack-protector-strong -isystem /usr/local/include -fno-strict-aliasing -fstack-protector-strong -o .libs/ibus-ui-gtk3 application.o bindingcommon.o candidatearea.o candidatepanel.o emojier.o handle.o iconwidget.o keybindingmanager.o panel.o pango.o property.o propertypanel.o separator.o switcher.o xkblayout.o gen-notification-item.xml.o gen-notification-watcher.xml.o -L/usr/local/lib -lgthread-2.0 -lgtk-3 -lgdk-3 -lz -lpangocairo-1.0 -lpango-1.0 -lharfbuzz -latk-1.0 -lcairo-gobject -lcairo ../../src/.libs/libibus-1.0.so -lXi -lnotify -lgdk_pixbuf-2.0 ../../client/wayland/.libs/libibuswaylandim.a -lwayland-client -lxkbcommon /usr/home/henryhu/proj/ports/textproc/ibus/work/ibus-1.5.32/src/.libs/libibus-1.0.so -lgio-2.0 -lgobject-2.0 -lglib-2.0 -lintl -lX11 -pthread -Wl,-rpath -Wl,/usr/local/lib
ld: error: undefined symbol: indicator_new
>>> referenced by panel.c
>>> panel.o:(panel_construct)
ld: error: undefined symbol: indicator_set_title
>>> referenced by panel.c
>>> panel.o:(panel_construct)
ld: error: undefined symbol: indicator_set_menu
>>> referenced by panel.c
>>> panel.o:(panel_construct)
>>> referenced by panel.c
>>> panel.o:(___lambda92__indicator_secondary_activate)
>>> referenced by panel.c
>>> panel.o:(___lambda114__gsource_func)
ld: error: undefined symbol: indicator_set_status
>>> referenced by panel.c
>>> panel.o:(panel_set_show_icon_on_systray)
>>> referenced by panel.c
>>> panel.o:(___lambda91__indicator_registered_status_notifier_item)
ld: error: undefined symbol: indicator_set_icon_full
>>> referenced by panel.c
>>> panel.o:(panel_real_state_changed)
>>> referenced by panel.c
>>> panel.o:(panel_real_state_changed)
ld: error: undefined symbol: indicator_set_cairo_image_surface_full
>>> referenced by panel.c
>>> panel.o:(panel_real_state_changed)
>>> referenced by panel.c
>>> panel.o:(___lambda113__gsource_func)
ld: error: undefined symbol: indicator_unregister_connection
>>> referenced by panel.c
>>> panel.o:(panel_finalize)
cc: error: linker command failed with exit code 1 (use -v to see invocation)
The reason seems to be that the #if statement in panel.vala does not work as intended. Although I don't have indicator enabled, possibly because of the IconType enum above, the "#if INDICATOR" block is still enabled. If I change it to "#if XINDICATOR" etc., it builds successfully.
I think we need a different macro name for this. I can provide a patch.