-
Notifications
You must be signed in to change notification settings - Fork 2
/
configure.ac
144 lines (91 loc) · 3.87 KB
/
configure.ac
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
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
AC_INIT([phenoparser], [m4_esyscmd_s([git describe --always])])
AC_CONFIG_AUX_DIR([.])
AM_INIT_AUTOMAKE
# Checks for programs.
AC_PROG_CC
AC_PROG_INSTALL
# Checks for libraries.
# FIXME: Replace `main' with a function in `-lm':
AC_CHECK_LIB([m], [log])
# FIXME: Replace `main' with a function in `-lpthread':AC_CHECK_LIB([m], [log])
PKG_CHECK_MODULES([curl], [libcurl],,
[AC_MSG_ERROR([No pkg-config for libcurl])])
AC_SUBST(CURL_CFLAGS)
AC_SUBST(CURL_LIBS)
#AC_CHECK_PROG(HAVE_EMACS, emacs, true, false)
#AM_CONDITIONAL(HAVE_EMACS,$HAVE_EMACS)
#AC_MSG_CHECKING([whether emacs is present ])
#AC_MSG_RESULT($HAVE_EMACS)
AC_CHECK_LIB([curl], [curl_easy_init],,[AC_MSG_ERROR([libcurl required!])])
AC_CHECK_LIB([curl], [curl_easy_escape],,[AC_MSG_ERROR([libcurl required!])])
AC_CHECK_LIB([curl], [curl_easy_setopt],,[AC_MSG_ERROR([libcurl required!])])
AC_CHECK_LIB([curl], [curl_easy_cleanup],,[AC_MSG_ERROR([libcurl required!])])
AC_CHECK_LIB([curl], [curl_free],,[AC_MSG_ERROR([libcurl required!])])
AC_CHECK_LIB([ssl], [SSL_new], [], [AC_MSG_ERROR([libssl required!])])
AC_CHECK_LIB([crypto], [EVP_get_cipherbyname], [], [AC_MSG_ERROR([libcrypto required!])])
AC_SUBST(CURL_CFLAGS)
AC_SUBST(CURL_LIBS)
AC_CHECK_HEADER([expat.h],, AC_MSG_ERROR([Expat header file is required]))
AC_CHECK_LIB([expat], [XML_ParseBuffer], , AC_MSG_ERROR([Expat library is required]))
AC_CHECK_LIB([sqlite3], [sqlite3_open_v2], ,[AC_MSG_ERROR( [libsqlite3 required for sqlite data interface])])
AC_CHECK_HEADERS([float.h stdint.h stdlib.h string.h unistd.h])
# Checks for typedefs, structures, and compiler characteristics.
AC_TYPE_INT32_T
AC_TYPE_SIZE_T
AC_TYPE_UINT8_T
# Checks for library functions.
AC_FUNC_LSTAT_FOLLOWS_SLASHED_SYMLINK
AC_FUNC_MALLOC
AC_FUNC_REALLOC
AC_CHECK_FUNCS([getcwd mkdir pow sqrt])
tldevel_check_f=$ac_abs_confdir/tldevel/README
AC_CHECK_FILE([$tldevel_check_f], [],[have_tldevel=no])
if test "x${have_tldevel}" = xno; then
echo "------------------------------------------"
echo " Unable to find tldevel on this system. "
echo "------------------------------------------"
AC_MSG_ERROR([TLLIB])
fi
LIB_TLDEVELDIR="tldevel"
AC_SUBST(LIB_TLDEVELDIR)
AC_ARG_ENABLE(debugging,[AS_HELP_STRING([--enable-debugging],[include debugging code])
AS_HELP_STRING([--enable-debugging=x],[also set diagnostics verbosity level to <x> (1-3)])],
enable_debugging=$enableval, enable_debugging="no")
case $enable_debugging in
yes) AC_DEFINE(DEBUGLEVEL, 0,[No debugging. ]);;
1) AC_DEFINE(DEBUGLEVEL, 1,[Defines debugging level 1.]);;
2) AC_DEFINE(DEBUGLEVEL, 2,[Defines debugging level 2.]);;
3) AC_DEFINE(DEBUGLEVEL, 3,[Defines debugging level 3.]);;
no) AC_DEFINE(DEBUGLEVEL, 0,[No debugging.]);;
*) AC_MSG_ERROR([Unknown argument to --enable-debugging: $enable_debugging]);;
esac
if test "$enable_debugging" != "no"; then
AC_DEFINE(DEBUG,1,[Defines debugging .])
CFLAGS="-ggdb -Wall -m64 -std=c11 $MEM $SIGNAL32"
else
CFLAGS="-O2 -funroll-loops -Wall -std=c11 $MEM $SIGNAL32"
DEBUG=0
fi
AC_ARG_ENABLE(valgrind-tests,
[--enable-valgrind-tests run self tests under valgrind],
opt_valgrind_tests="$enableval", opt_valgrind_tests="no")
OPTS="-q --trace-children=no --error-exitcode=1 --leak-check=yes"
# Run self-tests under valgrind?
if test "$opt_valgrind_tests" = "yes"; then
AC_DEFINE(DEBUG,1,[Defines debugging .])
CFLAGS="-pg -ggdb -pedantic -Wall -m64 -std=gnu11"
AC_CHECK_PROGS(VALGRIND, valgrind)
VALGRIND="$VALGRIND $OPTS"
else
VALGRIND=
fi
AC_MSG_CHECKING([whether self tests are run under valgrind])
AC_MSG_RESULT($opt_valgrind_tests)
ac_configure_args="$ac_configure_args PACKAGE_VERSION=$PACKAGE_VERSION PACKAGE_NAME=$PACKAGE_NAME"
AC_CONFIG_SUBDIRS([tldevel])
#AC_CONFIG_FILES([Makefile src/Makefile scripts/Makefile])
AC_CONFIG_FILES([Makefile src/Makefile])
#if test $HAVE_EMACS = "false"; then
#AC_MSG_WARN([*** emacs not found, pipeline scripts will not be tangled!])
#fi
AC_OUTPUT