diff options
author | Ismael Luceno | 2019-08-28 19:44:45 +0200 |
---|---|---|
committer | Ismael Luceno | 2019-08-28 20:22:11 +0200 |
commit | 3ed9ed811fc75327f6dc8e583af4b2d7180f73cb (patch) | |
tree | 63914033d3a76b31c7628a3b4aa960d8606f0b71 /net | |
parent | c5d0c7af796cb37d9920bb49cdb74a32b7f51152 (diff) |
ppp: Fix build against musl
Diffstat (limited to 'net')
-rwxr-xr-x | net/ppp/BUILD | 3 | ||||
-rw-r--r-- | net/ppp/HISTORY | 2 | ||||
-rwxr-xr-x | net/ppp/PRE_BUILD | 10 | ||||
-rw-r--r-- | net/ppp/patches/portability.patch | 45 |
4 files changed, 58 insertions, 2 deletions
diff --git a/net/ppp/BUILD b/net/ppp/BUILD index c633711ea3..0a9e991ee9 100755 --- a/net/ppp/BUILD +++ b/net/ppp/BUILD @@ -3,4 +3,7 @@ create_group ppp && ./configure --prefix="$INSTALL_ROOT/usr" \ --sysconfdir="$INSTALL_ROOT/etc" && +case "$HOST" in +*-musl) CFLAGS+=' -D"__P(x)=x"' ;; +esac && make COPTS="$CFLAGS $LDFLAGS" diff --git a/net/ppp/HISTORY b/net/ppp/HISTORY index 597d874b44..0535d399b8 100644 --- a/net/ppp/HISTORY +++ b/net/ppp/HISTORY @@ -8,6 +8,7 @@ patches/openssl_DES.patch, patches/openssl_include.patch: Imported general patches from Void-Linux * PRE_BUILD: Fixed more header includes + * BUILD, PRE_BUILD, patches/portability.patch: Fixed build against musl 2017-01-13 David C. Haley <khoralin@gmail.com> * DETAILS: updated SOURCE_URL @@ -155,4 +156,3 @@ * DETAILS: added LICENSE thanks to Justin Smithies <justin@smithies.plus.com> for help /w bugfix #350 - diff --git a/net/ppp/PRE_BUILD b/net/ppp/PRE_BUILD index b6c92698d6..3ffd6ccfca 100755 --- a/net/ppp/PRE_BUILD +++ b/net/ppp/PRE_BUILD @@ -42,4 +42,12 @@ fi && if [ "$HAVE_CBCP" == "y" ]; then sedit 's:#CBCP=y:CBCP=y:' pppd/Makefile.linux -fi +fi && + +case "$HOST" in +*-musl) + sedit '/^CFLAGS[\t +=]*-DHAVE_LOGWTMP=1/d' pppd/Makefile.linux && + sedit '/^#define HAVE_\(NET_ETHERNET\|SYS_CDEFS\)_H 1/d' \ + pppd/plugins/rp-pppoe/config.h + ;; +esac diff --git a/net/ppp/patches/portability.patch b/net/ppp/patches/portability.patch new file mode 100644 index 0000000000..ad19c7de90 --- /dev/null +++ b/net/ppp/patches/portability.patch @@ -0,0 +1,45 @@ +From: Ismael Luceno <ismael@sourcemage.org> +Subject: [PATCH] Fix portability issues + +Enables building against musl libc. + +--- + include/net/ppp_defs.h | 2 ++ + pppd/plugins/rp-pppoe/plugin.c | 2 ++ + pppd/plugins/rp-pppoe/pppoe.h | 2 +- + 3 files changed, 5 insertions(+), 1 deletion(-) + +--- a/include/net/ppp_defs.h ++++ b/include/net/ppp_defs.h +@@ -38,6 +38,8 @@ + #ifndef _PPP_DEFS_H_ + #define _PPP_DEFS_H_ + ++#include <sys/time.h> ++ + /* + * The basic PPP frame. + */ +--- a/pppd/plugins/rp-pppoe/pppoe.h ++++ b/pppd/plugins/rp-pppoe/pppoe.h +@@ -92,7 +92,7 @@ typedef unsigned long UINT32_t; + #ifdef HAVE_SYS_SOCKET_H + #include <sys/socket.h> + #endif +-#ifndef HAVE_SYS_DLPI_H ++#if !defined HAVE_SYS_DLPI_H && defined HAVE_NET_ETHERNET_H + #include <netinet/if_ether.h> + #endif + #endif +--- a/pppd/plugins/rp-pppoe/plugin.c ++++ b/pppd/plugins/rp-pppoe/plugin.c +@@ -46,7 +46,9 @@ static char const RCSID[] = + #include <unistd.h> + #include <fcntl.h> + #include <signal.h> ++#ifdef HAVE_NET_ETHERNET_H + #include <net/ethernet.h> ++#endif + #include <net/if_arp.h> + #include <linux/ppp_defs.h> + #include <linux/if_pppox.h> |