Add skeleton for udev support
authorMarcel Holtmann <marcel@holtmann.org>
Mon, 24 Nov 2008 16:11:29 +0000 (17:11 +0100)
committerMarcel Holtmann <marcel@holtmann.org>
Mon, 24 Nov 2008 16:11:29 +0000 (17:11 +0100)
src/Makefile.am
src/udev.c [new file with mode: 0644]

index f49e18e..c3a811c 100644 (file)
@@ -15,7 +15,11 @@ connmand_SOURCES = main.c connman.h log.c error.c plugin.c profile.c \
                        element.c device.c network.c security.c resolver.c \
                                storage.c manager.c agent.c rtnl.c dbus.c
 
-connmand_LDADD = @GDBUS_LIBS@ @GLIB_LIBS@ -ldl
+if UDEV
+connmand_SOURCES += udev.c
+endif
+
+connmand_LDADD = @GDBUS_LIBS@ @GLIB_LIBS@ @UDEV_LIBS@ -ldl
 
 connmand_LDFLAGS = -Wl,--export-dynamic -Wl,--version-script=connman.ver
 
@@ -33,10 +37,10 @@ else
 plugindir = $(libdir)/connman/plugins
 endif
 
-AM_CFLAGS = @GLIB_CFLAGS@ @GDBUS_CFLAGS@ \
-                       -DSTATEDIR=\""$(statedir)"\" \
-                       -DSTORAGEDIR=\""$(storagedir)\"" \
-                       -DPLUGINDIR=\""$(plugindir)"\"
+AM_CFLAGS = @UDEV_CFLAGS@ @GLIB_CFLAGS@ @GDBUS_CFLAGS@ \
+                               -DSTATEDIR=\""$(statedir)"\" \
+                                       -DSTORAGEDIR=\""$(storagedir)\"" \
+                                               -DPLUGINDIR=\""$(plugindir)"\"
 
 INCLUDES = -I$(top_builddir)/include
 
diff --git a/src/udev.c b/src/udev.c
new file mode 100644 (file)
index 0000000..0eba639
--- /dev/null
@@ -0,0 +1,29 @@
+/*
+ *
+ *  Connection Manager
+ *
+ *  Copyright (C) 2007-2008  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
+
+#define LIBUDEV_I_KNOW_THE_API_IS_SUBJECT_TO_CHANGE
+#include <libudev.h>
+
+#include "connman.h"