cond-if.m4 1.0 KB

123456789101112131415161718192021222324252627282930313233343536
  1. # AM_COND_IF -*- Autoconf -*-
  2. # Copyright (C) 2008-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_COND_IF
  8. # _AM_COND_ELSE
  9. # _AM_COND_ENDIF
  10. # --------------
  11. # These macros are only used for tracing.
  12. m4_define([_AM_COND_IF])
  13. m4_define([_AM_COND_ELSE])
  14. m4_define([_AM_COND_ENDIF])
  15. # AM_COND_IF(COND, [IF-TRUE], [IF-FALSE])
  16. # ---------------------------------------
  17. # If the shell condition COND is true, execute IF-TRUE, otherwise execute
  18. # IF-FALSE. Allow automake to learn about conditional instantiating macros
  19. # (the AC_CONFIG_FOOS).
  20. AC_DEFUN([AM_COND_IF],
  21. [m4_ifndef([_AM_COND_VALUE_$1],
  22. [m4_fatal([$0: no such condition "$1"])])dnl
  23. _AM_COND_IF([$1])dnl
  24. if test -z "$$1_TRUE"; then :
  25. m4_n([$2])[]dnl
  26. m4_ifval([$3],
  27. [_AM_COND_ELSE([$1])dnl
  28. else
  29. $3
  30. ])dnl
  31. _AM_COND_ENDIF([$1])dnl
  32. fi[]dnl
  33. ])