Browse Source

picocom: fix compilation with musl (#1383)

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>
Jo-Philipp Wich 9 years ago
parent
commit
acfce97879
2 changed files with 19 additions and 2 deletions
  1. 2
    2
      utils/picocom/Makefile
  2. 17
    0
      utils/picocom/patches/100-musl-compat.patch

+ 2
- 2
utils/picocom/Makefile View File

@@ -1,5 +1,5 @@
1 1
 #
2
-# Copyright (C) 2006-2014 OpenWrt.org
2
+# Copyright (C) 2006-2015 OpenWrt.org
3 3
 #
4 4
 # This is free software, licensed under the GNU General Public License v2.
5 5
 # See /LICENSE for more information.
@@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk
9 9
 
10 10
 PKG_NAME:=picocom
11 11
 PKG_VERSION:=1.7
12
-PKG_RELEASE:=1
12
+PKG_RELEASE:=2
13 13
 
14 14
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
15 15
 PKG_SOURCE_URL:=http://picocom.googlecode.com/files

+ 17
- 0
utils/picocom/patches/100-musl-compat.patch View File

@@ -0,0 +1,17 @@
1
+Index: picocom-1.7/term.c
2
+===================================================================
3
+--- picocom-1.7.orig/term.c
4
++++ picocom-1.7/term.c
5
+@@ -33,10 +33,11 @@
6
+ #include <string.h>
7
+ #include <errno.h>
8
+ #include <unistd.h>
9
+-#ifdef __linux__
10
++#if defined(__linux__) && (defined(__GLIBC__) || defined(__UCLIBC__))
11
+ #include <termio.h>
12
+ #else
13
+ #include <termios.h>
14
++#include <sys/ioctl.h>
15
+ #endif /* of __linux__ */
16
+ 
17
+ #include "term.h"