configure.ac 2.0 KB

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