configure.ac 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109
  1. AC_INIT([cpuminer], [1.0.1])
  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],[false])
  49. if test "x$YASM" != "xfalse" ; then
  50. AC_MSG_CHECKING([if yasm version is greater than 1.0.1])
  51. yasmver=`yasm --version | head -1 | cut -d\ -f2`
  52. yamajor=`echo $yasmver | cut -d. -f1`
  53. yaminor=`echo $yasmver | cut -d. -f2`
  54. yamini=`echo $yasmver | cut -d. -f3`
  55. if test "$yamajor" -ge "1" ; then
  56. if test "$yamajor" -eq "1" ; then
  57. if test "$yaminor" -ge "0" ; then
  58. if test "$yaminor" -eq "0"; then
  59. if test "$yamini" -ge "1"; then
  60. has_yasm=true
  61. fi
  62. else
  63. has_yasm=true
  64. fi
  65. fi
  66. fi
  67. else
  68. has_yasm=false
  69. fi
  70. if test "x$has_yasm" = "xtrue" ; then
  71. AC_MSG_RESULT([yes])
  72. else
  73. AC_MSG_RESULT([no])
  74. fi
  75. fi
  76. if test "x$has_yasm" = "xfalse" ; then
  77. AC_MSG_NOTICE([yasm is required for the sse2_64 algorithm. It will be skipped.])
  78. fi
  79. AM_CONDITIONAL([HAS_YASM], [test x$has_yasm = xtrue])
  80. PKG_PROG_PKG_CONFIG()
  81. LIBCURL_CHECK_CONFIG(, 7.10.1, ,
  82. [AC_MSG_ERROR([Missing required libcurl >= 7.10.1])])
  83. AC_SUBST(JANSSON_LIBS)
  84. AC_SUBST(PTHREAD_FLAGS)
  85. AC_SUBST(PTHREAD_LIBS)
  86. AC_CONFIG_FILES([
  87. Makefile
  88. compat/Makefile
  89. compat/jansson/Makefile
  90. x86_64/Makefile
  91. ])
  92. AC_OUTPUT