ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/deliantra/server/configure.ac
Revision: 1.38
Committed: Mon Jan 8 22:32:10 2007 UTC (17 years, 4 months ago) by root
Branch: MAIN
Changes since 1.37: +1 -1 lines
Log Message:
- disabled stuff that might cause instabilities at the cost of certain
  (controlled) additional memory usage.
- minor changes to improve the stability,

File Contents

# User Rev Content
1 root 1.1 dnl Process this file with autoconf to produce a configure script.
2    
3 root 1.29 AC_INIT([crossfire], [2.0+], [crossfire@schmorp.de])
4 root 1.1 AC_CONFIG_AUX_DIR(utils)
5 elmex 1.9 AC_CONFIG_SRCDIR([server/main.C])
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.33 AC_PATH_PROG(PERL, perl5.8)
14     AC_PATH_PROG(PERL, perl5)
15     AC_PATH_PROG(PERL, perl)
16    
17 root 1.36 for module_vers in "Coro 3.3" "Coro::Event 2.0" "Event 1.08" \
18 root 1.37 "IO::AIO 2.32" "Storable 2.0" "Time::HiRes 1.0" "YAML::Syck 0.71" \
19 root 1.38 "Digest::MD5 2.0" "Compress::LZF 1.7" "Safe::Hole 0.10"; do
20 root 1.33 set -- $module_vers
21     module=$1
22     minvers=$2
23     AC_MSG_CHECKING(for $module perl module version $minvers or higher)
24     if $PERL -M$module -e0 >/dev/null 2>&1; then
25     version=`$PERL -M$module -e "print \\$$module::VERSION"`
26     if $PERL -M$module=$minvers -e0 >/dev/null 2>&1; then
27     AC_MSG_RESULT([ok, version $version])
28     else
29     AC_MSG_ERROR([no, installed version is $version])
30     fi
31     else
32     AC_MSG_ERROR([no, cannot load module $module])
33     fi
34     done
35 root 1.1
36     dnl Checks for programs.
37 root 1.17 AC_LANG(C++)
38 root 1.12 AC_PROG_CXX
39 root 1.1 AC_PROG_LIBTOOL
40    
41     case "$target" in
42     alpha-dec-osf*)
43     # If we are not using gcc, we want the ansi version of cc.
44     if test -z "$GCC"; then
45     # CFLAGS="$CFLAGS -std1 -warnprotos" # Not yet ready for warnprotos...
46     CFLAGS="$CFLAGS -std1"
47     fi
48     ;;
49     *)
50     ;;
51     esac
52    
53     AC_PROG_CPP
54    
55 root 1.14 dnl AC_ARG_WITH(python, [ --with-python=dir Directory to look for python headers/library (default=standard system location) ], PYTHON_HOME="$withval")
56 root 1.1
57     dnl check for some other programs
58     AC_PATH_PROG(LATEX, latex)
59     AC_PATH_PROG(GZIP, gzip)
60 root 1.25 AC_PATH_PROG(BZIP, bzip2)
61 root 1.1 AC_PATH_PROG(TAR, tar)
62     AC_PATH_PROG(BASENAME, basename)
63    
64 root 1.25 AC_PATH_PROG(GPERF, gperf)
65     if test -z "$GPERF"; then
66     AC_MSG_ERROR([we need gperf, the GNU perfect hash generator])
67 root 1.1 fi
68    
69 root 1.25 GUNZIP="$GZIP -c"
70     BUNZIP="$BZIP -c"
71 root 1.1
72     if test -z "$COMPRESS" -a -z "$GZIP" -a -z "$BZIP" ; then
73     echo "Unable to find either compress, bzip2, or gzip - hope you don't plan on compressing";
74     echo "any files.";
75     fi;
76    
77     dnl nsl, socket may be needed for the X-windowing system, so check
78     dnl for them before before checking for X.
79     AC_CHECK_LIB(nsl, main)
80     AC_CHECK_LIB(socket, main)
81    
82     dnl Checks for libraries.
83     AC_CHECK_LIB(m, main)
84     AC_CHECK_LIB(png, main, AC_DEFINE(HAVE_LIBPNG,[],[Define if libpng is available]) X11LIBS="$X11LIBS -lpng", , $X11LIBS )
85    
86     dnl png has a dependency in some cases on libz - if we have it, can't really
87     dnl be harmful to link it in.
88     AC_CHECK_LIB(z, main, AC_DEFINE(HAVE_LIBZ,[],[Define if libz is available]) X11LIBS="$X11LIBS -lz", , $X11LIBS )
89    
90     dnl Misc libraries.
91     AC_CHECK_LIB(crypt, main)
92     AC_CHECK_LIB(des, des_crypt)
93    
94     dnl Checks for header files.
95 root 1.26 AC_CHECK_HEADERS(crypt.h des.h)
96 root 1.1
97     dnl Checks for typedefs, structures, and compiler characteristics.
98     AC_C_INLINE
99    
100     AC_CHECK_SIZEOF(long)
101     AC_CHECK_SIZEOF(long long)
102    
103     dnl Checks for library functions.
104     AC_PROG_GCC_TRADITIONAL
105     AC_TYPE_SIGNAL
106    
107 root 1.18 AC_PATH_PROG(PKG_CONFIG, pkg-config, no)
108    
109     AC_MSG_CHECKING(glib >= 2.10)
110     if $PKG_CONFIG glib-2.0 --atleast-version 2.10; then
111     CXXFLAGS="$CXXFLAGS `$PKG_CONFIG glib-2.0 --cflags`"
112     LIBS="$LIBS `$PKG_CONFIG glib-2.0 --libs`"
113     AC_MSG_RESULT(ok)
114     else
115     AC_MSG_ERROR(no)
116     fi
117    
118 root 1.1 AC_SUBST(x_includes)
119     AC_SUBST(x_libraries)
120     AC_SUBST(no_x)
121     AM_CONDITIONAL(HAVE_X,test "x$no_x" = "x")
122     AC_SUBST(X11LIBS)
123    
124     AC_SUBST(pkgstatedir,$localstatedir/$PACKAGE)
125     AC_SUBST(pkgconfdir,$sysconfdir/$PACKAGE)
126    
127     AC_DEFINE_UNQUOTED(COMPRESS,"${COMPRESS}",[Path to the compress binary])
128     AC_DEFINE_UNQUOTED(UNCOMPRESS,"${UNCOMPRESS}",[Path to the uncompress binary])
129     AC_DEFINE_UNQUOTED(GZIP,"${GZIP}",[Path to the gzip binary])
130     AC_DEFINE_UNQUOTED(GUNZIP,"${GUNZIP}",[Path to the gunzip binary])
131     AC_DEFINE_UNQUOTED(BZIP,"${BZIP}",[Path to the bzip binary])
132     AC_DEFINE_UNQUOTED(BUNZIP,"${BUNZIP}",[Path to the bunzip binary])
133    
134 root 1.3 AC_MSG_CHECKING(for $PERL suitability)
135 root 1.31 if $PERL -MExtUtils::Embed -e "use v5.8" >/dev/null 2>&1; then
136 root 1.18 save_CXXFLAGS="$CXXFLAGS"
137 root 1.3 save_LIBS="$LIBS"
138 root 1.31 xPERLFLAGS="`$PERL -MExtUtils::Embed -e ccopts`"
139     xPERLFLAGS="$xPERLFLAGS `$PERL -MEvent::MakeMaker -e 'print +{&Event::MakeMaker::event_args}->{INC}'`"
140     xPERLFLAGS="$xPERLFLAGS `$PERL -MCoro::MakeMaker -e 'print +{&Coro::MakeMaker::coro_args}->{INC}'`"
141     CXXFLAGS="$CXXFLAGS $xPERLFLAGS"
142 root 1.3 LIBS="$LIBS `$PERL -MExtUtils::Embed -e ldopts`"
143     AC_TRY_LINK([
144 root 1.2 #include <EXTERN.h>
145     #include <perl.h>
146     #include <XSUB.h>
147 root 1.8 #include "EventAPI.h"
148 root 1.2 ],[
149 root 1.3 PerlInterpreter *perl = perl_alloc ();
150 root 1.2 ],[perl_link=yes],[perl_link=no])
151 root 1.12 CXXFLAGS="$save_CXXFLAGS"
152 root 1.3 LIBS="$save_LIBS"
153 root 1.2
154 root 1.3 if test x$perl_link = xyes; then
155     AC_MSG_RESULT(ok)
156     AC_DEFINE(ENABLE_PERL, 1, Define if you can embed a perl interpreter)
157 root 1.31 PERLFLAGS="$xPERLFLAGS"
158 root 1.3 PERLLIB="`$PERL -MExtUtils::Embed -e ldopts`"
159     PERLPRIVLIBEXP="`$PERL -MConfig -e 'print $Config{privlibexp}'`"
160 root 1.15 CPPFLAGS="$CPPFLAGS $PERLFLAGS"
161 root 1.2 else
162 root 1.3 AC_MSG_ERROR([no, unable to link])
163 root 1.2 fi
164 root 1.3 else
165 root 1.32 AC_MSG_ERROR([no working perl found, or perl not version >= 5.8])
166 root 1.2 fi
167     AC_SUBST(PERLLIB)
168     AC_SUBST(PERLFLAGS)
169     AC_SUBST(PERLPRIVLIBEXP)
170     AC_SUBST(PERL)
171    
172 root 1.1 AC_OUTPUT([Makefile
173 pippijn 1.22 include/Makefile lib/Makefile pod/Makefile random_maps/Makefile socket/Makefile
174 root 1.27 server/Makefile src/Makefile utils/Makefile ext/Makefile
175 pippijn 1.21 lib/checkarch.pl lib/collect.pl utils/add_throw.perl
176     utils/crossloop.tmpl utils/crossloop.pl.tmpl utils/metaserver.pl
177     utils/crossloop.web utils/scores.pl utils/player_dl.pl common/Makefile
178 pippijn 1.22 ])
179 root 1.30