diff options
author | Ted Gould <ted@gould.cx> | 2010-12-03 21:24:47 -0600 |
---|---|---|
committer | Ted Gould <ted@gould.cx> | 2010-12-03 21:24:47 -0600 |
commit | fe4253d9430d99d87bde3e8afb3837be35009c82 (patch) | |
tree | 38e687a09cecf1bac01bf081951e3e9edede9f57 | |
parent | 6456a3f6beacbfbf4866ebfcc60bb95cb17fe71c (diff) | |
parent | 5ffa1850a8aefb9591309c6f884411543dd1fe04 (diff) | |
download | ayatana-indicator-application-fe4253d9430d99d87bde3e8afb3837be35009c82.tar.gz ayatana-indicator-application-fe4253d9430d99d87bde3e8afb3837be35009c82.tar.bz2 ayatana-indicator-application-fe4253d9430d99d87bde3e8afb3837be35009c82.zip |
Merging with trunk to get the GTK 3 build. Though, we don't really use it yet.
-rw-r--r-- | configure.ac | 39 | ||||
-rw-r--r-- | src/Makefile.am | 6 | ||||
-rw-r--r-- | src/appindicator3-0.1.pc.in | 14 | ||||
-rw-r--r-- | src/indicator-application.c | 7 |
4 files changed, 57 insertions, 9 deletions
diff --git a/configure.ac b/configure.ac index f7506d1..49fa8f7 100644 --- a/configure.ac +++ b/configure.ac @@ -29,20 +29,40 @@ PKG_PROG_PKG_CONFIG # Dependencies ########################### -GTK_REQUIRED_VERSION=2.12 +GTK_REQUIRED_VERSION=2.18 +GTK3_REQUIRED_VERSION=2.91 INDICATOR_REQUIRED_VERSION=0.3.5 DBUSMENUGTK_REQUIRED_VERSION=0.2.2 JSON_GLIB_REQUIRED_VERSION=0.7.6 DBUS_GLIB_REQUIRED_VERSION=0.82 -PKG_CHECK_MODULES(INDICATOR, gtk+-2.0 >= $GTK_REQUIRED_VERSION - indicator >= $INDICATOR_REQUIRED_VERSION - json-glib-1.0 >= $JSON_GLIB_REQUIRED_VERSION - dbus-glib-1 >= $DBUS_GLIB_REQUIRED_VERSION - dbusmenu-gtk >= $DBUSMENUGTK_REQUIRED_VERSION) - -AC_SUBST(INDICATOR_CFLAGS) -AC_SUBST(INDICATOR_LIBS) +AC_ARG_WITH([gtk], + [AS_HELP_STRING([--with-gtk], + [Which version of gtk to use @<:@default=2@:>@])], + [], + [with_gtk=2]) +AS_IF([test "x$with_gtk" = x3], + [PKG_CHECK_MODULES(INDICATOR, gtk+-3.0 >= $GTK3_REQUIRED_VERSION + indicator3 >= $INDICATOR_REQUIRED_VERSION + json-glib-1.0 >= $JSON_GLIB_REQUIRED_VERSION + dbus-glib-1 >= $DBUS_GLIB_REQUIRED_VERSION + dbusmenu-gtk3 >= $DBUSMENUGTK_REQUIRED_VERSION) + AC_SUBST(INDICATOR_CFLAGS) + AC_SUBST(INDICATOR_LIBS) + AC_DEFINE(HAVE_GTK3, 1, [whether gtk3 is available]) + ], + [test "x$with_gtk" = x2], + [PKG_CHECK_MODULES(INDICATOR, gtk+-2.0 >= $GTK_REQUIRED_VERSION + indicator >= $INDICATOR_REQUIRED_VERSION + json-glib-1.0 >= $JSON_GLIB_REQUIRED_VERSION + dbus-glib-1 >= $DBUS_GLIB_REQUIRED_VERSION + dbusmenu-gtk >= $DBUSMENUGTK_REQUIRED_VERSION) + AC_SUBST(INDICATOR_CFLAGS) + AC_SUBST(INDICATOR_LIBS) + ], + [AC_MSG_FAILURE([Value for --with-gtk was neither 2 nor 3])] +) +AM_CONDITIONAL(USE_GTK3, [test "x$with_gtk" = x3]) LIBAPPINDICATOR_REQUIRED_VERSION=0.2.9 @@ -109,4 +129,5 @@ Application Indicator Configuration: Prefix: $prefix Indicator Dir: $INDICATORDIR + GTK+ Version: $with_gtk ]) diff --git a/src/Makefile.am b/src/Makefile.am index e461599..3d1df8c 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -1,3 +1,9 @@ +if USE_GTK3 +VER=3 +else +VER= +endif + CLEANFILES = DISTCLEANFILES = BUILT_SOURCES = diff --git a/src/appindicator3-0.1.pc.in b/src/appindicator3-0.1.pc.in new file mode 100644 index 0000000..a485910 --- /dev/null +++ b/src/appindicator3-0.1.pc.in @@ -0,0 +1,14 @@ +prefix=@prefix@ +exec_prefix=@exec_prefix@ +libdir=@libdir@ +bindir=@bindir@ +includedir=@includedir@ + +Cflags: -I${includedir}/libappindicator3-0.1 +Requires: dbusmenu-glib gtk+-3.0 +Libs: -L${libdir} -lappindicator3 + +Name: appindicator3-0.1 +Description: Application indicators +Version: @VERSION@ + diff --git a/src/indicator-application.c b/src/indicator-application.c index 36e1446..ecf19e8 100644 --- a/src/indicator-application.c +++ b/src/indicator-application.c @@ -21,6 +21,9 @@ You should have received a copy of the GNU General Public License along with this program. If not, see <http://www.gnu.org/licenses/>. */ +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif /* G Stuff */ #include <glib.h> @@ -29,7 +32,11 @@ with this program. If not, see <http://www.gnu.org/licenses/>. /* DBus Stuff */ #include <dbus/dbus-glib.h> +#ifdef HAVE_GTK3 +#include <libdbusmenu-gtk3/menu.h> +#else #include <libdbusmenu-gtk/menu.h> +#endif /* Indicator Stuff */ #include <libindicator/indicator.h> |