AC_INIT([mm-book],[0.0.1],[gpernot@praksys.org]) AM_INIT_AUTOMAKE(mm-book, 0.0.1) AM_CONFIG_HEADER(mm-book.h) AC_C_CONST AC_C_INLINE AC_PROG_CC AC_PROG_LIBTOOL AC_PROG_INSTALL AC_PROG_LN_S AC_HEADER_TIME AC_FUNC_MALLOC CFLAGS="-Wall -pipe -D_GNU_SOURCE" MAKEFLAGS="-s $MAKEFLAGS" AC_ARG_ENABLE(debug, AS_HELP_STRING([--enable-debug], [enable tracing and debugging flags for all components]), [CFLAGS="-ggdb $CFLAGS"; enable_debug=yes], [CFLAGS="-O3 -fomit-frame-pointer -ffast-math -floop-optimize2 -DNDEBUG $CFLAGS"]) CHECK_ZLIB AC_SUBST(ZLIB_CFLAGS) AC_SUBST(ZLIB_LIBS) dnl Check for additional libraries that we might use: dnl ================================================= # we set the defaults always to make sure we have non-empty variables # for the Makefile PKG_CHECK_MODULES(LIBOIL, liboil-0.3 >= 0.3.0, HAVE_LIBOIL=yes, HAVE_LIBOIL=no) AC_SUBST(LIBOIL_CFLAGS) AC_SUBST(LIBOIL_LIBS) if test "x${HAVE_LIBOIL}" = xyes ; then AC_DEFINE_UNQUOTED(HAVE_LIBOIL, 1, [Define if liboil is being used]) true fi dnl check for pthread AC_ARG_WITH(libpthread, AC_HELP_STRING([--with-libpthread=DIR], [Where to find libpthread (required)]), libpthread=$withval, libpthread=yes) if test "$libpthread" != "no"; then if test "$libpthread" != "yes"; then PTHREAD_LIBS="-L$libpthread/lib" PTHREAD_CFLAGS="-I$libpthread/include" fi AC_CHECK_HEADER(pthread.h, AC_CHECK_LIB(pthread, pthread_create, [libpthread=yes PTHREAD_LIBS="-lpthread"], libpthread=no), libpthread=no) AC_SUBST(PTHREAD_CFLAGS) AC_SUBST(PTHREAD_LIBS) fi if test "$libpthread" != "yes"; then AC_MSG_ERROR([Couldn't find required libpthread installation]) fi dnl check for blas AC_ARG_WITH(libblas, AC_HELP_STRING([--with-libblas=DIR], [Where to find libblas (required)]), libblas=$withval, libblas=yes) if test "$libblas" != "no"; then if test "$libblas" != "yes"; then BLAS_LIBS="-L$libblas/lib" BLAS_CFLAGS="-I$libblas/include" fi AC_CHECK_HEADER(cblas.h, AC_CHECK_LIB(blas, cblas_ddot, [libblas=yes BLAS_LIBS="-lblas"], libblas=no), libblas=no) AC_SUBST(BLAS_CFLAGS) AC_SUBST(BLAS_LIBS) fi if test "$libblas" != "yes"; then AC_MSG_ERROR([Couldn't find required libblas installation]) fi AC_CONFIG_FILES([Makefile 00-simple/Makefile 05-block/Makefile 06-block-enhanced/Makefile 07-block-unroll/Makefile 15-simd-oil/Makefile 20-simd-atlas/Makefile 35-pthread/Makefile 40-mosix/Makefile 45-mosix-zlib/Makefile]) AC_OUTPUT