From: Philippe Coval Date: Wed, 29 Mar 2017 16:34:54 +0000 (+0200) Subject: tinycbor X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=f6f8ba39cbc9501ab8829a040773ac8d94660483;p=contrib%2Fiotivity.git tinycbor Change-Id: I89a912e869a778eeb1d9cb12303bddaffc4d6d57 Signed-off-by: Philippe Coval --- diff --git a/extlibs/tinycbor/tinycbor/.travis.yml b/extlibs/tinycbor/tinycbor/.travis.yml index 0948295..c3e1c7c 100644 --- a/extlibs/tinycbor/tinycbor/.travis.yml +++ b/extlibs/tinycbor/tinycbor/.travis.yml @@ -6,7 +6,7 @@ env: - CFLAGS="-O0 -g" QMAKEFLAGS="-config debug" PATH=/opt/qt56/bin:/usr/local/opt/qt5/bin:$PATH install: - if [ "${TRAVIS_OS_NAME}" = "linux" ]; then - sudo apt-add-repository -y ppa:beineri/opt-qt561; + sudo apt-add-repository -y ppa:beineri/opt-qt562; sudo apt-add-repository -y ppa:ubuntu-toolchain-r/test; sudo apt-get update -qq; sudo apt-get install -y qt56base valgrind g++-5; diff --git a/extlibs/tinycbor/tinycbor/Makefile b/extlibs/tinycbor/tinycbor/Makefile index 2377e37..97b292c 100644 --- a/extlibs/tinycbor/tinycbor/Makefile +++ b/extlibs/tinycbor/tinycbor/Makefile @@ -82,12 +82,12 @@ ifeq ($(open_memstream-pass),) endif endif -# json2cbor depends on an external library (cJSON) +# json2cbor depends on an external library (cjson) ifneq ($(cjson-pass)$(system-cjson-pass),) JSON2CBOR_SOURCES = tools/json2cbor/json2cbor.c INSTALL_TARGETS += $(bindir)/json2cbor ifeq ($(system-cjson-pass),1) - LDFLAGS_CJSON = -lcJSON + LDFLAGS_CJSON = -lcjson else JSON2CBOR_SOURCES += src/cjson/cJSON.c json2cbor_CCFLAGS = -I$(SRCDIR)src/cjson @@ -105,16 +105,16 @@ configure: .config .config: Makefile.configure $(MAKE) -f $(SRCDIR)Makefile.configure OUT='>&9' configure 9> $@ -lib bin: - $(MKDIR) $@ - -lib/libtinycbor.a: $(TINYCBOR_SOURCES:.c=.o) | lib +lib/libtinycbor.a: $(TINYCBOR_SOURCES:.c=.o) + @$(MKDIR) -p lib $(AR) cqs $@ $^ -bin/cbordump: $(CBORDUMP_SOURCES:.c=.o) lib/libtinycbor.a | bin +bin/cbordump: $(CBORDUMP_SOURCES:.c=.o) lib/libtinycbor.a + @$(MKDIR) -p bin $(CC) -o $@ $(LDFLAGS) $^ $(LDLIBS) -lm -bin/json2cbor: $(JSON2CBOR_SOURCES:.c=.o) lib/libtinycbor.a | bin +bin/json2cbor: $(JSON2CBOR_SOURCES:.c=.o) lib/libtinycbor.a + @$(MKDIR) -p bin $(CC) -o $@ $(LDFLAGS) $(LDFLAGS_CJSON) $^ $(LDLIBS) -lm tinycbor.pc: tinycbor.pc.in @@ -177,29 +177,8 @@ distcheck: .git cd $${TMPDIR-/tmp}/tinycbor-distcheck && $(MAKE) silentcheck $(RM) -r $${TMPDIR-/tmp}/tinycbor-distcheck -release: .git - $(MAKE) -f $(MAKEFILE) distcheck -ifeq ($(VERSION),) - git -C $(SRCDIR). show HEAD:VERSION | \ - perl -l -n -e '@_ = split /\./; print "$$_[0]." . ($$_[1] + 1)' > $(SRCDIR)VERSION -else - echo "$(VERSION)" > VERSION -endif - if test -n "`git diff VERSION`"; then \ - git -C $(SRCDIR). commit -s -m "Update version number" VERSION; \ - fi - { echo "TinyCBOR release `cat $(SRCDIR)VERSION`"; \ - echo; \ - echo '# Write something nice about this release here'; \ - tmpl=`git -C $(SRCDIR). config --get commit.template` && \ - cat "$$tmpl"; \ - echo '# Commit log:'; \ - git -C $(SRCDIR). shortlog -e --no-merges HEAD --not `git -C $(SRCDIR). tag` | sed 's,^,# ,'; \ - echo '# Header diff:'; \ - git -C $(SRCDIR). diff HEAD --not `git -C $(SRCDIR). tag` -- 'src/*.h' ':!*_p.h' | sed 's,^,# ,'; \ - } > $(SRCDIR).git/TAG_EDITMSG - @`git -C $(SRCDIR). var GIT_EDITOR` $(SRCDIR).git/TAG_EDITMSG - git -C $(SRCDIR). tag -a -F $(SRCDIR).git/TAG_EDITMSG $(GITTAGFLAGS) v`cat $(SRCDIR)VERSION` +tag: distcheck + @cd $(SRCDIR). && perl maketag.pl .PHONY: all check silentcheck configure install uninstall .PHONY: mostlyclean clean distclean @@ -207,7 +186,7 @@ endif .SECONDARY: cflags := $(CPPFLAGS) -I$(SRCDIR)src -cflags += -DTINYCBOR_VERSION=\"$(VERSION)$(DIRTYSRC)\" +cflags += -DTINYCBOR_VERSION_SUFFIX=\"$(DIRTYSRC)\" cflags += -std=c99 $(CFLAGS) %.o: %.c @test -d $(@D) || $(MKDIR) $(@D) diff --git a/extlibs/tinycbor/tinycbor/Makefile.configure b/extlibs/tinycbor/tinycbor/Makefile.configure index 28f4c92..424efb3 100644 --- a/extlibs/tinycbor/tinycbor/Makefile.configure +++ b/extlibs/tinycbor/tinycbor/Makefile.configure @@ -10,11 +10,11 @@ PROGRAM-gc_sections = int main() {} CCFLAGS-gc_sections = -Wl,--gc-sections PROGRAM-cjson = \#include \n -PROGRAM-cjson += \#include \n +PROGRAM-cjson += \#include \n PROGRAM-cjson += int main() { return cJSON_False; } CCFLAGS-cjson = -I$(dir $(MAKEFILE))src/cjson PROGRAM-system-cjson = $(PROGRAM-cjson) -CCFLAGS-system-cjson = -lcJSON +CCFLAGS-system-cjson = -lcjson sink: @echo >&2 Please run from the top-level Makefile. diff --git a/extlibs/tinycbor/tinycbor/Makefile.nmake b/extlibs/tinycbor/tinycbor/Makefile.nmake index abf50da..1e675f6 100644 --- a/extlibs/tinycbor/tinycbor/Makefile.nmake +++ b/extlibs/tinycbor/tinycbor/Makefile.nmake @@ -34,7 +34,9 @@ clean: mostlyclean if exist tests\Makefile (cd tests & $(MAKE) clean) distclean: clean if exist tests\Makefile (cd tests & $(MAKE) distclean) +tag: + @perl maketag.pl {src\}.c{src\}.obj: - $(CC) -nologo $(CFLAGS) -Isrc -DTINYCBOR_VERSION="" -c -Fo$@ $< + $(CC) -nologo $(CFLAGS) -Isrc -DTINYCBOR_VERSION_SUFFIX="" -c -Fo$@ $< diff --git a/extlibs/tinycbor/tinycbor/VERSION b/extlibs/tinycbor/tinycbor/VERSION index bd73f47..267577d 100644 --- a/extlibs/tinycbor/tinycbor/VERSION +++ b/extlibs/tinycbor/tinycbor/VERSION @@ -1 +1 @@ -0.4 +0.4.1 diff --git a/extlibs/tinycbor/tinycbor/maketag.pl b/extlibs/tinycbor/tinycbor/maketag.pl new file mode 100644 index 0000000..084ce5f --- /dev/null +++ b/extlibs/tinycbor/tinycbor/maketag.pl @@ -0,0 +1,69 @@ +#!perl +use strict; +sub run(@) { + open PROC, "-|", @_ or die("Cannot run $_[0]: $!"); + my @out; + while () { + chomp; + push @out, $_; + } + close PROC; + return @out; +} + +my @tags = run("git", "tag"); +my @v = run("git", "show", "HEAD:VERSION"); +my $v = $v[0]; + +my $tagfile = ".git/TAG_EDITMSG"; +open TAGFILE, ">", $tagfile + or die("Cannot create file for editing tag message: $!"); +select TAGFILE; +print "TinyCBOR release $v\n"; +print "\n"; +print "# Write something nice about this release here\n"; + +# Do we have a commit template? +my @result = run("git", "config", "--get", "commit.template"); +if (scalar @result) { + open TEMPLATE, "<", $result[0]; + map { print $_; }