ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/deliantra/server/configure.ac
Revision: 1.65
Committed: Mon Apr 9 05:06:40 2007 UTC (17 years, 1 month ago) by root
Branch: MAIN
Changes since 1.64: +1 -1 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.57 AC_INIT([cfserver], [2.1], [crossfire@schmorp.de])
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     AC_PREFIX_DEFAULT(/usr/games/crossfire)
12    
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     AC_PATH_PROG(IDENTIFY, identify)
29     if test -z "$IDENTIFY"; then
30     AC_MSG_ERROR([ImageMagick 'identify' must be in your PATH, check the README])
31 root 1.58 fi
32 root 1.41
33 root 1.55 AC_PATH_PROG(CONVERT, convert)
34     if test -z "$CONVERT"; then
35 root 1.59 AC_MSG_ERROR([ImageMagick 'convert' must be in your PATH, check the README])
36 root 1.55 fi
37    
38 root 1.33 AC_PATH_PROG(PERL, perl5.8)
39 root 1.56 if test -z "$PERL"; then
40     AC_PATH_PROG(PERL, perl5)
41     if test -z "$PERL"; then
42     AC_PATH_PROG(PERL, perl)
43 root 1.59 if test -z "$PERL"; then
44     AC_MSG_ERROR([perl 5.8 or higher must be in your PATH, check the README])
45     fi
46 root 1.56 fi
47     fi
48 root 1.33
49 root 1.60 for module_vers in \
50     "AnyEvent 2.52" \
51     "Image::Size 2.992" \
52     "Crossfire 0.97" \
53 root 1.61 "Coro 3.52" \
54 root 1.60 "Coro::Event 2.1" \
55     "Event 1.08" \
56     "IO::AIO 2.32" \
57     "BDB 0.1" \
58     "Storable 2.0" \
59 root 1.65 "JSON::XS 1.2" \
60 root 1.60 "Time::HiRes 1.0" \
61     "YAML::Syck 0.71" \
62     "Digest::MD5 2.0" \
63     "Compress::LZF 1.71" \
64     "Safe::Hole 0.10" \
65     "Pod::POM 0.17" \
66     ; do
67 root 1.47 set -- $module_vers
68     module=$1
69     minvers=$2
70     AC_MSG_CHECKING(for $module perl module version $minvers or higher)
71     if $PERL -M$module -e0 >/dev/null 2>&1; then
72     version=`$PERL -M$module -e "print \\$$module::VERSION"`
73     if $PERL -M$module=$minvers -e0 >/dev/null 2>&1; then
74     AC_MSG_RESULT([ok, version $version])
75     else
76     AC_MSG_ERROR([no, installed version is $version])
77     fi
78     else
79     AC_MSG_ERROR([no, cannot load module $module])
80     fi
81     done
82    
83 root 1.58 AC_LANG(C++)
84     AC_PROG_CXX
85     AC_PROG_CPP
86    
87     AC_CHECK_HEADER(tr1/unordered_map,[],[AC_MSG_ERROR([Your compiler must support the Library Technical Report 1 extensions.])])
88    
89     AC_PATH_PROG(PKG_CONFIG, pkg-config, no)
90    
91     AC_MSG_CHECKING(glib >= 2.10)
92     if $PKG_CONFIG glib-2.0 --atleast-version 2.10; then
93     CXXFLAGS="$CXXFLAGS `$PKG_CONFIG glib-2.0 --cflags`"
94     LIBS="$LIBS `$PKG_CONFIG glib-2.0 --libs`"
95     AC_MSG_RESULT(ok)
96     else
97     AC_MSG_ERROR(no)
98     fi
99    
100     AC_MSG_CHECKING(libpng)
101     if $PKG_CONFIG libpng --exists; then
102     CXXFLAGS="$CXXFLAGS `$PKG_CONFIG libpng --cflags`"
103     LIBS="$LIBS `$PKG_CONFIG libpng --libs`"
104     AC_MSG_RESULT(ok)
105     else
106     AC_MSG_ERROR(no)
107     fi
108    
109     AC_PROG_LIBTOOL
110    
111 root 1.41 AC_MSG_CHECKING(for $PERL suitability)
112     if $PERL -MExtUtils::Embed -e "use v5.8" >/dev/null 2>&1; then
113     save_CXXFLAGS="$CXXFLAGS"
114     save_LIBS="$LIBS"
115     xPERLFLAGS="`$PERL -MExtUtils::Embed -e ccopts`"
116     xPERLFLAGS="$xPERLFLAGS `$PERL -MEvent::MakeMaker -e 'print +{&Event::MakeMaker::event_args}->{INC}'`"
117     xPERLFLAGS="$xPERLFLAGS `$PERL -MCoro::MakeMaker -e 'print +{&Coro::MakeMaker::coro_args}->{INC}'`"
118     CXXFLAGS="$CXXFLAGS $xPERLFLAGS"
119     LIBS="$LIBS `$PERL -MExtUtils::Embed -e ldopts`"
120     AC_TRY_LINK([
121     #include <EXTERN.h>
122     #include <perl.h>
123     #include <XSUB.h>
124     #include "EventAPI.h"
125     ],[
126     PerlInterpreter *perl = perl_alloc ();
127     ],[perl_link=yes],[perl_link=no])
128     CXXFLAGS="$save_CXXFLAGS"
129     LIBS="$save_LIBS"
130    
131     if test x$perl_link = xyes; then
132     AC_MSG_RESULT(ok)
133     AC_DEFINE(ENABLE_PERL, 1, Define if you can embed a perl interpreter)
134     PERLFLAGS="$xPERLFLAGS"
135     PERLLIB="`$PERL -MExtUtils::Embed -e ldopts`"
136     PERLPRIVLIBEXP="`$PERL -MConfig -e 'print $Config{privlibexp}'`"
137     CPPFLAGS="$CPPFLAGS $PERLFLAGS"
138     else
139     AC_MSG_ERROR([no, unable to link])
140     fi
141     else
142     AC_MSG_ERROR([no working perl found, or perl not version >= 5.8])
143     fi
144     AC_SUBST(PERLLIB)
145     AC_SUBST(PERLFLAGS)
146     AC_SUBST(PERLPRIVLIBEXP)
147     AC_SUBST(PERL)
148    
149 root 1.1 dnl check for some other programs
150     AC_PATH_PROG(TAR, tar)
151     AC_PATH_PROG(BASENAME, basename)
152    
153     AC_CHECK_LIB(nsl, main)
154     AC_CHECK_LIB(socket, main)
155    
156     dnl Checks for libraries.
157     AC_CHECK_LIB(m, main)
158    
159     AC_CHECK_SIZEOF(long)
160     AC_CHECK_SIZEOF(long long)
161    
162     AC_SUBST(pkgstatedir,$localstatedir/$PACKAGE)
163     AC_SUBST(pkgconfdir,$sysconfdir/$PACKAGE)
164    
165     AC_OUTPUT([Makefile
166 pippijn 1.22 include/Makefile lib/Makefile pod/Makefile random_maps/Makefile socket/Makefile
167 root 1.52 server/Makefile utils/Makefile ext/Makefile doc/Makefile
168 root 1.58 lib/checkarch.pl lib/collect.pl common/Makefile utils/cfutil
169 pippijn 1.22 ])
170 root 1.30