diff --git a/package/libs/libjson-c/Makefile b/package/libs/libjson-c/Makefile index 0010b42d9b8..0f13883a3bd 100644 --- a/package/libs/libjson-c/Makefile +++ b/package/libs/libjson-c/Makefile @@ -8,35 +8,33 @@ include $(TOPDIR)/rules.mk PKG_NAME:=json-c -PKG_VERSION:=0.12 -PKG_RELEASE:=1 +PKG_VERSION:=0.15 +PKG_RELEASE:=2 -PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-nodoc.tar.gz PKG_SOURCE_URL:=https://s3.amazonaws.com/json-c_releases/releases/ -PKG_MD5SUM:=3ca4bbb881dfc4017e8021b5e0a8c491 +PKG_HASH:=99bca4f944b8ced8ae0bbc6310d6a3528ca715e69541793a1ef51f8c5b4b0878 +PKG_MAINTAINER:=Felix Fietkau PKG_LICENSE:=MIT PKG_LICENSE_FILES:=COPYING +PKG_CPE_ID:=cpe:/a:json-c_project:json-c -PKG_FIXUP:=autoreconf -PKG_INSTALL:=1 - -PKG_MAINTAINER:=Felix Fietkau +HOST_BUILD_PREFIX:=$(STAGING_DIR_HOST) include $(INCLUDE_DIR)/package.mk +include $(INCLUDE_DIR)/host-build.mk +include $(INCLUDE_DIR)/cmake.mk -TARGET_CFLAGS += $(FPIC) - -CONFIGURE_ARGS += \ - ac_cv_func_strdup=yes \ - ac_cv_func_strncasecmp=yes \ - ac_cv_func_snprintf=yes +CMAKE_HOST_OPTIONS += \ + -DBUILD_SHARED_LIBS=FALSE define Package/libjson-c SECTION:=libs CATEGORY:=Libraries TITLE:=javascript object notation - URL:=http://oss.metaparadigm.com/json-c/ + URL:=https://json-c.github.io/json-c/ + ABI_VERSION:=5 endef define Package/libjson-c/description @@ -44,12 +42,9 @@ define Package/libjson-c/description endef define Build/InstallDev - $(INSTALL_DIR) $(1)/usr/include - $(CP) $(PKG_INSTALL_DIR)/usr/include/json-c $(1)/usr/include/ - $(INSTALL_DIR) $(1)/usr/lib - $(CP) $(PKG_INSTALL_DIR)/usr/lib/libjson-c.{a,so*} $(1)/usr/lib/ - $(INSTALL_DIR) $(1)/usr/lib/pkgconfig - $(CP) $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/json-c.pc $(1)/usr/lib/pkgconfig/ + $(call Build/InstallDev/cmake,$(1)) + $(SED) 's,/usr/include,$$$${prefix}/include,g' $(1)/usr/lib/pkgconfig/json-c.pc + $(SED) 's,/usr/lib,$$$${exec_prefix}/lib,g' $(1)/usr/lib/pkgconfig/json-c.pc endef define Package/libjson-c/install @@ -58,3 +53,4 @@ define Package/libjson-c/install endef $(eval $(call BuildPackage,libjson-c)) +$(eval $(call HostBuild)) diff --git a/package/libs/libjson-c/patches/000-libm.patch b/package/libs/libjson-c/patches/000-libm.patch deleted file mode 100644 index 45adb0597f2..00000000000 --- a/package/libs/libjson-c/patches/000-libm.patch +++ /dev/null @@ -1,50 +0,0 @@ ---- a/configure.ac -+++ b/configure.ac -@@ -43,12 +43,6 @@ - AC_FUNC_MALLOC - AC_FUNC_REALLOC - AC_CHECK_FUNCS(strcasecmp strdup strerror snprintf vsnprintf vasprintf open vsyslog strncasecmp setlocale) --AC_CHECK_DECLS([INFINITY], [], [], [[#include ]]) --AC_CHECK_DECLS([nan], [], [], [[#include ]]) --AC_CHECK_DECLS([isnan], [], [], [[#include ]]) --AC_CHECK_DECLS([isinf], [], [], [[#include ]]) --AC_CHECK_DECLS([_isnan], [], [], [[#include ]]) --AC_CHECK_DECLS([_finite], [], [], [[#include ]]) - - #check if .section.gnu.warning accepts long strings (for __warn_references) - AC_LANG_PUSH([C]) ---- a/math_compat.h -+++ b/math_compat.h -@@ -1,28 +1,9 @@ - #ifndef __math_compat_h - #define __math_compat_h - --/* Define isnan and isinf on Windows/MSVC */ -- --#ifndef HAVE_DECL_ISNAN --# ifdef HAVE_DECL__ISNAN --#include --#define isnan(x) _isnan(x) --# endif --#endif -- --#ifndef HAVE_DECL_ISINF --# ifdef HAVE_DECL__FINITE --#include --#define isinf(x) (!_finite(x)) --# endif --#endif -- --#ifndef HAVE_DECL_NAN --#error This platform does not have nan() --#endif -- --#ifndef HAVE_DECL_INFINITY --#error This platform does not have INFINITY --#endif -+#undef isnan -+#define isnan(x) __builtin_isnan(x) -+#undef isinf -+#define isinf(x) __builtin_isinf(x) - - #endif diff --git a/package/libs/libjson-c/patches/001-backport_compile_fix.patch b/package/libs/libjson-c/patches/001-backport_compile_fix.patch deleted file mode 100644 index e83f5d28a34..00000000000 --- a/package/libs/libjson-c/patches/001-backport_compile_fix.patch +++ /dev/null @@ -1,23 +0,0 @@ -commit 3859e99f50abe11a8dade28efa9ea3d99dfaac11 -Author: Petar Koretić -Date: Fri Apr 11 10:03:40 2014 +0200 - - Remove unused variable 'size' - -diff --git a/json_tokener.c b/json_tokener.c -index 19de8ef..9a76293 100644 ---- a/json_tokener.c -+++ b/json_tokener.c -@@ -352,12 +352,10 @@ struct json_object* json_tokener_parse_ex(struct json_tokener *tok, - - case json_tokener_state_inf: /* aka starts with 'i' */ - { -- int size; - int size_inf; - int is_negative = 0; - - printbuf_memappend_fast(tok->pb, &c, 1); -- size = json_min(tok->st_pos+1, json_null_str_len); - size_inf = json_min(tok->st_pos+1, json_inf_str_len); - char *infbuf = tok->pb->buf; - if (*infbuf == '-') diff --git a/package/libs/libjson-c/patches/001-dont-build-docs.patch b/package/libs/libjson-c/patches/001-dont-build-docs.patch new file mode 100644 index 00000000000..1aa0da4f598 --- /dev/null +++ b/package/libs/libjson-c/patches/001-dont-build-docs.patch @@ -0,0 +1,11 @@ +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -401,8 +401,6 @@ set(JSON_C_SOURCES + include_directories(${PROJECT_SOURCE_DIR}) + include_directories(${PROJECT_BINARY_DIR}) + +-add_subdirectory(doc) +- + # uninstall + add_custom_target(uninstall + COMMAND cat ${PROJECT_BINARY_DIR}/install_manifest.txt | xargs rm diff --git a/package/libs/libjson-c/patches/010-clang.patch b/package/libs/libjson-c/patches/010-clang.patch new file mode 100644 index 00000000000..9ef73f1a82e --- /dev/null +++ b/package/libs/libjson-c/patches/010-clang.patch @@ -0,0 +1,11 @@ +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -265,7 +265,7 @@ message(STATUS "Wrote ${PROJECT_BINARY_D + configure_file(${PROJECT_SOURCE_DIR}/cmake/json_config.h.in ${PROJECT_BINARY_DIR}/json_config.h) + message(STATUS "Wrote ${PROJECT_BINARY_DIR}/json_config.h") + +-if ("${CMAKE_C_COMPILER_ID}" STREQUAL "GNU") ++if ("${CMAKE_C_COMPILER_ID}" STREQUAL "GNU" OR "${CMAKE_C_COMPILER_ID}" STREQUAL "Clang") + set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -ffunction-sections -fdata-sections") + if ("${DISABLE_WERROR}" STREQUAL "OFF") + set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Werror") diff --git a/target/linux/ipq/image/ipq60xx.mk b/target/linux/ipq/image/ipq60xx.mk index 57813f68d24..947d4a2c7d9 100644 --- a/target/linux/ipq/image/ipq60xx.mk +++ b/target/linux/ipq/image/ipq60xx.mk @@ -8,6 +8,11 @@ KERNEL_ENTRY := $(KERNEL_LOADADDR) INFO_IMG_PATH = $(TMP_DIR)/info.tmp INFO_IMG_SIZE = 152 +define Build/gzip + gzip -f -9n -c $@ $(1) > $@.new + @mv $@.new $@ +endef + define Build/fit-dummy-info dd if=/dev/zero of=$(INFO_IMG_PATH) bs=1 count=$(INFO_IMG_SIZE) $(TOPDIR)/scripts/mkits.sh \ @@ -34,7 +39,18 @@ define Device/8devices-mango-dvk BOARDNAME := mango IMAGE_SIZE := 27776k BLOCKSIZE = 64k - KERNEL = kernel-bin | lzma | fit-dummy-info lzma $$(DEVICE_DTS_DIR)/$$(DEVICE_DTS).dtb + KERNEL = kernel-bin | gzip | fit-dummy-info gzip $$(DEVICE_DTS_DIR)/$$(DEVICE_DTS).dtb IMAGE/sysupgrade.bin := insert-info | append-kernel $$$$(BLOCKSIZE) | append-rootfs | pad-rootfs | check-size $$$$(IMAGE_SIZE) endef TARGET_DEVICES += 8devices-mango-dvk + + +define Device/Yuncore-ax840 + DEVICE_TITLE := Yuncore ax840 + DEVICE_DTS := qcom-ipq6018-8dev-mango + BOARDNAME := ax840 + IMAGE_SIZE := 27776k + BLOCKSIZE = 64k + KERNEL = kernel-bin | gzip | fit-dummy-info gzip $$(DEVICE_DTS_DIR)/$$(DEVICE_DTS).dtb + IMAGE/sysupgrade.bin := insert-info | append-kernel $$$$(BLOCKSIZE) | append-rootfs | pad-rootfs | check-size $$$$(IMAGE_SIZE) +endef