Skip to content

Commit

Permalink
version 0.9.26
Browse files Browse the repository at this point in the history
  • Loading branch information
vlm committed Sep 11, 2014
1 parent 5809ec6 commit e0d321a
Show file tree
Hide file tree
Showing 71 changed files with 425 additions and 555 deletions.
2 changes: 1 addition & 1 deletion ChangeLog
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@

???:
0.9.26: 2014-Sep-11
* Updated asn1c-usage.pdf.
* Made -fskeletons-copy a default option; removed cmdline option.
* Made -fnative-types a default option; removed cmdline option.
Expand Down
4 changes: 2 additions & 2 deletions Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,12 @@ ACLOCAL_AMFLAGS = -I m4
SUBDIRS = \
libasn1parser libasn1fix \
libasn1print libasn1compiler \
skeletons examples tests \
skeletons examples \
doc asn1c

docsdir = $(datadir)/doc/asn1c

docs_DATA = README FAQ COPYING ChangeLog BUGS TODO

EXTRA_DIST = asn1c.spec.in FAQ BUGS MANIFEST
EXTRA_DIST = asn1c.spec.in FAQ BUGS MANIFEST tests/
CLEANFILES = asn1c.spec
13 changes: 7 additions & 6 deletions Makefile.in
Original file line number Diff line number Diff line change
Expand Up @@ -171,6 +171,7 @@ LIBTOOL = @LIBTOOL@
LIPO = @LIPO@
LN_S = @LN_S@
LTLIBOBJS = @LTLIBOBJS@
MAINT = @MAINT@
MAKEINFO = @MAKEINFO@
MANIFEST_TOOL = @MANIFEST_TOOL@
MKDIR_P = @MKDIR_P@
Expand Down Expand Up @@ -253,20 +254,20 @@ ACLOCAL_AMFLAGS = -I m4
SUBDIRS = \
libasn1parser libasn1fix \
libasn1print libasn1compiler \
skeletons examples tests \
skeletons examples \
doc asn1c

docsdir = $(datadir)/doc/asn1c
docs_DATA = README FAQ COPYING ChangeLog BUGS TODO
EXTRA_DIST = asn1c.spec.in FAQ BUGS MANIFEST
EXTRA_DIST = asn1c.spec.in FAQ BUGS MANIFEST tests/
CLEANFILES = asn1c.spec
all: config.h
$(MAKE) $(AM_MAKEFLAGS) all-recursive

.SUFFIXES:
am--refresh:
@:
$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps)
$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps)
@for dep in $?; do \
case '$(am__configure_deps)' in \
*$$dep*) \
Expand All @@ -293,9 +294,9 @@ Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
$(SHELL) ./config.status --recheck

$(top_srcdir)/configure: $(am__configure_deps)
$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps)
$(am__cd) $(srcdir) && $(AUTOCONF)
$(ACLOCAL_M4): $(am__aclocal_m4_deps)
$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps)
$(am__cd) $(srcdir) && $(ACLOCAL) $(ACLOCAL_AMFLAGS)
$(am__aclocal_m4_deps):

Expand All @@ -308,7 +309,7 @@ config.h: stamp-h1
stamp-h1: $(srcdir)/config.h.in $(top_builddir)/config.status
@rm -f stamp-h1
cd $(top_builddir) && $(SHELL) ./config.status config.h
$(srcdir)/config.h.in: $(am__configure_deps)
$(srcdir)/config.h.in: @MAINTAINER_MODE_TRUE@ $(am__configure_deps)
($(am__cd) $(top_srcdir) && $(AUTOHEADER))
rm -f stamp-h1
touch $@
Expand Down
40 changes: 40 additions & 0 deletions aclocal.m4
Original file line number Diff line number Diff line change
Expand Up @@ -608,6 +608,46 @@ if test "$LEX" = :; then
LEX=${am_missing_run}flex
fi])

# Add --enable-maintainer-mode option to configure. -*- Autoconf -*-
# From Jim Meyering

# Copyright (C) 1996, 1998, 2000, 2001, 2002, 2003, 2004, 2005, 2008
# Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.

# serial 5

