diff -Naurw connman-1.31.orig/configure.ac connman-1.31/configure.ac --- connman-1.31.orig/configure.ac 2015-12-27 19:05:49.000000000 -0800 +++ connman-1.31/configure.ac 2016-02-01 11:22:09.576978370 -0800 @@ -175,6 +175,8 @@ AM_CONDITIONAL(PPTP, test "${enable_pptp}" != "no") AM_CONDITIONAL(PPTP_BUILTIN, test "${enable_pptp}" = "builtin") +AC_CHECK_MEMBERS([struct in6_pktinfo.ipi6_addr], [], [], [[#include ]]) +AC_CHECK_HEADERS(execinfo.h) AC_CHECK_HEADERS(resolv.h, dummy=yes, AC_MSG_ERROR(resolver header files are required)) AC_CHECK_LIB(resolv, ns_initparse, dummy=yes, [ diff -Naurw connman-1.31.orig/gdhcp/common.c connman-1.31/gdhcp/common.c --- connman-1.31.orig/gdhcp/common.c 2015-04-19 15:16:21.000000000 -0700 +++ connman-1.31/gdhcp/common.c 2016-02-01 11:22:46.169977330 -0800 @@ -22,6 +22,7 @@ #include #endif +#define _GNU_SOURCE #include #include #include @@ -31,7 +32,6 @@ #include #include #include -#include #include #include #include @@ -40,6 +40,8 @@ #include "gdhcp.h" #include "common.h" +#include + static const DHCPOption client_options[] = { { OPTION_IP, 0x01 }, /* subnet-mask */ { OPTION_IP | OPTION_LIST, 0x03 }, /* routers */ diff -Naurw connman-1.31.orig/gdhcp/common.h connman-1.31/gdhcp/common.h --- connman-1.31.orig/gdhcp/common.h 2015-04-19 15:16:21.000000000 -0700 +++ connman-1.31/gdhcp/common.h 2016-02-01 11:29:53.731965170 -0800 @@ -18,6 +18,9 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA * */ +#ifdef HAVE_CONFIG_H +#include +#endif #include #include @@ -170,8 +173,8 @@ [OPTION_U32] = 4, }; -/* already defined within netinet/in.h if using GNU compiler */ -#ifndef __USE_GNU +/* already defined within netinet/in.h if using GNU compiler or musl libc */ +#ifndef HAVE_STRUCT_IN6_PKTINFO_IPI6_ADDR struct in6_pktinfo { struct in6_addr ipi6_addr; /* src/dst IPv6 address */ unsigned int ipi6_ifindex; /* send/recv interface index */ diff -Naurw connman-1.31.orig/gweb/gresolv.c connman-1.31/gweb/gresolv.c --- connman-1.31.orig/gweb/gresolv.c 2014-04-04 05:12:07.000000000 -0700 +++ connman-1.31/gweb/gresolv.c 2016-02-01 11:27:46.207968797 -0800 @@ -24,6 +24,7 @@ #endif #include +#include #include #include #include diff -Naurw connman-1.31.orig/plugins/wifi.c connman-1.31/plugins/wifi.c --- connman-1.31.orig/plugins/wifi.c 2015-12-27 19:05:49.000000000 -0800 +++ connman-1.31/plugins/wifi.c 2016-02-01 11:25:59.192971840 -0800 @@ -30,9 +30,8 @@ #include #include #include -#include -#include #include +#include #ifndef IFF_LOWER_UP #define IFF_LOWER_UP 0x10000 diff -Naurw connman-1.31.orig/src/tethering.c connman-1.31/src/tethering.c --- connman-1.31.orig/src/tethering.c 2015-12-27 19:05:49.000000000 -0800 +++ connman-1.31/src/tethering.c 2016-02-01 11:26:50.049970394 -0800 @@ -31,10 +31,8 @@ #include #include #include -#include #include #include -#include #include #include diff -Naurw connman-1.31.orig/tools/dhcp-test.c connman-1.31/tools/dhcp-test.c --- connman-1.31.orig/tools/dhcp-test.c 2013-08-19 09:57:25.000000000 -0700 +++ connman-1.31/tools/dhcp-test.c 2016-02-01 11:25:21.907972901 -0800 @@ -33,7 +33,6 @@ #include #include #include -#include #include diff -Naurw connman-1.31.orig/tools/dnsproxy-test.c connman-1.31/tools/dnsproxy-test.c --- connman-1.31.orig/tools/dnsproxy-test.c 2013-12-04 23:12:12.000000000 -0800 +++ connman-1.31/tools/dnsproxy-test.c 2016-02-01 11:27:04.525969982 -0800 @@ -24,6 +24,7 @@ #endif #include +#include #include #include #include