ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/deliantra/server/configure.ac
Revision: 1.83
Committed: Tue Jul 17 21:18:27 2007 UTC (16 years, 9 months ago) by root
Branch: MAIN
Changes since 1.82: +1 -0 lines
Log Message:
elevate net::irc3 to a required dependency

File Contents

# Content
1 dnl Process this file with autoconf to produce a configure script.
2
3 AC_INIT([cfserver], [2.2], [crossfire@schmorp.de])
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/crossfire)
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.8)
44 if test -z "$PERL"; then
45 AC_PATH_PROG(PERL, perl5)
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.52" \
56 "BDB 0.1" \
57 "Compress::LZF 1.8" \
58 "Coro 3.62" \
59 "Coro::Event 2.1" \
60 "Crossfire 0.99" \
61 "Digest::MD5 2.0" \
62 "Event 1.08" \
63 "IO::AIO 2.4" \
64 "JSON::XS 1.41" \
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 "YAML::Syck 0.71" \
71 ; do
72 set -- $module_vers
73 module=$1
74 minvers=$2
75 AC_MSG_CHECKING(for $module perl module version $minvers or higher)
76 if $PERL -M$module -e0 >/dev/null 2>&1; then
77 version=`$PERL -M$module -e "print \\$$module::VERSION"`
78 if $PERL -M$module -e "VERSION $module $minvers" >/dev/null 2>&1; then
79 AC_MSG_RESULT([ok, version $version])
80 else
81 AC_MSG_ERROR([no, installed version is $version])
82 fi
83 else
84 AC_MSG_ERROR([no, cannot load module $module])
85 fi
86 done
87
88 AC_LANG(C++)
89 AC_PROG_CXX
90 AC_PROG_CPP
91
92 AC_CHECK_HEADER(tr1/unordered_map,[],[AC_MSG_ERROR([Your compiler must support the Library Technical Report 1 extensions.])])
93
94 AC_PATH_PROG(PKG_CONFIG, pkg-config, no)
95
96 AC_MSG_CHECKING(glib >= 2.10)
97 if $PKG_CONFIG glib-2.0 --atleast-version 2.10; then
98 CXXFLAGS="$CXXFLAGS `$PKG_CONFIG glib-2.0 --cflags`"
99 LIBS="$LIBS `$PKG_CONFIG glib-2.0 --libs`"
100 AC_MSG_RESULT(ok)
101 else
102 AC_MSG_ERROR(no)
103 fi
104
105 dnl AC_MSG_CHECKING(libpng)
106 dnl if $PKG_CONFIG libpng --exists; then
107 dnl CXXFLAGS="$CXXFLAGS `$PKG_CONFIG libpng --cflags`"
108 dnl LIBS="$LIBS `$PKG_CONFIG libpng --libs`"
109 dnl AC_MSG_RESULT(ok)
110 dnl else
111 dnl AC_MSG_ERROR(no)
112 dnl fi
113
114 AC_MSG_CHECKING(for $PERL suitability)
115 if $PERL -MExtUtils::Embed -e "use v5.8" >/dev/null 2>&1; then
116 save_CXXFLAGS="$CXXFLAGS"
117 save_LIBS="$LIBS"
118 xPERLFLAGS="`$PERL -MExtUtils::Embed -e ccopts`"
119 xPERLFLAGS="$xPERLFLAGS `$PERL -MEvent::MakeMaker -e 'print +{&Event::MakeMaker::event_args}->{INC}'`"
120 xPERLFLAGS="$xPERLFLAGS `$PERL -MCoro::MakeMaker -e 'print +{&Coro::MakeMaker::coro_args}->{INC}'`"
121 CXXFLAGS="$CXXFLAGS $xPERLFLAGS"
122 LIBS="$LIBS `$PERL -MExtUtils::Embed -e ldopts`"
123 AC_TRY_LINK([
124 #include <EXTERN.h>
125 #include <perl.h>
126 #include <XSUB.h>
127 #include "EventAPI.h"
128 ],[
129 PerlInterpreter *perl = perl_alloc ();
130 ],[perl_link=yes],[perl_link=no])
131 CXXFLAGS="$save_CXXFLAGS"
132 LIBS="$save_LIBS"
133
134 if test x$perl_link = xyes; then
135 AC_MSG_RESULT(ok)
136 AC_DEFINE(ENABLE_PERL, 1, Define if you can embed a perl interpreter)
137 PERLFLAGS="$xPERLFLAGS"
138 PERLLIB="`$PERL -MExtUtils::Embed -e ldopts`"
139 PERLPRIVLIBEXP="`$PERL -MConfig -e 'print $Config{privlibexp}'`"
140 CPPFLAGS="$CPPFLAGS $PERLFLAGS"
141 else
142 AC_MSG_ERROR([no, unable to link])
143 fi
144 else
145 AC_MSG_ERROR([no working perl found, or perl not version >= 5.8])
146 fi
147 AC_SUBST(PERLLIB)
148 AC_SUBST(PERLFLAGS)
149 AC_SUBST(PERLPRIVLIBEXP)
150 AC_SUBST(PERL)
151
152 dnl AC_PROG_LIBTOOL
153 AC_PROG_RANLIB
154
155 AC_CHECK_HEADERS(execinfo.h)
156 AC_CHECK_FUNCS(backtrace)
157
158 dnl check for some other programs
159 AC_PATH_PROG(TAR, tar)
160 AC_PATH_PROG(BASENAME, basename)
161
162 AC_CHECK_LIB(nsl, main)
163 AC_CHECK_LIB(socket, main)
164
165 dnl Checks for libraries.
166 AC_CHECK_LIB(m, main)
167
168 AC_CHECK_SIZEOF(long)
169 AC_CHECK_SIZEOF(long long)
170
171 AC_MSG_CHECKING(for tcp_info support)
172 AC_TRY_LINK([
173 #include <sys/types.h>
174 #include <sys/socket.h>
175 #include <netinet/in.h>
176 #include <netinet/tcp.h>
177 ],[
178 int fd;
179 struct tcp_info tcpi;
180 socklen_t len = sizeof (tcpi);
181 getsockopt (fd, IPPROTO_TCP, TCP_INFO, &tcpi, &len);
182 fd = 0
183 + tcpi.tcpi_snd_mss
184 + tcpi.tcpi_rtt
185 + tcpi.tcpi_rttvar
186 + tcpi.tcpi_last_ack_recv
187 + tcpi.tcpi_last_data_sent
188 + tcpi.tcpi_unacked;
189 ],[
190 AC_DEFINE(HAVE_TCP_INFO, [1], [TCP_INFO info option supported])
191 AC_MSG_RESULT(yes)
192 ],[
193 AC_MSG_RESULT(no)
194 ])
195
196 AC_SUBST(pkgstatedir,$localstatedir/$PACKAGE)
197 AC_SUBST(pkgconfdir,$sysconfdir/$PACKAGE)
198
199 AC_OUTPUT([Makefile
200 include/Makefile lib/Makefile pod/Makefile random_maps/Makefile socket/Makefile
201 server/Makefile utils/Makefile ext/Makefile doc/Makefile
202 common/Makefile utils/cfutil
203 ])
204