# AM_MAINTAINER_MODE([DEFAULT-MODE])
# ----------------------------------
# Control maintainer-specific portions of Makefiles.
# Default is to disable them, unless `enable' is passed literally.
# For symmetry, `disable' may be passed as well. Anyway, the user
# can override the default with the --enable/--disable switch.
AC_DEFUN([AM_MAINTAINER_MODE],
[m4_case(m4_default([$1], [disable]),
[enable], [m4_define([am_maintainer_other], [disable])],
[disable], [m4_define([am_maintainer_other], [enable])],
[m4_define([am_maintainer_other], [enable])
m4_warn([syntax], [unexpected argument to AM@&t@_MAINTAINER_MODE: $1])])
AC_MSG_CHECKING([whether to am_maintainer_other maintainer-specific portions of Makefiles])
dnl maintainer-mode's default is 'disable' unless 'enable' is passed
AC_ARG_ENABLE([maintainer-mode],
[ --][am_maintainer_other][-maintainer-mode am_maintainer_other make rules and dependencies not useful
(and sometimes confusing) to the casual installer],
[USE_MAINTAINER_MODE=$enableval],
[USE_MAINTAINER_MODE=]m4_if(am_maintainer_other, [enable], [no], [yes]))
AC_MSG_RESULT([$USE_MAINTAINER_MODE])
AM_CONDITIONAL([MAINTAINER_MODE], [test $USE_MAINTAINER_MODE = yes])
MAINT=$MAINTAINER_MODE_TRUE
AC_SUBST([MAINT])dnl
]
)

AU_DEFUN([jm_MAINTAINER_MODE], [AM_MAINTAINER_MODE])

# Check to see how 'make' treats includes. -*- Autoconf -*-

# Copyright (C) 2001, 2002, 2003, 2005, 2009 Free Software Foundation, Inc.
Expand Down
1 change: 1 addition & 0 deletions asn1c/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -23,5 +23,6 @@ noinst_HEADERS = sys-common.h
dist_man1_MANS = asn1c.1 unber.1 enber.1

dist_check_SCRIPTS = check-xxber.sh check-parsing.sh
TESTS_ENVIRONMENT= top_srcdir=${top_srcdir}
TESTS = $(dist_check_SCRIPTS)
CLEANFILES = .check-xxber.*.tmp .check-parsing.*.tmp
8 changes: 5 additions & 3 deletions asn1c/Makefile.in
Original file line number Diff line number Diff line change
Expand Up @@ -189,6 +189,7 @@ LIBTOOL = @LIBTOOL@
LIPO = @LIPO@
LN_S = @LN_S@
LTLIBOBJS = @LTLIBOBJS@
MAINT = @MAINT@
MAKEINFO = @MAKEINFO@
MANIFEST_TOOL = @MANIFEST_TOOL@
MKDIR_P = @MKDIR_P@
Expand Down Expand Up @@ -286,13 +287,14 @@ asn1c_LDADD = \
noinst_HEADERS = sys-common.h
dist_man1_MANS = asn1c.1 unber.1 enber.1
dist_check_SCRIPTS = check-xxber.sh check-parsing.sh
TESTS_ENVIRONMENT = top_srcdir=${top_srcdir}
TESTS = $(dist_check_SCRIPTS)
CLEANFILES = .check-xxber.*.tmp .check-parsing.*.tmp
all: all-recursive

.SUFFIXES:
.SUFFIXES: .c .lo .o .obj
$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps)
$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps)
@for dep in $?; do \
case '$(am__configure_deps)' in \
*$$dep*) \
Expand All @@ -317,9 +319,9 @@ Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh

$(top_srcdir)/configure: $(am__configure_deps)
$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps)
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
$(ACLOCAL_M4): $(am__aclocal_m4_deps)
$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps)
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
$(am__aclocal_m4_deps):
install-binPROGRAMS: $(bin_PROGRAMS)
Expand Down
36 changes: 27 additions & 9 deletions asn1c/check-parsing.sh
Original file line number Diff line number Diff line change
@@ -1,25 +1,43 @@
#!/bin/sh

tmpfile=".check-parsing.$$.tmp"

# Test diff(1) capabilities
diff -a . . 2>/dev/null && diffArgs="-a" # Assume text files
diff -u . . 2>/dev/null && diffArgs="$diffArgs -u" # Unified diff output

ec=0

