ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/deliantra/server/configure.ac
Revision: 1.37
Committed: Sun Jan 7 21:54:58 2007 UTC (17 years, 4 months ago) by root
Branch: MAIN
Changes since 1.36: +1 -1 lines
Log Message:
implement quit

File Contents

# Content
1 dnl Process this file with autoconf to produce a configure script.
2
3 AC_INIT([crossfire], [2.0+], [crossfire@schmorp.de])
4 AC_CONFIG_AUX_DIR(utils)
5 AC_CONFIG_SRCDIR([server/main.C])
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(PERL, perl5.8)
14 AC_PATH_PROG(PERL, perl5)
15 AC_PATH_PROG(PERL, perl)
16
17 for module_vers in "Coro 3.3" "Coro::Event 2.0" "Event 1.08" \
18 "IO::AIO 2.32" "Storable 2.0" "Time::HiRes 1.0" "YAML::Syck 0.71" \
19 "Digest::MD5 2.0" "Compress::LZF 1.7"; do
20 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
36 dnl Checks for programs.
37 AC_LANG(C++)
38 AC_PROG_CXX
39 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 dnl AC_ARG_WITH(python, [ --with-python=dir Directory to look for python headers/library (default=standard system location) ], PYTHON_HOME="$withval")
56
57 dnl check for some other programs
58 AC_PATH_PROG(LATEX, latex)
59 AC_PATH_PROG(GZIP, gzip)
60 AC_PATH_PROG(BZIP, bzip2)
61 AC_PATH_PROG(TAR, tar)
62 AC_PATH_PROG(BASENAME, basename)
63
64 AC_PATH_PROG(GPERF, gperf)
65 if test -z "$GPERF"; then
66 AC_MSG_ERROR([we need gperf, the GNU perfect hash generator])
67 fi
68
69 GUNZIP="$GZIP -c"
70 BUNZIP="$BZIP -c"
71
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 AC_CHECK_HEADERS(crypt.h des.h)
96
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 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 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 AC_MSG_CHECKING(for $PERL suitability)
135 if $PERL -MExtUtils::Embed -e "use v5.8" >/dev/null 2>&1; then
136 save_CXXFLAGS="$CXXFLAGS"
137 save_LIBS="$LIBS"
138 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 LIBS="$LIBS `$PERL -MExtUtils::Embed -e ldopts`"
143 AC_TRY_LINK([
144 #include <EXTERN.h>
145 #include <perl.h>
146 #include <XSUB.h>
147 #include "EventAPI.h"
148 ],[
149 PerlInterpreter *perl = perl_alloc ();
150 ],[perl_link=yes],[perl_link=no])
151 CXXFLAGS="$save_CXXFLAGS"
152 LIBS="$save_LIBS"
153
154 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 PERLFLAGS="$xPERLFLAGS"
158 PERLLIB="`$PERL -MExtUtils::Embed -e ldopts`"
159 PERLPRIVLIBEXP="`$PERL -MConfig -e 'print $Config{privlibexp}'`"
160 CPPFLAGS="$CPPFLAGS $PERLFLAGS"
161 else
162 AC_MSG_ERROR([no, unable to link])
163 fi
164 else
165 AC_MSG_ERROR([no working perl found, or perl not version >= 5.8])
166 fi
167 AC_SUBST(PERLLIB)
168 AC_SUBST(PERLFLAGS)
169 AC_SUBST(PERLPRIVLIBEXP)
170 AC_SUBST(PERL)
171
172 AC_OUTPUT([Makefile
173 include/Makefile lib/Makefile pod/Makefile random_maps/Makefile socket/Makefile
174 server/Makefile src/Makefile utils/Makefile ext/Makefile
175 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 ])
179