Dmitry V. Levin
5cb45b25a3
Avoid duplicate definitions of xlat structures in files compiled in mpers mode. Each xlat file defines the corresponding xlat struct with either global or local visibility using the following rules: - if xlat struct declaration is available in defs.h, a global definition is provided in regular mode, and nothing is provided in mpers mode; - otherwise, if xlat file is included by a mpers source file, a global definition is provided in regular mode (unless no mpers mode is supported on this architecture, in that case, a local definition is provided instead), and a declaration is provided in mpers mode; - otherwise, a local definition is provided in regular mode, and an error message is printed in mpers mode. Fallback definitions of constants provided by xlat files remain available in all modes. * bootstrap: Invoke generate_mpers_am.sh before xlat/gen.sh. * defs.h (adjtimex_modes, adjtimex_status, sigev_value): Remove. * generate_mpers_am.sh: Generate mpers_xlat.h. * Makefile.am (EXTRA_DIST): Add mpers_xlat.h. * print_sigevent.c: Include "xlat/sigev_value.h" unconditionally. * print_timex.c: Include "xlat/adjtimex_modes.h" and "xlat/adjtimex_status.h" unconditionally. * xlat/gen.sh (cond_xlat): Move printing of fallback definitions ... (cond_def): ... here. (gen_header): Check also mpers_xlat.h for global declarations of xlat structures. Process input file twice, first time print directives only, second time print everything. Wrap struct xlat into #ifdef IN_MPERS ... #else ... #endif. * xlat/getrandom_flags.in: Cleanup.
21 lines
342 B
Bash
Executable File
21 lines
342 B
Bash
Executable File
#!/bin/sh -eu
|
|
|
|
for m in -m32 -mx32; do
|
|
tests=tests$m
|
|
rm -rf $tests
|
|
mkdir $tests
|
|
sed "s/^AM_CFLAGS[[:space:]]*=.*/& $m/" \
|
|
tests/Makefile.am > $tests/Makefile.am
|
|
for f in tests/*; do
|
|
case "${f##*/}" in
|
|
Makefile*) continue;;
|
|
esac
|
|
ln -s ../"$f" $tests/
|
|
done
|
|
done
|
|
|
|
./generate_mpers_am.sh
|
|
./xlat/gen.sh
|
|
|
|
exec autoreconf -f -i "$@"
|