configure.ac 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111
  1. AC_INIT([cpuminer], [1.0.2])
  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(OpenCL, clSetKernelArg, OPENCL_LIBS=-lOpenCL)
  36. AC_CHECK_LIB(jansson, json_loads, request_jansson=false, request_jansson=true)
  37. AC_CHECK_LIB(pthread, pthread_create, PTHREAD_LIBS=-lpthread)
  38. AM_CONDITIONAL([WANT_JANSSON], [test x$request_jansson = xtrue])
  39. AM_CONDITIONAL([HAVE_WINDOWS], [test x$have_win32 = xtrue])
  40. AM_CONDITIONAL([HAVE_x86_64], [test x$have_x86_64 = xtrue])
  41. if test x$request_jansson = xtrue
  42. then
  43. JANSSON_LIBS="compat/jansson/libjansson.a"
  44. else
  45. JANSSON_LIBS=-ljansson
  46. fi
  47. dnl Find YASM
  48. has_yasm=false
  49. AC_PATH_PROG([YASM],[yasm],[false])
  50. if test "x$YASM" != "xfalse" ; then
  51. AC_MSG_CHECKING([if yasm version is greater than 1.0.1])
  52. yasmver=`yasm --version | head -1 | cut -d\ -f2`
  53. yamajor=`echo $yasmver | cut -d. -f1`
  54. yaminor=`echo $yasmver | cut -d. -f2`
  55. yamini=`echo $yasmver | cut -d. -f3`
  56. if test "$yamajor" -ge "1" ; then
  57. if test "$yamajor" -eq "1" ; then
  58. if test "$yaminor" -ge "0" ; then
  59. if test "$yaminor" -eq "0"; then
  60. if test "$yamini" -ge "1"; then
  61. has_yasm=true
  62. fi
  63. else
  64. has_yasm=true
  65. fi
  66. fi
  67. fi
  68. else
  69. has_yasm=false
  70. fi
  71. if test "x$has_yasm" = "xtrue" ; then
  72. AC_MSG_RESULT([yes])
  73. else
  74. AC_MSG_RESULT([no])
  75. fi
  76. fi
  77. if test "x$has_yasm" = "xfalse" ; then
  78. AC_MSG_NOTICE([yasm is required for the sse2_64 algorithm. It will be skipped.])
  79. fi
  80. AM_CONDITIONAL([HAS_YASM], [test x$has_yasm = xtrue])
  81. PKG_PROG_PKG_CONFIG()
  82. LIBCURL_CHECK_CONFIG(, 7.10.1, ,
  83. [AC_MSG_ERROR([Missing required libcurl >= 7.10.1])])
  84. AC_SUBST(OPENCL_LIBS)
  85. AC_SUBST(JANSSON_LIBS)
  86. AC_SUBST(PTHREAD_FLAGS)
  87. AC_SUBST(PTHREAD_LIBS)
  88. AC_CONFIG_FILES([
  89. Makefile
  90. compat/Makefile
  91. compat/jansson/Makefile
  92. x86_64/Makefile
  93. ])
  94. AC_OUTPUT