-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathconfigure.ac
202 lines (174 loc) · 5.37 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
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
# Check for type traits in <type_traits> and std namespace
AC_DEFUN([ACX_CHECK_TYPE_TRAITS_CXX11], [
AC_LANG_PUSH([C++])
AC_MSG_CHECKING([for type traits <tr1/type_traits> or <type_trait>, for std or std:tr1, and if compiler option -std=c++11 is needed])
acx_type_traits=no
# (1) =========================== no compiler option ===========================
if test "$acx_type_traits" = no; then
AC_COMPILE_IFELSE(
[
AC_LANG_PROGRAM(
[[#include <type_traits>]],
[[typedef std::is_void<double> isVoidT;]]
)
],
[
AC_DEFINE([USE_TYPE_TRAITS],[1],[define if using <type_traits>.])
AC_DEFINE([HAS_STD_TYPE_TRAITS],[1],[define if std type traits are available.])
acx_type_traits=yes
]
)
fi
if test "$acx_type_traits" = no; then
AC_COMPILE_IFELSE(
[
AC_LANG_PROGRAM(
[[#include <type_traits>]],
[[typedef std::tr1::is_void<double> isVoidT;]]
)
],
[
AC_DEFINE([USE_TYPE_TRAITS],[1],[define if using <type_traits>.])
AC_DEFINE([HAS_STD_TR1_TYPE_TRAITS],[1],[define if std::tr1 type traits are available.])
acx_type_traits=yes
]
)
fi
if test "$acx_type_traits" = no; then
AC_COMPILE_IFELSE(
[
AC_LANG_PROGRAM(
[[#include <tr1/type_traits>]],
[[typedef std::is_void<double> isVoidT;]]
)
],
[
AC_DEFINE([USE_TR1_TYPE_TRAITS],[1],[define if using <tr1/type_traits>.])
AC_DEFINE([HAS_STD_TYPE_TRAITS],[1],[define if std::tr1 type traits are available.])
acx_type_traits=yes
]
)
fi
if test "$acx_type_traits" = no; then
AC_COMPILE_IFELSE(
[
AC_LANG_PROGRAM(
[[#include <tr1/type_traits>]],
[[typedef std::tr1::is_void<double> isVoidT;]]
)
],
[
AC_DEFINE([USE_TR1_TYPE_TRAITS],[1],[define if using <tr1/type_traits>.])
AC_DEFINE([HAS_STD_TR1_TYPE_TRAITS],[1],[define if std::tr1 type traits are available.])
acx_type_traits=yes
]
)
fi
# (2) ========================= c++0x compiler option ===========================
if test "$acx_type_traits" = no; then
ac_save_CXXFLAGS="$CXXFLAGS"
CXXFLAGS="$CXXFLAGS -std=c++11"
AC_COMPILE_IFELSE(
[
AC_LANG_PROGRAM(
[[#include <type_traits>]],
[[typedef std::is_void<double> isVoidT;]]
)
],
[
AC_DEFINE([USE_TYPE_TRAITS],[1],[define if using <type_traits>.])
AC_DEFINE([HAS_STD_TYPE_TRAITS],[1],[define if std type traits are available.])
acx_type_traits=yes
]
)
if test "$acx_type_traits" = no; then
CXXFLAGS="$ac_save_CXXFLAGS"
fi
fi
if test "$acx_type_traits" = no; then
ac_save_CXXFLAGS="$CXXFLAGS"
CXXFLAGS="$CXXFLAGS -std=c++11"
AC_COMPILE_IFELSE(
[
AC_LANG_PROGRAM(
[[#include <type_traits>]],
[[typedef std::tr1::is_void<double> isVoidT;]]
)
],
[
AC_DEFINE([USE_TYPE_TRAITS],[1],[define if using <type_traits>.])
AC_DEFINE([HAS_STD_TR1_TYPE_TRAITS],[1],[define if std::tr1 type traits are available.])
acx_type_traits=yes
]
)
if test "$acx_type_traits" = no; then
CXXFLAGS="$ac_save_CXXFLAGS"
fi
fi
if test "$acx_type_traits" = no; then
ac_save_CXXFLAGS="$CXXFLAGS"
CXXFLAGS="$CXXFLAGS -std=c++11"
AC_COMPILE_IFELSE(
[
AC_LANG_PROGRAM(
[[#include <tr1/type_traits>]],
[[typedef std::is_void<double> isVoidT;]]
)
],
[
AC_DEFINE([USE_TR1_TYPE_TRAITS],[1],[define if using <tr1/type_traits>.])
AC_DEFINE([HAS_STD_TYPE_TRAITS],[1],[define if std::tr1 type traits are available.])
acx_type_traits=yes
]
)
if test "$acx_type_traits" = no; then
CXXFLAGS="$ac_save_CXXFLAGS"
fi
fi
if test "$acx_type_traits" = no; then
ac_save_CXXFLAGS="$CXXFLAGS"
CXXFLAGS="$CXXFLAGS -std=c++11"
AC_COMPILE_IFELSE(
[
AC_LANG_PROGRAM(
[[#include <tr1/type_traits>]],
[[typedef std::tr1::is_void<double> isVoidT;]]
)
],
[
AC_DEFINE([USE_TR1_TYPE_TRAITS],[1],[define if using <tr1/type_traits>.])
AC_DEFINE([HAS_STD_TR1_TYPE_TRAITS],[1],[define if std::tr1 type traits are available.])
acx_type_traits=yes
]
)
if test "$acx_type_traits" = no; then
CXXFLAGS="$ac_save_CXXFLAGS"
fi
fi
# post type traits results
AC_MSG_RESULT([$acx_type_traits])
if test "$acx_type_traits" = no; then
AC_MSG_ERROR([std and std::tr1 <type_traits> or <tr1/type_traits> are not supported.])
fi
AC_LANG_POP([])
])
# ===========================================================================
AC_INIT([iedera],[1.07],[laurent DT noe AT univ-lille DT fr],[iedera],[http://bioinfo.univ-lille.fr/yass/iedera])
AC_CONFIG_SRCDIR([src/main.cc])
AC_LANG([C++])
AM_INIT_AUTOMAKE([subdir-objects
foreign
parallel-tests
color-tests])
CXXFLAGS=""
AC_PROG_CXX
AC_CHECK_HEADERS([stdlib.h string.h sys/time.h unistd.h])
AC_CHECK_FUNCS([gettimeofday sqrt strdup strtol])
ACX_CHECK_TYPE_TRAITS_CXX11
LIBS="$LIBS -lm"
AC_SUBST(CXXFLAGS)
AC_SUBST(LIBS)
AC_CONFIG_FILES([Makefile
src/Makefile
tests/Makefile])
AC_OUTPUT