forked from wnd-charm/wnd-charm
-
Notifications
You must be signed in to change notification settings - Fork 0
/
configure.ac
173 lines (154 loc) · 5.54 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
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
# -*- Autoconf -*-
# Process this file with autoconf to produce a configure script.
AC_PREREQ([2.69])
AC_INIT([wndchrm], [1.60], [christopher.coletta@nih.gov])
AM_INIT_AUTOMAKE([foreign subdir-objects])
AM_PATH_PYTHON
AC_CONFIG_SRCDIR([config.h.in])
AC_CONFIG_HEADERS([config.h])
AC_CONFIG_MACRO_DIR([m4])
LT_INIT
# Checks for programs.
AC_PROG_CXX
AC_PROG_AWK
AC_PROG_CC
AC_PROG_CPP
AC_PROG_INSTALL
AC_PROG_LN_S
AC_PROG_MAKE_SET
#AC_PROG_CXX sets CXX to g++ if it cannot find a working C++ compiler
#thus, we test here whether $CXX is actually working
AC_LANG_PUSH(C++)
AC_MSG_CHECKING([whether C++ compiler $CXX works]);
AC_COMPILE_IFELSE(
[AC_LANG_PROGRAM(, [int i=0;])],
[AC_MSG_RESULT(yes)],
[AC_MSG_RESULT(no)
AC_MSG_ERROR(failed to find a C++ compiler or C++ compiler $CXX does not work)]
)
AC_LANG_POP(C++)
# Add repository revision control
GITREV=`( git rev-parse --short HEAD ) 2>/dev/null`
if { ! expr "$GITREV" : '[[A-Za-z0-9]]*' >/dev/null 2>&1 ;} ;
then GITREV=`cat $srcdir/GITREV`
else echo $GITREV>$srcdir/GITREV
fi
AC_SUBST(GITREV)
AC_DEFINE_UNQUOTED([GITREV],["$GITREV"], [Git Revision from git rev-parse --short HEAD])
AC_DEFINE_UNQUOTED([PACKAGE_VERSION],["$VERSION-$GITREV"], [Version string, including GITREV])
AC_DEFINE_UNQUOTED([PACKAGE_STRING],["$PACKAGE_NAME $VERSION-$GITREV"], [Package string with version+GITREV])
# Checks for libraries.
# FIXME: Replace `main' with a function in `-lchrm':
AC_CHECK_LIB([chrm], [main])
dnl ------------------------------------------------------------
dnl check for FFTW3
dnl ------------------------------------------------------------
AC_CHECK_LIB(fftw3,fftw_execute,[AC_DEFINE(HAVE_FFTW3,1,"Turn on FFTW3 support.")],
[AC_MSG_ERROR([
FFTW3 library not found.
Please download+install FFTW 3.x from http://www.fftw.org/download.html
])]
)
AC_CHECK_HEADER(fftw3.h, [],
AC_MSG_ERROR([
the <fftw3.h> header file from FFTW3 could not be found.
Please download+install FFTW 3.x from http://www.fftw.org/download.html
]))
# FIXME: Replace `main' with a function in `-lm':
AC_CHECK_LIB([m], [main])
dnl ------------------------------------------------------------
dnl check for libtiff
dnl ------------------------------------------------------------
AC_CHECK_LIB(tiff, TIFFReadScanline)
AC_CHECK_HEADER(tiffio.h,LIBTIFF='yes',AC_MSG_ERROR([
*** WND_CHARM requires libtiff; (Required TIFF headers not found) ***
Please download+install libtiff from http://www.libtiff.org/
]))
# Checks for header files.
AC_CHECK_HEADERS([fcntl.h float.h limits.h memory.h stddef.h stdlib.h string.h sys/time.h unistd.h])
# Checks for typedefs, structures, and compiler characteristics.
AC_CHECK_HEADER_STDBOOL
AC_C_INLINE
AC_TYPE_INT32_T
AC_TYPE_MODE_T
AC_C_RESTRICT
AC_TYPE_SIZE_T
AC_CHECK_TYPES([ptrdiff_t])
# Checks for library functions.
AC_FUNC_ERROR_AT_LINE
AC_HEADER_MAJOR
#AC_FUNC_MALLOC
#AC_FUNC_REALLOC
AC_FUNC_STRERROR_R
AC_FUNC_STRTOD
AC_CHECK_FUNCS([bzero floor ftruncate memmove memset mkdir pow select sqrt strchr strerror strrchr strstr strtol])
dnl ------------------------------------------------------------
dnl check for TR1 stuff individually
dnl ------------------------------------------------------------
AC_DEFUN([AC_HEADER_TR1_UNORDERED_MAP], [
AC_CACHE_CHECK(for tr1/unordered_map,
ac_cv_cxx_tr1_unordered_map,
[AC_LANG_SAVE
AC_LANG_CPLUSPLUS
AC_TRY_COMPILE([#include <tr1/unordered_map>], [using std::tr1::unordered_map;],
ac_cv_cxx_tr1_unordered_map=yes, ac_cv_cxx_tr1_unordered_map=no)
AC_LANG_RESTORE
])
if test "$ac_cv_cxx_tr1_unordered_map" = yes; then
AC_DEFINE(HAVE_TR1_UNORDERED_MAP,,[Define if tr1/unordered_map is present. ])
fi
])
AC_HEADER_TR1_UNORDERED_MAP
AC_DEFUN([AC_HEADER_TR1_UNORDERED_SET], [
AC_CACHE_CHECK(for tr1/unordered_set,
ac_cv_cxx_tr1_unordered_set,
[AC_LANG_SAVE
AC_LANG_CPLUSPLUS
AC_TRY_COMPILE([#include <tr1/unordered_set>], [using std::tr1::unordered_set;],
ac_cv_cxx_tr1_unordered_set=yes, ac_cv_cxx_tr1_unordered_set=no)
AC_LANG_RESTORE
])
if test "$ac_cv_cxx_tr1_unordered_set" = yes; then
AC_DEFINE(HAVE_TR1_UNORDERED_SET,,[Define if tr1/unordered_set is present. ])
fi
])
AC_HEADER_TR1_UNORDERED_SET
dnl ------------------------------------------------------------
dnl check for native unordered_map and unordered_set individually
dnl ------------------------------------------------------------
AC_DEFUN([AC_HEADER_UNORDERED_MAP], [
AC_CACHE_CHECK(for native unordered_map,
ac_unordered_map,
[AC_LANG_SAVE
AC_LANG_CPLUSPLUS
AC_TRY_COMPILE([#include <unordered_map>], [using std::unordered_map;],
ac_unordered_map=yes, ac_unordered_map=no)
AC_LANG_RESTORE
])
if test "$ac_unordered_map" = yes; then
AC_DEFINE(HAVE_UNORDERED_MAP,,[Define if native unordered_map is present. ])
fi
])
AC_HEADER_UNORDERED_MAP
AC_DEFUN([AC_HEADER_UNORDERED_SET], [
AC_CACHE_CHECK(for native unordered_set,
ac_unordered_set,
[AC_LANG_SAVE
AC_LANG_CPLUSPLUS
AC_TRY_COMPILE([#include <unordered_set>], [using std::unordered_set;],
ac_unordered_set=yes, ac_unordered_set=no)
AC_LANG_RESTORE
])
if test "$ac_unordered_set" = yes; then
AC_DEFINE(HAVE_UNORDERED_SET,,[Define if native unordered_set is present. ])
fi
])
AC_HEADER_UNORDERED_SET
AC_ARG_ENABLE(class-prob-tsv,
[ --enable-class-prob-tsv When creating a report, output a tsv\
containing the Average Class Probability Matrix data for the purpose \
of computing Morphological Divergence Scores],
[ AC_DEFINE(AVG_CLASS_PROB_TSV,,[Define optional output. ])
])
AC_CONFIG_FILES([Makefile src/Makefile])
AC_OUTPUT