cond.m4 1.0 KB

1234567891011121314151617181920212223242526272829303132
  1. # AM_CONDITIONAL -*- Autoconf -*-
  2. # Copyright (C) 1997-2017 Free Software Foundation, Inc.
  3. #
  4. # This file is free software; the Free Software Foundation
  5. # gives unlimited permission to copy and/or distribute it,
  6. # with or without modifications, as long as this notice is preserved.
  7. # AM_CONDITIONAL(NAME, SHELL-CONDITION)
  8. # -------------------------------------
  9. # Define a conditional.
  10. AC_DEFUN([AM_CONDITIONAL],
  11. [AC_PREREQ([2.52])dnl
  12. m4_if([$1], [TRUE], [AC_FATAL([$0: invalid condition: $1])],
  13. [$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl
  14. AC_SUBST([$1_TRUE])dnl
  15. AC_SUBST([$1_FALSE])dnl
  16. _AM_SUBST_NOTMAKE([$1_TRUE])dnl
  17. _AM_SUBST_NOTMAKE([$1_FALSE])dnl
  18. m4_define([_AM_COND_VALUE_$1], [$2])dnl
  19. if $2; then
  20. $1_TRUE=
  21. $1_FALSE='#'
  22. else
  23. $1_TRUE='#'
  24. $1_FALSE=
  25. fi
  26. AC_CONFIG_COMMANDS_PRE(
  27. [if test -z "${$1_TRUE}" && test -z "${$1_FALSE}"; then
  28. AC_MSG_ERROR([[conditional "$1" was never defined.
  29. Usually this means the macro was only invoked conditionally.]])
  30. fi])])