forked from velnias75/NetMauMau
-
Notifications
You must be signed in to change notification settings - Fork 0
/
configure.ac
164 lines (134 loc) · 5.59 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
# -*- Autoconf -*-
# Process this file with autoconf to produce a configure script.
AC_PREREQ([2.61])
AC_INIT([NetMauMau], [0.8], [[email protected]], [netmaumau], [https://github.com/velnias75/NetMauMau])
m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES])
AM_INIT_AUTOMAKE([foreign dist-xz no-dist-gzip tar-pax no-installinfo no-texinfo.tex])
AM_MAINTAINER_MODE
AC_CONFIG_HEADERS([config.h])
LT_INIT
LT_LANG([Windows Resource])
AC_SUBST([BUILD_YEAR], [`date +%Y`])
AC_DEFINE_UNQUOTED([BUILD_DATE], [`date +%s`], [the build date in Unix time])
AC_DEFINE_UNQUOTED([BUILD_NODE], ["`uname -n`"], [the build node])
AC_DEFINE_UNQUOTED([BUILD_HOST], ["$build_cpu-$build_vendor-$build_os"], [the build host])
AC_DEFINE_UNQUOTED([BUILD_TARGET], ["$host_cpu-$host_vendor-$host_os"], [the build target])
AC_DEFINE([SERVER_PORT], [8899], [the default server port])
AC_ARG_ENABLE([ansi], [AS_HELP_STRING([--disable-ansi], [disables ANSI support])],
[ if test x$enable_ansi = xno; then
CPPFLAGS="${CPPFLAGS} -DDISABLE_ANSI"
fi
])
AC_ARG_ENABLE([client], [AS_HELP_STRING([--disable-client], [disables build of client library])],
[ AM_CONDITIONAL([ENABLE_CLIENT], [ test x$enable_client = xyes ]) ],
[ AM_CONDITIONAL([ENABLE_CLIENT], [ true ]) ])
AC_ARG_ENABLE([cli-client], [AS_HELP_STRING([--enable-cli-client], [enables build of CLI client])],
[ AM_CONDITIONAL([ENABLE_CLI_CLIENT], [ test x$enable_cli_client = xyes ]) ],
[ AM_CONDITIONAL([ENABLE_CLI_CLIENT], [ false ]) ])
AC_ARG_ENABLE([apidoc], [AS_HELP_STRING([--disable-apidoc], [disables generation of API docs])],
[ AM_CONDITIONAL([GENDOX], [ test x$enable_apidoc = xyes ]) ],
[ AM_CONDITIONAL([GENDOX], [ true ]) ])
AC_ARG_ENABLE([ai-name], [AS_HELP_STRING([--enable-ai-name], [default name of AI player])],
[ AC_DEFINE_UNQUOTED([AI_NAME], ["$enable_ai_name"], [default name of AI player]) ],
[ AC_DEFINE([AI_NAME], ["Computer"], [default name of AI player])])
AC_ARG_ENABLE([ai-image], [AS_HELP_STRING([--enable-ai-image], [path to image of AI player])],
[ AM_CONDITIONAL([BRANDING], [ true ]) AC_SUBST([AI_IMAGE], [$enable_ai_image]) ],
[ AM_CONDITIONAL([BRANDING], [ false ]) AC_SUBST([AI_IMAGE], [\$\(top_srcdir\)/src/server/KS.PNG])])
AC_ARG_ENABLE([pidfile], [AS_HELP_STRING([--enable-pidfile], [enables creation of pid file])],
[ AM_CONDITIONAL([PIDFILE], [ test x$enable_pidfile = xyes ]) ],
[ AM_CONDITIONAL([PIDFILE], [ false ]) ])
PKG_PROG_PKG_CONFIG([0.22])
# Checks for programs.
AC_PROG_CXX
AC_CHECK_PROGS([HELP2MAN], [help2man])
AC_CHECK_PROGS([DOXYGEN], [doxygen])
AC_CHECK_PROGS([CPPCHECK], [cppcheck])
if test -z "$ac_cv_prog_HELP2MAN"; then
AM_CONDITIONAL([GENMAN], [ false ])
else
AM_CONDITIONAL([GENMAN], [ true ])
fi
if test -z "$ac_cv_prog_DOXYGEN"; then
AM_CONDITIONAL([GENDOX], [ false ])
fi
if test -z "$ac_cv_prog_CPPCHECK"; then
AM_CONDITIONAL([CHECKCPP], [ false ])
else
AM_CONDITIONAL([CHECKCPP], [ true ])
fi
if test -z "$ac_cv_prog_RC"; then
AM_CONDITIONAL([RC], [ false ])
else
AM_CONDITIONAL([RC], [ true ])
fi
if test x$enable_cli_client = xyes; then
AM_CONDITIONAL([ENABLE_CLIENT], [ true ])
fi
# Checks for libraries.
PKG_CHECK_MODULES([POPT], [popt >= 1.10])
AC_CHECK_LIB([magic], [magic_open])
PKG_CHECK_MODULES([GSL], [gsl >= 1.9],
[ AM_CONDITIONAL([GSL], [ true ])
echo "[[ENVIRONMENT]]
.TP
\fBGSL_RNG_TYPE\fR
the name of a generator, such as ranlxs2, taus or mt19937
.TP
\fBGSL_RNG_SEED\fR
the desired seed value
.PP
See the
.mso www.tmac
.URL \"http://www.gnu.org/software/gsl/manual/html_node/Random-number-environment-variables.html\" \"GSL Manual\" \" for more information\"" > gsl.h2m ],
[ AM_CONDITIONAL([GSL], [ false ])] )
# Checks for header files.
AC_HEADER_STDBOOL
AC_CHECK_HEADERS([magic.h])
AC_CHECK_HEADERS([poll.h])
AC_CHECK_HEADERS([netdb.h])
AC_CHECK_HEADERS([syslog.h])
AC_CHECK_HEADERS([sys/socket.h])
# Checks for typedefs, structures, and compiler characteristics.
AX_CXX_GCC_ABI_DEMANGLE
AC_CHECK_TYPES([ptrdiff_t])
AC_TYPE_SIZE_T
AC_TYPE_SSIZE_T
AC_TYPE_UINT16_T
AC_TYPE_UINT32_T
AC_TYPE_UID_T
AC_TYPE_PID_T
AC_C_INLINE
# Checks for library functions.
AC_CHECK_FUNCS([initstate])
AC_CHECK_FUNCS([strtoul])
AC_CHECK_FUNCS([memset])
AC_CHECK_FUNCS([socket])
AC_CHECK_FUNCS([select])
AC_CHECK_FUNCS([atexit])
AC_CHECK_FUNCS([strerror])
AC_CHECK_FUNC([arc4random_uniform],
[ AC_DEFINE([HAVE_ARC4RANDOM_UNIFORM], [1], [we have arc4random_uniform])
])
AC_FUNC_ERROR_AT_LINE
AC_FUNC_CHOWN
SERVER_VERSION_MAJOR="`echo ${PACKAGE_VERSION} | tr -s '~.' '\t' | cut -f1`"
SERVER_VERSION_MINOR="`echo ${PACKAGE_VERSION} | tr -s '~.' '\t' | cut -f2`"
AC_SUBST([SERVER_VERSION_MAJOR])
AC_SUBST([SERVER_VERSION_MINOR])
AC_DEFINE([MAXPICBYTES], [1048576], [maximum size of player image in bytes (base64 encoded)])
AC_DEFINE_UNQUOTED([SERVER_VERSION_MAJOR], [${SERVER_VERSION_MAJOR}], [server version major])
AC_DEFINE_UNQUOTED([SERVER_VERSION_MINOR], [${SERVER_VERSION_MINOR}], [server version minor])
LDFLAGS="-Wl,--as-needed ${LDFLAGS}"
CFLAGS="${CFLAGS} -std=gnu99 -fvisibility-inlines-hidden"
CXXFLAGS="${CXXFLAGS} -std=gnu++98 -fvisibility=internal -fvisibility-inlines-hidden -fstrict-aliasing"
CPPFLAGS="${CPPFLAGS} -DBASICLOGGER_NO_PTHREADS -D_GLIBCXX_VISIBILITY=0"
NO_RTTI_FLAGS="-fno-rtti -fno-exceptions"
AC_SUBST([LDFLAGS])
AC_SUBST([CFLAGS])
AC_SUBST([CXXFLAGS])
AC_SUBST([CPPFLAGS])
AC_SUBST([NO_RTTI_FLAGS])
AC_CONFIG_MACRO_DIR([m4])
AC_CONFIG_FILES([src/server/netmaumau.rc doc/client.dox netmaumau.h2m])
AC_OUTPUT([Makefile src/include/Makefile src/Makefile src/common/Makefile src/engine/Makefile
src/server/Makefile src/client/Makefile src/test/Makefile doc/Makefile])