configure.ac 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899
  1. AC_INIT([cpuminer], [0.8])
  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. AC_CHECK_HEADERS(syslog.h)
  16. AC_FUNC_ALLOCA
  17. case $host in
  18. *-*-mingw*)
  19. have_win32=true
  20. PTHREAD_FLAGS=""
  21. ;;
  22. *)
  23. have_win32=false
  24. PTHREAD_FLAGS="-pthread"
  25. ;;
  26. esac
  27. AC_CHECK_LIB(jansson, json_loads, request_jansson=false, request_jansson=true)
  28. AC_CHECK_LIB(pthread, pthread_create, PTHREAD_LIBS=-lpthread)
  29. AM_CONDITIONAL([WANT_JANSSON], [test x$request_jansson = xtrue])
  30. AM_CONDITIONAL([HAVE_WINDOWS], [test x$have_win32 = xtrue])
  31. if test x$request_jansson = xtrue
  32. then
  33. JANSSON_LIBS="compat/jansson/libjansson.a"
  34. else
  35. JANSSON_LIBS=-ljansson
  36. fi
  37. dnl Find YASM
  38. has_yasm=false
  39. AC_PATH_PROG(YASM,[yasm],[true yasm])
  40. if test "$YASM" = "false" ; then
  41. AC_MSG_WARN([yasm is required for the x86_64 SSE2 code, but it was not found])
  42. else
  43. AC_MSG_CHECKING([if yasm version is greater than 1.0.1])
  44. yasmver=`yasm --version | head -1 | cut -d\ -f2`
  45. yamajor=`echo $yasmver | cut -d. -f1`
  46. yaminor=`echo $yasmver | cut -d. -f2`
  47. yamini=`echo $yasmver | cut -d. -f3`
  48. if test "$yamajor" -ge "1" ; then
  49. if test "$yamajor" -eq "1" ; then
  50. if test "$yaminor" -ge "0" ; then
  51. if test "$yaminor" -eq "0"; then
  52. if test "$yamini" -ge "1"; then
  53. has_yasm=true
  54. fi
  55. else
  56. has_yasm=true
  57. fi
  58. fi
  59. fi
  60. else
  61. has_yasm=false
  62. fi
  63. fi
  64. if test "x$has_yasm" != "x" ; then
  65. AC_MSG_RESULT([yes])
  66. else
  67. AC_MSG_RESULT([no])
  68. fi
  69. AM_CONDITIONAL([HAS_YASM], [test x$has_yasm = xtrue])
  70. PKG_PROG_PKG_CONFIG()
  71. LIBCURL_CHECK_CONFIG(, 7.10.1, ,
  72. [AC_MSG_ERROR([Missing required libcurl >= 7.10.1])])
  73. AC_SUBST(JANSSON_LIBS)
  74. AC_SUBST(PTHREAD_FLAGS)
  75. AC_SUBST(PTHREAD_LIBS)
  76. AC_CONFIG_FILES([
  77. Makefile
  78. compat/Makefile
  79. compat/jansson/Makefile
  80. x86_64/Makefile
  81. ])
  82. AC_OUTPUT