ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/deliantra/server/configure.ac
Revision: 1.183
Committed: Sun Nov 11 02:38:10 2012 UTC (11 years, 6 months ago) by root
Branch: MAIN
Changes since 1.182: +4 -5 lines
Log Message:
-Time::HiRes

File Contents

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