aboutsummaryrefslogtreecommitdiff
path: root/sim/common/aclocal.m4
diff options
context:
space:
mode:
Diffstat (limited to 'sim/common/aclocal.m4')
-rw-r--r--sim/common/aclocal.m434
1 files changed, 25 insertions, 9 deletions
diff --git a/sim/common/aclocal.m4 b/sim/common/aclocal.m4
index d3e6843..d05e8f8 100644
--- a/sim/common/aclocal.m4
+++ b/sim/common/aclocal.m4
@@ -211,13 +211,12 @@ dnl and SIM_AC_OUTPUT lines.
dnl Specify the alignment restrictions of the target architecture.
-dnl Without this option all possible alignment restrictions are accomidated.
+dnl Without this option all possible alignment restrictions are accommodated.
dnl arg[1] is hardwired target alignment
dnl arg[2] is default target alignment
AC_DEFUN(SIM_AC_OPTION_ALIGNMENT,
-wire_alignment="ifelse([$2],,ifelse([$1],,,[$1]),[$2])"
-default_alignment="ifelse([$2],,ifelse([$1],,,[$1]),[$2])"
-default_sim_alignment="ifelse([$1],,ifelse([$2],,,-DWITH_DEFAULT_ALIGNMENT=[$2]),-DWITH_ALIGNMENT=[$1])"
+wire_alignment="[$1]"
+default_alignment="[$2]"
[
AC_ARG_ENABLE(sim-alignment,
[ --enable-sim-alignment=align Specify strict, nonstrict or forced alignment of memory accesses.],
@@ -228,20 +227,37 @@ AC_ARG_ENABLE(sim-alignment,
yes) if test x"$wire_alignment" != x; then
sim_alignment="-DWITH_ALIGNMENT=${wire_alignment}"
else
- echo "No hard-wired alignment for target $target" 1>&6
- sim_alignment="-DWITH_ALIGNMENT=0"
+ if test x"$default_alignment" != x; then
+ sim_alignment="-DWITH_ALIGNMENT=${default_alignment}"
+ else
+ echo "No hard-wired alignment for target $target" 1>&6
+ sim_alignment="-DWITH_ALIGNMENT=0"
+ fi
fi;;
no) if test x"$default_alignment" != x; then
sim_alignment="-DWITH_DEFAULT_ALIGNMENT=${default_alignment}"
else
- echo "No default alignment for target $target" 1>&6
- sim_alignment="-DWITH_DEFAULT_ALIGNMENT=0"
+ if test x"$wire_alignment" != x; then
+ sim_alignment="-DWITH_DEFAULT_ALIGNMENT=${wire_alignment}"
+ else
+ echo "No default alignment for target $target" 1>&6
+ sim_alignment="-DWITH_DEFAULT_ALIGNMENT=0"
+ fi
fi;;
*) AC_MSG_ERROR("Unknown value $enableval passed to --enable-sim-alignment"); sim_alignment="";;
esac
if test x"$silent" != x"yes" && test x"$sim_alignment" != x""; then
echo "Setting alignment flags = $sim_alignment" 6>&1
-fi],[sim_alignment="${default_sim_alignment}"])dnl
+fi],
+[if test x"$default_alignment" != x; then
+ sim_alignment="-DWITH_DEFAULT_ALIGNMENT=${default_alignment}"
+else
+ if test x"$wire_alignment" != x; then
+ sim_alignment="-DWITH_ALIGNMENT=${wire_alignment}"
+ else
+ sim_alignment=
+ fi
+fi])dnl
AC_SUBST(sim_alignment)
])dnl