ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/deliantra/server/configure.ac
Revision: 1.190
Committed: Fri Nov 18 04:11:03 2016 UTC (7 years, 5 months ago) by root
Branch: MAIN
Changes since 1.189: +6 -3 lines
Log Message:
*** empty log message ***

File Contents

# User Rev Content
1 root 1.181 dnl Process this file with autoconf to produce a configure script.,
2 root 1.1
3 root 1.185 AC_INIT([deliantra-server], [3.1], [support@deliantra.net])
4     dnl AC_CONFIG_MACRO_DIR([m4])
5 root 1.1 AC_CONFIG_AUX_DIR(utils)
6 root 1.54 AC_CONFIG_SRCDIR([server/cfperl.xs])
7 root 1.186 AM_INIT_AUTOMAKE([silent-rules subdir-objects foreign no-dist-gzip dist-xz])
8 root 1.1 AM_CONFIG_HEADER(include/autoconf.h)
9    
10     AM_MAINTAINER_MODE
11    
12 root 1.95 AC_PREFIX_DEFAULT(/usr/games/deliantra)
13 root 1.1
14 root 1.59 AC_PATH_PROG(GPERF, gperf)
15     if test -z "$GPERF"; then
16     AC_MSG_ERROR([gperf, the GNU perfect hash generator, must be in your PATH, check the README])
17     fi
18    
19     AC_PATH_PROG(RSYNC, rsync)
20     if test -z "$RSYNC"; then
21     AC_MSG_ERROR([rsync must be in your PATH, check the README])
22     fi
23    
24 root 1.58 AC_PATH_PROG(OPTIPNG, optipng)
25     if test -z "$OPTIPNG"; then
26 root 1.59 AC_MSG_ERROR([optipng must be in your PATH, check the README])
27     fi
28    
29 root 1.70 AC_PATH_PROG(PNGNQ, pngnq)
30     if test -z "$PNGNQ"; then
31     AC_MSG_ERROR([png neuquant (pngnq) must be in your PATH, check the README])
32     fi
33    
34 root 1.180 AC_PATH_PROG(IDENTIFY, identify)
35     if test -z "$IDENTIFY"; then
36     AC_MSG_ERROR([ImageMagick 'identify' must be in your PATH, check the README])
37     fi
38 root 1.41
39 root 1.55 AC_PATH_PROG(CONVERT, convert)
40     if test -z "$CONVERT"; then
41 root 1.59 AC_MSG_ERROR([ImageMagick 'convert' must be in your PATH, check the README])
42 root 1.55 fi
43    
44 root 1.142 AC_PATH_PROG(PERL, perl5.10.1)
45 root 1.56 if test -z "$PERL"; then
46 root 1.175 AC_PATH_PROG(PERL, perl)
47 root 1.56 if test -z "$PERL"; then
48 root 1.175 AC_MSG_ERROR([perl 5.10.1 or higher must be in your PATH, check the README])
49 root 1.56 fi
50     fi
51 root 1.33
52 root 1.60 for module_vers in \
53 root 1.178 "common::sense 3.3" \
54 root 1.182 "AnyEvent 7.0" \
55 root 1.139 "AnyEvent::AIO 0" \
56     "AnyEvent::BDB 0" \
57 root 1.150 "BDB 1.8" \
58 root 1.146 "Compress::LZF 3.41" \
59 root 1.183 "Coro 6" \
60 root 1.133 "Coro::EV 0" \
61 root 1.184 "Deliantra 2.0" \
62 root 1.72 "Digest::MD5 2.0" \
63 root 1.183 "EV 4" \
64     "Guard 1" \
65     "IO::AIO 4" \
66 root 1.100 "JSON::XS 2.01" \
67 elmex 1.148 "AnyEvent::IRC 0.6" \
68 root 1.177 "Pod::POM 0.27" \
69 root 1.72 "Safe::Hole 0.10" \
70 root 1.60 "Storable 2.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 root 1.190 AX_CHECK_COMPILE_FLAG(-Wno-unused-result,[CXXFLAGS="$CXXFLAGS -Wno-unused-result"])
95     AX_CHECK_COMPILE_FLAG(-Wno-narrowing,[CXXFLAGS="$CXXFLAGS -Wno-narrowing"])
96    
97 root 1.185 AX_CXX_COMPILE_STDCXX_11([noext], [mandatory])
98    
99 root 1.58 AC_CHECK_HEADER(tr1/unordered_map,[],[AC_MSG_ERROR([Your compiler must support the Library Technical Report 1 extensions.])])
100    
101 root 1.118 AC_CHECK_HEADER(pthread.h,[],[AC_MSG_ERROR([POSIX thread support is required.])])
102    
103 root 1.58 AC_PATH_PROG(PKG_CONFIG, pkg-config, no)
104    
105 root 1.190 AC_MSG_CHECKING(blitz++ >= 0.10)
106     if $PKG_CONFIG blitz --atleast-version 0.10; then
107 root 1.181 CXXFLAGS="$CXXFLAGS `$PKG_CONFIG blitz --cflags`"
108     LIBS="$LIBS `$PKG_CONFIG blitz --libs`"
109     AC_MSG_RESULT(ok)
110     else
111     AC_MSG_ERROR(no)
112     fi
113    
114 root 1.190 AC_MSG_CHECKING(glib >= 2.32)
115 root 1.58 if $PKG_CONFIG glib-2.0 --atleast-version 2.10; then
116     CXXFLAGS="$CXXFLAGS `$PKG_CONFIG glib-2.0 --cflags`"
117     LIBS="$LIBS `$PKG_CONFIG glib-2.0 --libs`"
118     AC_MSG_RESULT(ok)
119     else
120     AC_MSG_ERROR(no)
121     fi
122    
123 root 1.126 AC_MSG_CHECKING(gthread >= 0.0)
124     if $PKG_CONFIG gthread-2.0 --atleast-version 0.0; then
125     CXXFLAGS="$CXXFLAGS `$PKG_CONFIG gthread-2.0 --cflags`"
126     LIBS="$LIBS `$PKG_CONFIG gthread-2.0 --libs`"
127     AC_MSG_RESULT(ok)
128     else
129     AC_MSG_ERROR(no)
130     fi
131    
132 root 1.77 dnl AC_MSG_CHECKING(libpng)
133     dnl if $PKG_CONFIG libpng --exists; then
134     dnl CXXFLAGS="$CXXFLAGS `$PKG_CONFIG libpng --cflags`"
135     dnl LIBS="$LIBS `$PKG_CONFIG libpng --libs`"
136     dnl AC_MSG_RESULT(ok)
137     dnl else
138     dnl AC_MSG_ERROR(no)
139     dnl fi
140 root 1.58
141 root 1.41 AC_MSG_CHECKING(for $PERL suitability)
142 root 1.175 if $PERL -MExtUtils::Embed -e "use 5.10.1" >/dev/null 2>&1; then
143 root 1.41 save_CXXFLAGS="$CXXFLAGS"
144     save_LIBS="$LIBS"
145     xPERLFLAGS="`$PERL -MExtUtils::Embed -e ccopts`"
146 root 1.97 xPERLFLAGS="$xPERLFLAGS `$PERL -MEV::MakeMaker -e 'print +{&EV::MakeMaker::ev_args}->{INC}'`"
147 root 1.41 xPERLFLAGS="$xPERLFLAGS `$PERL -MCoro::MakeMaker -e 'print +{&Coro::MakeMaker::coro_args}->{INC}'`"
148     CXXFLAGS="$CXXFLAGS $xPERLFLAGS"
149     LIBS="$LIBS `$PERL -MExtUtils::Embed -e ldopts`"
150     AC_TRY_LINK([
151     #include <EXTERN.h>
152     #include <perl.h>
153     #include <XSUB.h>
154 root 1.97 #include "EVAPI.h"
155 root 1.142 #include "CoroAPI.h"
156 root 1.41 ],[
157     PerlInterpreter *perl = perl_alloc ();
158     ],[perl_link=yes],[perl_link=no])
159     CXXFLAGS="$save_CXXFLAGS"
160     LIBS="$save_LIBS"
161    
162     if test x$perl_link = xyes; then
163     AC_MSG_RESULT(ok)
164     PERLFLAGS="$xPERLFLAGS"
165     PERLLIB="`$PERL -MExtUtils::Embed -e ldopts`"
166     PERLPRIVLIBEXP="`$PERL -MConfig -e 'print $Config{privlibexp}'`"
167     CPPFLAGS="$CPPFLAGS $PERLFLAGS"
168     else
169 root 1.142 AC_MSG_ERROR([no, unable to link test program])
170 root 1.41 fi
171     else
172 root 1.175 AC_MSG_ERROR([no working perl found, or perl not version >= 5.10.1])
173 root 1.41 fi
174     AC_SUBST(PERLLIB)
175     AC_SUBST(PERLFLAGS)
176     AC_SUBST(PERLPRIVLIBEXP)
177     AC_SUBST(PERL)
178    
179 root 1.78 dnl AC_PROG_LIBTOOL
180     AC_PROG_RANLIB
181 root 1.77
182 root 1.92 AC_CHECK_HEADERS(execinfo.h malloc.h)
183 root 1.77 AC_CHECK_FUNCS(backtrace)
184    
185 root 1.1 dnl check for some other programs
186     AC_PATH_PROG(TAR, tar)
187     AC_PATH_PROG(BASENAME, basename)
188    
189 root 1.118 AC_CHECK_LIB(nsl, gethostbyname)
190     AC_CHECK_LIB(socket, connect)
191     AC_CHECK_LIB(pthread, pthread_create)
192 root 1.1
193     dnl Checks for libraries.
194     AC_CHECK_LIB(m, main)
195    
196     AC_CHECK_SIZEOF(long)
197     AC_CHECK_SIZEOF(long long)
198    
199 root 1.77 AC_MSG_CHECKING(for tcp_info support)
200     AC_TRY_LINK([
201     #include <sys/types.h>
202     #include <sys/socket.h>
203     #include <netinet/in.h>
204     #include <netinet/tcp.h>
205     ],[
206     int fd;
207     struct tcp_info tcpi;
208     socklen_t len = sizeof (tcpi);
209     getsockopt (fd, IPPROTO_TCP, TCP_INFO, &tcpi, &len);
210     fd = 0
211 root 1.79 + tcpi.tcpi_snd_mss
212 root 1.77 + tcpi.tcpi_rtt
213     + tcpi.tcpi_rttvar
214     + tcpi.tcpi_last_ack_recv
215     + tcpi.tcpi_last_data_sent
216     + tcpi.tcpi_unacked;
217     ],[
218     AC_DEFINE(HAVE_TCP_INFO, [1], [TCP_INFO info option supported])
219     AC_MSG_RESULT(yes)
220     ],[
221     AC_MSG_RESULT(no)
222     ])
223    
224 root 1.1 AC_SUBST(pkgstatedir,$localstatedir/$PACKAGE)
225     AC_SUBST(pkgconfdir,$sysconfdir/$PACKAGE)
226    
227     AC_OUTPUT([Makefile
228 root 1.189 include/Makefile lib/Makefile
229 root 1.186 utils/cfutil
230 pippijn 1.22 ])
231 root 1.30