Skip to content

Phonet build work-arounds take two

Rémi Denis-Courmont ofono 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest0 of 3 patches 1 replyIn review

Patches in v1 No applies recorded yet

None of the 3 patches the cover letter announces are in this archive.

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [0/3] Phonet build work-arounds take two

A variant with less configure and config.h clutter.

 configure.ac           |    4 +++
 drivers/atmodem/at.h   |    4 ---
 drivers/isimodem/isi.h |    4 ---
 gisi/client.c          |   10 ++++----
 gisi/netlink.c         |    9 ++++---
 gisi/phonet.h          |   56
+++++++++++++++++++++++++++++++++++++++++++++++++
 gisi/socket.c          |   11 ++++-----
 7 files changed, 75 insertions(+), 23 deletions(-)
Signature · 1 line
Rémi Denis-Courmont

From 44ed0e385e79c1230ecc6a3d583e1095eee7f9a0 Mon Sep 17 00:00:00 2001
From: =?utf-8?q?R=C3=A9mi=20Denis-Courmont?= <[email protected]>
Date: Thu, 2 Jul 2009 13:43:34 +0300
Subject: [PATCH] Do not include <config.h> from headers

It should be included _first_ in all modules, and it is not proof against multiple inclusions.

---
 drivers/atmodem/at.h   |    4 ----
 drivers/isimodem/isi.h |    4 ----
 2 files changed, 0 insertions(+), 8 deletions(-)
drivers/atmodem/at.h +0 -4
index 0300282..3cc3cb1 100644
@@ -19,10 +19,6 @@
  *
  */
 
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
 struct at_data {
 	GAtChat *parser;
 	struct ofono_modem *modem;
drivers/isimodem/isi.h +0 -4
index b89a694..e808bfd 100644
@@ -21,10 +21,6 @@
  *
  */
 
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
 #define DECLARE_FAILURE(e) 			\
 	struct ofono_error e;			\
 	e.type = OFONO_ERROR_TYPE_FAILURE;	\
Signature · 1 line
1.6.0.4

From f840ea7a705e3c03cd774149ccf4f4bb35c8a3ea Mon Sep 17 00:00:00 2001
From: =?utf-8?q?R=C3=A9mi=20Denis-Courmont?= <[email protected]>
Date: Fri, 3 Jul 2009 18:19:15 +0300
Subject: [PATCH] Replacement header for Phonet definitions

---
 gisi/phonet.h |   56 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 1 files changed, 56 insertions(+), 0 deletions(-)
 create mode 100644 gisi/phonet.h
gisi/phonet.h new file +56 -0

56 lines not on this page · raw message

Signature · 1 line
1.6.0.4

From 7e50d7580cdcddf55864ebad91396bc21e41c59f Mon Sep 17 00:00:00 2001
From: =?utf-8?q?R=C3=A9mi=20Denis-Courmont?= <[email protected]>
Date: Thu, 2 Jul 2009 11:07:56 +0300
Subject: [PATCH] Check and use netphonet/phonet.h instead of linux/phonet.h

---
 configure.ac   |    4 ++++
 gisi/client.c  |   10 +++++-----
 gisi/netlink.c |    9 +++++----
 gisi/socket.c  |   11 +++++------
 4 files changed, 19 insertions(+), 15 deletions(-)
configure.ac +4 -0
index 9ba745f..71989e0 100644
@@ -80,6 +80,10 @@ AC_SUBST([GDBUS_LIBS], ['$(top_builddir)/gdbus/libgdbus.la $(DBUS_LIBS)'])
 AC_SUBST([GATCHAT_CFLAGS], ['-I$(top_srcdir)/gatchat'])
 AC_SUBST([GATCHAT_LIBS], ['$(top_builddir)/gatchat/libgatchat.la'])
 
+AC_CHECK_HEADERS([netphonet/phonet.h], [], [],
+[#include <sys/types.h>
+#include <sys/socket.h>
+])
 AC_SUBST([GISI_CFLAGS], ['-I$(top_srcdir)'])
 AC_SUBST([GISI_LIBS], ['$(top_builddir)/gisi/libgisi.la'])
 
gisi/client.c +5 -5
index ae8b030..fd6dc87 100644
@@ -33,12 +33,12 @@
 #include <sys/socket.h>
 #include <sys/uio.h>
 #include <errno.h>
-#include <glib.h>
-#include <linux/types.h>
-#include <linux/phonet.h>
-#ifndef AF_PHONET
-#define AF_PHONET 35
+#ifdef HAVE_NETPHONET_PHONET_H
+#include <netphonet/phonet.h>
+#else
+#include "phonet.h"
 #endif
+#include <glib.h>
 
 #include "socket.h"
 #include "client.h"
gisi/netlink.c +5 -4
index d555588..b34e8b4 100644
@@ -33,14 +33,15 @@
 #include <unistd.h>
 #include <fcntl.h>
 #include <sys/socket.h>
+#ifdef HAVE_NETPHONET_PHONET_H
+#include <netphonet/phonet.h>
+#else
+#include "phonet.h"
+#endif
 #ifndef SOL_NETLINK
 #define SOL_NETLINK 270 /* libc!? */
 #endif
-#ifndef AF_PHONET
-#define AF_PHONET 35
-#endif
 #include <linux/rtnetlink.h>
-#include <linux/phonet.h>
 #include <glib.h>
 
 #include "netlink.h"
gisi/socket.c +5 -6
index 6f72120..2b0493c 100644
@@ -31,14 +31,13 @@
 #include <sys/ioctl.h>
 #include <unistd.h>
 #include <fcntl.h>
-#include <linux/types.h>
-#include <linux/phonet.h>
+#ifdef HAVE_NETPHONET_PHONET_H
+#include <netphonet/phonet.h>
+#else
+#include "phonet.h"
+#endif
 #include <glib.h>
 
-#ifndef AF_PHONET
-#define AF_PHONET 35
-#define PF_PHONET AF_PHONET
-#endif
 #include "socket.h"
 
 GIOChannel *phonet_new(uint8_t resource)
Signature · 1 line
1.6.0.4