-
Notifications
You must be signed in to change notification settings - Fork 51
/
configure.ac
246 lines (213 loc) · 7.21 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
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
# -*- Autoconf -*-
# Process this file with autoconf to produce a configure script.
AC_PREREQ([2.69])
LT_PREREQ([2.2])
AC_INIT([RCSSServer],[19.0.0],[https://github.com/rcsoccersim/],[rcssserver])
#AM_INIT_AUTOMAKE([gnu 1.7.2 check-news dist-bzip2 dist-zip])
AM_INIT_AUTOMAKE([gnu 1.7.2 check-news foreign])
AC_CONFIG_SRCDIR([config.h.in])
AC_CONFIG_HEADERS([config.h])
AC_CONFIG_MACRO_DIR([m4])
##################################################
# 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
#ACX_PTHREAD([LIBS="$PTHREAD_LIBS $LIBS"
# CFLAGS="$CFLAGS $PTHREAD_CFLAGS"
# CXXFLAGS="$CXXFLAGS $PTHREAD_CFLAGS"
# CC="$PTHREAD_CC"])
##################################################
# Checks for libraries.
##################################################
AC_CHECK_LIB([m], [cos])
dnl AC_CHECK_LIB(expat, XML_Parse)
#AC_CHECK_LIB([z], [deflate])
#AC_SUBST(GZ_LIBS)
#AC_CHECK_LIB([z], [deflate],
# [AC_DEFINE([HAVE_LIBZ], [1],
# [Define to 1 if you have the `z' library (-lz).])
# GZ_LIBS="-lz"])
AX_CHECK_ZLIB([],
[AC_MSG_NOTICE(Zlib not found.)])
##################################################
# Checks for header files.
##################################################
AC_FUNC_ALLOCA
#AC_HEADER_STDC
AC_CHECK_HEADERS([arpa/inet.h fcntl.h])
AC_CHECK_HEADERS([inttypes.h libintl.h libintl.h malloc.h netdb.h])
AC_CHECK_HEADERS([netinet/in.h poll.h pwd.h stddef.h stdlib.h sys/param.h])
AC_CHECK_HEADERS([sys/socket.h sys/time.h sys/types.h unistd.h])
#AC_CHECK_HEADERS([winsock2.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_INT8_T
AC_TYPE_SIZE_T
#AC_HEADER_TIME
AC_STRUCT_TM
AC_TYPE_UINT16_T
AC_TYPE_UINT32_T
AC_TYPE_UINT8_T
AC_CHECK_TYPES([ptrdiff_t])
AC_CHECK_TYPES([socklen_t], [], [], [
#include <sys/types.h>
#include <sys/socket.h>
])
##################################################
# Checks for library functions.
##################################################
AC_FUNC_FORK
AC_FUNC_MALLOC
AC_FUNC_REALLOC
AC_DIAGNOSE([obsolete],[your code may safely assume C89 semantics that RETSIGTYPE is void.
Remove this warning and the `AC_CACHE_CHECK' when you adjust the code.])dnl
AC_CACHE_CHECK([return type of signal handlers],[ac_cv_type_signal],[AC_COMPILE_IFELSE(
[AC_LANG_PROGRAM([#include <sys/types.h>
#include <signal.h>
],
[return *(signal (0, 0)) (0) == 1;])],
[ac_cv_type_signal=int],
[ac_cv_type_signal=void])])
AC_DEFINE_UNQUOTED([RETSIGTYPE],[$ac_cv_type_signal],[Define as the return type of signal handlers
(`int' or `void').])
AC_FUNC_STRFTIME
AC_CHECK_FUNCS([floor gethostbyname gettimeofday inet_ntoa memset mkdir pow rint])
AC_CHECK_FUNCS([select socket sqrt strdup strerror])
##################################################
# check flex
##################################################
AC_SUBST([FLEX])
AC_SUBST([FLEXFLAGS])
AC_SUBST([AM_FLEXFLAGS])
#AC_ARG_WITH([flex],
# [ --with-flex=FLEX_PATH set the flex path. it is possible to specify a
# certain flex to generate lexer sources.])
#if test x$with_flex != x && test -x "$with_flex" ; then
# FLEX="$with_flex"
AC_ARG_VAR(FLEX, [name and location of the fast lexical analyser generator.
If it is not set, configure looks for flex in your PATH])
if test -z "$FLEX" ; then
# AC_CHECK_PROG([FLEX],[flex],flex)
AX_PROG_FLEX([FLEX="$LEX"],[FLEX=""])
fi
AM_FLEXFLAGS="-olex.yy.c"
if test -z "$FLEX" ; then
AC_MSG_ERROR([
\`flex' is missing on your system. Please install it first.]);
fi
##################################################
# check bison
##################################################
#AC_PROG_YACC
AX_PROG_BISON([],
[AC_MSG_ERROR([
\`bison' is missing on your system. Please install it first.]);])
##################################################
# libtool settings
##################################################
AC_ENABLE_SHARED
AC_DISABLE_STATIC
#LT_INIT([shared disable-static])
#LT_LANG([C++])
AC_PROG_LIBTOOL
#AC_ENABLE_SHARED
#AC_DISABLE_STATIC
AC_SUBST(LIBTOOL_DEPS)
##LIBS="$LIBS $lt_cv_dlopen_libs"
#AC_ARG_VAR(SED, [name and location of sed executable. If it is not
#set, configure looks for sed in your PATH])
#
#grep "SED=" ./libtool >& /dev/null
#if test "$?" -ne 0; then
# if test -z "$SED" ; then
# AC_PATH_PROG(SED, sed)
# fi
# if test -z "$SED"; then
# AC_MSG_ERROR([
# sed cannot be found on your system. Please install it in
# your PATH, or specify it's location to configure. e.g.
# `./configure SED=/bin/sed`], 1)
# fi
# mv libtool libtool.tmp
# ${AWK} -v SED="$SED" '/# libtool/ \
# { if( done != "true" ) { print "SED=\"" SED "\""; done = "true"; } } \
# { print; }' libtool.tmp > libtool
# chmod +x libtool
#fi
#
#echo `pwd`
#mv libtool libtool.tmp
#${AWK} -v EGREP="${EGREP}" '/# libtool/ \
#{ if( done != "true" ) { print "EGREP=\"" EGREP "\""; done = "true"; } } \
#{ print; }' libtool.tmp > libtool
#chmod +x libtool
#rm -f libtool.tmp
##################################################
# check C++
##################################################
AX_CXX_COMPILE_STDCXX_17(noext)
##################################################
# check boost
##################################################
AX_BOOST_BASE([1.44.0])
AX_BOOST_SYSTEM
CPPFLAGS="$CPPFLAGS $BOOST_CPPFLAGS"
LDFLAGS="$LDFLAGS $BOOST_LDFLAGS"
#OLDLIBS="$LIBS"
#LIBS="$LIBS $BOOST_FILESYSTEM_LIB"
##################################################
# enable/disable rcssclient
##################################################
AC_SUBST(RCSSCLIENT)
AC_ARG_ENABLE(rcssclient,
[ --enable-rcssclient[=ARG] build rcssclient, a sample client [ARG=yes]],
if test -n $enableval; then
if test $enableval = yes; then
RCSSCLIENT=rcssclient$EXEEXT
echo enabling rcssclient
elif test $enableval = no; then
RCSSCLIENT=
echo disabling rcssclient
fi
fi
, RCSSCLIENT=rcssclient$EXEEXT)
if ! test -z "$RCSSCLIENT"; then
AC_CHECK_FUNCS([select])
AC_FUNC_SELECT_ARGTYPES
# AC_ARG_WITH(ncurses,
# AS_HELP_STRING(--with-ncurses,use ncurses for rcssclient (default=yes)),
# use_ncurses=$withval, use_ncurses=yes)
# if test "$use_ncurses" = "yes"; then
# AC_CHECK_LIB(ncurses, initscr,[
# AC_DEFINE(HAVE_LIBNCURSES, 1, [
# "Define to 1 if you have the `ncurses' library (-lncurses)."] )
AC_ARG_VAR(RCSSCLIENT_LIBS, The libs rcssclient needs)
# RCSSCLIENT_LIBS="-lncurses"
# ])
# fi
fi
##################################################
# generated files
##################################################
AC_CONFIG_FILES([Makefile
rcss/Makefile
rcss/net/Makefile
rcss/conf/Makefile
rcss/gzip/Makefile
rcss/clang/Makefile
src/Makefile
src/rcsoccersim],
[test -f src/rcsoccersim && chmod +x src/rcsoccersim])
AC_OUTPUT