forked from helios-base/librcsc
-
Notifications
You must be signed in to change notification settings - Fork 1
/
configure.ac
225 lines (191 loc) · 6.55 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
214
215
216
217
218
219
220
221
222
223
224
225
# -*- Autoconf -*-
# Process this file with autoconf to produce a configure script.
AC_PREREQ(2.65)
LT_PREREQ(2.2)
AC_INIT([librcsc],[rc2021],[[email protected]])
#LT_PREREQ(2.2.4)
AC_CONFIG_SRCDIR([config.h.in])
#AM_CONFIG_HEADER([config.h])
AC_CONFIG_HEADERS([config.h])
AC_CONFIG_AUX_DIR([config])
AC_CONFIG_MACRO_DIR([m4])
#
#AM_INIT_AUTOMAKE([gnu check-news])
AM_INIT_AUTOMAKE([gnu])
# it is necessary to check c++ header files.
AC_LANG([C++])
##################################################
# libtool settings
##################################################
LT_INIT([shared disable-static])
LT_LANG([C++])
# AC_PROG_LIBTOOL
# AC_ENABLE_SHARED
# AC_DISABLE_STATIC
AC_SUBST(LIBTOOL_DEPS)
##################################################
# Checks for programs.
##################################################
AC_PROG_CXX
AC_PROG_CC
AC_PROG_CPP
AC_PROG_INSTALL
AC_PROG_LN_S
AC_PROG_MAKE_SET
##################################################
# Checks for libraries.
##################################################
AC_CHECK_LIB([m], [cos],
[LIBS="-lm $LIBS"],
[AC_MSG_ERROR([*** -lm not found! ***])])
libz="yes"
AC_CHECK_LIB([z], [deflate],
[AC_DEFINE([HAVE_LIBZ], [1],
[Define to 1 if you have the `z' library (-lz).])
LIBS="-lz $LIBS"],
[libz="no"])
##################################################
# Checks for header files.
##################################################
AC_CHECK_HEADERS([arpa/inet.h])
AC_CHECK_HEADERS([fcntl.h],
break,
[AC_MSG_ERROR([*** fcntl.h not found ***])])
AC_CHECK_HEADERS([netinet/in.h],
break,
[AC_MSG_ERROR([*** netinet/in.h not found ***])])
AC_CHECK_HEADERS([netdb.h],
break,
[AC_MSG_ERROR([*** netdb.h not found ***])])
AC_CHECK_HEADERS([sys/socket.h],
break,
[AC_MSG_ERROR([*** sys/socket.h not found ***])])
AC_CHECK_HEADERS([sys/time.h],
break,
[AC_MSG_ERROR([*** sys/time.h not found ***])])
AC_CHECK_HEADERS([unistd.h],
break,
[AC_MSG_ERROR([*** unistd.h not found ***])])
##################################################
# Checks for types.
##################################################
AC_CHECK_TYPES(socklen_t,,
AC_DEFINE(socklen_t, int, [Define missing socklen_t.]), [
#if HAVE_SYS_TYPES_H
# include <sys/types.h>
#endif
#include <sys/socket.h>])
##################################################
# Checks for typedefs, structures, and compiler characteristics.
##################################################
AC_HEADER_STDBOOL
AC_C_CONST
AC_C_INLINE
#AC_TYPE_INT16_T
#AC_TYPE_INT32_T
#AC_TYPE_INT64_T
#AC_TYPE_UINT32_T
AC_TYPE_SIZE_T
AC_HEADER_TIME
##################################################
# Checks for library functions.
##################################################
AC_HEADER_STDC
AC_FUNC_MALLOC
AC_FUNC_REALLOC
AC_FUNC_SELECT_ARGTYPES
AC_FUNC_STRTOD
AC_FUNC_VPRINTF
AC_CHECK_FUNCS([floor inet_addr getaddrinfo gethostbyname gettimeofday])
AC_CHECK_FUNCS([memset pow rint select socket sqrt strerror strtol])
##################################################
# check C++
##################################################
AX_CXX_COMPILE_STDCXX_14(noext)
##################################################
# check boost
##################################################
AX_BOOST_BASE([1.38.0])
AX_BOOST_SYSTEM
CPPFLAGS="$CPPFLAGS $BOOST_CPPFLAGS"
LDFLAGS="$LDFLAGS $BOOST_LDFLAGS"
##################################################
# enable/disable unit test
##################################################
AC_ARG_ENABLE(unit-test,
AS_HELP_STRING([--enable-unit-test],[build unit test code. (default=no)]))
if test "x$enable_unit_test" = "xyes"; then
AC_MSG_NOTICE(enabled unit test)
# AX_BOOST_UNIT_TEST_FRAMEWORK
AM_PATH_CPPUNIT([1.12.0],
[],
[AC_MSG_ERROR([*** CppUnit not found! ***])])
AM_CONDITIONAL(UNIT_TEST, [test "1" = "1"])
else
AM_CONDITIONAL(UNIT_TEST, [test "1" = "0"])
fi
##################################################
# enable/disable debug mode
##################################################
AC_ARG_ENABLE(debug,
AS_HELP_STRING([--enable-debug],[turn on debugging. DEBUG is defined in preprocessor. (default=no)]))
if test "x$enable_debug" = "xyes"; then
AC_MSG_NOTICE(enabled debug)
# AC_DEFINE([DEBUG], [1], [debugging flag])
CFLAGS="-DDEBUG $CFLAGS"
CXXFLAGS="-DDEBUG $CXXFLAGS"
fi
##################################################
# enable/disable example code
##################################################
#example code
AC_ARG_ENABLE(example,
AS_HELP_STRING([--enable-example],[build example code (default=no)]))
if test "x$enable_example" = "xyes"; then
AC_MSG_NOTICE(enabled example build)
AM_CONDITIONAL(BUILD_EXAMPLE, [test "1" = "1"])
else
AM_CONDITIONAL(BUILD_EXAMPLE, [test "1" = "0"])
fi
##################################################
# check external tools
##################################################
#AC_CHECK_PROG([DOXYGEN], [doxygen], [yes], [no])
#AM_CONDITIONAL(DOXYGEN, test x$DOXYGEN = xyes)
AC_SUBST(DOXYGEN)
AC_SUBST(HAVE_DOT)
AC_PATH_PROG([DOXYGEN], [doxygen], [AC_MSG_NOTICE(doxygen not found)])
AC_CHECK_PROG([HAVE_DOT], [dot], [YES], [NO])
##################################################
# generated files
##################################################
AC_CONFIG_FILES([Doxyfile
librcsc.pc
librcsc.spec
librcsc-config
librcscenv
Makefile
rcsc/Makefile
rcsc/ann/Makefile
rcsc/clang/Makefile
rcsc/color/Makefile
rcsc/geom/Makefile
rcsc/geom/triangle/Makefile
rcsc/gz/Makefile
rcsc/monitor/Makefile
rcsc/net/Makefile
rcsc/param/Makefile
rcsc/rcg/Makefile
rcsc/time/Makefile
rcsc/util/Makefile
rcsc/common/Makefile
rcsc/player/Makefile
rcsc/action/Makefile
rcsc/formation/Makefile
rcsc/coach/Makefile
rcsc/trainer/Makefile
example/Makefile
src/Makefile],
[test -f librcsc-config && chmod +x librcsc-config
test -f librcscenv && chmod +x librcscenv])
AC_OUTPUT