2012-05-02 21:37:54 +02:00
|
|
|
AC_INIT([cpuminer], [2.2.1])
|
2010-11-25 01:31:12 +01:00
|
|
|
|
2012-03-06 14:20:55 +01:00
|
|
|
AC_PREREQ([2.59c])
|
2011-04-11 19:04:29 +02:00
|
|
|
AC_CANONICAL_SYSTEM
|
2010-11-25 01:31:12 +01:00
|
|
|
AC_CONFIG_SRCDIR([cpu-miner.c])
|
|
|
|
AM_INIT_AUTOMAKE([gnu])
|
|
|
|
AC_CONFIG_HEADERS([cpuminer-config.h])
|
|
|
|
|
|
|
|
dnl Make sure anyone changing configure.ac/Makefile.am has a clue
|
|
|
|
AM_MAINTAINER_MODE
|
|
|
|
|
|
|
|
dnl Checks for programs
|
2012-03-06 14:20:55 +01:00
|
|
|
AC_PROG_CC_C99
|
2010-11-25 01:31:12 +01:00
|
|
|
AC_PROG_GCC_TRADITIONAL
|
|
|
|
AM_PROG_CC_C_O
|
2011-12-18 22:41:16 +01:00
|
|
|
AM_PROG_AS
|
2010-11-26 21:20:54 +01:00
|
|
|
AC_PROG_RANLIB
|
2010-11-25 01:31:12 +01:00
|
|
|
|
2012-04-08 00:33:56 +02:00
|
|
|
dnl Checks for header files
|
2010-11-25 01:31:12 +01:00
|
|
|
AC_HEADER_STDC
|
2012-04-08 00:33:56 +02:00
|
|
|
AC_CHECK_HEADERS([sys/endian.h sys/param.h syslog.h])
|
2012-04-07 14:55:50 +02:00
|
|
|
# sys/sysctl.h requires sys/types.h on FreeBSD
|
|
|
|
# sys/sysctl.h requires sys/param.h on OpenBSD
|
|
|
|
AC_CHECK_HEADERS([sys/sysctl.h], [], [],
|
|
|
|
[#include <sys/types.h>
|
2012-04-08 00:33:56 +02:00
|
|
|
#ifdef HAVE_SYS_PARAM_H
|
2012-04-07 14:55:50 +02:00
|
|
|
#include <sys/param.h>
|
|
|
|
#endif
|
|
|
|
])
|
2011-03-18 22:24:16 +01:00
|
|
|
|
2012-04-08 00:33:56 +02:00
|
|
|
AC_CHECK_DECLS([be32dec, le32dec, be32enc, le32enc], [], [],
|
|
|
|
[AC_INCLUDES_DEFAULT
|
|
|
|
#ifdef HAVE_SYS_ENDIAN_H
|
|
|
|
#include <sys/endian.h>
|
|
|
|
#endif
|
|
|
|
])
|
|
|
|
|
2011-03-18 22:24:16 +01:00
|
|
|
AC_FUNC_ALLOCA
|
2012-04-08 23:28:54 +02:00
|
|
|
AC_CHECK_FUNCS([getopt_long])
|
2010-11-25 01:31:12 +01:00
|
|
|
|
2011-04-11 19:04:29 +02:00
|
|
|
case $target in
|
2012-03-05 19:32:52 +01:00
|
|
|
i*86-*-*)
|
|
|
|
have_x86=true
|
2011-04-11 19:04:29 +02:00
|
|
|
;;
|
2012-03-05 19:32:52 +01:00
|
|
|
x86_64-*-*)
|
|
|
|
have_x86=true
|
|
|
|
have_x86_64=true
|
2010-11-26 22:28:12 +01:00
|
|
|
;;
|
|
|
|
esac
|
|
|
|
|
2012-03-03 16:51:32 +01:00
|
|
|
PTHREAD_FLAGS="-pthread"
|
|
|
|
WS2_LIBS=""
|
|
|
|
|
|
|
|
case $target in
|
|
|
|
*-*-mingw*)
|
|
|
|
have_win32=true
|
|
|
|
PTHREAD_FLAGS=""
|
|
|
|
WS2_LIBS="-lws2_32"
|
|
|
|
;;
|
|
|
|
esac
|
2010-11-26 22:28:12 +01:00
|
|
|
|
2012-03-05 19:32:52 +01:00
|
|
|
if test x$have_x86 = xtrue
|
|
|
|
then
|
|
|
|
AC_MSG_CHECKING(whether we can compile AVX code)
|
|
|
|
AC_COMPILE_IFELSE([AC_LANG_PROGRAM(,[asm ("vmovdqa %ymm0, %ymm1");])],
|
2012-03-07 10:46:04 +01:00
|
|
|
AC_DEFINE(USE_AVX, 1, [Define to 1 if AVX assembly is available.])
|
|
|
|
AC_MSG_RESULT(yes)
|
|
|
|
AC_MSG_CHECKING(whether we can compile XOP code)
|
|
|
|
AC_COMPILE_IFELSE([AC_LANG_PROGRAM(,[asm ("vprotd \$7, %xmm0, %xmm1");])],
|
|
|
|
AC_DEFINE(USE_XOP, 1, [Define to 1 if XOP assembly is available.])
|
2012-03-05 19:32:52 +01:00
|
|
|
AC_MSG_RESULT(yes)
|
|
|
|
,
|
|
|
|
AC_MSG_RESULT(no)
|
2012-03-07 10:46:04 +01:00
|
|
|
AC_MSG_WARN([The assembler does not support the XOP instruction set.])
|
|
|
|
)
|
|
|
|
,
|
|
|
|
AC_MSG_RESULT(no)
|
|
|
|
AC_MSG_WARN([The assembler does not support the AVX instruction set.])
|
2012-03-05 19:32:52 +01:00
|
|
|
)
|
|
|
|
fi
|
|
|
|
|
2010-11-26 22:13:32 +01:00
|
|
|
AC_CHECK_LIB(jansson, json_loads, request_jansson=false, request_jansson=true)
|
2012-03-03 22:41:47 +01:00
|
|
|
AC_CHECK_LIB([pthread], [pthread_create], PTHREAD_LIBS="-lpthread",
|
|
|
|
AC_CHECK_LIB([pthreadGC2], [pthread_create], PTHREAD_LIBS="-lpthreadGC2",
|
|
|
|
AC_CHECK_LIB([pthreadGC1], [pthread_create], PTHREAD_LIBS="-lpthreadGC1",
|
|
|
|
AC_CHECK_LIB([pthreadGC], [pthread_create], PTHREAD_LIBS="-lpthreadGC"
|
|
|
|
))))
|
2010-11-25 01:31:12 +01:00
|
|
|
|
2010-11-26 22:13:32 +01:00
|
|
|
AM_CONDITIONAL([WANT_JANSSON], [test x$request_jansson = xtrue])
|
2011-03-15 04:36:28 +01:00
|
|
|
AM_CONDITIONAL([HAVE_WINDOWS], [test x$have_win32 = xtrue])
|
2012-03-05 19:32:52 +01:00
|
|
|
AM_CONDITIONAL([ARCH_x86], [test x$have_x86 = xtrue])
|
|
|
|
AM_CONDITIONAL([ARCH_x86_64], [test x$have_x86_64 = xtrue])
|
2010-11-26 22:13:32 +01:00
|
|
|
|
|
|
|
if test x$request_jansson = xtrue
|
|
|
|
then
|
|
|
|
JANSSON_LIBS="compat/jansson/libjansson.a"
|
|
|
|
else
|
|
|
|
JANSSON_LIBS=-ljansson
|
|
|
|
fi
|
|
|
|
|
2010-11-25 01:31:12 +01:00
|
|
|
LIBCURL_CHECK_CONFIG(, 7.10.1, ,
|
|
|
|
[AC_MSG_ERROR([Missing required libcurl >= 7.10.1])])
|
|
|
|
|
|
|
|
AC_SUBST(JANSSON_LIBS)
|
2010-11-26 22:28:12 +01:00
|
|
|
AC_SUBST(PTHREAD_FLAGS)
|
2010-11-26 21:20:54 +01:00
|
|
|
AC_SUBST(PTHREAD_LIBS)
|
2012-03-03 16:51:32 +01:00
|
|
|
AC_SUBST(WS2_LIBS)
|
2010-11-25 01:31:12 +01:00
|
|
|
|
|
|
|
AC_CONFIG_FILES([
|
|
|
|
Makefile
|
2010-11-26 22:13:32 +01:00
|
|
|
compat/Makefile
|
|
|
|
compat/jansson/Makefile
|
2010-11-25 01:31:12 +01:00
|
|
|
])
|
|
|
|
AC_OUTPUT
|