Message ID | 1364416080-10797-1-git-send-email-spdawson@gmail.com |
---|---|
State | Accepted |
Headers | show |
>>>>> "spdawson" == spdawson <spdawson@gmail.com> writes:
spdawson> From: Simon Dawson <spdawson@gmail.com>
spdawson> Signed-off-by: Simon Dawson <spdawson@gmail.com>
spdawson> ---
spdawson> package/Config.in | 1 +
spdawson> package/libjson/Config.in | 11 ++++
spdawson> .../libjson/libjson-0001-fix-broken-makefile.patch | 16 ++++++
spdawson> package/libjson/libjson.mk | 53 ++++++++++++++++++++
spdawson> 4 files changed, 81 insertions(+)
spdawson> create mode 100644 package/libjson/Config.in
spdawson> create mode 100644 package/libjson/libjson-0001-fix-broken-makefile.patch
spdawson> create mode 100644 package/libjson/libjson.mk
Committed with some modifications (see below) - Thanks.
spdawson> +LIBJSON_LICENSE_FILES = License.txt
spdawson> +
spdawson> +LIBJSON_MAKE_OPT = BUILD_TYPE= SHARED=1
spdawson> +
spdawson> +define LIBJSON_EXTRACT_CMDS
spdawson> + unzip -d $(@D) $(DL_DIR)/$(LIBJSON_SOURCE)
spdawson> + mv $(@D)/libjson/* $(@D)
spdawson> + $(RM) -r $(@D)/libjson
spdawson> +endef
spdawson> +
spdawson> +define LIBJSON_BUILD_CMDS
spdawson> + mkdir -p $(@D)/Objects_shared $(@D)/_internal/Source/Dependencies
It should be built statically if BR2_PREFER_STATIC_LIB is enabled, so
SHARED=0 and Objects_static.
It complains loudly that the assert checks are still enabled, so I've
changed it to pass -NDEBUG in CXXFLAGS, like the makefile normally does.
spdawson> +define LIBJSON_INSTALL_TARGET_CMDS
spdawson> + $(TARGET_MAKE_ENV) $(MAKE) $(TARGET_CONFIGURE_OPTS) \
spdawson> + $(LIBJSON_MAKE_OPT) prefix=$(TARGET_DIR)/usr install -C $(@D)
spdawson> +endef
It runs ldconfig after installation, which doesn't make sense for cross
compilation, and the host version is normally not in the path, so I've
stripped that.
On 29 April 2013 21:55, Peter Korsgaard <jacmet@uclibc.org> wrote: >>>>>> "spdawson" == spdawson <spdawson@gmail.com> writes: > > spdawson> From: Simon Dawson <spdawson@gmail.com> > spdawson> Signed-off-by: Simon Dawson <spdawson@gmail.com> > spdawson> --- > spdawson> package/Config.in | 1 + > spdawson> package/libjson/Config.in | 11 ++++ > spdawson> .../libjson/libjson-0001-fix-broken-makefile.patch | 16 ++++++ > spdawson> package/libjson/libjson.mk | 53 ++++++++++++++++++++ > spdawson> 4 files changed, 81 insertions(+) > spdawson> create mode 100644 package/libjson/Config.in > spdawson> create mode 100644 package/libjson/libjson-0001-fix-broken-makefile.patch > spdawson> create mode 100644 package/libjson/libjson.mk > > Committed with some modifications (see below) - Thanks. Thanks for your help with this Peter. Simon.
diff --git a/package/Config.in b/package/Config.in index 463d1b9..5f9c6c1 100644 --- a/package/Config.in +++ b/package/Config.in @@ -609,6 +609,7 @@ source "package/expat/Config.in" source "package/ezxml/Config.in" source "package/json-c/Config.in" source "package/json-glib/Config.in" +source "package/libjson/Config.in" source "package/libroxml/Config.in" source "package/libxml-parser-perl/Config.in" source "package/libxml2/Config.in" diff --git a/package/libjson/Config.in b/package/libjson/Config.in new file mode 100644 index 0000000..949c748 --- /dev/null +++ b/package/libjson/Config.in @@ -0,0 +1,11 @@ +config BR2_PACKAGE_LIBJSON + bool "libjson" + depends on BR2_INSTALL_LIBSTDCPP + help + A JSON reader and writer which is super-efficient and usually + runs circles around other JSON libraries. + + http://sourceforge.net/projects/libjson/ + +comment "libjson requires a toolchain with C++ support" + depends on !BR2_INSTALL_LIBSTDCPP diff --git a/package/libjson/libjson-0001-fix-broken-makefile.patch b/package/libjson/libjson-0001-fix-broken-makefile.patch new file mode 100644 index 0000000..8ceb0ca --- /dev/null +++ b/package/libjson/libjson-0001-fix-broken-makefile.patch @@ -0,0 +1,16 @@ +Fix the broken libjson makefile. + +Signed-off-by: Simon Dawson <spdawson@gmail.com> + +diff -Nurp a/makefile b/makefile +--- a/makefile 2012-05-30 10:15:42.000000000 +0100 ++++ b/makefile 2013-03-27 18:45:34.814670534 +0000 +@@ -170,7 +170,7 @@ include_path = $(prefix)/$(includedi + # Usage check + ifdef CXXFLAGS + ifdef BUILD_TYPE +- $(error CXXFLAGS and BUILD_TYPE are mutually exclusive) ++$(error CXXFLAGS and BUILD_TYPE are mutually exclusive) + endif + endif + diff --git a/package/libjson/libjson.mk b/package/libjson/libjson.mk new file mode 100644 index 0000000..9bd9030 --- /dev/null +++ b/package/libjson/libjson.mk @@ -0,0 +1,53 @@ +############################################################# +# +# libjson +# +############################################################# + +LIBJSON_VERSION = 7.6.1 +LIBJSON_SITE = http://downloads.sourceforge.net/project/libjson +LIBJSON_SOURCE = libjson_$(LIBJSON_VERSION).zip +LIBJSON_INSTALL_STAGING = YES +LIBJSON_LICENSE = BSD-2c +LIBJSON_LICENSE_FILES = License.txt + +LIBJSON_MAKE_OPT = BUILD_TYPE= SHARED=1 + +define LIBJSON_EXTRACT_CMDS + unzip -d $(@D) $(DL_DIR)/$(LIBJSON_SOURCE) + mv $(@D)/libjson/* $(@D) + $(RM) -r $(@D)/libjson +endef + +define LIBJSON_BUILD_CMDS + mkdir -p $(@D)/Objects_shared $(@D)/_internal/Source/Dependencies + $(TARGET_MAKE_ENV) $(MAKE) $(TARGET_CONFIGURE_OPTS) \ + $(LIBJSON_MAKE_OPT) -C $(@D) +endef + +define LIBJSON_INSTALL_TARGET_CMDS + $(TARGET_MAKE_ENV) $(MAKE) $(TARGET_CONFIGURE_OPTS) \ + $(LIBJSON_MAKE_OPT) prefix=$(TARGET_DIR)/usr install -C $(@D) +endef + +define LIBJSON_UNINSTALL_TARGET_CMDS + $(TARGET_MAKE_ENV) $(MAKE) $(TARGET_CONFIGURE_OPTS) \ + $(LIBJSON_MAKE_OPT) prefix=$(TARGET_DIR)/usr uninstall -C $(@D) +endef + +define LIBJSON_INSTALL_STAGING_CMDS + $(TARGET_MAKE_ENV) $(MAKE) $(TARGET_CONFIGURE_OPTS) \ + $(LIBJSON_MAKE_OPT) prefix=$(STAGING_DIR)/usr install -C $(@D) +endef + +define LIBJSON_UNINSTALL_STAGING_CMDS + $(TARGET_MAKE_ENV) $(MAKE) $(TARGET_CONFIGURE_OPTS) \ + $(LIBJSON_MAKE_OPT) prefix=$(STAGING_DIR)/usr uninstall -C $(@D) +endef + +define LIBJSON_CLEAN_CMDS + $(TARGET_MAKE_ENV) $(MAKE) $(TARGET_CONFIGURE_OPTS) $(LIBJSON_MAKE_OPT) \ + clean -C $(@D) +endef + +$(eval $(generic-package))