apple-target.m4 970 B

12345678910111213141516171819202122232425262728293031323334353637383940
  1. # Usage:
  2. # AC_MONO_APPLE_TARGET(target-name, action-if-found, action-if-not-found)
  3. #
  4. # Checks whether `target-name` is defined in "TargetConditionals.h"
  5. #
  6. AC_DEFUN([AC_MONO_APPLE_TARGET], [
  7. AC_MONO_APPLE_AVAILABLE([$1], [for $1], [$1 == 1], $2, $3)
  8. ])
  9. # Usage:
  10. # AC_MONO_APPLE_AVAILABLE(name, message, conditional, action-if-found, action-if-not-found)
  11. #
  12. # Checks for `conditional` using "TargetConditionals.h" and "AvailabilityMacros.h"
  13. #
  14. AC_DEFUN([AC_MONO_APPLE_AVAILABLE], [
  15. # cache the compilation check
  16. AC_CACHE_CHECK([$2], [ac_cv_apple_available_[]$1], [
  17. AC_TRY_COMPILE([
  18. #include "TargetConditionals.h"
  19. #include "AvailabilityMacros.h"
  20. ],[
  21. #if !($3)
  22. #error failed
  23. #endif
  24. ], [
  25. ac_cv_apple_available_[]$1=yes
  26. ], [
  27. ac_cv_apple_available_[]$1=no
  28. ])
  29. ])
  30. # keep the actions out of the cache check because they need to be always executed.
  31. if test x$ac_cv_apple_available_[]$1 = xyes; then
  32. $1=yes
  33. [$4]
  34. else
  35. $1=no
  36. [$5]
  37. fi
  38. ])