ASR_BASE
Change-Id: Icf3719cc0afe3eeb3edc7fa80a2eb5199ca9dda1
diff --git a/external/subpack/devel/diffutils/Makefile b/external/subpack/devel/diffutils/Makefile
new file mode 100644
index 0000000..dfd5e0f
--- /dev/null
+++ b/external/subpack/devel/diffutils/Makefile
@@ -0,0 +1,56 @@
+#
+# Copyright (C) 2008-2015 OpenWrt.org
+#
+# This is free software, licensed under the GNU General Public License v2.
+# See /LICENSE for more information.
+#
+
+include $(TOPDIR)/rules.mk
+
+PKG_NAME:=diffutils
+PKG_VERSION:=3.10
+PKG_RELEASE:=1
+
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
+PKG_SOURCE_URL:=@GNU/diffutils
+PKG_HASH:=90e5e93cc724e4ebe12ede80df1634063c7a855692685919bfe60b556c9bd09e
+
+PKG_MAINTAINER:=Roger D <rogerdammit@gmail.com>
+PKG_LICENSE:=GPL-3.0
+PKG_LICENSE_FILES:=COPYING
+PKG_CPE_ID:=cpe:/a:gnu:diffutils
+
+PKG_BUILD_PARALLEL:=1
+PKG_INSTALL:=1
+
+include $(INCLUDE_DIR)/package.mk
+
+define Package/diffutils
+ SECTION:=devel
+ CATEGORY:=Development
+ DEPENDS:=+USE_GLIBC:librt
+ TITLE:=diffutils
+ URL:=https://www.gnu.org/software/diffutils/
+ ALTERNATIVES:=\
+ 200:/usr/bin/cmp:/usr/libexec/cmp-gnu \
+ 200:/usr/bin/diff:/usr/libexec/diff-gnu
+endef
+
+define Package/diffutils/description
+ The Diffutils package contains programs that show the differences between
+ files or directories.
+endef
+
+CONFIGURE_VARS += \
+ gl_cv_func_getopt_gnu=yes \
+ ac_cv_func_mempcpy=n
+
+define Package/diffutils/install
+ $(INSTALL_DIR) $(1)/usr/bin
+ $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/{sdiff,diff3} $(1)/usr/bin/
+ $(INSTALL_DIR) $(1)/usr/libexec
+ $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/diff $(1)/usr/libexec/diff-gnu
+ $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/cmp $(1)/usr/libexec/cmp-gnu
+endef
+
+$(eval $(call BuildPackage,diffutils))
diff --git a/external/subpack/devel/diffutils/patches/010-ppc.patch b/external/subpack/devel/diffutils/patches/010-ppc.patch
new file mode 100644
index 0000000..f2b55a5
--- /dev/null
+++ b/external/subpack/devel/diffutils/patches/010-ppc.patch
@@ -0,0 +1,13 @@
+--- a/lib/sigsegv.c
++++ b/lib/sigsegv.c
+@@ -244,8 +244,8 @@ int libsigsegv_version = LIBSIGSEGV_VERS
+ /* Assume the structure of ucontext_t in
+ glibc/sysdeps/unix/sysv/linux/powerpc/sys/ucontext.h. */
+ /* Because of the union, both definitions should be equivalent. */
+-# if 0
+-# define SIGSEGV_FAULT_STACKPOINTER ((ucontext_t *) ucp)->uc_mcontext.regs->gpr[1]
++# ifndef __GLIBC__
++# define SIGSEGV_FAULT_STACKPOINTER ((ucontext_t *) ucp)->uc_mcontext.gregs[1]
+ # else
+ # define SIGSEGV_FAULT_STACKPOINTER ((ucontext_t *) ucp)->uc_mcontext.uc_regs->gregs[1]
+ # endif