Allow build without libmenu-cache.
authorJim Huang <jserv.tw@gmail.com>
Sun, 7 Dec 2008 03:55:07 +0000 (03:55 +0000)
committerJim Huang <jserv.tw@gmail.com>
Sun, 7 Dec 2008 03:55:07 +0000 (03:55 +0000)
configure.ac
src/Makefile.am
src/configurator.c
src/panel.c
src/plugin.c
src/plugins/Makefile.am

index 4ddef62..e5c23ef 100644 (file)
@@ -16,13 +16,26 @@ AC_PROG_INTLTOOL(, [no-xml])
 
 # Checks for libraries.
 pkg_modules="gtk+-2.0 >= 2.12.0 \
-             gthread-2.0 \
-             libmenu-cache"
+             gthread-2.0"
 #             libstartup-notification-1.0"
 PKG_CHECK_MODULES(PACKAGE, [$pkg_modules])
 AC_SUBST(PACKAGE_CFLAGS)
 AC_SUBST(PACKAGE_LIBS)
 
+pkg_modules="libmenu-cache"
+PKG_CHECK_MODULES(MENU_CACHE, [$pkg_modules],
+                 enable_menu_cache=yes, enable_menu_cache=no)
+if test x"$enable_menu_cache" = "xno"; then
+       AC_WARN([No libmenu-cache found.  All menu related routines are not built.])
+       AC_DEFINE(DISABLE_MENU, [1], [Disable menu related routines])
+fi
+AC_SUBST(MENU_CACHE_CFLAGS)
+AC_SUBST(MENU_CACHE_LIBS)
+AM_CONDITIONAL(ENABLE_MENU_CACHE, test x"$enable_menu_cache" = x"yes") 
+
+PACKAGE_CFLAGS="$PACKAGE_CFLAGS $MENU_CACHE_CFLAGS"
+PACKAGE_LIBS="$PACKAGE_LIBS $MENU_CACHE_LIBS"
+
 # Gtk Builder
 #AC_PATH_PROG([GTK_BUILDER_CONVERT],[gtk-builder-convert],[false])
 #if test "$GTK_BUILDER_CONVERT" = "false"; then
index d523e40..c4cff64 100644 (file)
@@ -11,7 +11,7 @@ INCLUDES = \
        -DPACKAGE_DATA_DIR=\""$(datadir)"\" \
        -DPACKAGE_BIN_DIR=\""$(bindir)"\" \
        -DPACKAGE_LOCALE_DIR=\""$(prefix)/$(DATADIRNAME)/locale"\" \
-       $(PACKAGE_CFLAGS) \
+       $(PACKAGE_CFLAGS)
        $(G_CAST_CHECKS)
 
 BUILTIN_PLUGINS = $(top_builddir)/src/plugins/libbuiltin_plugins.a
@@ -22,6 +22,10 @@ TRAY_SOURCES= \
        systray/fixedtip.c systray/fixedtip.h \
        systray/tray.c
 
+if ENABLE_MENU_CACHE
+MENU_SOURCES = gtk-run.c
+endif
+
 lxpanel_SOURCES = \
        glib-mem.h \
        misc.c misc.h \
@@ -33,7 +37,7 @@ lxpanel_SOURCES = \
        gtkbar.h gtkbar.c \
        panel.c panel.h \
        plugin.c plugin.h \
-       gtk-run.c
+       $(MENU_SOURCES)
 
 if BUILD_PLUGIN_LOADER
 DYNAMIC_FLAGS = -export-dynamic
index c09ea42..f31b02b 100644 (file)
@@ -48,7 +48,9 @@ static void logout(void);
 
 Command commands[] = {
     //{ "configure", N_("Preferences"), configure },
+#ifndef DISABLE_MENU
     { "run", N_("Run"), gtk_run },
+#endif
     { "restart", N_("Restart"), restart },
     { "logout", N_("Logout"), logout },
     { NULL, NULL },
index c96e347..eb97526 100644 (file)
@@ -164,6 +164,7 @@ static void process_client_msg ( XClientMessageEvent* ev )
     int cmd = ev->data.b[0];
     switch( cmd )
     {
+#ifndef DISABLE_MENU
         case LXPANEL_CMD_SYS_MENU:
         {
             GSList* l;
@@ -181,9 +182,12 @@ static void process_client_msg ( XClientMessageEvent* ev )
             }
             break;
         }
+#endif
+#ifndef DISABLE_MENU
         case LXPANEL_CMD_RUN:
             gtk_run();
             break;
+#endif
         case LXPANEL_CMD_CONFIG:
             //FIXME: configure();
             break;
index aab8edf..ea8878c 100644 (file)
@@ -134,9 +134,11 @@ init_plugin_class_list()
     REGISTER_PLUGIN_CLASS(tray_plugin_class, 0);
 #endif
 
+#ifndef DISABLE_MENU
 #ifdef STATIC_MENU
     REGISTER_PLUGIN_CLASS(menu_plugin_class, 0);
 #endif
+#endif
 
 #ifdef STATIC_SPACE
     REGISTER_PLUGIN_CLASS(space_plugin_class, 0);
index 216db09..34d54f4 100644 (file)
@@ -20,11 +20,16 @@ INCLUDES = \
        $(PACKAGE_CFLAGS) \
        $(G_CAST_CHECKS)
 
-PLUGINS_SOURCES= \
+if ENABLE_MENU_CACHE
+MENU_SOURCES = \
+       menu.c
+endif
+
+PLUGINS_SOURCES = \
        launchbar.c \
        taskbar.c \
        dclock.c \
-       menu.c \
+       $(MENU_SOURCES) \
        separator.c \
        pager.c \
        space.c \