ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/deliantra/server/configure.ac
Revision: 1.40
Committed: Thu Jan 18 16:19:33 2007 UTC (17 years, 3 months ago) by root
Branch: MAIN
Changes since 1.39: +0 -7 lines
Log Message:
- fix a horrendous bug that might have caused all the map corruption
- optimise/modernise some map-insert-related stuff
- fix debug_desc
- remove crypt configury
- minor adjustments/cleanups

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.39 for module_vers in "Coro 3.4" "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 Checks for typedefs, structures, and compiler characteristics.
91     AC_C_INLINE
92    
93     AC_CHECK_SIZEOF(long)
94     AC_CHECK_SIZEOF(long long)
95    
96     dnl Checks for library functions.
97     AC_PROG_GCC_TRADITIONAL
98     AC_TYPE_SIGNAL
99    
100 root 1.18 AC_PATH_PROG(PKG_CONFIG, pkg-config, no)
101    
102     AC_MSG_CHECKING(glib >= 2.10)
103     if $PKG_CONFIG glib-2.0 --atleast-version 2.10; then
104     CXXFLAGS="$CXXFLAGS `$PKG_CONFIG glib-2.0 --cflags`"
105     LIBS="$LIBS `$PKG_CONFIG glib-2.0 --libs`"
106     AC_MSG_RESULT(ok)
107     else
108     AC_MSG_ERROR(no)
109     fi
110    
111 root 1.1 AC_SUBST(x_includes)
112     AC_SUBST(x_libraries)
113     AC_SUBST(no_x)
114     AM_CONDITIONAL(HAVE_X,test "x$no_x" = "x")
115     AC_SUBST(X11LIBS)
116    
117     AC_SUBST(pkgstatedir,$localstatedir/$PACKAGE)
118     AC_SUBST(pkgconfdir,$sysconfdir/$PACKAGE)
119    
120     AC_DEFINE_UNQUOTED(COMPRESS,"${COMPRESS}",[Path to the compress binary])
121     AC_DEFINE_UNQUOTED(UNCOMPRESS,"${UNCOMPRESS}",[Path to the uncompress binary])
122     AC_DEFINE_UNQUOTED(GZIP,"${GZIP}",[Path to the gzip binary])
123     AC_DEFINE_UNQUOTED(GUNZIP,"${GUNZIP}",[Path to the gunzip binary])
124     AC_DEFINE_UNQUOTED(BZIP,"${BZIP}",[Path to the bzip binary])
125     AC_DEFINE_UNQUOTED(BUNZIP,"${BUNZIP}",[Path to the bunzip binary])
126    
127 root 1.3 AC_MSG_CHECKING(for $PERL suitability)
128 root 1.31 if $PERL -MExtUtils::Embed -e "use v5.8" >/dev/null 2>&1; then
129 root 1.18 save_CXXFLAGS="$CXXFLAGS"
130 root 1.3 save_LIBS="$LIBS"
131 root 1.31 xPERLFLAGS="`$PERL -MExtUtils::Embed -e ccopts`"
132     xPERLFLAGS="$xPERLFLAGS `$PERL -MEvent::MakeMaker -e 'print +{&Event::MakeMaker::event_args}->{INC}'`"
133     xPERLFLAGS="$xPERLFLAGS `$PERL -MCoro::MakeMaker -e 'print +{&Coro::MakeMaker::coro_args}->{INC}'`"
134     CXXFLAGS="$CXXFLAGS $xPERLFLAGS"
135 root 1.3 LIBS="$LIBS `$PERL -MExtUtils::Embed -e ldopts`"
136     AC_TRY_LINK([
137 root 1.2 #include <EXTERN.h>
138     #include <perl.h>
139     #include <XSUB.h>
140 root 1.8 #include "EventAPI.h"
141 root 1.2 ],[
142 root 1.3 PerlInterpreter *perl = perl_alloc ();
143 root 1.2 ],[perl_link=yes],[perl_link=no])
144 root 1.12 CXXFLAGS="$save_CXXFLAGS"
145 root 1.3 LIBS="$save_LIBS"
146 root 1.2
147 root 1.3 if test x$perl_link = xyes; then
148     AC_MSG_RESULT(ok)
149     AC_DEFINE(ENABLE_PERL, 1, Define if you can embed a perl interpreter)
150 root 1.31 PERLFLAGS="$xPERLFLAGS"
151 root 1.3 PERLLIB="`$PERL -MExtUtils::Embed -e ldopts`"
152     PERLPRIVLIBEXP="`$PERL -MConfig -e 'print $Config{privlibexp}'`"
153 root 1.15 CPPFLAGS="$CPPFLAGS $PERLFLAGS"
154 root 1.2 else
155 root 1.3 AC_MSG_ERROR([no, unable to link])
156 root 1.2 fi
157 root 1.3 else
158 root 1.32 AC_MSG_ERROR([no working perl found, or perl not version >= 5.8])
159 root 1.2 fi
160     AC_SUBST(PERLLIB)
161     AC_SUBST(PERLFLAGS)
162     AC_SUBST(PERLPRIVLIBEXP)
163     AC_SUBST(PERL)
164    
165 root 1.1 AC_OUTPUT([Makefile
166 pippijn 1.22 include/Makefile lib/Makefile pod/Makefile random_maps/Makefile socket/Makefile
167 root 1.27 server/Makefile src/Makefile utils/Makefile ext/Makefile
168 pippijn 1.21 lib/checkarch.pl lib/collect.pl utils/add_throw.perl
169     utils/crossloop.tmpl utils/crossloop.pl.tmpl utils/metaserver.pl
170     utils/crossloop.web utils/scores.pl utils/player_dl.pl common/Makefile
171 pippijn 1.22 ])
172 root 1.30