picocom: fix compilation with musl (#1383)
authorJo-Philipp Wich <jow@openwrt.org>
Tue, 16 Jun 2015 12:37:55 +0000 (14:37 +0200)
committerJo-Philipp Wich <jow@openwrt.org>
Tue, 16 Jun 2015 12:39:44 +0000 (14:39 +0200)
Only use termio.h with glibc or uclibc, for musl include sys/ioctl.h and
termios.h instead.

Signed-off-by: Jo-Philipp Wich <jow@openwrt.org>
utils/picocom/Makefile
utils/picocom/patches/100-musl-compat.patch [new file with mode: 0644]

index b5251b41239fed35ca27171fd9ce97f4398d38b1..31a1ad644bdca3066a4daf4a5aeeb1cf25fe1080 100644 (file)
@@ -1,5 +1,5 @@
 #
-# Copyright (C) 2006-2014 OpenWrt.org
+# Copyright (C) 2006-2015 OpenWrt.org
 #
 # This is free software, licensed under the GNU General Public License v2.
 # See /LICENSE for more information.
@@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk
 
 PKG_NAME:=picocom
 PKG_VERSION:=1.7
-PKG_RELEASE:=1
+PKG_RELEASE:=2
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
 PKG_SOURCE_URL:=http://picocom.googlecode.com/files
diff --git a/utils/picocom/patches/100-musl-compat.patch b/utils/picocom/patches/100-musl-compat.patch
new file mode 100644 (file)
index 0000000..5f7d750
--- /dev/null
@@ -0,0 +1,17 @@
+Index: picocom-1.7/term.c
+===================================================================
+--- picocom-1.7.orig/term.c
++++ picocom-1.7/term.c
+@@ -33,10 +33,11 @@
+ #include <string.h>
+ #include <errno.h>
+ #include <unistd.h>
+-#ifdef __linux__
++#if defined(__linux__) && (defined(__GLIBC__) || defined(__UCLIBC__))
+ #include <termio.h>
+ #else
+ #include <termios.h>
++#include <sys/ioctl.h>
+ #endif /* of __linux__ */
+ #include "term.h"