1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116
|
# Process this file with autoconf to produce a configure script.
m4_define([m4_apop_version], [m4_esyscmd_s(date +%Y%m%d)]) #will switch to this soon.
AC_PREREQ(2.60)
AC_INIT([apophenia], [1.0], [fluffmail@f-m.fm])
AM_SILENT_RULES([no])
AC_CONFIG_SRCDIR([apop_arms.c])
AC_CONFIG_AUX_DIR([build-aux])
AC_CONFIG_HEADER([config.h])
AC_CONFIG_MACRO_DIR([m4])
AM_INIT_AUTOMAKE
AM_MAINTAINER_MODE([enable])
# The normal /usr/local default confused too many people
##AC_PREFIX_DEFAULT([/usr])
# libtool:
LT_INIT
# check linker script support
gl_LD_VERSION_SCRIPT
# Checks for programs.
AC_PATH_PROG([HELP2MAN],[help2man])
AC_PROG_CC
AC_PROG_CC_C99
ACX_PTHREAD
AC_OPENMP
# Checks for libraries.
## math library
LT_LIB_M
## GNU Scientific Library (GSL)
AX_PATH_GSL([1.12.0],[],[AC_MSG_ERROR(could not find required version of GSL)])
## DataBase system libraries
#### MySQL library
AX_LIB_MYSQL
#### SQLite3 library
AX_LIB_SQLITE3
# Checks for header files.
AC_FUNC_ALLOCA
AC_HEADER_STDC
AC_CHECK_HEADERS([float.h inttypes.h limits.h stddef.h stdint.h stdlib.h string.h unistd.h wchar.h])
# Checks for typedefs, structures, and compiler characteristics.
AC_C_CONST
AC_C_INLINE
AC_TYPE_SIZE_T
AC_STRUCT_TM
AC_CHECK_TYPES([ptrdiff_t])
AX_C___ATTRIBUTE__
#Some versions of GCC support atomics iff OpenMP is off.
export CFLAGS="$CFLAGS $OPENMP_CFLAGS"
AC_RUN_IFELSE(
[AC_LANG_SOURCE([int main(){
_Atomic(int) i;
}
])]
, [AC_SUBST([Autoconf_no_atomics], 0)]
, [AC_SUBST([Autoconf_no_atomics], 1)]
, [AC_SUBST([Autoconf_no_atomics], 1)]
)
# Checks for library functions.
AC_FUNC_MALLOC
AC_FUNC_REALLOC
AC_FUNC_STRTOD
AC_CHECK_FUNCS([floor memset pow regcomp sqrt strcasecmp asprintf])
# Checks for tests tools
AC_PATH_PROGS([BC],[bc],[/usr/bin/bc])
AC_PATH_PROGS([SQLITE3],[sqlite3],[/usr/bin/sqlite3])
# Run only the basic tests unless asked to run the full suite.
AC_MSG_CHECKING([whether to run extended tests])
AC_ARG_ENABLE([extended-tests],
[AS_HELP_STRING([--enable-extended-tests], [run numeric torture tests (may be slow)])],
[enable_extended_tests="yes"], [enable_extended_tests="no"])
AC_MSG_RESULT([$enable_extended_tests])
AM_CONDITIONAL([EXTENDED_TESTS], [test "X$enable_extended_tests" != "Xno"])
# Debian stuff
## Debian package version
DEB_PKG_VERSION=$(dpkg-parsechangelog -S Version)
AC_SUBST(DEB_PKG_VERSION)
## work around for bugs #597187, #757967 and #841636
MYSQL_CFLAGS=$(echo "${MYSQL_CFLAGS}" | sed -e 's/-DNDEBUG//g;s/-g//g;s/-fabi-version=2//g;s/-fno-omit-frame-pointer//g;s/-fno-strict-aliasing//g;s/[ ]*$//g;s|-fdebug-prefix-map=.*=.||g' | tr -s ' ')
MYSQL_LDFLAGS=$(echo "${MYSQL_LDFLAGS}" | sed -e 's/-lz//g;s/-lrt//g;s/-ldl//g' | tr -s ' ')
AC_CONFIG_FILES([
apophenia.pc
apop.h
Makefile
transform/Makefile
model/Makefile
cmd/Makefile
tests/Makefile
docs/doxygen.conf
docs/Makefile
eg/Makefile
])
AC_CONFIG_FILES([
tests/utilities_test
],
[
chmod a+x tests/utilities_test
])
AC_OUTPUT
##
## eof
|