wolfssl_darwin_clang.m4 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637
  1. # ===========================================================================
  2. #
  3. # SYNOPSIS
  4. #
  5. # WOLFSSL_DARWIN_USING_CLANG
  6. #
  7. # DESCRIPTION
  8. #
  9. # With the advent of Apple Xcode v5.0, the old tool sets are missing from
  10. # the distribution. The provided "gcc" executable wrapper accepts the
  11. # "-pthread" flag, and passes it to the underlying "clang" which chokes
  12. # on it. This script checks the version of the gcc executable to see if
  13. # it reports it is really "clang".
  14. #
  15. # The value is placed in the wolfssl_darwin_clang variable.
  16. #
  17. # LICENSE
  18. #
  19. # Copyright (c) 2013 John Safranek <john@wolfssl.com>
  20. #
  21. # Copying and distribution of this file, with or without modification, are
  22. # permitted in any medium without royalty provided the copyright notice
  23. # and this notice are preserved. This file is offered as-is, without any
  24. # warranty.
  25. #serial 1
  26. AC_DEFUN([WOLFSSL_DARWIN_USING_CLANG],
  27. [
  28. if test x"$CC" = xclang; then
  29. wolfssl_darwin_clang=yes
  30. elif test x"$CC" = x || test x"$CC" = xgcc; then
  31. if /usr/bin/gcc -v 2>&1 | grep 'clang' >/dev/null 2>&1; then
  32. wolfssl_darwin_clang=yes
  33. fi
  34. fi
  35. ])