ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/deliantra/server/configure.ac
Revision: 1.112
Committed: Mon Jan 14 10:12:11 2008 UTC (16 years, 3 months ago) by root
Branch: MAIN
Changes since 1.111: +1 -2 lines
Log Message:
*** empty log message ***

File Contents

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