build: make WiMAX support optional

This commit is contained in:
Dan Williams 2011-01-05 18:23:08 -06:00
parent 6971dcd34e
commit 430151d6c2
8 changed files with 73 additions and 25 deletions

View file

@ -268,7 +268,16 @@ PKG_CHECK_MODULES(UUID, uuid)
AC_SUBST(UUID_CFLAGS)
AC_SUBST(UUID_LIBS)
PKG_CHECK_MODULES(WIMAX, libiWmxSdk-0)
AC_ARG_ENABLE(wimax, AC_HELP_STRING([--enable-wimax], [enable WiMAX support]),
[enable_wimax=${enableval}], [enable_wimax=yes])
if (test "${enable_wimax}" = "yes"); then
PKG_CHECK_MODULES(IWMX_SDK, libiWmxSdk-0, dummy=yes,
AC_MSG_ERROR(Intel WiMAX SDK is required))
AC_SUBST(IWMX_SDK_CFLAGS)
AC_SUBST(IWMX_SDK_LIBS)
AC_DEFINE(WITH_WIMAX, 1, [Define if you have WiMAX support])
fi
AM_CONDITIONAL(WITH_WIMAX, test "${enable_wimax}" = "yes")
PKG_CHECK_MODULES(POLKIT, polkit-gobject-1)
AC_SUBST(POLKIT_CFLAGS)
@ -621,6 +630,12 @@ else
echo systemd support: no
fi
if test "${enable_wimax}" = "yes"; then
echo WiMAX support: yes
else
echo WiMAX support: no
fi
echo
echo Building documentation: ${with_docs}
echo Building tests: ${with_tests}

View file

@ -10,29 +10,36 @@ SUBDIRS= \
dnsmasq-manager \
modem-manager \
bluez-manager \
wimax \
system-settings \
. \
tests
system-settings
INCLUDES = -I${top_srcdir} \
-I${top_srcdir}/include \
-I${top_builddir}/marshallers \
if WITH_WIMAX
SUBDIRS += wimax
endif
SUBDIRS += . tests
INCLUDES = -I${top_srcdir} \
-I${top_srcdir}/include \
-I${top_builddir}/marshallers \
-I${top_srcdir}/src/logging \
-I${top_srcdir}/src/dns-manager \
-I${top_srcdir}/src/vpn-manager \
-I${top_srcdir}/src/dhcp-manager \
-I${top_srcdir}/src/ip6-manager \
-I${top_srcdir}/src/supplicant-manager \
-I${top_srcdir}/src/dnsmasq-manager \
-I${top_srcdir}/src/modem-manager \
-I${top_srcdir}/src/vpn-manager \
-I${top_srcdir}/src/dhcp-manager \
-I${top_srcdir}/src/ip6-manager \
-I${top_srcdir}/src/supplicant-manager \
-I${top_srcdir}/src/dnsmasq-manager \
-I${top_srcdir}/src/modem-manager \
-I$(top_srcdir)/src/bluez-manager \
-I$(top_srcdir)/src/wimax \
-I$(top_srcdir)/src/system-settings \
-I${top_srcdir}/libnm-util \
-I${top_srcdir}/libnm-glib \
-I${top_srcdir}/callouts
if WITH_WIMAX
INCLUDES += -I$(top_srcdir)/src/wimax
endif
INCLUDES += -I${top_srcdir}/libnm-glib
###########################################
# Test libraries
###########################################
@ -215,7 +222,6 @@ NetworkManager_CPPFLAGS = \
$(GUDEV_CFLAGS) \
$(LIBNL_CFLAGS) \
$(GMODULE_CFLAGS) \
$(WIMAX_CFLAGS) \
$(POLKIT_CFLAGS) \
-DG_DISABLE_DEPRECATED \
-DBINDIR=\"$(bindir)\" \
@ -240,7 +246,6 @@ NetworkManager_LDADD = \
./ppp-manager/libppp-manager.la \
./modem-manager/libmodem-manager.la \
./bluez-manager/libbluez-manager.la \
./wimax/libwimax.la \
./system-settings/libsystem-settings.la \
./backends/libnmbackend.la \
$(top_builddir)/libnm-util/libnm-util.la \
@ -253,6 +258,10 @@ NetworkManager_LDADD = \
$(LIBM) \
$(LIBDL)
if WITH_WIMAX
NetworkManager_LDADD += ./wimax/libwimax.la
endif
NetworkManager_LDFLAGS = -rdynamic
libexec_PROGRAMS = nm-crash-logger

View file

@ -16,7 +16,7 @@
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Copyright (C) 2007 - 2009 Novell, Inc.
* Copyright (C) 2007 - 2010 Red Hat, Inc.
* Copyright (C) 2007 - 2011 Red Hat, Inc.
*/
#include <config.h>
@ -38,7 +38,9 @@
#include "nm-device-ethernet.h"
#include "nm-device-wifi.h"
#include "nm-device-olpc-mesh.h"
#if WITH_WIMAX
#include "nm-device-wimax.h"
#endif
#include "nm-device-cdma.h"
#include "nm-device-gsm.h"
#include "nm-system.h"
@ -2117,10 +2119,12 @@ add_device (NMManager *self, NMDevice *device)
nm_device_interface_set_enabled (NM_DEVICE_INTERFACE (device),
priv->radio_states[RFKILL_TYPE_WWAN].enabled);
*/
#if WITH_WIMAX
} else if (NM_IS_DEVICE_WIMAX (device)) {
nm_manager_rfkill_update (self, RFKILL_TYPE_WIMAX);
enabled = radio_enabled_for_type (self, RFKILL_TYPE_WIMAX);
nm_device_interface_set_enabled (NM_DEVICE_INTERFACE (device), enabled);
#endif
}
type_desc = nm_device_get_type_desc (device);

View file

@ -36,7 +36,9 @@
#include "nm-device-wifi.h"
#include "nm-device-ethernet.h"
#include "nm-device-modem.h"
#if WITH_WIMAX
#include "nm-device-wimax.h"
#endif
#include "nm-dbus-manager.h"
#include "nm-setting-ip4-config.h"
#include "nm-setting-connection.h"
@ -933,11 +935,13 @@ wireless_networks_changed (NMDeviceWifi *device, NMAccessPoint *ap, gpointer use
schedule_activate_check ((NMPolicy *) user_data, NM_DEVICE (device), 0);
}
#if WITH_WIMAX
static void
nsps_changed (NMDeviceWimax *device, NMWimaxNsp *nsp, gpointer user_data)
{
schedule_activate_check ((NMPolicy *) user_data, NM_DEVICE (device), 0);
}
#endif
typedef struct {
gulong id;
@ -989,6 +993,7 @@ device_added (NMManager *manager, NMDevice *device, gpointer user_data)
G_CALLBACK (wireless_networks_changed),
policy);
policy->dev_signal_ids = add_device_signal_id (policy->dev_signal_ids, id, device);
#if WITH_WIMAX
} else if (NM_IS_DEVICE_WIMAX (device)) {
id = g_signal_connect (device, "nsp-added",
G_CALLBACK (nsps_changed),
@ -999,6 +1004,7 @@ device_added (NMManager *manager, NMDevice *device, gpointer user_data)
G_CALLBACK (nsps_changed),
policy);
policy->dev_signal_ids = add_device_signal_id (policy->dev_signal_ids, id, device);
#endif
}
}

View file

@ -15,9 +15,10 @@
* with this program; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Copyright (C) 2009 - 2010 Red Hat, Inc.
* Copyright (C) 2009 - 2011 Red Hat, Inc.
*/
#include <config.h>
#include <signal.h>
#include <string.h>
#include <stdlib.h>
@ -38,7 +39,9 @@
#include "nm-device-wifi.h"
#include "nm-device-olpc-mesh.h"
#include "nm-device-ethernet.h"
#if WITH_WIMAX
#include "nm-device-wimax.h"
#endif
typedef struct {
GUdevClient *client;
@ -397,9 +400,11 @@ device_creator (NMUdevManager *manager,
device = (GObject *) nm_device_olpc_mesh_new (path, ifname, driver);
else if (is_wireless (udev_device))
device = (GObject *) nm_device_wifi_new (path, ifname, driver);
else if (is_wimax (driver))
else if (is_wimax (driver)) {
#if WITH_WIMAX
device = (GObject *) nm_device_wimax_new (path, ifname, driver);
else
#endif
} else
device = (GObject *) nm_device_ethernet_new (path, ifname, driver);
out:

View file

@ -20,11 +20,11 @@ libwimax_la_SOURCES = \
libwimax_la_CPPFLAGS = \
$(DBUS_CFLAGS) \
$(WIMAX_CFLAGS)
$(IWMX_SDK_CFLAGS)
libwimax_la_LIBADD = \
$(DBUS_LIBS) \
$(WIMAX_LIBS) \
$(IWMX_SDK_LIBS) \
$(top_builddir)/marshallers/libmarshallers.la
nm-wimax-nsp-glue.h: $(top_srcdir)/introspection/nm-wimax-nsp.xml

View file

@ -23,7 +23,6 @@
#define NM_DEVICE_WIMAX_H
#include <net/ethernet.h>
#include <WiMaxType.h>
#include "nm-device.h"
#include "nm-wimax-nsp.h"

View file

@ -38,7 +38,9 @@
#include <nm-gsm-device.h>
#include <nm-cdma-device.h>
#include <nm-device-bt.h>
#if WITH_WIMAX
#include <nm-device-wimax.h>
#endif
#include <nm-utils.h>
#include <nm-setting-ip4-config.h>
#include <nm-setting-ip6-config.h>
@ -194,6 +196,7 @@ detail_access_point (gpointer data, gpointer user_data)
g_free (tmp);
}
#if WITH_WIMAX
static const char *
wimax_network_type_to_str (NMWimaxNspNetworkType type)
{
@ -233,6 +236,7 @@ detail_nsp (gpointer data, gpointer user_data)
g_free (label);
g_free (data_str);
}
#endif
static gchar *
ip4_address_as_string (guint32 ip)
@ -379,8 +383,10 @@ detail_device (gpointer data, gpointer user_data)
print_string ("Type", "Mobile Broadband (CDMA)");
else if (NM_IS_DEVICE_BT (device))
print_string ("Type", "Bluetooth");
#if WITH_WIMAX
else if (NM_IS_DEVICE_WIMAX (device))
print_string ("Type", "WiMAX");
#endif
print_string ("Driver", nm_device_get_driver (device) ? nm_device_get_driver (device) : "(unknown)");
@ -396,8 +402,10 @@ detail_device (gpointer data, gpointer user_data)
tmp = g_strdup (nm_device_ethernet_get_hw_address (NM_DEVICE_ETHERNET (device)));
else if (NM_IS_DEVICE_WIFI (device))
tmp = g_strdup (nm_device_wifi_get_hw_address (NM_DEVICE_WIFI (device)));
#if WITH_WIMAX
else if (NM_IS_DEVICE_WIMAX (device))
tmp = g_strdup (nm_device_wimax_get_hw_address (NM_DEVICE_WIMAX (device)));
#endif
if (tmp) {
print_string ("HW Address", tmp);
@ -463,6 +471,7 @@ detail_device (gpointer data, gpointer user_data)
print_string (" Carrier", "on");
else
print_string (" Carrier", "off");
#if WITH_WIMAX
} else if (NM_IS_DEVICE_WIMAX (device)) {
NMWimaxNsp *active_nsp = NULL;
const char *active_name = NULL;
@ -478,6 +487,7 @@ detail_device (gpointer data, gpointer user_data)
nsps = nm_device_wimax_get_nsps (NM_DEVICE_WIMAX (device));
if (nsps && nsps->len)
g_ptr_array_foreach ((GPtrArray *) nsps, detail_nsp, (gpointer) active_name);
#endif
}
/* IP Setup info */