1 |
root |
1.181 |
dnl Process this file with autoconf to produce a configure script., |
2 |
root |
1.1 |
|
3 |
root |
1.185 |
AC_INIT([deliantra-server], [3.1], [support@deliantra.net]) |
4 |
|
|
dnl AC_CONFIG_MACRO_DIR([m4]) |
5 |
root |
1.1 |
AC_CONFIG_AUX_DIR(utils) |
6 |
root |
1.54 |
AC_CONFIG_SRCDIR([server/cfperl.xs]) |
7 |
root |
1.186 |
AM_INIT_AUTOMAKE([silent-rules subdir-objects foreign no-dist-gzip dist-xz]) |
8 |
root |
1.1 |
AM_CONFIG_HEADER(include/autoconf.h) |
9 |
|
|
|
10 |
|
|
AM_MAINTAINER_MODE |
11 |
|
|
|
12 |
root |
1.95 |
AC_PREFIX_DEFAULT(/usr/games/deliantra) |
13 |
root |
1.1 |
|
14 |
root |
1.59 |
AC_PATH_PROG(GPERF, gperf) |
15 |
|
|
if test -z "$GPERF"; then |
16 |
|
|
AC_MSG_ERROR([gperf, the GNU perfect hash generator, must be in your PATH, check the README]) |
17 |
|
|
fi |
18 |
|
|
|
19 |
|
|
AC_PATH_PROG(RSYNC, rsync) |
20 |
|
|
if test -z "$RSYNC"; then |
21 |
|
|
AC_MSG_ERROR([rsync must be in your PATH, check the README]) |
22 |
|
|
fi |
23 |
|
|
|
24 |
root |
1.58 |
AC_PATH_PROG(OPTIPNG, optipng) |
25 |
|
|
if test -z "$OPTIPNG"; then |
26 |
root |
1.59 |
AC_MSG_ERROR([optipng must be in your PATH, check the README]) |
27 |
|
|
fi |
28 |
|
|
|
29 |
root |
1.70 |
AC_PATH_PROG(PNGNQ, pngnq) |
30 |
|
|
if test -z "$PNGNQ"; then |
31 |
|
|
AC_MSG_ERROR([png neuquant (pngnq) must be in your PATH, check the README]) |
32 |
|
|
fi |
33 |
|
|
|
34 |
root |
1.180 |
AC_PATH_PROG(IDENTIFY, identify) |
35 |
|
|
if test -z "$IDENTIFY"; then |
36 |
|
|
AC_MSG_ERROR([ImageMagick 'identify' must be in your PATH, check the README]) |
37 |
|
|
fi |
38 |
root |
1.41 |
|
39 |
root |
1.55 |
AC_PATH_PROG(CONVERT, convert) |
40 |
|
|
if test -z "$CONVERT"; then |
41 |
root |
1.59 |
AC_MSG_ERROR([ImageMagick 'convert' must be in your PATH, check the README]) |
42 |
root |
1.55 |
fi |
43 |
|
|
|
44 |
root |
1.142 |
AC_PATH_PROG(PERL, perl5.10.1) |
45 |
root |
1.56 |
if test -z "$PERL"; then |
46 |
root |
1.175 |
AC_PATH_PROG(PERL, perl) |
47 |
root |
1.56 |
if test -z "$PERL"; then |
48 |
root |
1.175 |
AC_MSG_ERROR([perl 5.10.1 or higher must be in your PATH, check the README]) |
49 |
root |
1.56 |
fi |
50 |
|
|
fi |
51 |
root |
1.33 |
|
52 |
root |
1.60 |
for module_vers in \ |
53 |
root |
1.178 |
"common::sense 3.3" \ |
54 |
root |
1.182 |
"AnyEvent 7.0" \ |
55 |
root |
1.139 |
"AnyEvent::AIO 0" \ |
56 |
|
|
"AnyEvent::BDB 0" \ |
57 |
root |
1.150 |
"BDB 1.8" \ |
58 |
root |
1.146 |
"Compress::LZF 3.41" \ |
59 |
root |
1.183 |
"Coro 6" \ |
60 |
root |
1.133 |
"Coro::EV 0" \ |
61 |
root |
1.184 |
"Deliantra 2.0" \ |
62 |
root |
1.72 |
"Digest::MD5 2.0" \ |
63 |
root |
1.183 |
"EV 4" \ |
64 |
|
|
"Guard 1" \ |
65 |
|
|
"IO::AIO 4" \ |
66 |
root |
1.100 |
"JSON::XS 2.01" \ |
67 |
elmex |
1.148 |
"AnyEvent::IRC 0.6" \ |
68 |
root |
1.177 |
"Pod::POM 0.27" \ |
69 |
root |
1.72 |
"Safe::Hole 0.10" \ |
70 |
root |
1.60 |
"Storable 2.0" \ |
71 |
root |
1.87 |
"URI 1.35" \ |
72 |
root |
1.165 |
"YAML::XS 0.32" \ |
73 |
root |
1.193 |
"CBOR::XS 1.5" \ |
74 |
root |
1.60 |
; do |
75 |
root |
1.47 |
set -- $module_vers |
76 |
|
|
module=$1 |
77 |
|
|
minvers=$2 |
78 |
|
|
AC_MSG_CHECKING(for $module perl module version $minvers or higher) |
79 |
|
|
if $PERL -M$module -e0 >/dev/null 2>&1; then |
80 |
|
|
version=`$PERL -M$module -e "print \\$$module::VERSION"` |
81 |
root |
1.111 |
if $PERL -M$module -e "\$$module::VERSION >= $minvers or die" >/dev/null 2>&1; then |
82 |
root |
1.47 |
AC_MSG_RESULT([ok, version $version]) |
83 |
|
|
else |
84 |
|
|
AC_MSG_ERROR([no, installed version is $version]) |
85 |
|
|
fi |
86 |
|
|
else |
87 |
|
|
AC_MSG_ERROR([no, cannot load module $module]) |
88 |
|
|
fi |
89 |
|
|
done |
90 |
|
|
|
91 |
root |
1.58 |
AC_LANG(C++) |
92 |
|
|
AC_PROG_CXX |
93 |
|
|
AC_PROG_CPP |
94 |
|
|
|
95 |
root |
1.194 |
AX_CXX_COMPILE_STDCXX(14, [noext], [mandatory]) |
96 |
root |
1.191 |
|
97 |
root |
1.190 |
AX_CHECK_COMPILE_FLAG(-Wno-unused-result,[CXXFLAGS="$CXXFLAGS -Wno-unused-result"]) |
98 |
|
|
AX_CHECK_COMPILE_FLAG(-Wno-narrowing,[CXXFLAGS="$CXXFLAGS -Wno-narrowing"]) |
99 |
|
|
|
100 |
root |
1.191 |
AC_CHECK_HEADER(unordered_map,[],[AC_MSG_ERROR([Your compiler must support C++11 headers.])]) |
101 |
root |
1.58 |
|
102 |
root |
1.118 |
AC_CHECK_HEADER(pthread.h,[],[AC_MSG_ERROR([POSIX thread support is required.])]) |
103 |
|
|
|
104 |
root |
1.58 |
AC_PATH_PROG(PKG_CONFIG, pkg-config, no) |
105 |
|
|
|
106 |
root |
1.190 |
AC_MSG_CHECKING(blitz++ >= 0.10) |
107 |
|
|
if $PKG_CONFIG blitz --atleast-version 0.10; then |
108 |
root |
1.181 |
CXXFLAGS="$CXXFLAGS `$PKG_CONFIG blitz --cflags`" |
109 |
|
|
LIBS="$LIBS `$PKG_CONFIG blitz --libs`" |
110 |
|
|
AC_MSG_RESULT(ok) |
111 |
|
|
else |
112 |
|
|
AC_MSG_ERROR(no) |
113 |
|
|
fi |
114 |
|
|
|
115 |
root |
1.190 |
AC_MSG_CHECKING(glib >= 2.32) |
116 |
root |
1.58 |
if $PKG_CONFIG glib-2.0 --atleast-version 2.10; then |
117 |
|
|
CXXFLAGS="$CXXFLAGS `$PKG_CONFIG glib-2.0 --cflags`" |
118 |
|
|
LIBS="$LIBS `$PKG_CONFIG glib-2.0 --libs`" |
119 |
|
|
AC_MSG_RESULT(ok) |
120 |
|
|
else |
121 |
|
|
AC_MSG_ERROR(no) |
122 |
|
|
fi |
123 |
|
|
|
124 |
root |
1.126 |
AC_MSG_CHECKING(gthread >= 0.0) |
125 |
|
|
if $PKG_CONFIG gthread-2.0 --atleast-version 0.0; then |
126 |
|
|
CXXFLAGS="$CXXFLAGS `$PKG_CONFIG gthread-2.0 --cflags`" |
127 |
|
|
LIBS="$LIBS `$PKG_CONFIG gthread-2.0 --libs`" |
128 |
|
|
AC_MSG_RESULT(ok) |
129 |
|
|
else |
130 |
|
|
AC_MSG_ERROR(no) |
131 |
|
|
fi |
132 |
|
|
|
133 |
root |
1.77 |
dnl AC_MSG_CHECKING(libpng) |
134 |
|
|
dnl if $PKG_CONFIG libpng --exists; then |
135 |
|
|
dnl CXXFLAGS="$CXXFLAGS `$PKG_CONFIG libpng --cflags`" |
136 |
|
|
dnl LIBS="$LIBS `$PKG_CONFIG libpng --libs`" |
137 |
|
|
dnl AC_MSG_RESULT(ok) |
138 |
|
|
dnl else |
139 |
|
|
dnl AC_MSG_ERROR(no) |
140 |
|
|
dnl fi |
141 |
root |
1.58 |
|
142 |
root |
1.41 |
AC_MSG_CHECKING(for $PERL suitability) |
143 |
root |
1.175 |
if $PERL -MExtUtils::Embed -e "use 5.10.1" >/dev/null 2>&1; then |
144 |
root |
1.41 |
save_CXXFLAGS="$CXXFLAGS" |
145 |
|
|
save_LIBS="$LIBS" |
146 |
|
|
xPERLFLAGS="`$PERL -MExtUtils::Embed -e ccopts`" |
147 |
root |
1.97 |
xPERLFLAGS="$xPERLFLAGS `$PERL -MEV::MakeMaker -e 'print +{&EV::MakeMaker::ev_args}->{INC}'`" |
148 |
root |
1.41 |
xPERLFLAGS="$xPERLFLAGS `$PERL -MCoro::MakeMaker -e 'print +{&Coro::MakeMaker::coro_args}->{INC}'`" |
149 |
|
|
CXXFLAGS="$CXXFLAGS $xPERLFLAGS" |
150 |
|
|
LIBS="$LIBS `$PERL -MExtUtils::Embed -e ldopts`" |
151 |
|
|
AC_TRY_LINK([ |
152 |
|
|
#include <EXTERN.h> |
153 |
|
|
#include <perl.h> |
154 |
|
|
#include <XSUB.h> |
155 |
root |
1.97 |
#include "EVAPI.h" |
156 |
root |
1.142 |
#include "CoroAPI.h" |
157 |
root |
1.41 |
],[ |
158 |
|
|
PerlInterpreter *perl = perl_alloc (); |
159 |
|
|
],[perl_link=yes],[perl_link=no]) |
160 |
|
|
CXXFLAGS="$save_CXXFLAGS" |
161 |
|
|
LIBS="$save_LIBS" |
162 |
|
|
|
163 |
|
|
if test x$perl_link = xyes; then |
164 |
|
|
AC_MSG_RESULT(ok) |
165 |
|
|
PERLFLAGS="$xPERLFLAGS" |
166 |
|
|
PERLLIB="`$PERL -MExtUtils::Embed -e ldopts`" |
167 |
|
|
PERLPRIVLIBEXP="`$PERL -MConfig -e 'print $Config{privlibexp}'`" |
168 |
|
|
CPPFLAGS="$CPPFLAGS $PERLFLAGS" |
169 |
|
|
else |
170 |
root |
1.142 |
AC_MSG_ERROR([no, unable to link test program]) |
171 |
root |
1.41 |
fi |
172 |
|
|
else |
173 |
root |
1.175 |
AC_MSG_ERROR([no working perl found, or perl not version >= 5.10.1]) |
174 |
root |
1.41 |
fi |
175 |
|
|
AC_SUBST(PERLLIB) |
176 |
|
|
AC_SUBST(PERLFLAGS) |
177 |
|
|
AC_SUBST(PERLPRIVLIBEXP) |
178 |
|
|
AC_SUBST(PERL) |
179 |
|
|
|
180 |
root |
1.78 |
dnl AC_PROG_LIBTOOL |
181 |
|
|
AC_PROG_RANLIB |
182 |
root |
1.77 |
|
183 |
root |
1.92 |
AC_CHECK_HEADERS(execinfo.h malloc.h) |
184 |
root |
1.77 |
AC_CHECK_FUNCS(backtrace) |
185 |
|
|
|
186 |
root |
1.1 |
dnl check for some other programs |
187 |
|
|
AC_PATH_PROG(TAR, tar) |
188 |
|
|
AC_PATH_PROG(BASENAME, basename) |
189 |
|
|
|
190 |
root |
1.118 |
AC_CHECK_LIB(nsl, gethostbyname) |
191 |
|
|
AC_CHECK_LIB(socket, connect) |
192 |
|
|
AC_CHECK_LIB(pthread, pthread_create) |
193 |
root |
1.1 |
|
194 |
|
|
dnl Checks for libraries. |
195 |
|
|
AC_CHECK_LIB(m, main) |
196 |
|
|
|
197 |
|
|
AC_CHECK_SIZEOF(long) |
198 |
|
|
AC_CHECK_SIZEOF(long long) |
199 |
|
|
|
200 |
root |
1.77 |
AC_MSG_CHECKING(for tcp_info support) |
201 |
|
|
AC_TRY_LINK([ |
202 |
|
|
#include <sys/types.h> |
203 |
|
|
#include <sys/socket.h> |
204 |
|
|
#include <netinet/in.h> |
205 |
|
|
#include <netinet/tcp.h> |
206 |
|
|
],[ |
207 |
|
|
int fd; |
208 |
|
|
struct tcp_info tcpi; |
209 |
|
|
socklen_t len = sizeof (tcpi); |
210 |
|
|
getsockopt (fd, IPPROTO_TCP, TCP_INFO, &tcpi, &len); |
211 |
|
|
fd = 0 |
212 |
root |
1.79 |
+ tcpi.tcpi_snd_mss |
213 |
root |
1.77 |
+ tcpi.tcpi_rtt |
214 |
|
|
+ tcpi.tcpi_rttvar |
215 |
|
|
+ tcpi.tcpi_last_ack_recv |
216 |
|
|
+ tcpi.tcpi_last_data_sent |
217 |
|
|
+ tcpi.tcpi_unacked; |
218 |
|
|
],[ |
219 |
|
|
AC_DEFINE(HAVE_TCP_INFO, [1], [TCP_INFO info option supported]) |
220 |
|
|
AC_MSG_RESULT(yes) |
221 |
|
|
],[ |
222 |
|
|
AC_MSG_RESULT(no) |
223 |
|
|
]) |
224 |
|
|
|
225 |
root |
1.1 |
AC_SUBST(pkgstatedir,$localstatedir/$PACKAGE) |
226 |
|
|
AC_SUBST(pkgconfdir,$sysconfdir/$PACKAGE) |
227 |
|
|
|
228 |
root |
1.192 |
AC_OUTPUT([Makefile lib/Makefile utils/cfutil]) |
229 |
root |
1.30 |
|