for ref in ../tests/*.asn1.-*; do
set -o pipefail
set -e

PROCESSING=""
print_status() {
echo "Error while processing $PROCESSING"
}

trap print_status ERR

if [ "x${top_srcdir}" = "x" ]; then
top_srcdir=".."
fi

for ref in ${top_srcdir}/tests/*.asn1.-*; do
# Figure out the initial source file used to generate this output.
src=`echo "$ref" | sed -e 's/\.-[-a-zA-Z0-9=]*$//'`
# Figure out compiler flags used to create the file.
flags=`echo "$ref" | sed -e 's/.*\.-//'`
echo "Checking $src against $ref"
./asn1c -S../skeletons "-$flags" "$src" > "$tmpfile" || ec=$?
template=.tmp.check-parsing.$$
oldversion=${template}.old
newversion=${template}.new
PROCESSING="$ref (from $src)"
cat "$ref" | LANG=C sed -e 's/^found in .*/found in .../' > $oldversion
(./asn1c -S ${top_srcdir}/skeletons "-$flags" "$src" | LANG=C sed -e 's/^found in .*/found in .../' > "$newversion") || ec=$?
if [ $? = 0 ]; then
diff $diffArgs "$ref" "$tmpfile" || ec=$?
diff $diffArgs "$oldversion" "$newversion" || ec=$?
fi
if [ "$1" != "regenerate" ]; then
rm -f "$tmpfile"
else
mv "$tmpfile" "$ref"
rm -f $oldversion $newversion
if [ "$1" = "regenerate" ]; then
./asn1c -S ${top_srcdir}/skeletons "-$flags" "$src" > "$ref"
fi
done

Expand Down
8 changes: 4 additions & 4 deletions asn1c/tests/Makefile.am
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@

dist_check_SCRIPTS = check-assembly.sh

TESTS_ENVIRONMENT= CC="${CC}" CFLAGS="${TESTSUITE_CFLAGS} ${CFLAGS} -Wno-error=unused-variable" CXXFLAGS="${CXXFLAGS}" ./check-assembly.sh
TESTS_ENVIRONMENT= CC="${CC}" CFLAGS="${TESTSUITE_CFLAGS} ${CFLAGS} -Wno-error=unused-variable" CXXFLAGS="${CXXFLAGS}" srcdir=${srcdir} top_srcdir=${top_srcdir} top_builddir=${top_builddir} ${srcdir}/check-assembly.sh

TESTS = check-*.c
TESTS = ${srcdir}/check-src/check-*.c
if TEST_64BIT
TESTS += check64-*.c
TESTS += ${srcdir}/check-src/check64-*.c
endif

EXTRA_DIST = \
check-*.c* \
check-src/ \
data-62 \
data-70 \
data-119 \
Expand Down
15 changes: 8 additions & 7 deletions asn1c/tests/Makefile.in
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ PRE_UNINSTALL = :
POST_UNINSTALL = :
build_triplet = @build@
host_triplet = @host@
@TEST_64BIT_TRUE@am__append_1 = check64-*.c
@TEST_64BIT_TRUE@am__append_1 = ${srcdir}/check-src/check64-*.c
subdir = asn1c/tests
DIST_COMMON = README $(dist_check_SCRIPTS) $(srcdir)/Makefile.am \
$(srcdir)/Makefile.in
Expand Down Expand Up @@ -95,6 +95,7 @@ LIBTOOL = @LIBTOOL@
LIPO = @LIPO@
LN_S = @LN_S@
LTLIBOBJS = @LTLIBOBJS@
MAINT = @MAINT@
MAKEINFO = @MAKEINFO@
MANIFEST_TOOL = @MANIFEST_TOOL@
MKDIR_P = @MKDIR_P@
Expand Down Expand Up @@ -174,10 +175,10 @@ top_build_prefix = @top_build_prefix@
top_builddir = @top_builddir@
top_srcdir = @top_srcdir@
dist_check_SCRIPTS = check-assembly.sh
TESTS_ENVIRONMENT = CC="${CC}" CFLAGS="${TESTSUITE_CFLAGS} ${CFLAGS} -Wno-error=unused-variable" CXXFLAGS="${CXXFLAGS}" ./check-assembly.sh
TESTS = check-*.c $(am__append_1)
TESTS_ENVIRONMENT = CC="${CC}" CFLAGS="${TESTSUITE_CFLAGS} ${CFLAGS} -Wno-error=unused-variable" CXXFLAGS="${CXXFLAGS}" srcdir=${srcdir} top_srcdir=${top_srcdir} top_builddir=${top_builddir} ${srcdir}/check-assembly.sh
TESTS = ${srcdir}/check-src/check-*.c $(am__append_1)
EXTRA_DIST = \
check-*.c* \
check-src/ \
data-62 \
data-70 \
data-119 \
Expand All @@ -186,7 +187,7 @@ EXTRA_DIST = \
all: all-am

