diff options
author | Mike Frysinger <vapier@gentoo.org> | 2013-03-26 18:00:04 +0000 |
---|---|---|
committer | Mike Frysinger <vapier@gentoo.org> | 2013-03-26 18:00:04 +0000 |
commit | 1517bd274290e06af498ef7e496519e4bbc4d5e6 (patch) | |
tree | d946b54ed6d438ea64f47b15e44c56f0a8bd55fe /sim/common | |
parent | 1fb2e2b56901690331720448836755a4eee944c7 (diff) | |
download | gdb-1517bd274290e06af498ef7e496519e4bbc4d5e6.zip gdb-1517bd274290e06af498ef7e496519e4bbc4d5e6.tar.gz gdb-1517bd274290e06af498ef7e496519e4bbc4d5e6.tar.bz2 |
sim: rewrite SIM_AC_OPTION_HARDWARE a bit to simplify things
There's no need to put the majority of the logic into the 3rd arg of the
AC_ARG_ENABLE. Coupled with the lack of indentation, it makes it hard to
follow, error prone to update, and duplicates code (with the 4th arg).
So pull the logic out of the 3rd arg and outside of the AC_ARG_ENABLE
macro. This allows us to gut the 4th arg entirely, merge with the code
that followed the macro, and fix bugs related to the new dv-sockser in
the process.
Hopefully building the various sims with the default sim-hardware
settings, as well as with explicit --{dis,en}able-sim-hardware flags,
should all just work now.
Diffstat (limited to 'sim/common')
-rw-r--r-- | sim/common/ChangeLog | 4 | ||||
-rw-r--r-- | sim/common/acinclude.m4 | 48 |
2 files changed, 26 insertions, 26 deletions
diff --git a/sim/common/ChangeLog b/sim/common/ChangeLog index 9daab66..3056cce 100644 --- a/sim/common/ChangeLog +++ b/sim/common/ChangeLog @@ -1,3 +1,7 @@ +2013-03-26 Mike Frysinger <vapier@gentoo.org> + + * acinclude.m4: Regenerate. + 2013-03-23 Joel Sherrill <joel.sherrill@oarcorp.com> * acinclude.m4: Add SIM_DV_SOCKSER_O which is empty on hosts diff --git a/sim/common/acinclude.m4 b/sim/common/acinclude.m4 index 7f98903..73191f2 100644 --- a/sim/common/acinclude.m4 +++ b/sim/common/acinclude.m4 @@ -609,30 +609,38 @@ dnl arg[3] is a space separated list of extra target specific devices. AC_DEFUN([SIM_AC_OPTION_HARDWARE], [ if test x"[$1]" != x"no"; then - sim_hw_p=yes + enable_sim_hardware=yes else - sim_hw_p=no + enable_sim_hardware=no fi + if test "[$2]"; then hardware="[$2]" else hardware="cfi core pal glue" fi hardware="$hardware [$3]" + sim_hw_cflags="-DWITH_HW=1" sim_hw="$hardware" sim_hw_objs="\$(SIM_COMMON_HW_OBJS) `echo $sim_hw | sed -e 's/\([[^ ]][[^ ]]*\)/dv-\1.o/g'`" + AC_ARG_ENABLE(sim-hardware, -[ --enable-sim-hardware=LIST Specify the hardware to be included in the build.], -[ -case "${enableval}" in - yes) sim_hw_p=yes;; - no) sim_hw_p=no;; + [AS_HELP_STRING([--enable-sim-hardware=LIST], + [Specify the hardware to be included in the build.])]) +case ${enable_sim_hardware} in + yes) sim_hw_p=yes;; + no) sim_hw_p=no;; ,*) sim_hw_p=yes; hardware="${hardware} `echo ${enableval} | sed -e 's/,/ /'`";; *,) sim_hw_p=yes; hardware="`echo ${enableval} | sed -e 's/,/ /'` ${hardware}";; - *) sim_hw_p=yes; hardware="`echo ${enableval} | sed -e 's/,/ /'`"'';; + *) sim_hw_p=yes; hardware="`echo ${enableval} | sed -e 's/,/ /'`"'';; esac + if test "$sim_hw_p" != yes; then + if test "[$1]" = "always"; then + AC_MSG_ERROR([Sorry, but this simulator requires that hardware support +be enabled. Please configure without --disable-hw-support.]) + fi sim_hw_objs= sim_hw_cflags="-DWITH_HW=0" sim_hw= @@ -657,26 +665,14 @@ else ;; esac AC_SUBST(SIM_DV_SOCKSER_O) -fi -if test x"$silent" != x"yes" && test "$sim_hw_p" = "yes"; then - echo "Setting hardware to $sim_hw_cflags, $sim_hw, $sim_hw_objs" -fi],[ -if test "$sim_hw_p" != yes; then - if test "[$1]" = "always"; then - AC_MSG_ERROR([Sorry, but this simulator requires that hardware support -be enabled. Please configure without --disable-hw-support.]) + if test x"$silent" != x"yes"; then + echo "Setting hardware to $sim_hw_cflags, $sim_hw, $sim_hw_objs" fi - sim_hw_objs= - sim_hw_cflags="-DWITH_HW=0" - sim_hw= + dnl Some devices require extra libraries. + case " $hardware " in + *" cfi "*) AC_CHECK_LIB(m, log2);; + esac fi -if test x"$silent" != x"yes"; then - echo "Setting hardware to $sim_hw_cflags, $sim_hw, $sim_hw_objs" -fi]) -dnl Some devices require extra libraries. -case " $hardware " in - *" cfi "*) AC_CHECK_LIB(m, log2);; -esac ]) AC_SUBST(sim_hw_cflags) AC_SUBST(sim_hw_objs) |