diff -Nru osmo-libasn1c-0.9.28/configure.ac osmo-libasn1c-0.9.31/configure.ac --- osmo-libasn1c-0.9.28/configure.ac 2017-10-27 20:09:16.000000000 +0000 +++ osmo-libasn1c-0.9.31/configure.ac 2018-05-04 10:15:34.000000000 +0000 @@ -1,4 +1,5 @@ -AC_INIT([libasn1c], [0.9.28], +AC_INIT([libasn1c], + m4_esyscmd([./git-version-gen .tarball-version]), [openbsc-devel@lists.openbsc.org]) AM_INIT_AUTOMAKE([dist-bzip2]) @@ -6,6 +7,10 @@ dnl kernel style compile messages m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])]) +dnl include release helper +RELMAKE='-include osmo-release.mk' +AC_SUBST([RELMAKE]) + dnl checks for programs AC_PROG_MAKE_SET AC_PROG_CC @@ -17,6 +22,36 @@ PKG_CHECK_MODULES(LIBTALLOC, talloc) +AC_ARG_ENABLE(sanitize, + [AS_HELP_STRING( + [--enable-sanitize], + [Compile with address sanitizer enabled], + )], + [sanitize=$enableval], [sanitize="no"]) +if test x"$sanitize" = x"yes" +then + CFLAGS="$CFLAGS -fsanitize=address -fsanitize=undefined" + CPPFLAGS="$CPPFLAGS -fsanitize=address -fsanitize=undefined" +fi + +AC_ARG_ENABLE(werror, + [AS_HELP_STRING( + [--enable-werror], + [Turn all compiler warnings into errors, with exceptions: + a) deprecation (allow upstream to mark deprecation without breaking builds); + b) "#warning" pragmas (allow to remind ourselves of errors without breaking builds) + ] + )], + [werror=$enableval], [werror="no"]) +if test x"$werror" = x"yes" +then + WERROR_FLAGS="-Werror" + WERROR_FLAGS+=" -Wno-error=deprecated -Wno-error=deprecated-declarations" + WERROR_FLAGS+=" -Wno-error=cpp" # "#warning" + CFLAGS="$CFLAGS $WERROR_FLAGS" + CPPFLAGS="$CPPFLAGS $WERROR_FLAGS" +fi + # The following test is taken from WebKit's webkit.m4 saved_CFLAGS="$CFLAGS" CFLAGS="$CFLAGS -fvisibility=hidden " @@ -32,10 +67,12 @@ [build_debug="$enableval"], [build_debug="no"]) AM_CONDITIONAL(BUILD_DEBUG, test "x$build_debug" = "xyes") +AC_MSG_RESULT([CFLAGS="$CFLAGS"]) +AC_MSG_RESULT([CPPFLAGS="$CPPFLAGS"]) + AC_OUTPUT( libasn1c.pc src/Makefile include/Makefile include/asn1c/Makefile Makefile) - diff -Nru osmo-libasn1c-0.9.28/contrib/jenkins.sh osmo-libasn1c-0.9.31/contrib/jenkins.sh --- osmo-libasn1c-0.9.28/contrib/jenkins.sh 2017-10-27 20:09:16.000000000 +0000 +++ osmo-libasn1c-0.9.31/contrib/jenkins.sh 2018-05-04 10:15:34.000000000 +0000 @@ -1,6 +1,9 @@ #!/usr/bin/env bash # jenkins build helper script for libasn1c. This is how we build on jenkins.osmocom.org +set -e +osmo-clean-workspace.sh + set +x echo echo @@ -10,7 +13,9 @@ set -x autoreconf --install --force -./configure CFLAGS="-Werror" CPPFLAGS="-Werror" +./configure --enable-werror $MAKE $PARALLEL_MAKE $MAKE distcheck \ || cat-testlogs.sh + +osmo-clean-workspace.sh diff -Nru osmo-libasn1c-0.9.28/debian/changelog osmo-libasn1c-0.9.31/debian/changelog --- osmo-libasn1c-0.9.28/debian/changelog 2018-02-19 18:47:14.000000000 +0000 +++ osmo-libasn1c-0.9.31/debian/changelog 2018-06-22 16:51:51.000000000 +0000 @@ -1,11 +1,24 @@ +osmo-libasn1c (0.9.31-2) unstable; urgency=medium + + * debian/patches/version.patch: set version instead of relying on git + + -- Thorsten Alteholz Fri, 22 Jun 2018 18:51:51 +0200 + +osmo-libasn1c (0.9.31-1) unstable; urgency=medium + + * New upstream release + * debian/control: bump standard to 4.1.4 (no changes) + + -- Thorsten Alteholz Thu, 21 Jun 2018 19:51:51 +0200 + osmo-libasn1c (0.9.28-2) unstable; urgency=medium * move to unstable * debian/control: move to debian-mobcom maintainer * debian/control: add salsa URLs * debian/control: use dh11 - * debian/control: bum standard to 4.1.3 (no changes) - + * debian/control: bump standard to 4.1.3 (no changes) + -- Thorsten Alteholz Mon, 19 Feb 2018 19:47:14 +0100 osmo-libasn1c (0.9.28-1) experimental; urgency=medium diff -Nru osmo-libasn1c-0.9.28/debian/control osmo-libasn1c-0.9.31/debian/control --- osmo-libasn1c-0.9.28/debian/control 2018-02-19 18:47:14.000000000 +0000 +++ osmo-libasn1c-0.9.31/debian/control 2018-06-21 17:50:06.000000000 +0000 @@ -5,8 +5,8 @@ Uploaders: Thorsten Alteholz Build-Depends: debhelper (>=11), libtalloc-dev -Standards-Version: 4.1.3 -Vcs-Browser: https://salsa.debian.org/debian-mobcom-team/osmo-libasn1c.git +Standards-Version: 4.1.4 +Vcs-Browser: https://salsa.debian.org/debian-mobcom-team/osmo-libasn1c Vcs-Git: https://salsa.debian.org/debian-mobcom-team/osmo-libasn1c.git Homepage: https://projects.osmocom.org/projects/libasn1c diff -Nru osmo-libasn1c-0.9.28/debian/patches/series osmo-libasn1c-0.9.31/debian/patches/series --- osmo-libasn1c-0.9.28/debian/patches/series 1970-01-01 00:00:00.000000000 +0000 +++ osmo-libasn1c-0.9.31/debian/patches/series 2018-06-22 16:51:51.000000000 +0000 @@ -0,0 +1 @@ +version.patch diff -Nru osmo-libasn1c-0.9.28/debian/patches/version.patch osmo-libasn1c-0.9.31/debian/patches/version.patch --- osmo-libasn1c-0.9.28/debian/patches/version.patch 1970-01-01 00:00:00.000000000 +0000 +++ osmo-libasn1c-0.9.31/debian/patches/version.patch 2018-06-22 16:51:51.000000000 +0000 @@ -0,0 +1,13 @@ +Description: we don't have access to git during build, so manually set the version +Author: Thorsten Alteholz +Index: osmo-libasn1c-0.9.31/configure.ac +=================================================================== +--- osmo-libasn1c-0.9.31.orig/configure.ac 2018-05-04 12:15:34.000000000 +0200 ++++ osmo-libasn1c-0.9.31/configure.ac 2018-06-22 14:00:36.675673244 +0200 +@@ -1,5 +1,5 @@ + AC_INIT([libasn1c], +- m4_esyscmd([./git-version-gen .tarball-version]), ++ 0.9.31, + [openbsc-devel@lists.openbsc.org]) + + AM_INIT_AUTOMAKE([dist-bzip2]) diff -Nru osmo-libasn1c-0.9.28/.gitignore osmo-libasn1c-0.9.31/.gitignore --- osmo-libasn1c-0.9.28/.gitignore 2017-10-27 20:09:16.000000000 +0000 +++ osmo-libasn1c-0.9.31/.gitignore 2018-05-04 10:15:34.000000000 +0000 @@ -8,6 +8,7 @@ aclocal.m4 config.* configure +compile depcomp libtool ltmain.sh diff -Nru osmo-libasn1c-0.9.28/git-version-gen osmo-libasn1c-0.9.31/git-version-gen --- osmo-libasn1c-0.9.28/git-version-gen 1970-01-01 00:00:00.000000000 +0000 +++ osmo-libasn1c-0.9.31/git-version-gen 2018-05-04 10:15:34.000000000 +0000 @@ -0,0 +1,151 @@ +#!/bin/sh +# Print a version string. +scriptversion=2010-01-28.01 + +# Copyright (C) 2007-2010 Free Software Foundation, Inc. +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . + +# This script is derived from GIT-VERSION-GEN from GIT: http://git.or.cz/. +# It may be run two ways: +# - from a git repository in which the "git describe" command below +# produces useful output (thus requiring at least one signed tag) +# - from a non-git-repo directory containing a .tarball-version file, which +# presumes this script is invoked like "./git-version-gen .tarball-version". + +# In order to use intra-version strings in your project, you will need two +# separate generated version string files: +# +# .tarball-version - present only in a distribution tarball, and not in +# a checked-out repository. Created with contents that were learned at +# the last time autoconf was run, and used by git-version-gen. Must not +# be present in either $(srcdir) or $(builddir) for git-version-gen to +# give accurate answers during normal development with a checked out tree, +# but must be present in a tarball when there is no version control system. +# Therefore, it cannot be used in any dependencies. GNUmakefile has +# hooks to force a reconfigure at distribution time to get the value +# correct, without penalizing normal development with extra reconfigures. +# +# .version - present in a checked-out repository and in a distribution +# tarball. Usable in dependencies, particularly for files that don't +# want to depend on config.h but do want to track version changes. +# Delete this file prior to any autoconf run where you want to rebuild +# files to pick up a version string change; and leave it stale to +# minimize rebuild time after unrelated changes to configure sources. +# +# It is probably wise to add these two files to .gitignore, so that you +# don't accidentally commit either generated file. +# +# Use the following line in your configure.ac, so that $(VERSION) will +# automatically be up-to-date each time configure is run (and note that +# since configure.ac no longer includes a version string, Makefile rules +# should not depend on configure.ac for version updates). +# +# AC_INIT([GNU project], +# m4_esyscmd([build-aux/git-version-gen .tarball-version]), +# [bug-project@example]) +# +# Then use the following lines in your Makefile.am, so that .version +# will be present for dependencies, and so that .tarball-version will +# exist in distribution tarballs. +# +# BUILT_SOURCES = $(top_srcdir)/.version +# $(top_srcdir)/.version: +# echo $(VERSION) > $@-t && mv $@-t $@ +# dist-hook: +# echo $(VERSION) > $(distdir)/.tarball-version + +case $# in + 1) ;; + *) echo 1>&2 "Usage: $0 \$srcdir/.tarball-version"; exit 1;; +esac + +tarball_version_file=$1 +nl=' +' + +# First see if there is a tarball-only version file. +# then try "git describe", then default. +if test -f $tarball_version_file +then + v=`cat $tarball_version_file` || exit 1 + case $v in + *$nl*) v= ;; # reject multi-line output + [0-9]*) ;; + *) v= ;; + esac + test -z "$v" \ + && echo "$0: WARNING: $tarball_version_file seems to be damaged" 1>&2 +fi + +if test -n "$v" +then + : # use $v +elif + v=`git describe --abbrev=4 --match='v*' HEAD 2>/dev/null \ + || git describe --abbrev=4 HEAD 2>/dev/null` \ + && case $v in + [0-9]*) ;; + v[0-9]*) ;; + *) (exit 1) ;; + esac +then + # Is this a new git that lists number of commits since the last + # tag or the previous older version that did not? + # Newer: v6.10-77-g0f8faeb + # Older: v6.10-g0f8faeb + case $v in + *-*-*) : git describe is okay three part flavor ;; + *-*) + : git describe is older two part flavor + # Recreate the number of commits and rewrite such that the + # result is the same as if we were using the newer version + # of git describe. + vtag=`echo "$v" | sed 's/-.*//'` + numcommits=`git rev-list "$vtag"..HEAD | wc -l` + v=`echo "$v" | sed "s/\(.*\)-\(.*\)/\1-$numcommits-\2/"`; + ;; + esac + + # Change the first '-' to a '.', so version-comparing tools work properly. + # Remove the "g" in git describe's output string, to save a byte. + v=`echo "$v" | sed 's/-/./;s/\(.*\)-g/\1-/'`; +else + v=UNKNOWN +fi + +v=`echo "$v" |sed 's/^v//'` + +# Don't declare a version "dirty" merely because a time stamp has changed. +git status > /dev/null 2>&1 + +dirty=`sh -c 'git diff-index --name-only HEAD' 2>/dev/null` || dirty= +case "$dirty" in + '') ;; + *) # Append the suffix only if there isn't one already. + case $v in + *-dirty) ;; + *) v="$v-dirty" ;; + esac ;; +esac + +# Omit the trailing newline, so that m4_esyscmd can use the result directly. +echo "$v" | tr -d '\012' + +# Local variables: +# eval: (add-hook 'write-file-hooks 'time-stamp) +# time-stamp-start: "scriptversion=" +# time-stamp-format: "%:y-%02m-%02d.%02H" +# time-stamp-end: "$" +# End: diff -Nru osmo-libasn1c-0.9.28/libasn1c.pc.in osmo-libasn1c-0.9.31/libasn1c.pc.in --- osmo-libasn1c-0.9.28/libasn1c.pc.in 2017-10-27 20:09:16.000000000 +0000 +++ osmo-libasn1c-0.9.31/libasn1c.pc.in 2018-05-04 10:15:34.000000000 +0000 @@ -6,6 +6,6 @@ Name: asn1c runtime library Description: C Utility Library Version: @VERSION@ -Libs: -L${libdir} @LIBTALLOC_LIBS@ -lasn1c -lm +Libs: -L${libdir} @LIBTALLOC_LIBS@ -lasn1c Cflags: -I${includedir}/ -I${includedir}/asn1c @LIBTALLOC_CFLAGS@ diff -Nru osmo-libasn1c-0.9.28/Makefile.am osmo-libasn1c-0.9.31/Makefile.am --- osmo-libasn1c-0.9.28/Makefile.am 2017-10-27 20:09:16.000000000 +0000 +++ osmo-libasn1c-0.9.31/Makefile.am 2018-05-04 10:15:34.000000000 +0000 @@ -1,3 +1,5 @@ +@RELMAKE@ + AUTOMAKE_OPTIONS = foreign dist-bzip2 1.6 ACLOCAL_AMFLAGS = -I m4 diff -Nru osmo-libasn1c-0.9.28/src/asn1helpers.c osmo-libasn1c-0.9.31/src/asn1helpers.c --- osmo-libasn1c-0.9.28/src/asn1helpers.c 2017-10-27 20:09:16.000000000 +0000 +++ osmo-libasn1c-0.9.31/src/asn1helpers.c 2018-05-04 10:15:34.000000000 +0000 @@ -65,9 +65,6 @@ return 0; } - if (len < 0) - len = strlen((char*)str); - buf = MALLOC(len); if (!buf) { errno = ENOMEM; diff -Nru osmo-libasn1c-0.9.28/src/Makefile.am osmo-libasn1c-0.9.31/src/Makefile.am --- osmo-libasn1c-0.9.28/src/Makefile.am 2017-10-27 20:09:16.000000000 +0000 +++ osmo-libasn1c-0.9.31/src/Makefile.am 2018-05-04 10:15:34.000000000 +0000 @@ -1,7 +1,7 @@ # This is _NOT_ the library release version, it's an API version. # Please read Chapter 6 "Library interface versions" of the libtool # documentation before making any modification -LIBVERSION=1:0:0 +LIBVERSION=1:1:0 AM_CPPFLAGS = $(all_includes) -I$(top_srcdir)/include/asn1c AM_CFLAGS = -fPIC -Wall $(LIBTALLOC_CFLAGS) @@ -11,6 +11,6 @@ lib_LTLIBRARIES = libasn1c.la -libasn1c_la_LDFLAGS = $(LIBTALLOC_LIBS) +libasn1c_la_LDFLAGS = $(LIBTALLOC_LIBS) -lm libasn1c_la_SOURCES = ANY.c constraints.c GeneralizedTime.c NumericString.c T61String.c asn_codecs_prim.c constr_CHOICE.c GeneralString.c ObjectDescriptor.c TeletexString.c asn_SEQUENCE_OF.c constr_SEQUENCE.c GraphicString.c OBJECT_IDENTIFIER.c UniversalString.c asn_SET_OF.c constr_SEQUENCE_OF.c IA5String.c OCTET_STRING.c UTCTime.c ber_decoder.c constr_SET.c INTEGER.c per_decoder.c UTF8String.c ber_tlv_length.c constr_SET_OF.c ISO646String.c per_encoder.c VideotexString.c ber_tlv_tag.c constr_TYPE.c NativeEnumerated.c per_support.c VisibleString.c BIT_STRING.c NativeInteger.c PrintableString.c xer_decoder.c BMPString.c der_encoder.c NativeReal.c REAL.c xer_encoder.c BOOLEAN.c ENUMERATED.c NULL.c RELATIVE-OID.c xer_support.c per_opentype.c asn1helpers.c