ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/deliantra/server/configure.ac
Revision: 1.139
Committed: Tue Jul 29 02:05:00 2008 UTC (15 years, 9 months ago) by root
Branch: MAIN
Changes since 1.138: +2 -0 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.138 AC_INIT([deliantra-server], [2.6], [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.117 AC_PATH_PROG(PERL, perl5.10.0)
44 root 1.56 if test -z "$PERL"; then
45 root 1.117 AC_PATH_PROG(PERL, perl5.8.8)
46 root 1.56 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.138 "AnyEvent 4.22" \
56 root 1.139 "AnyEvent::AIO 0" \
57     "AnyEvent::BDB 0" \
58 root 1.137 "BDB 1.6" \
59 root 1.72 "Compress::LZF 1.8" \
60 root 1.135 "Coro 4.73" \
61 root 1.133 "Coro::EV 0" \
62 root 1.108 "Deliantra 1.13" \
63 root 1.72 "Digest::MD5 2.0" \
64 root 1.134 "EV 3.41" \
65 root 1.135 "IO::AIO 3.03" \
66 root 1.100 "JSON::XS 2.01" \
67 root 1.83 "Net::IRC3 0.5" \
68 root 1.72 "Pod::POM 0.17" \
69     "Safe::Hole 0.10" \
70 root 1.60 "Storable 2.0" \
71     "Time::HiRes 1.0" \
72 root 1.87 "URI 1.35" \
73 root 1.112 "YAML 0.66" \
74 root 1.60 ; do
75 root 1.47 set -- $module_vers
76     module=$1
77     minvers=$2
78     AC_MSG_CHECKING(for $module perl module version $minvers or higher)
79     if $PERL -M$module -e0 >/dev/null 2>&1; then
80     version=`$PERL -M$module -e "print \\$$module::VERSION"`
81 root 1.111 if $PERL -M$module -e "\$$module::VERSION >= $minvers or die" >/dev/null 2>&1; then
82 root 1.47 AC_MSG_RESULT([ok, version $version])
83     else
84     AC_MSG_ERROR([no, installed version is $version])
85     fi
86     else
87     AC_MSG_ERROR([no, cannot load module $module])
88     fi
89     done
90    
91 root 1.58 AC_LANG(C++)
92     AC_PROG_CXX
93     AC_PROG_CPP
94    
95     AC_CHECK_HEADER(tr1/unordered_map,[],[AC_MSG_ERROR([Your compiler must support the Library Technical Report 1 extensions.])])
96    
97 root 1.118 AC_CHECK_HEADER(pthread.h,[],[AC_MSG_ERROR([POSIX thread support is required.])])
98    
99 root 1.58 AC_PATH_PROG(PKG_CONFIG, pkg-config, no)
100    
101     AC_MSG_CHECKING(glib >= 2.10)
102     if $PKG_CONFIG glib-2.0 --atleast-version 2.10; then
103     CXXFLAGS="$CXXFLAGS `$PKG_CONFIG glib-2.0 --cflags`"
104     LIBS="$LIBS `$PKG_CONFIG glib-2.0 --libs`"
105     AC_MSG_RESULT(ok)
106     else
107     AC_MSG_ERROR(no)
108     fi
109    
110 root 1.126 AC_MSG_CHECKING(gthread >= 0.0)
111     if $PKG_CONFIG gthread-2.0 --atleast-version 0.0; then
112     CXXFLAGS="$CXXFLAGS `$PKG_CONFIG gthread-2.0 --cflags`"
113     LIBS="$LIBS `$PKG_CONFIG gthread-2.0 --libs`"
114     AC_MSG_RESULT(ok)
115     else
116     AC_MSG_ERROR(no)
117     fi
118    
119 root 1.77 dnl AC_MSG_CHECKING(libpng)
120     dnl if $PKG_CONFIG libpng --exists; then
121     dnl CXXFLAGS="$CXXFLAGS `$PKG_CONFIG libpng --cflags`"
122     dnl LIBS="$LIBS `$PKG_CONFIG libpng --libs`"
123     dnl AC_MSG_RESULT(ok)
124     dnl else
125     dnl AC_MSG_ERROR(no)
126     dnl fi
127 root 1.58
128 root 1.41 AC_MSG_CHECKING(for $PERL suitability)
129     if $PERL -MExtUtils::Embed -e "use v5.8" >/dev/null 2>&1; then
130     save_CXXFLAGS="$CXXFLAGS"
131     save_LIBS="$LIBS"
132     xPERLFLAGS="`$PERL -MExtUtils::Embed -e ccopts`"
133 root 1.97 xPERLFLAGS="$xPERLFLAGS `$PERL -MEV::MakeMaker -e 'print +{&EV::MakeMaker::ev_args}->{INC}'`"
134 root 1.41 xPERLFLAGS="$xPERLFLAGS `$PERL -MCoro::MakeMaker -e 'print +{&Coro::MakeMaker::coro_args}->{INC}'`"
135     CXXFLAGS="$CXXFLAGS $xPERLFLAGS"
136     LIBS="$LIBS `$PERL -MExtUtils::Embed -e ldopts`"
137     AC_TRY_LINK([
138     #include <EXTERN.h>
139     #include <perl.h>
140     #include <XSUB.h>
141 root 1.97 #include "EVAPI.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     AC_DEFINE(ENABLE_PERL, 1, Define if you can embed a perl interpreter)
151     PERLFLAGS="$xPERLFLAGS"
152     PERLLIB="`$PERL -MExtUtils::Embed -e ldopts`"
153     PERLPRIVLIBEXP="`$PERL -MConfig -e 'print $Config{privlibexp}'`"
154     CPPFLAGS="$CPPFLAGS $PERLFLAGS"
155     else
156     AC_MSG_ERROR([no, unable to link])
157     fi
158     else
159     AC_MSG_ERROR([no working perl found, or perl not version >= 5.8])
160     fi
161     AC_SUBST(PERLLIB)
162     AC_SUBST(PERLFLAGS)
163     AC_SUBST(PERLPRIVLIBEXP)
164     AC_SUBST(PERL)
165    
166 root 1.78 dnl AC_PROG_LIBTOOL
167     AC_PROG_RANLIB
168 root 1.77
169 root 1.92 AC_CHECK_HEADERS(execinfo.h malloc.h)
170 root 1.77 AC_CHECK_FUNCS(backtrace)
171    
172 root 1.1 dnl check for some other programs
173     AC_PATH_PROG(TAR, tar)
174     AC_PATH_PROG(BASENAME, basename)
175    
176 root 1.118 AC_CHECK_LIB(nsl, gethostbyname)
177     AC_CHECK_LIB(socket, connect)
178     AC_CHECK_LIB(pthread, pthread_create)
179 root 1.1
180     dnl Checks for libraries.
181     AC_CHECK_LIB(m, main)
182    
183     AC_CHECK_SIZEOF(long)
184     AC_CHECK_SIZEOF(long long)
185    
186 root 1.77 AC_MSG_CHECKING(for tcp_info support)
187     AC_TRY_LINK([
188     #include <sys/types.h>
189     #include <sys/socket.h>
190     #include <netinet/in.h>
191     #include <netinet/tcp.h>
192     ],[
193     int fd;
194     struct tcp_info tcpi;
195     socklen_t len = sizeof (tcpi);
196     getsockopt (fd, IPPROTO_TCP, TCP_INFO, &tcpi, &len);
197     fd = 0
198 root 1.79 + tcpi.tcpi_snd_mss
199 root 1.77 + tcpi.tcpi_rtt
200     + tcpi.tcpi_rttvar
201     + tcpi.tcpi_last_ack_recv
202     + tcpi.tcpi_last_data_sent
203     + tcpi.tcpi_unacked;
204     ],[
205     AC_DEFINE(HAVE_TCP_INFO, [1], [TCP_INFO info option supported])
206     AC_MSG_RESULT(yes)
207     ],[
208     AC_MSG_RESULT(no)
209     ])
210    
211 root 1.1 AC_SUBST(pkgstatedir,$localstatedir/$PACKAGE)
212     AC_SUBST(pkgconfdir,$sysconfdir/$PACKAGE)
213    
214     AC_OUTPUT([Makefile
215 pippijn 1.22 include/Makefile lib/Makefile pod/Makefile random_maps/Makefile socket/Makefile
216 root 1.52 server/Makefile utils/Makefile ext/Makefile doc/Makefile
217 root 1.73 common/Makefile utils/cfutil
218 pippijn 1.22 ])
219 root 1.30