Commit d383f731 authored by Julian Andres Klode's avatar Julian Andres Klode Committed by Vincent Untz

[build, main-menu] Allow building without NetworkManager and iwlib

If NetworkManager or iwlib is not available, allow gnome-main-menu to be
built without it by disabling the network-related functionality; making
it possible to build on non-Linux architectures.

Based on a patch by Petr Salinger <Petr.Salinger@seznam.cz>.

Bug-Debian: http://bugs.debian.org/542628
parent 4cb4e7f7
......@@ -43,30 +43,49 @@ COMMON_MODULES="glib-2.0 >= $GLIB_REQUIRED \
gdk-2.0 \
libslab >= $SLAB_REQUIRED"
PKG_CHECK_MODULES(APPLICATION_BROWSER, [ $COMMON_MODULES gnome-desktop-2.0 unique-1.0 ])
AC_SUBST(APPLICATION_BROWSER_CFLAGS)
AC_SUBST(APPLICATION_BROWSER_LIBS)
PKG_CHECK_MODULES(MAIN_MENU, [ $COMMON_MODULES libpanelapplet-2.0 gnome-desktop-2.0 gconf-2.0 libgtop-2.0 libgnome-2.0 libgnomeui-2.0 x11 cairo ])
AC_SUBST(MAIN_MENU_CFLAGS)
AC_SUBST(MAIN_MENU_LIBS)
# Check for network support
NM_GLIB=
PKG_CHECK_EXISTS(libnm-glib, [ NM_GLIB=libnm-glib ])
PKG_CHECK_EXISTS(libnm-glib, [ NM_GLIB=libnm-glib ],
PKG_CHECK_EXISTS(libnm_glib, [ NM_GLIB=libnm_glib ]))
if test "x$NM_GLIB" = "x"; then
PKG_CHECK_EXISTS(libnm_glib, [ NM_GLIB=libnm_glib ], [ AC_ERROR(cannot find NetworkManager Glib library) ])
# make sure we have something set for the call to PKG_CHECK_MODULES
NM_GLIB=libnm-glib
fi
PKG_CHECK_MODULES(MAIN_MENU, [ $COMMON_MODULES libpanelapplet-2.0 gnome-desktop-2.0 gconf-2.0 libgtop-2.0 libgnome-2.0 libgnomeui-2.0 NetworkManager $NM_GLIB >= 0.7.0 libnm-util >= 0.7.0 x11 cairo ])
PKG_CHECK_MODULES(NETWORKMANAGER, [NetworkManager $NM_GLIB >= 0.7.0 libnm-util >= 0.7.0], HAVE_NM=1, HAVE_NM=0)
if test "x$HAVE_NM" != "x1"; then
AC_WARN(NetworkManager is not available)
fi
AC_CHECK_HEADERS(iwlib.h, [ AC_CHECK_LIB(iw, iw_sockets_open, have_iwlib=yes, have_iwlib=no, -lm)], have_iwlib=no)
AC_CHECK_HEADERS(iwlib.h, [ AC_CHECK_LIB(iw, iw_sockets_open, HAVE_IWLIB=1, HAVE_IWLIB=0, -lm)], HAVE_IWLIB=0)
if test "x$HAVE_IWLIB" != "x1"; then
AC_WARN(iwlib is not available)
fi
if test "x$have_iwlib" != "xyes" ; then
AC_ERROR(cannot find iwlib)
HAVE_NETWORK=0
NETWORK_CFLAGS=
NETWORK_LIBS=
if test "x$HAVE_NM" != "x1" -o "x$HAVE_IWLIB" != "x1"; then
AC_WARN(network support disabled)
else
MAIN_MENU_LIBS="$MAIN_MENU_LIBS -liw -lm"
AC_SUBST(MAIN_MENU_LIBS)
HAVE_NETWORK=1
NETWORK_CFLAGS="$NETWORKMANAGER_CFLAGS"
NETWORK_LIBS="$NETWORKMANAGER_LIBS -liw -lm"
AC_DEFINE(HAVE_NETWORK, 1, [Use NetworkManager and wireless library])
fi
AC_SUBST(MAIN_MENU_CFLAGS)
AC_SUBST(MAIN_MENU_LIBS)
PKG_CHECK_MODULES(APPLICATION_BROWSER, [ $COMMON_MODULES gnome-desktop-2.0 unique-1.0 ])
AC_SUBST(APPLICATION_BROWSER_CFLAGS)
AC_SUBST(APPLICATION_BROWSER_LIBS)
AM_CONDITIONAL(HAVE_NETWORK, test "x$HAVE_NETWORK" = "x1")
AC_SUBST(NETWORK_CFLAGS)
AC_SUBST(NETWORK_LIBS)
dnl ==============================================
dnl Gconf
......
INCLUDES = \
$(MAIN_MENU_CFLAGS) \
$(NETWORK_CFLAGS) \
$(WARN_CFLAGS)
uidir = $(datadir)/$(PACKAGE)
......@@ -19,14 +20,19 @@ main_menu_SOURCES = \
main-menu-migration.c main-menu-migration.h \
tile-table.c tile-table.h \
hard-drive-status-tile.c hard-drive-status-tile.h \
network-status-tile.c network-status-tile.h \
network-status-agent.c network-status-agent.h \
network-status-info.c network-status-info.h \
tomboykeybinder.c tomboykeybinder.h \
eggaccelerators.c eggaccelerators.h
if HAVE_NETWORK
main_menu_SOURCES += \
network-status-tile.c network-status-tile.h \
network-status-agent.c network-status-agent.h \
network-status-info.c network-status-info.h
endif
main_menu_LDADD = \
$(MAIN_MENU_LIBS)
$(MAIN_MENU_LIBS) \
$(NETWORK_LIBS)
trigger_panel_run_dialog_SOURCES = \
trigger-panel-run-dialog.c
......
......@@ -37,7 +37,10 @@
#include <libslab/slab.h>
#include "hard-drive-status-tile.h"
#ifdef HAVE_NETWORK
#include "network-status-tile.h"
#endif
#include "tile-table.h"
......@@ -737,6 +740,7 @@ create_status_section (MainMenuUI *this)
gtk_container_add (ctnr, tile);
gtk_widget_show_all (GTK_WIDGET (ctnr));
#ifdef HAVE_NETWORK
ctnr = GTK_CONTAINER (gtk_builder_get_object (
priv->main_menu_ui, "network-status-container"));
priv->network_status = network_status_tile_new ();
......@@ -749,6 +753,7 @@ create_status_section (MainMenuUI *this)
gtk_container_add (ctnr, priv->network_status);
gtk_widget_show_all (GTK_WIDGET (ctnr));
#endif
priv->status_section = get_widget (priv, "slab-status-section");
......@@ -1855,7 +1860,9 @@ present_slab_window (MainMenuUI *this)
{
MainMenuUIPrivate *priv = PRIVATE (this);
#ifdef HAVE_NETWORK
network_tile_update_status (priv->network_status);
#endif
update_recently_used_sections (this);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment