summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarcel Holtmann <marcel@holtmann.org>2009-07-03 15:05:20 -0700
committerMarcel Holtmann <marcel@holtmann.org>2009-07-03 15:05:20 -0700
commitf2419468e93e2dba548d02a511993a8443f9d1eb (patch)
tree067173226418aaa75e307485fd18a05ab34b6bae
parenta2f953500ea73dd3580e0865cdadd87e70cc561b (diff)
downloadconnman-f2419468e93e2dba548d02a511993a8443f9d1eb.tar.gz
connman-f2419468e93e2dba548d02a511993a8443f9d1eb.tar.bz2
connman-f2419468e93e2dba548d02a511993a8443f9d1eb.zip
Require udev and if not present use a compat layer
-rw-r--r--README8
-rwxr-xr-xbootstrap-configure1
-rw-r--r--configure.ac9
-rw-r--r--src/Makefile.am2
-rw-r--r--src/connman.h16
-rw-r--r--src/udev-compat.c40
6 files changed, 45 insertions, 31 deletions
diff --git a/README b/README
index 37130dd7..3b003e34 100644
--- a/README
+++ b/README
@@ -128,14 +128,6 @@ For a working system, certain configuration options need to be enabled:
are in place. It detects an already configured loopback
device and leaves it as it is.
- --enable-udev
-
- Enable device detection support via udev
-
- Network devices are by default detected via the builtin RTNL
- functionality. This allows to detect TTY based modem devices
- via udev.
-
--enable-polkit
Enable support for PolicyKit authorization
diff --git a/bootstrap-configure b/bootstrap-configure
index 236579d7..674f6e06 100755
--- a/bootstrap-configure
+++ b/bootstrap-configure
@@ -31,7 +31,6 @@ fi
--enable-hso=builtin \
--enable-mbm=builtin \
--enable-ppp \
- --enable-udev \
--enable-iwmx \
--enable-iospm \
--enable-polkit=builtin \
diff --git a/configure.ac b/configure.ac
index 7223efa7..7e37a961 100644
--- a/configure.ac
+++ b/configure.ac
@@ -195,16 +195,13 @@ AC_CHECK_LIB(c, inotify_init, dummy=yes,
AC_CHECK_LIB(dl, dlopen, dummy=yes,
AC_MSG_ERROR(dynamic linking loader is required))
-AC_ARG_ENABLE(udev, AC_HELP_STRING([--enable-udev],
- [enable udev support]), [enable_udev=${enableval}])
+PKG_CHECK_MODULES(UDEV, libudev >= 141,
+ [enable_udev="yes"], [enable_udev="no"])
if (test "${enable_udev}" = "yes"); then
- AC_DEFINE(HAVE_UDEV, 1, [Define if udev support is available])
- PKG_CHECK_MODULES(UDEV, libudev >= 141, dummy=yes,
- AC_MSG_ERROR(udev >= 141 is required))
AC_CHECK_LIB(udev, udev_monitor_filter_update, dummy=yes,
AC_DEFINE(NEED_UDEV_MONITOR_FILTER, 1,
[Define to 1 if you need the
- udev_monitor_filter...() functions.]))
+ udev_monitor_filter...() functions.]))
UDEV_DATADIR="`$PKG_CONFIG --variable=rulesdir libudev`"
if (test -z "${UDEV_DATADIR}"); then
UDEV_DATADIR="${sysconfdir}/udev/rules.d"
diff --git a/src/Makefile.am b/src/Makefile.am
index 8b733464..b146a4b9 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -15,6 +15,8 @@ connmand_SOURCES = main.c connman.h log.c selftest.c error.c plugin.c \
if UDEV
connmand_SOURCES += udev.c
+else
+connmand_SOURCES += udev-compat.c
endif
connmand_LDADD = $(top_builddir)/plugins/libbuiltin.la \
diff --git a/src/connman.h b/src/connman.h
index 22737693..24b64adb 100644
--- a/src/connman.h
+++ b/src/connman.h
@@ -186,25 +186,9 @@ void __connman_connection_cleanup(void);
void __connman_connection_update_gateway(void);
-#ifdef HAVE_UDEV
int __connman_udev_init(void);
void __connman_udev_cleanup(void);
char *__connman_udev_get_devtype(const char *ifname);
-#else
-static inline int __connman_udev_init(void)
-{
- return 0;
-}
-
-static inline void __connman_udev_cleanup(void)
-{
-}
-
-static inline char *__connman_udev_get_devtype(const char *ifname)
-{
- return NULL;
-}
-#endif
#include <connman/device.h>
diff --git a/src/udev-compat.c b/src/udev-compat.c
new file mode 100644
index 00000000..516a48db
--- /dev/null
+++ b/src/udev-compat.c
@@ -0,0 +1,40 @@
+/*
+ *
+ * Connection Manager
+ *
+ * Copyright (C) 2007-2009 Intel Corporation. All rights reserved.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+ *
+ */
+
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+#include "connman.h"
+
+char *__connman_udev_get_devtype(const char *ifname)
+{
+ return NULL;
+}
+
+int __connman_udev_init(void)
+{
+ return 0;
+}
+
+void __connman_udev_cleanup(void)
+{
+}