5. Using changequote

AC_ARG_ENABLE(max-num-stacks,
[  --enable-max-num-stacks[=stacks num] Set the maximal number of Stacks],
[ if   test "x$enableval" = "x" ; then
     max_num_stacks=8
  else
      changequote(, )
      # Check if it's indeed a number
      if echo "0$enableval" | grep '[^0-9]' > /dev/null ; then
          echo
          echo "Error!"
          echo "max-num-stacks should be a number!"
          exit -1
      elif expr $enableval \< 8 > /dev/null ; then
          echo
          echo "Error!"
          echo "max-num-stacks cannot be lower than 8"
          exit -1
      elif expr $enableval \> 20 > /dev/null ; then
          echo
          echo "Error!"
          echo "max-num-stacks cannot be greater than 20"
          exit -1
      else
          max_num_stacks="$enableval"
      fi
      changequote([, ])
  fi])

Written by Shlomi Fish