1 | dnl Process this file with autoconf to produce a configure script. |
1 | dnl Process this file with autoconf to produce a configure script., |
2 | |
2 | |
3 | AC_INIT([deliantra-server], [2.43], [support@deliantra.net]) |
3 | AC_INIT([deliantra-server], [3.1], [support@deliantra.net]) |
|
|
4 | dnl AC_CONFIG_MACRO_DIR([m4]) |
4 | AC_CONFIG_AUX_DIR(utils) |
5 | AC_CONFIG_AUX_DIR(utils) |
5 | AC_CONFIG_SRCDIR([server/cfperl.xs]) |
6 | AC_CONFIG_SRCDIR([server/cfperl.xs]) |
6 | AM_INIT_AUTOMAKE |
7 | AM_INIT_AUTOMAKE([silent-rules subdir-objects foreign no-dist-gzip dist-xz]) |
7 | AM_CONFIG_HEADER(include/autoconf.h) |
8 | AM_CONFIG_HEADER(include/autoconf.h) |
8 | |
9 | |
9 | AM_MAINTAINER_MODE |
10 | AM_MAINTAINER_MODE |
10 | |
11 | |
11 | AC_PREFIX_DEFAULT(/usr/games/deliantra) |
12 | AC_PREFIX_DEFAULT(/usr/games/deliantra) |
… | |
… | |
28 | AC_PATH_PROG(PNGNQ, pngnq) |
29 | AC_PATH_PROG(PNGNQ, pngnq) |
29 | if test -z "$PNGNQ"; then |
30 | if test -z "$PNGNQ"; then |
30 | AC_MSG_ERROR([png neuquant (pngnq) must be in your PATH, check the README]) |
31 | AC_MSG_ERROR([png neuquant (pngnq) must be in your PATH, check the README]) |
31 | fi |
32 | fi |
32 | |
33 | |
33 | dnl AC_PATH_PROG(IDENTIFY, identify) |
34 | AC_PATH_PROG(IDENTIFY, identify) |
34 | dnl if test -z "$IDENTIFY"; then |
35 | if test -z "$IDENTIFY"; then |
35 | dnl AC_MSG_ERROR([ImageMagick 'identify' must be in your PATH, check the README]) |
36 | AC_MSG_ERROR([ImageMagick 'identify' must be in your PATH, check the README]) |
36 | dnl fi |
37 | fi |
37 | |
38 | |
38 | AC_PATH_PROG(CONVERT, convert) |
39 | AC_PATH_PROG(CONVERT, convert) |
39 | if test -z "$CONVERT"; then |
40 | if test -z "$CONVERT"; then |
40 | AC_MSG_ERROR([ImageMagick 'convert' must be in your PATH, check the README]) |
41 | AC_MSG_ERROR([ImageMagick 'convert' must be in your PATH, check the README]) |
41 | fi |
42 | fi |
42 | |
43 | |
43 | AC_PATH_PROG(PERL, perl5.10.0) |
44 | AC_PATH_PROG(PERL, perl5.10.1) |
44 | if test -z "$PERL"; then |
45 | if test -z "$PERL"; then |
45 | AC_PATH_PROG(PERL, perl5.8.8) |
46 | AC_PATH_PROG(PERL, perl) |
46 | if test -z "$PERL"; then |
47 | 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]) |
48 | AC_MSG_ERROR([perl 5.10.1 or higher must be in your PATH, check the README]) |
50 | fi |
|
|
51 | fi |
49 | fi |
52 | fi |
50 | fi |
53 | |
51 | |
54 | for module_vers in \ |
52 | for module_vers in \ |
|
|
53 | "common::sense 3.3" \ |
55 | "AnyEvent 2.9" \ |
54 | "AnyEvent 7.0" \ |
|
|
55 | "AnyEvent::AIO 0" \ |
|
|
56 | "AnyEvent::BDB 0" \ |
56 | "BDB 1.43" \ |
57 | "BDB 1.8" \ |
57 | "Compress::LZF 1.8" \ |
58 | "Compress::LZF 3.41" \ |
58 | "Coro 4.50" \ |
59 | "Coro 6" \ |
59 | "Coro::EV 2.1" \ |
60 | "Coro::EV 0" \ |
60 | "Deliantra 1.13" \ |
61 | "Deliantra 2.0" \ |
61 | "Digest::MD5 2.0" \ |
62 | "Digest::MD5 2.0" \ |
62 | "EV 3.2" \ |
63 | "EV 4" \ |
|
|
64 | "Guard 1" \ |
63 | "IO::AIO 2.51" \ |
65 | "IO::AIO 4" \ |
64 | "JSON::XS 2.01" \ |
66 | "JSON::XS 2.01" \ |
65 | "Net::IRC3 0.5" \ |
67 | "AnyEvent::IRC 0.6" \ |
66 | "Pod::POM 0.17" \ |
68 | "Pod::POM 0.27" \ |
67 | "Safe::Hole 0.10" \ |
69 | "Safe::Hole 0.10" \ |
68 | "Storable 2.0" \ |
70 | "Storable 2.0" \ |
69 | "Time::HiRes 1.0" \ |
|
|
70 | "URI 1.35" \ |
71 | "URI 1.35" \ |
71 | "YAML 0.66" \ |
72 | "YAML::XS 0.32" \ |
72 | ; do |
73 | ; do |
73 | set -- $module_vers |
74 | set -- $module_vers |
74 | module=$1 |
75 | module=$1 |
75 | minvers=$2 |
76 | minvers=$2 |
76 | AC_MSG_CHECKING(for $module perl module version $minvers or higher) |
77 | AC_MSG_CHECKING(for $module perl module version $minvers or higher) |
… | |
… | |
88 | |
89 | |
89 | AC_LANG(C++) |
90 | AC_LANG(C++) |
90 | AC_PROG_CXX |
91 | AC_PROG_CXX |
91 | AC_PROG_CPP |
92 | AC_PROG_CPP |
92 | |
93 | |
|
|
94 | AX_CXX_COMPILE_STDCXX_11([noext], [mandatory]) |
|
|
95 | |
93 | AC_CHECK_HEADER(tr1/unordered_map,[],[AC_MSG_ERROR([Your compiler must support the Library Technical Report 1 extensions.])]) |
96 | AC_CHECK_HEADER(tr1/unordered_map,[],[AC_MSG_ERROR([Your compiler must support the Library Technical Report 1 extensions.])]) |
94 | |
97 | |
95 | AC_CHECK_HEADER(pthread.h,[],[AC_MSG_ERROR([POSIX thread support is required.])]) |
98 | AC_CHECK_HEADER(pthread.h,[],[AC_MSG_ERROR([POSIX thread support is required.])]) |
96 | |
99 | |
97 | AC_PATH_PROG(PKG_CONFIG, pkg-config, no) |
100 | AC_PATH_PROG(PKG_CONFIG, pkg-config, no) |
|
|
101 | |
|
|
102 | AC_MSG_CHECKING(blitz++ >= 0.9) |
|
|
103 | if $PKG_CONFIG blitz --atleast-version 0.9; then |
|
|
104 | CXXFLAGS="$CXXFLAGS `$PKG_CONFIG blitz --cflags`" |
|
|
105 | LIBS="$LIBS `$PKG_CONFIG blitz --libs`" |
|
|
106 | AC_MSG_RESULT(ok) |
|
|
107 | else |
|
|
108 | AC_MSG_ERROR(no) |
|
|
109 | fi |
98 | |
110 | |
99 | AC_MSG_CHECKING(glib >= 2.10) |
111 | AC_MSG_CHECKING(glib >= 2.10) |
100 | if $PKG_CONFIG glib-2.0 --atleast-version 2.10; then |
112 | if $PKG_CONFIG glib-2.0 --atleast-version 2.10; then |
101 | CXXFLAGS="$CXXFLAGS `$PKG_CONFIG glib-2.0 --cflags`" |
113 | CXXFLAGS="$CXXFLAGS `$PKG_CONFIG glib-2.0 --cflags`" |
102 | LIBS="$LIBS `$PKG_CONFIG glib-2.0 --libs`" |
114 | LIBS="$LIBS `$PKG_CONFIG glib-2.0 --libs`" |
|
|
115 | AC_MSG_RESULT(ok) |
|
|
116 | else |
|
|
117 | AC_MSG_ERROR(no) |
|
|
118 | fi |
|
|
119 | |
|
|
120 | AC_MSG_CHECKING(gthread >= 0.0) |
|
|
121 | if $PKG_CONFIG gthread-2.0 --atleast-version 0.0; then |
|
|
122 | CXXFLAGS="$CXXFLAGS `$PKG_CONFIG gthread-2.0 --cflags`" |
|
|
123 | LIBS="$LIBS `$PKG_CONFIG gthread-2.0 --libs`" |
103 | AC_MSG_RESULT(ok) |
124 | AC_MSG_RESULT(ok) |
104 | else |
125 | else |
105 | AC_MSG_ERROR(no) |
126 | AC_MSG_ERROR(no) |
106 | fi |
127 | fi |
107 | |
128 | |
… | |
… | |
113 | dnl else |
134 | dnl else |
114 | dnl AC_MSG_ERROR(no) |
135 | dnl AC_MSG_ERROR(no) |
115 | dnl fi |
136 | dnl fi |
116 | |
137 | |
117 | AC_MSG_CHECKING(for $PERL suitability) |
138 | AC_MSG_CHECKING(for $PERL suitability) |
118 | if $PERL -MExtUtils::Embed -e "use v5.8" >/dev/null 2>&1; then |
139 | if $PERL -MExtUtils::Embed -e "use 5.10.1" >/dev/null 2>&1; then |
119 | save_CXXFLAGS="$CXXFLAGS" |
140 | save_CXXFLAGS="$CXXFLAGS" |
120 | save_LIBS="$LIBS" |
141 | save_LIBS="$LIBS" |
121 | xPERLFLAGS="`$PERL -MExtUtils::Embed -e ccopts`" |
142 | xPERLFLAGS="`$PERL -MExtUtils::Embed -e ccopts`" |
122 | xPERLFLAGS="$xPERLFLAGS `$PERL -MEV::MakeMaker -e 'print +{&EV::MakeMaker::ev_args}->{INC}'`" |
143 | 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}'`" |
144 | xPERLFLAGS="$xPERLFLAGS `$PERL -MCoro::MakeMaker -e 'print +{&Coro::MakeMaker::coro_args}->{INC}'`" |
… | |
… | |
126 | AC_TRY_LINK([ |
147 | AC_TRY_LINK([ |
127 | #include <EXTERN.h> |
148 | #include <EXTERN.h> |
128 | #include <perl.h> |
149 | #include <perl.h> |
129 | #include <XSUB.h> |
150 | #include <XSUB.h> |
130 | #include "EVAPI.h" |
151 | #include "EVAPI.h" |
|
|
152 | #include "CoroAPI.h" |
131 | ],[ |
153 | ],[ |
132 | PerlInterpreter *perl = perl_alloc (); |
154 | PerlInterpreter *perl = perl_alloc (); |
133 | ],[perl_link=yes],[perl_link=no]) |
155 | ],[perl_link=yes],[perl_link=no]) |
134 | CXXFLAGS="$save_CXXFLAGS" |
156 | CXXFLAGS="$save_CXXFLAGS" |
135 | LIBS="$save_LIBS" |
157 | LIBS="$save_LIBS" |
136 | |
158 | |
137 | if test x$perl_link = xyes; then |
159 | if test x$perl_link = xyes; then |
138 | AC_MSG_RESULT(ok) |
160 | AC_MSG_RESULT(ok) |
139 | AC_DEFINE(ENABLE_PERL, 1, Define if you can embed a perl interpreter) |
|
|
140 | PERLFLAGS="$xPERLFLAGS" |
161 | PERLFLAGS="$xPERLFLAGS" |
141 | PERLLIB="`$PERL -MExtUtils::Embed -e ldopts`" |
162 | PERLLIB="`$PERL -MExtUtils::Embed -e ldopts`" |
142 | PERLPRIVLIBEXP="`$PERL -MConfig -e 'print $Config{privlibexp}'`" |
163 | PERLPRIVLIBEXP="`$PERL -MConfig -e 'print $Config{privlibexp}'`" |
143 | CPPFLAGS="$CPPFLAGS $PERLFLAGS" |
164 | CPPFLAGS="$CPPFLAGS $PERLFLAGS" |
144 | else |
165 | else |
145 | AC_MSG_ERROR([no, unable to link]) |
166 | AC_MSG_ERROR([no, unable to link test program]) |
146 | fi |
167 | fi |
147 | else |
168 | else |
148 | AC_MSG_ERROR([no working perl found, or perl not version >= 5.8]) |
169 | AC_MSG_ERROR([no working perl found, or perl not version >= 5.10.1]) |
149 | fi |
170 | fi |
150 | AC_SUBST(PERLLIB) |
171 | AC_SUBST(PERLLIB) |
151 | AC_SUBST(PERLFLAGS) |
172 | AC_SUBST(PERLFLAGS) |
152 | AC_SUBST(PERLPRIVLIBEXP) |
173 | AC_SUBST(PERLPRIVLIBEXP) |
153 | AC_SUBST(PERL) |
174 | AC_SUBST(PERL) |
… | |
… | |
199 | |
220 | |
200 | AC_SUBST(pkgstatedir,$localstatedir/$PACKAGE) |
221 | AC_SUBST(pkgstatedir,$localstatedir/$PACKAGE) |
201 | AC_SUBST(pkgconfdir,$sysconfdir/$PACKAGE) |
222 | AC_SUBST(pkgconfdir,$sysconfdir/$PACKAGE) |
202 | |
223 | |
203 | AC_OUTPUT([Makefile |
224 | AC_OUTPUT([Makefile |
204 | include/Makefile lib/Makefile pod/Makefile random_maps/Makefile socket/Makefile |
225 | include/Makefile lib/Makefile |
205 | server/Makefile utils/Makefile ext/Makefile doc/Makefile |
226 | utils/cfutil |
206 | common/Makefile utils/cfutil |
|
|
207 | ]) |
227 | ]) |
208 | |
228 | |