.SUFFIXES:
$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps)
$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps)
@for dep in $?; do \
case '$(am__configure_deps)' in \
*$$dep*) \
Expand All @@ -211,9 +212,9 @@ Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh

$(top_srcdir)/configure: $(am__configure_deps)
$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps)
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
$(ACLOCAL_M4): $(am__aclocal_m4_deps)
$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps)
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
$(am__aclocal_m4_deps):

Expand Down
37 changes: 20 additions & 17 deletions asn1c/tests/check-assembly.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,15 @@ if [ "x$1" = "x" ]; then
exit
fi

set -o pipefail
set -e

# Compute the .asn1 spec name by the given file name.
source=`echo "$1" | sed -e 's/.*\///'`
testno=`echo "$source" | cut -f2 -d'-' | cut -f1 -d'.'`
source_full=$1
source_short=`echo "$source_full" | sed -e 's/.*\///'`
testno=`echo "$source_short" | cut -f2 -d'-' | cut -f1 -d'.'`

args=`echo "$source" | sed -e 's/\.c[c]*$//'`
args=`echo "$source_short" | sed -e 's/\.c[c]*$//'`
testdir=test-${args}

OFS=$IFS
Expand All @@ -24,35 +28,35 @@ shift
IFS=$OFS
AFLAGS="$@"

touch ${testdir}-FAILED # Create this file to ease post mortem analysis
# Assume the test fails. Will be removed when it passes well.
touch ${testdir}-FAILED

if [ ! -d $testdir ]; then
mkdir $testdir || exit $?
fi
cd $testdir || exit $?
rm -f ./$source 2>/dev/null
ln -fns ../$source || exit $?
mkdir -p $testdir
cd $testdir
rm -f $source_short
ln -fns ../$source_full

asn_module=`echo ../../../tests/${testno}-*.asn1`
asn_module=`echo ../${top_srcdir}/tests/${testno}-*.asn1`

# Create a Makefile for the project.
cat > Makefile <<EOM
# This file is autogenerated by ../$0
COMMON_FLAGS= -I. -DEMIT_ASN_DEBUG
CFLAGS = \${COMMON_FLAGS} ${CFLAGS} -g -O0
CPPFLAGS = -DSRCDIR=../${srcdir}
CXXFLAGS = \${COMMON_FLAGS} ${CXXFLAGS}
CC ?= ${CC}
all: check-executable
check-executable: compiled-module *.c*
@rm -f *.core
\$(CC) \$(CFLAGS) -o check-executable *.c* -lm
\$(CC) \$(CPPFLAGS) \$(CFLAGS) -o check-executable *.c* -lm
# Compile the corresponding .asn1 spec.
compiled-module: ${asn_module} ../../asn1c
../../asn1c -S ../../../skeletons -Wdebug-compiler \\
compiled-module: ${asn_module} ../${top_builddir}/asn1c/asn1c
../${top_builddir}/asn1c/asn1c -S ../${top_srcdir}/skeletons -Wdebug-compiler \\
${AFLAGS} ${asn_module}
rm -f converter-sample.c
@touch compiled-module
Expand All @@ -69,8 +73,7 @@ clean:
EOM

# Perform building and checking
make check || exit $?
make check

# Make sure the test is not marked as failed any longer.
rm -f ../${testdir}-FAILED

exit 0
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,14 @@

#include <PDU.h>

#ifndef SRCDIR
#define SRCDIR_S ".."
#else
#define STRINGIFY_MACRO2(x) #x
#define STRINGIFY_MACRO(x) STRINGIFY_MACRO2(x)
#define SRCDIR_S STRINGIFY_MACRO(SRCDIR)
#endif

enum expectation {
EXP_OK, /* Encoding/decoding must succeed */
EXP_CXER_EXACT, /* Encoding/decoding using CXER must be exact */
Expand Down Expand Up @@ -311,7 +319,7 @@ process(const char *fname) {

fprintf(stderr, "\nProcessing file [../%s]\n", fname);

snprintf((char *)fbuf, sizeof(fbuf), "../data-119/%s", fname);
snprintf((char *)fbuf, sizeof(fbuf), SRCDIR_S "/data-119/%s", fname);
fp = fopen((char *)fbuf, "r");
assert(fp);

Expand Down Expand Up @@ -341,7 +349,7 @@ main() {
return 0;
}

dir = opendir("../data-119");
dir = opendir(SRCDIR_S "/data-119");
assert(dir);

/*
Expand Down
Loading

0 comments on commit e0d321a

Please sign in to comment.