RE: Trouble compiling dhcpcd wiht glibc 2.3.5 and gcc 3.4.4
Saima
Thu Apr 24 00:26:42 2014
This is the patch I used, is it ok to set the constant values to 0:
iff -Nur dhcpcd-6.3.2-orig/auth.c dhcpcd-6.3.2/auth.c
--- dhcpcd-6.3.2-orig/auth.c 2014-04-23 12:04:04.000000000 -0700
+++ dhcpcd-6.3.2/auth.c 2014-04-23 13:19:33.000000000 -0700
@@ -26,7 +26,6 @@
*/
#include <sys/file.h>
-#include <sys/queue.h>
#include <errno.h>
#include <fcntl.h>
#include <inttypes.h>
diff -Nur dhcpcd-6.3.2-orig/dhcp6.c dhcpcd-6.3.2/dhcp6.c
--- dhcpcd-6.3.2-orig/dhcp6.c 2014-04-23 12:04:04.000000000 -0700
+++ dhcpcd-6.3.2/dhcp6.c 2014-04-23 13:18:53.000000000 -0700
@@ -36,6 +36,10 @@
# include <linux/ipv6.h>
#endif
+#ifndef IPV6_RECVPKTINFO
+#define IPV6_RECVPKTINFO 0
+#endif
+
#include <ctype.h>
#include <errno.h>
#include <fcntl.h>
diff -Nur dhcpcd-6.3.2-orig/eloop.c dhcpcd-6.3.2/eloop.c
--- dhcpcd-6.3.2-orig/eloop.c 2014-04-23 12:04:04.000000000 -0700
+++ dhcpcd-6.3.2/eloop.c 2014-04-23 12:11:05.000000000 -0700
@@ -28,7 +28,6 @@
/* Needed for ppoll(2) */
#define _GNU_SOURCE
-#include <sys/queue.h>
#include <sys/time.h>
#include <errno.h>
diff -Nur dhcpcd-6.3.2-orig/if-linux.c dhcpcd-6.3.2/if-linux.c
--- dhcpcd-6.3.2-orig/if-linux.c 2014-04-23 12:04:04.000000000 -0700
+++ dhcpcd-6.3.2/if-linux.c 2014-04-23 12:52:47.000000000 -0700
@@ -47,6 +47,14 @@
#define IFF_LOWER_UP 0x10000 /* driver signals L1 up */
#endif
+#ifndef SOCK_CLOEXEC
+#define SOCK_CLOEXEC 0
+#endif
+
+#ifndef SOCK_NONBLOCK
+#define SOCK_NONBLOCK 0
+#endif
+
#include <errno.h>
#include <ctype.h>
#include <stddef.h>
diff -Nur dhcpcd-6.3.2-orig/if-options.c dhcpcd-6.3.2/if-options.c
--- dhcpcd-6.3.2-orig/if-options.c 2014-04-23 12:04:04.000000000 -0700
+++ dhcpcd-6.3.2/if-options.c 2014-04-23 13:20:19.000000000 -0700
@@ -29,7 +29,6 @@
#include <sys/param.h>
#include <sys/types.h>
-#include <sys/queue.h>
#include <arpa/inet.h>
diff -Nur dhcpcd-6.3.2-orig/ipv4.c dhcpcd-6.3.2/ipv4.c
--- dhcpcd-6.3.2-orig/ipv4.c 2014-04-23 12:04:04.000000000 -0700
+++ dhcpcd-6.3.2/ipv4.c 2014-04-23 12:53:52.000000000 -0700
@@ -25,7 +25,6 @@
* SUCH DAMAGE.
*/
-#include <sys/queue.h>
#include <sys/socket.h>
#include <sys/types.h>
diff -Nur dhcpcd-6.3.2-orig/ipv6.c dhcpcd-6.3.2/ipv6.c
--- dhcpcd-6.3.2-orig/ipv6.c 2014-04-23 12:04:04.000000000 -0700
+++ dhcpcd-6.3.2/ipv6.c 2014-04-23 12:57:33.000000000 -0700
@@ -47,6 +47,15 @@
# include <netinet6/in6_var.h>
#endif
+#ifndef IFA_F_OPTMISTIC
+#define IFA_F_OPTIMISTIC 0
+#endif
+
+#ifndef IFA_F_DADFAILED
+#define IFA_F_DADFAILED 0
+#endif
+
+
#include <errno.h>
#include <ifaddrs.h>
#include <inttypes.h>
diff -Nur dhcpcd-6.3.2-orig/ipv6nd.c dhcpcd-6.3.2/ipv6nd.c
--- dhcpcd-6.3.2-orig/ipv6nd.c 2014-04-23 12:04:04.000000000 -0700
+++ dhcpcd-6.3.2/ipv6nd.c 2014-04-23 13:09:10.000000000 -0700
@@ -38,6 +38,14 @@
# include <linux/ipv6.h>
#endif
+#ifndef IPV6_RECVPKTINFO
+#define IPV6_RECVPKTINFO 0
+#endif
+
+#ifndef IPV6_RECVHOPLIMIT
+#define IPV6_RECVHOPLIMIT 0
+#endif
+
#include <errno.h>
#include <fcntl.h>
#include <stddef.h>
diff -Nur dhcpcd-6.3.2-orig/lpf.c dhcpcd-6.3.2/lpf.c
--- dhcpcd-6.3.2-orig/lpf.c 2014-04-23 12:04:04.000000000 -0700
+++ dhcpcd-6.3.2/lpf.c 2014-04-23 12:51:06.000000000 -0700
@@ -64,6 +64,14 @@
@@ -64,6 +64,14 @@
0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff
};
+#ifndef SOCK_CLOEXEC
+#define SOCK_CLOEXEC 0
+#endif
+
+#ifndef SOCK_NONBLOCK
+#define SOCK_NONBLOCK 0
+#endif
+
#ifdef INET
int
ipv4_opensocket(struct interface *ifp, int protocol)
From: sa_farooqui@xxxxxxxxxxx
To: roy@xxxxxxxxxxxx; dhcpcd-discuss@xxxxxxxxxxxx
Subject: RE: [dhcpcd-discuss] Trouble compiling dhcpcd wiht glibc 2.3.5 and gcc 3.4.4
Date: Wed, 23 Apr 2014 16:45:52 -0700
thanks, this worked. I had to define some constants and after that the compilation succeeded.
Saima
> Date: Wed, 23 Apr 2014 10:37:32 +0100
> From: roy@xxxxxxxxxxxx
> To: dhcpcd-discuss@xxxxxxxxxxxx
> Subject: RE: [dhcpcd-discuss] Trouble compiling dhcpcd wiht glibc 2.3.5 and gcc 3.4.4
>
> On 22/04/2014 14:55, Saima wrote:
> > dhcpcd.c: In function `write_pid':
> > dhcpcd.c:109: warning: implicit declaration of function `dprintf'
> > dhcpcd.c: In function `find_interface':
> > dhcpcd.c:301: warning: implicit declaration of function
> > `TAILQ_FOREACH'
>
> So no TAILQ support at all.
> This patch should help:
> http://roy.marples.name/projects/dhcpcd/ci/f8b7a57af1?sbs=0
>
> I suspect linking will fail on dprintf, but there could be more errors.
> Can you try the latest fossil head?
> I've attached a patch which may compile to 6.3.2 if you can't use
> fossil.
>
> Roy
Archive administrator: postmaster@marples.name