ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/deliantra/server/configure.ac
Revision: 1.178
Committed: Fri Jul 2 20:56:52 2010 UTC (13 years, 10 months ago) by root
Branch: MAIN
Changes since 1.177: +1 -1 lines
Log Message:
exitign warnings class is not healthy

File Contents

# User Rev Content
1 root 1.1 dnl Process this file with autoconf to produce a configure script.
2    
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.77 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 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.167 "AnyEvent 5.2" \
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.153 "Coro 5.13" \
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.134 "EV 3.41" \
63 root 1.152 "Guard 0.5" \
64 root 1.168 "IO::AIO 3.3" \
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     "Time::HiRes 1.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     AC_CHECK_HEADER(tr1/unordered_map,[],[AC_MSG_ERROR([Your compiler must support the Library Technical Report 1 extensions.])])
95    
96 root 1.118 AC_CHECK_HEADER(pthread.h,[],[AC_MSG_ERROR([POSIX thread support is required.])])
97    
98 root 1.58 AC_PATH_PROG(PKG_CONFIG, pkg-config, no)
99    
100     AC_MSG_CHECKING(glib >= 2.10)
101     if $PKG_CONFIG glib-2.0 --atleast-version 2.10; then
102     CXXFLAGS="$CXXFLAGS `$PKG_CONFIG glib-2.0 --cflags`"
103     LIBS="$LIBS `$PKG_CONFIG glib-2.0 --libs`"
104     AC_MSG_RESULT(ok)
105     else
106     AC_MSG_ERROR(no)
107     fi
108    
109 root 1.126 AC_MSG_CHECKING(gthread >= 0.0)
110     if $PKG_CONFIG gthread-2.0 --atleast-version 0.0; then
111     CXXFLAGS="$CXXFLAGS `$PKG_CONFIG gthread-2.0 --cflags`"
112     LIBS="$LIBS `$PKG_CONFIG gthread-2.0 --libs`"
113     AC_MSG_RESULT(ok)
114     else
115     AC_MSG_ERROR(no)
116     fi
117    
118 root 1.77 dnl AC_MSG_CHECKING(libpng)
119     dnl if $PKG_CONFIG libpng --exists; then
120     dnl CXXFLAGS="$CXXFLAGS `$PKG_CONFIG libpng --cflags`"
121     dnl LIBS="$LIBS `$PKG_CONFIG libpng --libs`"
122     dnl AC_MSG_RESULT(ok)
123     dnl else
124     dnl AC_MSG_ERROR(no)
125     dnl fi
126 root 1.58
127 root 1.41 AC_MSG_CHECKING(for $PERL suitability)
128 root 1.175 if $PERL -MExtUtils::Embed -e "use 5.10.1" >/dev/null 2>&1; then
129 root 1.41 save_CXXFLAGS="$CXXFLAGS"
130     save_LIBS="$LIBS"
131     xPERLFLAGS="`$PERL -MExtUtils::Embed -e ccopts`"
132 root 1.97 xPERLFLAGS="$xPERLFLAGS `$PERL -MEV::MakeMaker -e 'print +{&EV::MakeMaker::ev_args}->{INC}'`"
133 root 1.41 xPERLFLAGS="$xPERLFLAGS `$PERL -MCoro::MakeMaker -e 'print +{&Coro::MakeMaker::coro_args}->{INC}'`"
134     CXXFLAGS="$CXXFLAGS $xPERLFLAGS"
135     LIBS="$LIBS `$PERL -MExtUtils::Embed -e ldopts`"
136     AC_TRY_LINK([
137     #include <EXTERN.h>
138     #include <perl.h>
139     #include <XSUB.h>
140 root 1.97 #include "EVAPI.h"
141 root 1.142 #include "CoroAPI.h"
142 root 1.41 ],[
143     PerlInterpreter *perl = perl_alloc ();
144     ],[perl_link=yes],[perl_link=no])
145     CXXFLAGS="$save_CXXFLAGS"
146     LIBS="$save_LIBS"
147    
148     if test x$perl_link = xyes; then
149     AC_MSG_RESULT(ok)
150     PERLFLAGS="$xPERLFLAGS"
151     PERLLIB="`$PERL -MExtUtils::Embed -e ldopts`"
152     PERLPRIVLIBEXP="`$PERL -MConfig -e 'print $Config{privlibexp}'`"
153     CPPFLAGS="$CPPFLAGS $PERLFLAGS"
154     else
155 root 1.142 AC_MSG_ERROR([no, unable to link test program])
156 root 1.41 fi
157     else
158 root 1.175 AC_MSG_ERROR([no working perl found, or perl not version >= 5.10.1])
159 root 1.41 fi
160     AC_SUBST(PERLLIB)
161     AC_SUBST(PERLFLAGS)
162     AC_SUBST(PERLPRIVLIBEXP)
163     AC_SUBST(PERL)
164    
165 root 1.78 dnl AC_PROG_LIBTOOL
166     AC_PROG_RANLIB
167 root 1.77
168 root 1.92 AC_CHECK_HEADERS(execinfo.h malloc.h)
169 root 1.77 AC_CHECK_FUNCS(backtrace)
170    
171 root 1.1 dnl check for some other programs
172     AC_PATH_PROG(TAR, tar)
173     AC_PATH_PROG(BASENAME, basename)
174    
175 root 1.118 AC_CHECK_LIB(nsl, gethostbyname)
176     AC_CHECK_LIB(socket, connect)
177     AC_CHECK_LIB(pthread, pthread_create)
178 root 1.1
179     dnl Checks for libraries.
180     AC_CHECK_LIB(m, main)
181    
182     AC_CHECK_SIZEOF(long)
183     AC_CHECK_SIZEOF(long long)
184    
185 root 1.77 AC_MSG_CHECKING(for tcp_info support)
186     AC_TRY_LINK([
187     #include <sys/types.h>
188     #include <sys/socket.h>
189     #include <netinet/in.h>
190     #include <netinet/tcp.h>
191     ],[
192     int fd;
193     struct tcp_info tcpi;
194     socklen_t len = sizeof (tcpi);
195     getsockopt (fd, IPPROTO_TCP, TCP_INFO, &tcpi, &len);
196     fd = 0
197 root 1.79 + tcpi.tcpi_snd_mss
198 root 1.77 + tcpi.tcpi_rtt
199     + tcpi.tcpi_rttvar
200     + tcpi.tcpi_last_ack_recv
201     + tcpi.tcpi_last_data_sent
202     + tcpi.tcpi_unacked;
203     ],[
204     AC_DEFINE(HAVE_TCP_INFO, [1], [TCP_INFO info option supported])
205     AC_MSG_RESULT(yes)
206     ],[
207     AC_MSG_RESULT(no)
208     ])
209    
210 root 1.1 AC_SUBST(pkgstatedir,$localstatedir/$PACKAGE)
211     AC_SUBST(pkgconfdir,$sysconfdir/$PACKAGE)
212    
213     AC_OUTPUT([Makefile
214 pippijn 1.22 include/Makefile lib/Makefile pod/Makefile random_maps/Makefile socket/Makefile
215 root 1.52 server/Makefile utils/Makefile ext/Makefile doc/Makefile
216 root 1.73 common/Makefile utils/cfutil
217 pippijn 1.22 ])
218 root 1.30