configure.ac 2.42 KB
Newer Older
1 2 3 4 5
# 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)
6
AC_INIT([apophenia], [0.999e], [fluffmail@f-m.fm])
7 8
AM_SILENT_RULES([yes])
AC_CONFIG_SRCDIR([apop_arms.c])
9
AC_CONFIG_AUX_DIR([build-aux])
10 11 12
AC_CONFIG_HEADER([config.h])
AC_CONFIG_MACRO_DIR([m4])
AM_INIT_AUTOMAKE
13
AM_MAINTAINER_MODE
14 15

# The normal /usr/local default confused too many people
16
##AC_PREFIX_DEFAULT([/usr])
17

18
# libtool:
19 20
LT_INIT

21 22 23
# check linker script support
gl_LD_VERSION_SCRIPT

24 25 26 27
# Checks for programs.
AC_PROG_CC
AC_PROG_CC_C99

28 29 30
ACX_PTHREAD
AC_OPENMP

31
# Checks for libraries.
32 33 34 35 36 37 38 39 40
## 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
41 42 43 44 45 46 47 48 49 50 51 52 53 54

# 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__

55 56 57 58 59 60 61 62 63 64 65 66
#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)]
)

67 68 69 70 71 72
# Checks for library functions.
AC_FUNC_MALLOC
AC_FUNC_REALLOC
AC_FUNC_STRTOD
AC_CHECK_FUNCS([floor memset pow regcomp sqrt strcasecmp asprintf])

73 74 75 76
# Checks for tests tools
AC_PATH_PROGS([BC],[bc],[/usr/bin/bc])
AC_PATH_PROGS([SQLITE3],[sqlite3],[/usr/bin/sqlite3])

77 78 79 80 81 82 83
# 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"])
84 85 86

AC_CONFIG_FILES([
	apophenia.pc
87
    apop.h
88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103
	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
	])
104 105
AC_OUTPUT

106 107
##
## eof