Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- dnl --------------------------------
- dnl Initialization macros.
- dnl --------------------------------
- #gap as instructed by autoreconf:
- AC_CONFIG_MACRO_DIR([m4])
- # The file passed into the following macro must exist or it will fail
- AC_INIT(src/matrixlib.h)
- # Store the config files in a separate subdirectory
- AC_CONFIG_AUX_DIR(linux/config)
- # Get the host system information to enable Mac OS X define checking
- AC_CANONICAL_HOST
- # if we're using autoconf, we assume (for now) that we're on a unix system. I.E., on windows we'll use Visual Studio
- AC_DEFINE([ML_OS_UNIX], [], [UNIX OS])
- AC_LANG_CPLUSPLUS
- # check the host information acquired above and #define ML_OS_MACOSX if appropriate
- host_is_mac=no
- case "$host_os" in
- *darwin*)
- host_is_mac=yes
- AC_DEFINE([ML_OS_MACOSX], [], [Mac OS X])
- LFLAGS="${LFLAGS} -framework Accelerate"
- CXXFLAGS="-falign-loops=16 ${CXXFLAGS}"
- ;;
- *linux*)
- AC_DEFINE([ML_OS_LINUX], [], [Linux OS])
- ;;
- cygwin)
- AC_DEFINE([ML_OS_LINUX], [], [Linux OS])
- AC_DEFINE([ML_OS_CYGWIN], [], [Cygwin OS])
- AC_DEFINE([ML_OS_UNIX], [], [Unix OS])
- ;;
- *)
- ;;
- esac
- AC_MSG_ERROR([Canonical host info $host_cpu $host_vendor $host_os])
- CXXFLAGS="-Wall -Wno-deprecated -O3 ${CXXFLAGS}"
- # create a special configuration header for automake that will contain all preprocessor #defines
- AM_CONFIG_HEADER(config.h)
- AM_CONFIG_HEADER(src/matrix.h)
- # need config.h in one more place (with differnent name)
- AC_CONFIG_HEADER(ml_os_defines.h:config.h.in)
- dnl --------------------------------
- dnl Compile time options.
- dnl --------------------------------
- AC_CHECK_HEADER([math.h], , [])
- AC_ARG_ENABLE([dbg],
- AC_HELP_STRING([--enable-dbg], [Enable debug information in library, default=no]),
- enable_dbg=$enableval, enable_dbg=no)
- if test "$enable_dbg" = yes; then
- CXXFLAGS="${CXXFLAGS} -g"
- fi
- AC_ARG_ENABLE([dbgwarn],
- AC_HELP_STRING([--enable-dbgwarn], [Enable debug warnings, default=no]),
- enable_dbgwarn=$enableval, enable_dbgwarn=no)
- if test "$enable_dbgwarn" = yes; then
- AC_DEFINE([ML_ERR_WARN], [], [Display debug information for inappropriate matrix usage.])
- CXXFLAGS="${CXXFLAGS} -g -O0"
- fi
- AC_ARG_ENABLE([dbgabrt],
- AC_HELP_STRING([--enable-dbgabrt], [Enable debug SIGABRT, default=no]),
- enable_dbgabrt=$enableval, enable_dbgabrt=no)
- if test "$enable_dbgabrt" = yes; then
- AC_DEFINE([ML_ERR_WARN], [], [Display debug information for inappropriate matrix usage.])
- AC_DEFINE([ML_ERR_ABRT], [], [Deliver SIGABRT on inappropriate matrix usage.])
- CXXFLAGS="${CXXFLAGS} -g -O0"
- fi
- AC_ARG_ENABLE([blas],
- AC_HELP_STRING([--enable-blas], [Enable use of a local BLAS library, if found, default=no]),
- enable_blas=$enableval, enable_blas=no)
- if test "$enable_blas" = yes; then
- AC_DEFINE([ML_USE_BLAS], [], [Use the BLAS if detected.])
- fi
- AC_ARG_ENABLE([lapack],
- AC_HELP_STRING([--enable-lapack], [Enable use of a local LAPACK library, if found; implies --enable-blas=yes, default=no]),
- enable_lapack=$enableval, enable_lapack=no)
- if test "$enable_lapack" = yes; then
- AC_DEFINE([ML_USE_BLAS], [], [Use the BLAS if detected.])
- AC_DEFINE([ML_USE_LAPACK], [], [Use the LAPACK if detected.])
- fi
- AC_ARG_ENABLE([rowmajor],
- AC_HELP_STRING([--enable-rowmajor], [Cause the library to use a row-major storage format rather than column major, default=no]),
- enable_rowmajor=$enableval, enable_rowmajor=no)
- if test "$enable_rowmajor" = no; then
- AC_DEFINE([ML_COLUMN_MAJOR], [], [Column major storage format.])
- fi
- AC_ARG_ENABLE([demo],
- AC_HELP_STRING([--enable-demo], [Cause the library to use a row-major storage format rather than column major, default=no]),
- enable_demo=$enableval, enable_demo=no)
- if test "$enable_rowmajor" = yes; then
- AC_DEFINE([ML_DEMO], [], [Demo version.])
- fi
- dnl -----------------------------------------------
- dnl Package name and version number (user defined)
- dnl -----------------------------------------------
- #release versioning
- ML_MAJOR_VERSION=3
- ML_MINOR_VERSION=0
- ML_MICRO_VERSION=0
- # the base form of the library name (minus "lib", suffix (dylib/la) and version info
- ML_LIBRARY_NAME=pssmatrix
- ML_RELEASE=$ML_MAJOR_VERSION.$ML_MINOR_VERSION.$ML_MICRO_VERSION
- AC_SUBST(ML_LIBRARY_NAME)
- AC_SUBST(ML_RELEASE)
- AC_DEFINE_UNQUOTED([ML_VERSION_STRING], "$ML_LIBRARY_NAME $ML_RELEASE", [Version information])
- AC_DEFINE_UNQUOTED([ML_DATE_STRING], "$(date)", [Build date])
- AM_INIT_AUTOMAKE($ML_LIBRARY_NAME, $ML_RELEASE, no-define)
- dnl -----------------------------------------------
- dnl Checks for programs.
- dnl -----------------------------------------------
- # make sure we have a c compiler (generally gcc)
- AC_PROG_CXX
- AC_PROG_CC
- # make sure we have libtool
- #AC_DISABLE_STATIC
- AM_PROG_LIBTOOL
- dnl -----------------------------------------------
- dnl Checks for libraries.
- dnl -----------------------------------------------
- AC_CHECK_LIB([c], [fopen])
- # make sure the standard headers are present
- AC_HEADER_STDC
- # we also need these headers
- AC_CHECK_HEADERS([stdlib.h string.h sys/time.h math.h ctype.h assert.h], , [AC_MSG_ERROR([Unable to locate required header.])])
- dnl -----------------------------------------------
- dnl Checks for typedefs, structures, and compiler characteristics.
- dnl -----------------------------------------------
- AC_HEADER_STDBOOL
- AC_C_CONST
- AC_C_INLINE
- AC_TYPE_MODE_T
- AC_TYPE_PID_T
- AC_TYPE_SIZE_T
- AC_HEADER_TIME
- AC_STRUCT_TM
- dnl -----------------------------------------------
- dnl Checks for library functions.
- dnl -----------------------------------------------
- AC_FUNC_MALLOC
- AC_FUNC_REALLOC
- AC_CHECK_FUNCS([memset sqrt])
- dnl -----------------------------------------------
- dnl Generates Makefile's, configuration files and scripts
- dnl -----------------------------------------------
- AC_OUTPUT(Makefile \
- src/Makefile
- )
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement