ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/deliantra/server/configure.ac
Revision: 1.120
Committed: Sun Apr 6 18:40:52 2008 UTC (16 years, 1 month ago) by root
Branch: MAIN
Changes since 1.119: +2 -2 lines
Log Message:
2.43

File Contents

# Content
1 dnl Process this file with autoconf to produce a configure script.
2
3 AC_INIT([deliantra-server], [2.43], [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.0)
44 if test -z "$PERL"; then
45 AC_PATH_PROG(PERL, perl5.8.8)
46 if test -z "$PERL"; then
47 AC_PATH_PROG(PERL, perl)
48 if test -z "$PERL"; then
49 AC_MSG_ERROR([perl 5.8 or higher must be in your PATH, check the README])
50 fi
51 fi
52 fi
53
54 for module_vers in \
55 "AnyEvent 2.9" \
56 "BDB 1.43" \
57 "Compress::LZF 1.8" \
58 "Coro 4.48" \
59 "Coro::EV 2.1" \
60 "Deliantra 1.13" \
61 "Digest::MD5 2.0" \
62 "EV 3.2" \
63 "IO::AIO 2.51" \
64 "JSON::XS 2.01" \
65 "Net::IRC3 0.5" \
66 "Pod::POM 0.17" \
67 "Safe::Hole 0.10" \
68 "Storable 2.0" \
69 "Time::HiRes 1.0" \
70 "URI 1.35" \
71 "YAML 0.66" \
72 ; do
73 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 if $PERL -M$module -e "\$$module::VERSION >= $minvers or die" >/dev/null 2>&1; then
80 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 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 AC_CHECK_HEADER(pthread.h,[],[AC_MSG_ERROR([POSIX thread support is required.])])
96
97 AC_PATH_PROG(PKG_CONFIG, pkg-config, no)
98
99 AC_MSG_CHECKING(glib >= 2.10)
100 if $PKG_CONFIG glib-2.0 --atleast-version 2.10; then
101 CXXFLAGS="$CXXFLAGS `$PKG_CONFIG glib-2.0 --cflags`"
102 LIBS="$LIBS `$PKG_CONFIG glib-2.0 --libs`"
103 AC_MSG_RESULT(ok)
104 else
105 AC_MSG_ERROR(no)
106 fi
107
108 dnl AC_MSG_CHECKING(libpng)
109 dnl if $PKG_CONFIG libpng --exists; then
110 dnl CXXFLAGS="$CXXFLAGS `$PKG_CONFIG libpng --cflags`"
111 dnl LIBS="$LIBS `$PKG_CONFIG libpng --libs`"
112 dnl AC_MSG_RESULT(ok)
113 dnl else
114 dnl AC_MSG_ERROR(no)
115 dnl fi
116
117 AC_MSG_CHECKING(for $PERL suitability)
118 if $PERL -MExtUtils::Embed -e "use v5.8" >/dev/null 2>&1; then
119 save_CXXFLAGS="$CXXFLAGS"
120 save_LIBS="$LIBS"
121 xPERLFLAGS="`$PERL -MExtUtils::Embed -e ccopts`"
122 xPERLFLAGS="$xPERLFLAGS `$PERL -MEV::MakeMaker -e 'print +{&EV::MakeMaker::ev_args}->{INC}'`"
123 xPERLFLAGS="$xPERLFLAGS `$PERL -MCoro::MakeMaker -e 'print +{&Coro::MakeMaker::coro_args}->{INC}'`"
124 CXXFLAGS="$CXXFLAGS $xPERLFLAGS"
125 LIBS="$LIBS `$PERL -MExtUtils::Embed -e ldopts`"
126 AC_TRY_LINK([
127 #include <EXTERN.h>
128 #include <perl.h>
129 #include <XSUB.h>
130 #include "EVAPI.h"
131 ],[
132 PerlInterpreter *perl = perl_alloc ();
133 ],[perl_link=yes],[perl_link=no])
134 CXXFLAGS="$save_CXXFLAGS"
135 LIBS="$save_LIBS"
136
137 if test x$perl_link = xyes; then
138 AC_MSG_RESULT(ok)
139 AC_DEFINE(ENABLE_PERL, 1, Define if you can embed a perl interpreter)
140 PERLFLAGS="$xPERLFLAGS"
141 PERLLIB="`$PERL -MExtUtils::Embed -e ldopts`"
142 PERLPRIVLIBEXP="`$PERL -MConfig -e 'print $Config{privlibexp}'`"
143 CPPFLAGS="$CPPFLAGS $PERLFLAGS"
144 else
145 AC_MSG_ERROR([no, unable to link])
146 fi
147 else
148 AC_MSG_ERROR([no working perl found, or perl not version >= 5.8])
149 fi
150 AC_SUBST(PERLLIB)
151 AC_SUBST(PERLFLAGS)
152 AC_SUBST(PERLPRIVLIBEXP)
153 AC_SUBST(PERL)
154
155 dnl AC_PROG_LIBTOOL
156 AC_PROG_RANLIB
157
158 AC_CHECK_HEADERS(execinfo.h malloc.h)
159 AC_CHECK_FUNCS(backtrace)
160
161 dnl check for some other programs
162 AC_PATH_PROG(TAR, tar)
163 AC_PATH_PROG(BASENAME, basename)
164
165 AC_CHECK_LIB(nsl, gethostbyname)
166 AC_CHECK_LIB(socket, connect)
167 AC_CHECK_LIB(pthread, pthread_create)
168
169 dnl Checks for libraries.
170 AC_CHECK_LIB(m, main)
171
172 AC_CHECK_SIZEOF(long)
173 AC_CHECK_SIZEOF(long long)
174
175 AC_MSG_CHECKING(for tcp_info support)
176 AC_TRY_LINK([
177 #include <sys/types.h>
178 #include <sys/socket.h>
179 #include <netinet/in.h>
180 #include <netinet/tcp.h>
181 ],[
182 int fd;
183 struct tcp_info tcpi;
184 socklen_t len = sizeof (tcpi);
185 getsockopt (fd, IPPROTO_TCP, TCP_INFO, &tcpi, &len);
186 fd = 0
187 + tcpi.tcpi_snd_mss
188 + tcpi.tcpi_rtt
189 + tcpi.tcpi_rttvar
190 + tcpi.tcpi_last_ack_recv
191 + tcpi.tcpi_last_data_sent
192 + tcpi.tcpi_unacked;
193 ],[
194 AC_DEFINE(HAVE_TCP_INFO, [1], [TCP_INFO info option supported])
195 AC_MSG_RESULT(yes)
196 ],[
197 AC_MSG_RESULT(no)
198 ])
199
200 AC_SUBST(pkgstatedir,$localstatedir/$PACKAGE)
201 AC_SUBST(pkgconfdir,$sysconfdir/$PACKAGE)
202
203 AC_OUTPUT([Makefile
204 include/Makefile lib/Makefile pod/Makefile random_maps/Makefile socket/Makefile
205 server/Makefile utils/Makefile ext/Makefile doc/Makefile
206 common/Makefile utils/cfutil
207 ])
208