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.1 |
AM_INIT_AUTOMAKE |
8 |
|
|
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.60 |
; do |
74 |
root |
1.47 |
set -- $module_vers |
75 |
|
|
module=$1 |
76 |
|
|
minvers=$2 |
77 |
|
|
AC_MSG_CHECKING(for $module perl module version $minvers or higher) |
78 |
|
|
if $PERL -M$module -e0 >/dev/null 2>&1; then |
79 |
|
|
version=`$PERL -M$module -e "print \\$$module::VERSION"` |
80 |
root |
1.111 |
if $PERL -M$module -e "\$$module::VERSION >= $minvers or die" >/dev/null 2>&1; then |
81 |
root |
1.47 |
AC_MSG_RESULT([ok, version $version]) |
82 |
|
|
else |
83 |
|
|
AC_MSG_ERROR([no, installed version is $version]) |
84 |
|
|
fi |
85 |
|
|
else |
86 |
|
|
AC_MSG_ERROR([no, cannot load module $module]) |
87 |
|
|
fi |
88 |
|
|
done |
89 |
|
|
|
90 |
root |
1.58 |
AC_LANG(C++) |
91 |
|
|
AC_PROG_CXX |
92 |
|
|
AC_PROG_CPP |
93 |
|
|
|
94 |
root |
1.185 |
AX_CXX_COMPILE_STDCXX_11([noext], [mandatory]) |
95 |
|
|
|
96 |
root |
1.58 |
AC_CHECK_HEADER(tr1/unordered_map,[],[AC_MSG_ERROR([Your compiler must support the Library Technical Report 1 extensions.])]) |
97 |
|
|
|
98 |
root |
1.118 |
AC_CHECK_HEADER(pthread.h,[],[AC_MSG_ERROR([POSIX thread support is required.])]) |
99 |
|
|
|
100 |
root |
1.58 |
AC_PATH_PROG(PKG_CONFIG, pkg-config, no) |
101 |
|
|
|
102 |
root |
1.181 |
AC_MSG_CHECKING(blitz++ >= 0.9) |
103 |
|
|
if $PKG_CONFIG blitz --atleast-version 0.9; then |
104 |
|
|
CXXFLAGS="$CXXFLAGS `$PKG_CONFIG blitz --cflags`" |
105 |
|
|
LIBS="$LIBS `$PKG_CONFIG blitz --libs`" |
106 |
|
|
AC_MSG_RESULT(ok) |
107 |
|
|
else |
108 |
|
|
AC_MSG_ERROR(no) |
109 |
|
|
fi |
110 |
|
|
|
111 |
root |
1.58 |
AC_MSG_CHECKING(glib >= 2.10) |
112 |
|
|
if $PKG_CONFIG glib-2.0 --atleast-version 2.10; then |
113 |
|
|
CXXFLAGS="$CXXFLAGS `$PKG_CONFIG glib-2.0 --cflags`" |
114 |
|
|
LIBS="$LIBS `$PKG_CONFIG glib-2.0 --libs`" |
115 |
|
|
AC_MSG_RESULT(ok) |
116 |
|
|
else |
117 |
|
|
AC_MSG_ERROR(no) |
118 |
|
|
fi |
119 |
|
|
|
120 |
root |
1.126 |
AC_MSG_CHECKING(gthread >= 0.0) |
121 |
|
|
if $PKG_CONFIG gthread-2.0 --atleast-version 0.0; then |
122 |
|
|
CXXFLAGS="$CXXFLAGS `$PKG_CONFIG gthread-2.0 --cflags`" |
123 |
|
|
LIBS="$LIBS `$PKG_CONFIG gthread-2.0 --libs`" |
124 |
|
|
AC_MSG_RESULT(ok) |
125 |
|
|
else |
126 |
|
|
AC_MSG_ERROR(no) |
127 |
|
|
fi |
128 |
|
|
|
129 |
root |
1.77 |
dnl AC_MSG_CHECKING(libpng) |
130 |
|
|
dnl if $PKG_CONFIG libpng --exists; then |
131 |
|
|
dnl CXXFLAGS="$CXXFLAGS `$PKG_CONFIG libpng --cflags`" |
132 |
|
|
dnl LIBS="$LIBS `$PKG_CONFIG libpng --libs`" |
133 |
|
|
dnl AC_MSG_RESULT(ok) |
134 |
|
|
dnl else |
135 |
|
|
dnl AC_MSG_ERROR(no) |
136 |
|
|
dnl fi |
137 |
root |
1.58 |
|
138 |
root |
1.41 |
AC_MSG_CHECKING(for $PERL suitability) |
139 |
root |
1.175 |
if $PERL -MExtUtils::Embed -e "use 5.10.1" >/dev/null 2>&1; then |
140 |
root |
1.41 |
save_CXXFLAGS="$CXXFLAGS" |
141 |
|
|
save_LIBS="$LIBS" |
142 |
|
|
xPERLFLAGS="`$PERL -MExtUtils::Embed -e ccopts`" |
143 |
root |
1.97 |
xPERLFLAGS="$xPERLFLAGS `$PERL -MEV::MakeMaker -e 'print +{&EV::MakeMaker::ev_args}->{INC}'`" |
144 |
root |
1.41 |
xPERLFLAGS="$xPERLFLAGS `$PERL -MCoro::MakeMaker -e 'print +{&Coro::MakeMaker::coro_args}->{INC}'`" |
145 |
|
|
CXXFLAGS="$CXXFLAGS $xPERLFLAGS" |
146 |
|
|
LIBS="$LIBS `$PERL -MExtUtils::Embed -e ldopts`" |
147 |
|
|
AC_TRY_LINK([ |
148 |
|
|
#include <EXTERN.h> |
149 |
|
|
#include <perl.h> |
150 |
|
|
#include <XSUB.h> |
151 |
root |
1.97 |
#include "EVAPI.h" |
152 |
root |
1.142 |
#include "CoroAPI.h" |
153 |
root |
1.41 |
],[ |
154 |
|
|
PerlInterpreter *perl = perl_alloc (); |
155 |
|
|
],[perl_link=yes],[perl_link=no]) |
156 |
|
|
CXXFLAGS="$save_CXXFLAGS" |
157 |
|
|
LIBS="$save_LIBS" |
158 |
|
|
|
159 |
|
|
if test x$perl_link = xyes; then |
160 |
|
|
AC_MSG_RESULT(ok) |
161 |
|
|
PERLFLAGS="$xPERLFLAGS" |
162 |
|
|
PERLLIB="`$PERL -MExtUtils::Embed -e ldopts`" |
163 |
|
|
PERLPRIVLIBEXP="`$PERL -MConfig -e 'print $Config{privlibexp}'`" |
164 |
|
|
CPPFLAGS="$CPPFLAGS $PERLFLAGS" |
165 |
|
|
else |
166 |
root |
1.142 |
AC_MSG_ERROR([no, unable to link test program]) |
167 |
root |
1.41 |
fi |
168 |
|
|
else |
169 |
root |
1.175 |
AC_MSG_ERROR([no working perl found, or perl not version >= 5.10.1]) |
170 |
root |
1.41 |
fi |
171 |
|
|
AC_SUBST(PERLLIB) |
172 |
|
|
AC_SUBST(PERLFLAGS) |
173 |
|
|
AC_SUBST(PERLPRIVLIBEXP) |
174 |
|
|
AC_SUBST(PERL) |
175 |
|
|
|
176 |
root |
1.78 |
dnl AC_PROG_LIBTOOL |
177 |
|
|
AC_PROG_RANLIB |
178 |
root |
1.77 |
|
179 |
root |
1.92 |
AC_CHECK_HEADERS(execinfo.h malloc.h) |
180 |
root |
1.77 |
AC_CHECK_FUNCS(backtrace) |
181 |
|
|
|
182 |
root |
1.1 |
dnl check for some other programs |
183 |
|
|
AC_PATH_PROG(TAR, tar) |
184 |
|
|
AC_PATH_PROG(BASENAME, basename) |
185 |
|
|
|
186 |
root |
1.118 |
AC_CHECK_LIB(nsl, gethostbyname) |
187 |
|
|
AC_CHECK_LIB(socket, connect) |
188 |
|
|
AC_CHECK_LIB(pthread, pthread_create) |
189 |
root |
1.1 |
|
190 |
|
|
dnl Checks for libraries. |
191 |
|
|
AC_CHECK_LIB(m, main) |
192 |
|
|
|
193 |
|
|
AC_CHECK_SIZEOF(long) |
194 |
|
|
AC_CHECK_SIZEOF(long long) |
195 |
|
|
|
196 |
root |
1.77 |
AC_MSG_CHECKING(for tcp_info support) |
197 |
|
|
AC_TRY_LINK([ |
198 |
|
|
#include <sys/types.h> |
199 |
|
|
#include <sys/socket.h> |
200 |
|
|
#include <netinet/in.h> |
201 |
|
|
#include <netinet/tcp.h> |
202 |
|
|
],[ |
203 |
|
|
int fd; |
204 |
|
|
struct tcp_info tcpi; |
205 |
|
|
socklen_t len = sizeof (tcpi); |
206 |
|
|
getsockopt (fd, IPPROTO_TCP, TCP_INFO, &tcpi, &len); |
207 |
|
|
fd = 0 |
208 |
root |
1.79 |
+ tcpi.tcpi_snd_mss |
209 |
root |
1.77 |
+ tcpi.tcpi_rtt |
210 |
|
|
+ tcpi.tcpi_rttvar |
211 |
|
|
+ tcpi.tcpi_last_ack_recv |
212 |
|
|
+ tcpi.tcpi_last_data_sent |
213 |
|
|
+ tcpi.tcpi_unacked; |
214 |
|
|
],[ |
215 |
|
|
AC_DEFINE(HAVE_TCP_INFO, [1], [TCP_INFO info option supported]) |
216 |
|
|
AC_MSG_RESULT(yes) |
217 |
|
|
],[ |
218 |
|
|
AC_MSG_RESULT(no) |
219 |
|
|
]) |
220 |
|
|
|
221 |
root |
1.1 |
AC_SUBST(pkgstatedir,$localstatedir/$PACKAGE) |
222 |
|
|
AC_SUBST(pkgconfdir,$sysconfdir/$PACKAGE) |
223 |
|
|
|
224 |
|
|
AC_OUTPUT([Makefile |
225 |
pippijn |
1.22 |
include/Makefile lib/Makefile pod/Makefile random_maps/Makefile socket/Makefile |
226 |
root |
1.52 |
server/Makefile utils/Makefile ext/Makefile doc/Makefile |
227 |
root |
1.73 |
common/Makefile utils/cfutil |
228 |
pippijn |
1.22 |
]) |
229 |
root |
1.30 |
|