enable-disable.m4 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. # ARG_ENABL_SET(option, help)
  2. # ---------------------------
  3. # Create a --enable-$1 option with helptext, set a variable $1 to true/false
  4. # All $1 are collected in the variable $disabled_by_default
  5. AC_DEFUN([ARG_ENABL_SET],
  6. [AC_ARG_ENABLE(
  7. [$1],
  8. AS_HELP_STRING([--enable-$1], [$2]),
  9. [patsubst([$1], [-], [_])_given=true
  10. if test x$enableval = xyes; then
  11. patsubst([$1], [-], [_])=true
  12. else
  13. patsubst([$1], [-], [_])=false
  14. fi],
  15. [patsubst([$1], [-], [_])=false
  16. patsubst([$1], [-], [_])_given=false]
  17. )
  18. disabled_by_default=${disabled_by_default}" patsubst([$1], [-], [_])"]
  19. )
  20. # ARG_DISBL_SET(option, help)
  21. # ---------------------------
  22. # Create a --disable-$1 option with helptext, set a variable $1 to true/false
  23. # All $1 are collected in the variable $enabled_by_default
  24. AC_DEFUN([ARG_DISBL_SET],
  25. [AC_ARG_ENABLE(
  26. [$1],
  27. AS_HELP_STRING([--disable-$1], [$2]),
  28. [patsubst([$1], [-], [_])_given=true
  29. if test x$enableval = xyes; then
  30. patsubst([$1], [-], [_])=true
  31. else
  32. patsubst([$1], [-], [_])=false
  33. fi],
  34. [patsubst([$1], [-], [_])=true
  35. patsubst([$1], [-], [_])_given=false]
  36. )
  37. enabled_by_default=${enabled_by_default}" patsubst([$1], [-], [_])"]
  38. )