1 # gf-complete autoconf template
3 # FIXME - add project url as the last argument
4 AC_INIT(gf-complete, 1.0)
6 # Override default CFLAGS
7 : ${CFLAGS="-Wall -Wpointer-arith -O3 -g"}
11 AM_INIT_AUTOMAKE([no-dependencies foreign parallel-tests])
14 AC_CONFIG_HEADER(include/config.h)
16 dnl Needed when reconfiguring with 'autoreconf -i -s'
17 AC_CONFIG_MACRO_DIR([m4])
19 # This prevents './configure; make' from trying to run autotools.
20 AM_MAINTAINER_MODE([disable])
22 dnl Compiling with per-target flags requires AM_PROG_CC_C_O.
25 # Check for functions to provide aligned memory
27 AC_CHECK_FUNCS([posix_memalign],
28 [found_memalign=yes; break])
30 AS_IF([test "x$found_memalign" != "xyes"], [AC_MSG_WARN([No function for aligned memory allocation found])])
32 AC_ARG_ENABLE([debug-functions],
33 AS_HELP_STRING([--enable-debug-func], [Enable debugging of functions selected]))
34 AS_IF([test "x$enable_debug_func" = "xyes"], [CPPFLAGS="$CPPFLAGS -DDEBUG_FUNCTIONS"])
36 AC_ARG_ENABLE([debug-cpu],
37 AS_HELP_STRING([--enable-debug-cpu], [Enable debugging of SIMD detection]))
38 AS_IF([test "x$enable_debug_cpu" = "xyes"], [CPPFLAGS="$CPPFLAGS -DDEBUG_CPU_DETECTION"])
43 AS_HELP_STRING([--disable-neon], [Build without NEON optimizations]))
45 AS_IF([test "x$enable_neon" != "xno"],
46 [noneon_CPPFLAGS=$CPPFLAGS
47 CPPFLAGS="$CPPFLAGS $SIMD_FLAGS"
48 AC_CHECK_HEADER([arm_neon.h],
51 CPPFLAGS=$noneon_CPPFLAGS])],
53 AS_IF([test "x$ax_cv_have_neon_ext" = "xyes"],
57 AS_IF([test "x$have_neon" = "xno"],
58 [AS_IF([test "x$enable_neon" = "xyes"],
59 [AC_MSG_ERROR([neon requested but arm_neon.h not found])])
61 AM_CONDITIONAL([HAVE_NEON], [test "x$have_neon" = "xyes"])
64 AS_HELP_STRING([--disable-sse], [Build without SSE optimizations]),
65 [if test "x$enableval" = "xno" ; then
67 echo "DISABLED SSE!!!"
71 AC_ARG_ENABLE([valgrind],
72 [AS_HELP_STRING([--enable-valgrind], [run tests with valgrind])],
75 AM_CONDITIONAL(ENABLE_VALGRIND, test "x$enable_valgrind" != xno)
77 AC_ARG_ENABLE([avx], AS_HELP_STRING([--enable-avx], [Build with AVX optimizations]))
78 AX_CHECK_COMPILE_FLAG(-mavx, [ax_cv_support_avx=yes], [])
80 AS_IF([test "x$enable_avx" = "xyes"],
81 [AS_IF([test "x$ax_cv_support_avx" = "xno"],
82 [AC_MSG_ERROR([AVX requested but compiler does not support -mavx])],
83 [SIMD_FLAGS="$SIMD_FLAGS -mavx"])
86 AC_CONFIG_FILES([Makefile src/Makefile tools/Makefile test/Makefile examples/Makefile])