configure.ac 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108
  1. AC_INIT([cpuminer], [1.0])
  2. AC_PREREQ(2.52)
  3. AC_CANONICAL_SYSTEM
  4. AC_CONFIG_SRCDIR([cpu-miner.c])
  5. AM_INIT_AUTOMAKE([gnu])
  6. AC_CONFIG_HEADERS([cpuminer-config.h])
  7. dnl Make sure anyone changing configure.ac/Makefile.am has a clue
  8. AM_MAINTAINER_MODE
  9. dnl Checks for programs
  10. AC_PROG_CC
  11. AC_PROG_GCC_TRADITIONAL
  12. AM_PROG_CC_C_O
  13. AC_PROG_RANLIB
  14. dnl Checks for header files.
  15. AC_HEADER_STDC
  16. AC_CHECK_HEADERS(syslog.h)
  17. AC_FUNC_ALLOCA
  18. case $target in
  19. *-*-mingw*)
  20. have_x86_64=false
  21. have_win32=true
  22. PTHREAD_FLAGS=""
  23. ;;
  24. x86_64-*)
  25. have_x86_64=true
  26. have_win32=false
  27. PTHREAD_FLAGS="-pthread"
  28. ;;
  29. *)
  30. have_x86_64=false
  31. have_win32=false
  32. PTHREAD_FLAGS="-pthread"
  33. ;;
  34. esac
  35. AC_CHECK_LIB(jansson, json_loads, request_jansson=false, request_jansson=true)
  36. AC_CHECK_LIB(pthread, pthread_create, PTHREAD_LIBS=-lpthread)
  37. AM_CONDITIONAL([WANT_JANSSON], [test x$request_jansson = xtrue])
  38. AM_CONDITIONAL([HAVE_WINDOWS], [test x$have_win32 = xtrue])
  39. AM_CONDITIONAL([HAVE_x86_64], [test x$have_x86_64 = xtrue])
  40. if test x$request_jansson = xtrue
  41. then
  42. JANSSON_LIBS="compat/jansson/libjansson.a"
  43. else
  44. JANSSON_LIBS=-ljansson
  45. fi
  46. dnl Find YASM
  47. has_yasm=false
  48. AC_PATH_PROG(YASM,[yasm],[true yasm])
  49. if test "$YASM" = "false" ; then
  50. AC_MSG_WARN([yasm is required for the x86_64 SSE2 code, but it was not found])
  51. else
  52. AC_MSG_CHECKING([if yasm version is greater than 1.0.1])
  53. yasmver=`yasm --version | head -1 | cut -d\ -f2`
  54. yamajor=`echo $yasmver | cut -d. -f1`
  55. yaminor=`echo $yasmver | cut -d. -f2`
  56. yamini=`echo $yasmver | cut -d. -f3`
  57. if test "$yamajor" -ge "1" ; then
  58. if test "$yamajor" -eq "1" ; then
  59. if test "$yaminor" -ge "0" ; then
  60. if test "$yaminor" -eq "0"; then
  61. if test "$yamini" -ge "1"; then
  62. has_yasm=true
  63. fi
  64. else
  65. has_yasm=true
  66. fi
  67. fi
  68. fi
  69. else
  70. has_yasm=false
  71. fi
  72. fi
  73. if test "x$has_yasm" == "xtrue" ; then
  74. AC_MSG_RESULT([yes])
  75. else
  76. AC_MSG_RESULT([no])
  77. fi
  78. AM_CONDITIONAL([HAS_YASM], [test x$has_yasm = xtrue])
  79. PKG_PROG_PKG_CONFIG()
  80. LIBCURL_CHECK_CONFIG(, 7.10.1, ,
  81. [AC_MSG_ERROR([Missing required libcurl >= 7.10.1])])
  82. AC_SUBST(JANSSON_LIBS)
  83. AC_SUBST(PTHREAD_FLAGS)
  84. AC_SUBST(PTHREAD_LIBS)
  85. AC_CONFIG_FILES([
  86. Makefile
  87. compat/Makefile
  88. compat/jansson/Makefile
  89. x86_64/Makefile
  90. ])
  91. AC_OUTPUT