ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/deliantra/server/configure.ac
Revision: 1.174
Committed: Tue May 4 21:45:42 2010 UTC (14 years ago) by root
Branch: MAIN
Changes since 1.173: +1 -0 lines
Log Message:
*** empty log message ***

File Contents

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