ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/deliantra/server/configure.ac
Revision: 1.70
Committed: Thu Apr 26 00:39:18 2007 UTC (17 years ago) by root
Branch: MAIN
Changes since 1.69: +5 -1 lines
Log Message:
require pngnq and automatically requantise too large 32x32 smooth faces so gcfclient doesn't nuke

File Contents

# Content
1 dnl Process this file with autoconf to produce a configure script.
2
3 AC_INIT([cfserver], [2.1], [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 AC_PATH_PROG(IDENTIFY, identify)
34 if test -z "$IDENTIFY"; then
35 AC_MSG_ERROR([ImageMagick 'identify' must be in your PATH, check the README])
36 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 "Crossfire 0.97" \
57 "Coro 3.61" \
58 "Coro::Event 2.1" \
59 "Event 1.08" \
60 "IO::AIO 2.32" \
61 "BDB 0.1" \
62 "Storable 2.0" \
63 "JSON::XS 1.11" \
64 "Time::HiRes 1.0" \
65 "YAML::Syck 0.71" \
66 "Digest::MD5 2.0" \
67 "Compress::LZF 1.8" \
68 "Safe::Hole 0.10" \
69 "Pod::POM 0.17" \
70 ; do
71 set -- $module_vers
72 module=$1
73 minvers=$2
74 AC_MSG_CHECKING(for $module perl module version $minvers or higher)
75 if $PERL -M$module -e0 >/dev/null 2>&1; then
76 version=`$PERL -M$module -e "print \\$$module::VERSION"`
77 if $PERL -M$module=$minvers -e0 >/dev/null 2>&1; then
78 AC_MSG_RESULT([ok, version $version])
79 else
80 AC_MSG_ERROR([no, installed version is $version])
81 fi
82 else
83 AC_MSG_ERROR([no, cannot load module $module])
84 fi
85 done
86
87 AC_LANG(C++)
88 AC_PROG_CXX
89 AC_PROG_CPP
90
91 AC_CHECK_HEADER(tr1/unordered_map,[],[AC_MSG_ERROR([Your compiler must support the Library Technical Report 1 extensions.])])
92
93 AC_PATH_PROG(PKG_CONFIG, pkg-config, no)
94
95 AC_MSG_CHECKING(glib >= 2.10)
96 if $PKG_CONFIG glib-2.0 --atleast-version 2.10; then
97 CXXFLAGS="$CXXFLAGS `$PKG_CONFIG glib-2.0 --cflags`"
98 LIBS="$LIBS `$PKG_CONFIG glib-2.0 --libs`"
99 AC_MSG_RESULT(ok)
100 else
101 AC_MSG_ERROR(no)
102 fi
103
104 AC_MSG_CHECKING(libpng)
105 if $PKG_CONFIG libpng --exists; then
106 CXXFLAGS="$CXXFLAGS `$PKG_CONFIG libpng --cflags`"
107 LIBS="$LIBS `$PKG_CONFIG libpng --libs`"
108 AC_MSG_RESULT(ok)
109 else
110 AC_MSG_ERROR(no)
111 fi
112
113 AC_PROG_LIBTOOL
114
115 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 xPERLFLAGS="$xPERLFLAGS `$PERL -MEvent::MakeMaker -e 'print +{&Event::MakeMaker::event_args}->{INC}'`"
121 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 #include "EventAPI.h"
129 ],[
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 dnl check for some other programs
154 AC_PATH_PROG(TAR, tar)
155 AC_PATH_PROG(BASENAME, basename)
156
157 AC_CHECK_LIB(nsl, main)
158 AC_CHECK_LIB(socket, main)
159
160 dnl Checks for libraries.
161 AC_CHECK_LIB(m, main)
162
163 AC_CHECK_SIZEOF(long)
164 AC_CHECK_SIZEOF(long long)
165
166 AC_SUBST(pkgstatedir,$localstatedir/$PACKAGE)
167 AC_SUBST(pkgconfdir,$sysconfdir/$PACKAGE)
168
169 AC_OUTPUT([Makefile
170 include/Makefile lib/Makefile pod/Makefile random_maps/Makefile socket/Makefile
171 server/Makefile utils/Makefile ext/Makefile doc/Makefile
172 lib/checkarch.pl lib/collect.pl common/Makefile utils/cfutil
173 ])
174