I can put fragment 1 in configure.in to get "#define COLOR_SUPPORT 1" or
"#define COLOR_SUPPORT 0" into config.h.  However, I'd much rather have   
"#define COLOR_SUPPORT" or no #define to decide if color will be
supported.  To me, fragment 2 looks like it would do the trick, however   
COLOR_SUPPORT will always be defined in some way.  I can't remove the
define from acconfig.h or else autoheader will complain and COLOR_SUPPORT 
won't be defined even if I want it so.  I've seen this sort of thing done
properly in other programs, but I can't figure out how to get it to work
here.


--(fragment 1)--

AC_ARG_ENABLE(color,
[  --disable-color    no color],
[case "${enableval}" in
 yes) color=1 ;;
  no) color=0 ;;
   *) AC_MSG_ERROR(bad value ${enableval} for --disable-color) ;;
esac],
[color=1])
AC_DEFINE_UNQUOTED(COLOR_SUPPORT,       ${color})


--(fragment 2)--

AC_ARG_ENABLE(color,
[  --disable-color   no color], 
[if test "${enableval}" = "no" ; then
  AC_DEFINE(COLOR_SUPPORT)
fi


Reply via email to