mpers: add MPERS_IS_* to CFLAGS passed to mpers.sh

This allows testing of MPERS_IS_* macros in pre-MPERS_DEFS parts
of source code.

* Makefile.am (mpers-m%.stamp): Add -DMPERS_IS_$(mpers_NAME) to CFLAGS
passed to mpers.sh.
* mpers_test.sh: Likewise.
This commit is contained in:
Дмитрий Левин 2016-08-23 14:27:19 +00:00
parent 1aae061d4d
commit a27c47b2c4
2 changed files with 2 additions and 2 deletions

View File

@ -774,7 +774,7 @@ libmpers_CFLAGS = $(strace_CFLAGS)
mpers-m%.stamp: $(srcdir_mpers_source_files) | printers.h
for f in $^; do \
CC="$(CC)" CFLAGS="$(mpers_sh_opts)" \
CC="$(CC)" CFLAGS="$(mpers_sh_opts) -DMPERS_IS_$(mpers_NAME)" \
CPP="$(CPP)" CPPFLAGS="$(mpers_sh_opts) -DIN_MPERS -DMPERS_IS_$(mpers_NAME)" \
$(srcdir)/mpers.sh -$(mpers_NAME) $$f || exit; \
done

View File

@ -121,7 +121,7 @@ int16_t f[0];
#define MPERS_${mpers_name}_sample_struct ${mpers_name}_sample_struct
EOF
CFLAGS="$CPPFLAGS -I${srcdir}" \
CFLAGS="$CPPFLAGS -I${srcdir} -DMPERS_IS_${mpers_name}" \
CPPFLAGS="$CPPFLAGS -I${srcdir} -DIN_MPERS -DMPERS_IS_${mpers_name}" \
"$mpers_sh" "-$mpers_name" "$sample"
cmp "$expected" "$mpers_dir"/sample_struct.h > /dev/null