-
Notifications
You must be signed in to change notification settings - Fork 0
/
configure.ac
214 lines (182 loc) · 6.35 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
203
204
205
206
207
208
209
210
211
212
213
AC_INIT([opendnp3], [1.1.0-RC1], [open-dnp3@googlegroups.com])
AC_COPYRIGHT([(C) 2010, 2011 Green Energy Corp. All rights reserved.])
srcdir="`cd $srcdir; pwd`"
AC_CONFIG_AUX_DIR([build-aux])
AC_CONFIG_MACRO_DIR([config/autotools/m4])
AM_INIT_AUTOMAKE([subdir-objects -Wno-portability])
AC_PREFIX_DEFAULT([/usr])
AC_CONFIG_FILES([Makefile])
AC_CONFIG_HEADERS([config.h])
AC_LANG([C++])
AX_BOOST_BASE([1.43],, AC_MSG_ERROR(missing boost))
AX_BOOST_DATE_TIME
AX_BOOST_PROGRAM_OPTIONS
AX_BOOST_SYSTEM
AX_BOOST_THREAD
AX_BOOST_UNIT_TEST_FRAMEWORK
AC_ARG_ENABLE(teamcity,
AS_HELP_STRING([--enable-teamcity], [Enable teamcity test output]),
[ac_teamcity_enabled=$enableval], [ac_teamcity_enabled=no])
AM_CONDITIONAL(TEAMCITY, [test "$ac_teamcity_enabled" = yes])
AC_ARG_ENABLE(lcov,
AS_HELP_STRING([--enable-lcov], [Enable gcov/lcov support]),
[ac_lcov_enabled=$enableval], [ac_lcov_enabled=no])
if test "$ac_lcov_enabled" = yes; then
AC_CHECK_PROGS(gcov, gcov)
if ! test "$gcov"; then
AC_MSG_ERROR([Could not find gcov utility, check your gcc instalation])
fi
AC_CHECK_LIB(gcov, __gcov_init, [], [])
AC_CHECK_PROGS(lcov, lcov)
AC_CHECK_PROGS(genhtml, genhtml)
AC_CHECK_PROGS(gendesc, gendesc)
AC_CHECK_PROGS(geninfo, geninfo)
if ! test "$lcov" || ! test "$genhtml" || ! test "$gendesc" ||
! test "$geninfo"; then
AC_MSG_ERROR([Could not find lcov utilities, do you have lcov installed?])
fi
CFLAGS="--coverage -g -O0"
CXXFLAGS="--coverage -g -O0"
LDFLAGS="--coverage"
enable_static=yes
enable_shared=no
fi
AM_CONDITIONAL(LCOV, [test "$ac_lcov_enabled" = yes])
AC_CHECK_HEADERS([arpa/inet.h] ,,AC_MSG_ERROR(missing header))
AC_CHECK_HEADERS([ctype.h] ,,AC_MSG_ERROR(missing header))
AC_CHECK_HEADERS([errno.h] ,,AC_MSG_ERROR(missing header))
AC_CHECK_HEADERS([fcntl.h] ,,AC_MSG_ERROR(missing header))
AC_CHECK_HEADERS([float.h] ,,AC_MSG_ERROR(missing header))
AC_CHECK_HEADERS([getopt.h] ,,AC_MSG_ERROR(missing header))
AC_CHECK_HEADERS([inttypes.h] ,,AC_MSG_ERROR(missing header))
AC_CHECK_HEADERS([math.h] ,,AC_MSG_ERROR(missing header))
AC_CHECK_HEADERS([pthread.h] ,,AC_MSG_ERROR(missing header))
AC_CHECK_HEADERS([setjmp.h] ,,AC_MSG_ERROR(missing header))
AC_CHECK_HEADERS([signal.h] ,,AC_MSG_ERROR(missing header))
AC_CHECK_HEADERS([stdarg.h] ,,AC_MSG_ERROR(missing header))
AC_CHECK_HEADERS([stdio.h] ,,AC_MSG_ERROR(missing header))
AC_CHECK_HEADERS([stdlib.h] ,,AC_MSG_ERROR(missing header))
AC_CHECK_HEADERS([string.h] ,,AC_MSG_ERROR(missing header))
AC_CHECK_HEADERS([sys/select.h] ,,AC_MSG_ERROR(missing header))
AC_CHECK_HEADERS([sys/stat.h] ,,AC_MSG_ERROR(missing header))
AC_CHECK_HEADERS([sys/types.h] ,,AC_MSG_ERROR(missing header))
AC_CHECK_HEADERS([sys/wait.h] ,,AC_MSG_ERROR(missing header))
AC_CHECK_HEADERS([syslog.h] ,,AC_MSG_ERROR(missing header))
AC_CHECK_HEADERS([unistd.h] ,,AC_MSG_ERROR(missing header))
AC_CHECK_LIB([c], [atexit] ,,AC_MSG_ERROR(missing library))
AC_CHECK_LIB([pthread], [pthread_join] ,,AC_MSG_ERROR(missing library))
AC_PROG_AWK
AC_PROG_CXX
AC_PROG_GREP
AC_PROG_INSTALL
AC_PROG_MKDIR_P
AC_PROG_SED
want_swig="no"
AC_ARG_WITH([java],
[AS_HELP_STRING([--with-java@<:@=ARG@:>@],
[use the Java JDK from a standard location (ARG=yes),
from the specified location (ARG=<path>),
or disable it (ARG=no)
@<:@ARG=yes@:>@ ])],
[
if test "$withval" = "no"; then
want_java="no"
elif test "$withval" = "yes"; then
want_java="yes"
ac_java_path=""
else
want_java="yes"
ac_java_path="$withval"
fi
],
[want_java="no"])
if test "$want_java" = yes; then
want_swig="yes"
if test "x$ac_java_path" != "x"; then
CPPFLAGS="$CPPFLAGS -I$ac_java_path"
else
CPPFLAGS="$CPPFLAGS -I/usr/lib/jvm/default-java/include"
fi
AC_CHECK_HEADERS([jni.h] ,,AC_MSG_ERROR(missing header))
AM_PROG_GCJ
fi
AM_CONDITIONAL(WANT_JAVA, [test "$want_java" = yes])
AC_ARG_WITH([python],
[AS_HELP_STRING([--with-python@<:@=ARG@:>@],
[use the Python headers from a standard location (ARG=yes),
from the specified location (ARG=<path>),
or disable it (ARG=no)
@<:@ARG=yes@:>@ ])],
[
if test "$withval" = "no"; then
want_python="no"
elif test "$withval" = "yes"; then
want_python="yes"
ac_python_path=""
else
want_python="yes"
ac_python_path="$withval"
fi
],
[want_python="no"])
if test "$want_python" = yes; then
want_swig="yes"
AM_PATH_PYTHON([2.6],,AC_MSG_ERROR(Python 2.6 or later not found))
AC_CHECK_LIB([python$PYTHON_VERSION], [PyObject_Malloc] ,,AC_MSG_ERROR(missing library))
AC_CHECK_LIB([python$PYTHON_VERSION], [PyExc_ValueError] ,,AC_MSG_ERROR(missing library))
AC_CHECK_LIB([python$PYTHON_VERSION], [_Py_NoneStruct] ,,AC_MSG_ERROR(missing library))
if test "x$ac_python_path" != "x"; then
CPPFLAGS="$CPPFLAGS -I$ac_python_path"
fi
fi
AM_CONDITIONAL(WANT_PYTHON, [test "$want_python" = yes])
if test "$want_swig" = yes; then
AX_PKG_SWIG(1.3.21, [], [ AC_MSG_ERROR([SWIG is required to build.]) ])
AX_SWIG_ENABLE_CXX
AX_SWIG_MULTI_MODULE_SUPPORT
if test "$want_python" = yes; then
SWIG_PYTHON
fi
fi
AM_CONDITIONAL(SWIG_ENABLED, [test "$want_swig" = yes])
LT_INIT
dnl AX_LIBTOOLIZE_CFLAGS(CFLAGS)
dnl AX_LIBTOOLIZE_CFLAGS(CXXFLAGS)
AC_FUNC_FORK
AC_STRUCT_TIMEZONE
AC_TYPE_SIZE_T
AC_TYPE_SSIZE_T
AM_PROG_CC_C_O
AC_CONFIG_FILES([config/doxygen.config])
DX_DOXYGEN_FEATURE(ON)
DX_DOT_FEATURE(OFF)
DX_HTML_FEATURE(ON)
DX_CHM_FEATURE(OFF)
DX_CHI_FEATURE(OFF)
DX_MAN_FEATURE(OFF)
DX_RTF_FEATURE(OFF)
DX_XML_FEATURE(OFF)
DX_PDF_FEATURE(OFF)
DX_PS_FEATURE(OFF)
DX_INIT_DOXYGEN($PACKAGE_NAME, [config/doxygen.config])
AC_OUTPUT
echo "
$PACKAGE_NAME $PACKAGE_VERSION configuration:
-----------------------------------------------------
Source code location: ${srcdir}
Host system type: ${host}
Install path (prefix): ${prefix}
Boost libraries: ${BOOSTLIBDIR}
CXX: ${CXX}
CPPFLAGS: ${CPPFLAGS}
CXXFLAGS: ${CXXFLAGS}
LDFLAGS: ${LDFLAGS}
LIBS: ${LIBS}
java support: ${want_java}
lcov support: ${ac_lcov_enabled}
python support: ${want_python}
shared libraries: ${enable_shared}
static libraries: ${enable_static}
-----------------------------------------------------
When ready, type 'make' to build.
"