CheckSystemAndBasicDependencies.m4 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109
  1. AC_CANONICAL_HOST
  2. os_win32=no
  3. os_linux=no
  4. os_freebsd=no
  5. os_gnu=no
  6. case "$host_os" in
  7. mingw*)
  8. os_win32=yes
  9. ;;
  10. freebsd*)
  11. os_freebsd=yes
  12. ;;
  13. linux*)
  14. os_linux=yes
  15. os_gnu=yes
  16. ;;
  17. darwin*)
  18. os_darwin=yes
  19. ;;
  20. gnu*|k*bsd*-gnu*)
  21. os_gnu=yes
  22. ;;
  23. esac
  24. AC_PATH_PROG(PERL, perl)
  25. if test -z "$PERL"; then
  26. AC_MSG_ERROR([You need 'perl' to compile WebKit])
  27. fi
  28. AC_PATH_PROG(PYTHON, python)
  29. if test -z "$PYTHON"; then
  30. AC_MSG_ERROR([You need 'python' to compile WebKit])
  31. fi
  32. AC_PATH_PROG(RUBY, ruby)
  33. if test -z "$RUBY"; then
  34. AC_MSG_ERROR([You need 'ruby' to compile WebKit])
  35. fi
  36. AC_PATH_PROG(BISON, bison)
  37. if test -z "$BISON"; then
  38. AC_MSG_ERROR([You need the 'bison' parser generator to compile WebKit])
  39. fi
  40. AC_PATH_PROG(MV, mv)
  41. if test -z "$MV"; then
  42. AC_MSG_ERROR([You need 'mv' to compile WebKit])
  43. fi
  44. AC_PATH_PROG(GPERF, gperf)
  45. if test -z "$GPERF"; then
  46. AC_MSG_ERROR([You need the 'gperf' hash function generator to compile WebKit])
  47. fi
  48. AC_PATH_PROG(FLEX, flex)
  49. if test -z "$FLEX"; then
  50. AC_MSG_ERROR([You need the 'flex' lexer generator to compile WebKit])
  51. else
  52. FLEX_VERSION=`$FLEX --version | sed 's,.*\ \([0-9]*\.[0-9]*\.[0-9]*\)$,\1,'`
  53. AX_COMPARE_VERSION([2.5.33],[gt],[$FLEX_VERSION],
  54. AC_MSG_WARN([You need at least version 2.5.33 of the 'flex' lexer generator to compile WebKit correctly]))
  55. fi
  56. # If CFLAGS and CXXFLAGS are unset, default to empty.
  57. # This is to tell automake not to include '-g' if C{XX,}FLAGS is not set.
  58. # For more info - http://www.gnu.org/software/automake/manual/autoconf.html#C_002b_002b-Compiler
  59. if test -z "$CXXFLAGS"; then
  60. CXXFLAGS=""
  61. fi
  62. if test -z "$CFLAGS"; then
  63. CFLAGS=""
  64. fi
  65. AC_PROG_CC
  66. AC_PROG_CXX
  67. AC_PROG_INSTALL
  68. AC_SYS_LARGEFILE
  69. # Check that an appropriate C compiler is available.
  70. AC_LANG_PUSH([C])
  71. AC_COMPILE_IFELSE([AC_LANG_PROGRAM([
  72. #if !(defined(__GNUC__) && !defined(__clang__) && !defined(__INTEL_COMPILER) && __GNUC__ >= 4 && __GNUC_MINOR__ >= 7) \
  73. && !(defined(__clang__) && __clang_major__ >= 3 && __clang_minor__ >= 0)
  74. #error Unsupported compiler
  75. #endif
  76. ],[])],[],[AC_MSG_ERROR([Compiler GCC >= 4.7 or Clang >= 3.0 is required for C compilation])])
  77. AC_LANG_POP([C])
  78. # Check that an appropriate C++ compiler is available.
  79. AC_LANG_PUSH([C++])
  80. AC_COMPILE_IFELSE([AC_LANG_PROGRAM([
  81. #if !(defined(__GNUG__) && defined(__GNUC__) && !defined(__clang__) && !defined(__INTEL_COMPILER) && __GNUC__ >= 4 && __GNUC_MINOR__ >= 7) \
  82. && !(defined(__clang__) && __clang_major__ >= 3 && __clang_minor__ >= 0)
  83. #error Unsupported compiler
  84. #endif
  85. ],[])],[],[AC_MSG_ERROR([Compiler GCC >= 4.7 or Clang >= 3.0 is required for C++ compilation])])
  86. AC_LANG_POP([C++])
  87. # C/C++ Language Features
  88. AC_C_CONST
  89. AC_C_INLINE
  90. AC_C_VOLATILE
  91. # C/C++ Headers
  92. AC_HEADER_STDC
  93. AC_HEADER_STDBOOL