ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/deliantra/server/configure.ac
Revision: 1.166
Committed: Mon Oct 12 18:06:56 2009 UTC (14 years, 7 months ago) by root
Branch: MAIN
CVS Tags: rel-2_81
Changes since 1.165: +1 -1 lines
Log Message:
2.81

File Contents

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