-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathconfigure.ac
163 lines (119 loc) · 2.91 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
# configure support 07/2015
AC_INIT([gapc], [pr1.0], [[email protected]])
AC_CONFIG_FILES([config.mf])
AC_CONFIG_MACRO_DIR([m4])
AC_CANONICAL_BUILD
AC_CANONICAL_HOST
## get shell
AC_PATH_PROGS(SHELL, [bash sh ksh93 ksh])
## compile and optimize flags
AC_ARG_ENABLE([--debug], [Set --debug to disable optimization and set debug flags],
[
CFLAGS+=" -g "
CXXFLAGS+=" -g "
], [
CFLAGS+=" -O3 "
CXXFLAGS+=" -O3 "
])
## adding librna path for includes due to re-structuring ViennaRNA code
CFLAGS+="-I librna/"
## get compiler
AC_PROG_CXX
AC_PROG_CC
## other programms
AC_PROG_INSTALL
AC_PROG_SED
## Test for c11 or c99
AC_LANG([C])
AX_CHECK_COMPILE_FLAG([-std=c11], [
CFLAGS+=" -std=c11"
], [
AX_CHECK_COMPILE_FLAG([-std=c99], [
CFLAGS+=" -std=c99"
], [
echo "C compiler cannot compile C11 or C99 code"
exit -1
])
])
##fast-math
AX_CHECK_COMPILE_FLAG([-ffast-math], [
FAST_MATH=" -ffast-math "
], [
FAST_MATH=" "
echo "-ffast-math not supported by compiler"
])
AC_SUBST(FAST_MATH)
## test for Position Independednd Code, sets PIC_FLAGS
GAP_PIC_FLAGS
AC_LANG([C++])
AX_CHECK_COMPILE_FLAG([-std=c++17], [
CXXFLAGS+=" -std=c++17"
])
## test additional flags
AX_CHECK_COMPILE_FLAG([-D_XOPEN_SOURCE=500],
[CXXFLAGS+=" -D_XOPEN_SOURCE=500"])
AX_CHECK_COMPILE_FLAG([-MMD -MP],
[CXXFLAGS+=" -MMD -MP"])
AX_CHECK_COMPILE_FLAG([-Wall -Wnon-virtual-dtor -Wno-unused-variable -Wno-parentheses],
[CXXFLAGS+=" -Wall -Wnon-virtual-dtor -Wno-unused-variable -Wno-parentheses"])
## openmp option
AX_OPENMP([AC_SUBST(OPENMP_CXXFLAGS)])
## test for shared linking option based on OS
GAP_OS_FLAGS
AC_PATH_PROG([FLEX], [flex])
if test "x$FLEX" = "x"; then
echo "flex is needed to compile GapC."
exit -1
fi
AC_PATH_PROG([BISON], [bison])
if test "x$BISON" = "x"; then
echo "bison is needed to compile GapC."
exit -1
fi
AC_PATH_PROG([HG], [hg])
## bison version switch
AX_PROG_BISON_VERSION([3.0],
[BISON_VERSION_FLAG=" -DBISONNEW "],
[BISON_VERSION_FLAG=""])
AC_SUBST(BISON_VERSION_FLAG)
## test for boost # BOOST_CPPFLAGS, BOOST_LDFLAGS
AX_BOOST_BASE([1.36],, [
echo "Boost version 1.36 or newer needed to compile GapC"
exit -1
])
#BOOST_PROGRAM_OPTIONS_LIB
AX_BOOST_PROGRAM_OPTIONS
#BOOST_UNIT_TEST_FRAMEWORK_LIB
AX_BOOST_UNIT_TEST_FRAMEWORK
#BOOST_FILESYSTEM_LIB
AX_BOOST_FILESYSTEM
#BOOST_SERIALIZATION_LIB
AX_BOOST_SERIALIZATION
## GSL , GSL_LIBS, GSL_CFLAGS
AX_PATH_GSL([1.0],[],
[
echo "GSL needed to compile GapC"
exit -1
])
# Checks for typedefs, structures, and compiler characteristics.
AC_HEADER_STDBOOL
AC_C_INLINE
AC_C_CONST
AC_TYPE_INT16_T
AC_TYPE_INT32_T
AC_TYPE_INT8_T
AC_C_RESTRICT
AC_TYPE_SIZE_T
AC_TYPE_UINT16_T
AC_TYPE_UINT32_T
AC_TYPE_UINT64_T
AC_TYPE_UINT8_T
AC_FUNC_ERROR_AT_LINE
AC_FUNC_MALLOC
AC_FUNC_MEMCMP
AC_FUNC_REALLOC
AC_CHECK_FUNCS([memset strerror])
# compile flags for ViennaRNA part
CFLAGS+=" -DHAVE_CONFIG_H "
AC_CONFIG_SUBDIRS([librna])
AC_OUTPUT