ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/deliantra/server/configure.ac
Revision: 1.56
Committed: Tue Mar 6 03:06:00 2007 UTC (17 years, 2 months ago) by root
Branch: MAIN
CVS Tags: rel-2_0
Changes since 1.55: +6 -2 lines
Log Message:
- automake insists on naming all libdirs .../cfserver now. i have to concur :/
- correctly reattach to players on reload, this likely fixes the reload crash bug.
- init env vars very early, so perl gets to see them.

File Contents

# User Rev Content
1 root 1.1 dnl Process this file with autoconf to produce a configure script.
2    
3 root 1.54 AC_INIT([cfserver], [2.0], [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.41 dnl Checks for programs.
14     AC_LANG(C++)
15     AC_PROG_CXX
16     AC_PROG_LIBTOOL
17    
18     AC_PROG_CPP
19    
20 root 1.55 AC_PATH_PROG(CONVERT, convert)
21    
22     if test -z "$CONVERT"; then
23     AC_MSG_ERROR([ImageMagick 'convert' must be in your PATH, see the README])
24     fi
25    
26 root 1.33 AC_PATH_PROG(PERL, perl5.8)
27 root 1.56 if test -z "$PERL"; then
28     AC_PATH_PROG(PERL, perl5)
29     if test -z "$PERL"; then
30     AC_PATH_PROG(PERL, perl)
31     fi
32     fi
33 root 1.33
34 root 1.49 for module_vers in "Crossfire 0.97" "Coro 3.5" "Coro::Event 2.1" "Event 1.08" \
35 root 1.47 "IO::AIO 2.32" "BDB 0.1" "Storable 2.0" "Time::HiRes 1.0" "YAML::Syck 0.71" \
36 root 1.48 "Digest::MD5 2.0" "Compress::LZF 1.71" "Safe::Hole 0.10" "Pod::POM 0.17"; do
37 root 1.47 set -- $module_vers
38     module=$1
39     minvers=$2
40     AC_MSG_CHECKING(for $module perl module version $minvers or higher)
41     if $PERL -M$module -e0 >/dev/null 2>&1; then
42     version=`$PERL -M$module -e "print \\$$module::VERSION"`
43     if $PERL -M$module=$minvers -e0 >/dev/null 2>&1; then
44     AC_MSG_RESULT([ok, version $version])
45     else
46     AC_MSG_ERROR([no, installed version is $version])
47     fi
48     else
49     AC_MSG_ERROR([no, cannot load module $module])
50     fi
51     done
52    
53 root 1.41 AC_MSG_CHECKING(for $PERL suitability)
54     if $PERL -MExtUtils::Embed -e "use v5.8" >/dev/null 2>&1; then
55     save_CXXFLAGS="$CXXFLAGS"
56     save_LIBS="$LIBS"
57     xPERLFLAGS="`$PERL -MExtUtils::Embed -e ccopts`"
58     xPERLFLAGS="$xPERLFLAGS `$PERL -MEvent::MakeMaker -e 'print +{&Event::MakeMaker::event_args}->{INC}'`"
59     xPERLFLAGS="$xPERLFLAGS `$PERL -MCoro::MakeMaker -e 'print +{&Coro::MakeMaker::coro_args}->{INC}'`"
60     CXXFLAGS="$CXXFLAGS $xPERLFLAGS"
61     LIBS="$LIBS `$PERL -MExtUtils::Embed -e ldopts`"
62     AC_TRY_LINK([
63     #include <EXTERN.h>
64     #include <perl.h>
65     #include <XSUB.h>
66     #include "EventAPI.h"
67     ],[
68     PerlInterpreter *perl = perl_alloc ();
69     ],[perl_link=yes],[perl_link=no])
70     CXXFLAGS="$save_CXXFLAGS"
71     LIBS="$save_LIBS"
72    
73     if test x$perl_link = xyes; then
74     AC_MSG_RESULT(ok)
75     AC_DEFINE(ENABLE_PERL, 1, Define if you can embed a perl interpreter)
76     PERLFLAGS="$xPERLFLAGS"
77     PERLLIB="`$PERL -MExtUtils::Embed -e ldopts`"
78     PERLPRIVLIBEXP="`$PERL -MConfig -e 'print $Config{privlibexp}'`"
79     CPPFLAGS="$CPPFLAGS $PERLFLAGS"
80     else
81     AC_MSG_ERROR([no, unable to link])
82     fi
83     else
84     AC_MSG_ERROR([no working perl found, or perl not version >= 5.8])
85     fi
86     AC_SUBST(PERLLIB)
87     AC_SUBST(PERLFLAGS)
88     AC_SUBST(PERLPRIVLIBEXP)
89     AC_SUBST(PERL)
90    
91 root 1.1 dnl check for some other programs
92     AC_PATH_PROG(TAR, tar)
93     AC_PATH_PROG(BASENAME, basename)
94    
95 root 1.25 AC_PATH_PROG(GPERF, gperf)
96     if test -z "$GPERF"; then
97     AC_MSG_ERROR([we need gperf, the GNU perfect hash generator])
98 root 1.1 fi
99    
100     AC_CHECK_LIB(nsl, main)
101     AC_CHECK_LIB(socket, main)
102    
103     dnl Checks for libraries.
104     AC_CHECK_LIB(m, main)
105    
106 root 1.41 AC_CHECK_HEADER(tr1/unordered_map,[],[AC_MSG_ERROR([Your compiler must support the Library Technical Report 1 extensions.])])
107 root 1.1
108     AC_CHECK_SIZEOF(long)
109     AC_CHECK_SIZEOF(long long)
110    
111 root 1.18 AC_PATH_PROG(PKG_CONFIG, pkg-config, no)
112    
113     AC_MSG_CHECKING(glib >= 2.10)
114     if $PKG_CONFIG glib-2.0 --atleast-version 2.10; then
115     CXXFLAGS="$CXXFLAGS `$PKG_CONFIG glib-2.0 --cflags`"
116     LIBS="$LIBS `$PKG_CONFIG glib-2.0 --libs`"
117     AC_MSG_RESULT(ok)
118     else
119     AC_MSG_ERROR(no)
120     fi
121    
122 root 1.41 AC_MSG_CHECKING(libpng)
123     if $PKG_CONFIG libpng --exists; then
124     CXXFLAGS="$CXXFLAGS `$PKG_CONFIG libpng --cflags`"
125     LIBS="$LIBS `$PKG_CONFIG libpng --libs`"
126     AC_MSG_RESULT(ok)
127     else
128     AC_MSG_ERROR(no)
129     fi
130    
131 root 1.1 AC_SUBST(pkgstatedir,$localstatedir/$PACKAGE)
132     AC_SUBST(pkgconfdir,$sysconfdir/$PACKAGE)
133    
134     AC_OUTPUT([Makefile
135 pippijn 1.22 include/Makefile lib/Makefile pod/Makefile random_maps/Makefile socket/Makefile
136 root 1.52 server/Makefile utils/Makefile ext/Makefile doc/Makefile
137 root 1.50 lib/checkarch.pl lib/collect.pl common/Makefile
138 pippijn 1.22 ])
139 root 1.30