--- deliantra/server/configure.ac 2007/03/05 01:56:48 1.49 +++ deliantra/server/configure.ac 2009/09/15 19:06:02 1.164 @@ -1,48 +1,85 @@ dnl Process this file with autoconf to produce a configure script. -AC_INIT([crossfire], [2.0+], [crossfire@schmorp.de]) +AC_INIT([deliantra-server], [2.80], [support@deliantra.net]) AC_CONFIG_AUX_DIR(utils) -AC_CONFIG_SRCDIR([server/main.C]) +AC_CONFIG_SRCDIR([server/cfperl.xs]) AM_INIT_AUTOMAKE AM_CONFIG_HEADER(include/autoconf.h) AM_MAINTAINER_MODE -AC_PREFIX_DEFAULT(/usr/games/crossfire) +AC_PREFIX_DEFAULT(/usr/games/deliantra) -dnl Checks for programs. -AC_LANG(C++) -AC_PROG_CXX -AC_PROG_LIBTOOL +AC_PATH_PROG(GPERF, gperf) +if test -z "$GPERF"; then + AC_MSG_ERROR([gperf, the GNU perfect hash generator, must be in your PATH, check the README]) +fi -case "$target" in - alpha-dec-osf*) - # If we are not using gcc, we want the ansi version of cc. - if test -z "$GCC"; then -# CFLAGS="$CFLAGS -std1 -warnprotos" # Not yet ready for warnprotos... - CFLAGS="$CFLAGS -std1" - fi - ;; - *) - ;; -esac +AC_PATH_PROG(RSYNC, rsync) +if test -z "$RSYNC"; then + AC_MSG_ERROR([rsync must be in your PATH, check the README]) +fi -AC_PROG_CPP +AC_PATH_PROG(OPTIPNG, optipng) +if test -z "$OPTIPNG"; then + AC_MSG_ERROR([optipng must be in your PATH, check the README]) +fi -AC_PATH_PROG(PERL, perl5.8) -AC_PATH_PROG(PERL, perl5) -AC_PATH_PROG(PERL, perl) - -for module_vers in "Crossfire 0.97" "Coro 3.5" "Coro::Event 2.1" "Event 1.08" \ - "IO::AIO 2.32" "BDB 0.1" "Storable 2.0" "Time::HiRes 1.0" "YAML::Syck 0.71" \ - "Digest::MD5 2.0" "Compress::LZF 1.71" "Safe::Hole 0.10" "Pod::POM 0.17"; do +AC_PATH_PROG(PNGNQ, pngnq) +if test -z "$PNGNQ"; then + AC_MSG_ERROR([png neuquant (pngnq) must be in your PATH, check the README]) +fi + +dnl AC_PATH_PROG(IDENTIFY, identify) +dnl if test -z "$IDENTIFY"; then +dnl AC_MSG_ERROR([ImageMagick 'identify' must be in your PATH, check the README]) +dnl fi + +AC_PATH_PROG(CONVERT, convert) +if test -z "$CONVERT"; then + AC_MSG_ERROR([ImageMagick 'convert' must be in your PATH, check the README]) +fi + +AC_PATH_PROG(PERL, perl5.10.1) +if test -z "$PERL"; then + AC_PATH_PROG(PERL, perl5.10.0) + if test -z "$PERL"; then + AC_PATH_PROG(PERL, perl) + if test -z "$PERL"; then + AC_MSG_ERROR([perl 5.10 or higher must be in your PATH, check the README]) + fi + fi +fi + +for module_vers in \ + "AnyEvent 4.22" \ + "AnyEvent::AIO 0" \ + "AnyEvent::BDB 0" \ + "BDB 1.8" \ + "Compress::LZF 3.41" \ + "Coro 5.13" \ + "Coro::EV 0" \ + "Deliantra 1.24" \ + "Digest::MD5 2.0" \ + "EV 3.41" \ + "Guard 0.5" \ + "IO::AIO 3.25" \ + "JSON::XS 2.01" \ + "AnyEvent::IRC 0.6" \ + "Pod::POM 0.17" \ + "Safe::Hole 0.10" \ + "Storable 2.0" \ + "Time::HiRes 1.0" \ + "URI 1.35" \ + "YAML 0.66" \ +; do set -- $module_vers module=$1 minvers=$2 AC_MSG_CHECKING(for $module perl module version $minvers or higher) if $PERL -M$module -e0 >/dev/null 2>&1; then version=`$PERL -M$module -e "print \\$$module::VERSION"` - if $PERL -M$module=$minvers -e0 >/dev/null 2>&1; then + if $PERL -M$module -e "\$$module::VERSION >= $minvers or die" >/dev/null 2>&1; then AC_MSG_RESULT([ok, version $version]) else AC_MSG_ERROR([no, installed version is $version]) @@ -52,12 +89,49 @@ fi done +AC_LANG(C++) +AC_PROG_CXX +AC_PROG_CPP + +AC_CHECK_HEADER(tr1/unordered_map,[],[AC_MSG_ERROR([Your compiler must support the Library Technical Report 1 extensions.])]) + +AC_CHECK_HEADER(pthread.h,[],[AC_MSG_ERROR([POSIX thread support is required.])]) + +AC_PATH_PROG(PKG_CONFIG, pkg-config, no) + +AC_MSG_CHECKING(glib >= 2.10) +if $PKG_CONFIG glib-2.0 --atleast-version 2.10; then + CXXFLAGS="$CXXFLAGS `$PKG_CONFIG glib-2.0 --cflags`" + LIBS="$LIBS `$PKG_CONFIG glib-2.0 --libs`" + AC_MSG_RESULT(ok) +else + AC_MSG_ERROR(no) +fi + +AC_MSG_CHECKING(gthread >= 0.0) +if $PKG_CONFIG gthread-2.0 --atleast-version 0.0; then + CXXFLAGS="$CXXFLAGS `$PKG_CONFIG gthread-2.0 --cflags`" + LIBS="$LIBS `$PKG_CONFIG gthread-2.0 --libs`" + AC_MSG_RESULT(ok) +else + AC_MSG_ERROR(no) +fi + +dnl AC_MSG_CHECKING(libpng) +dnl if $PKG_CONFIG libpng --exists; then +dnl CXXFLAGS="$CXXFLAGS `$PKG_CONFIG libpng --cflags`" +dnl LIBS="$LIBS `$PKG_CONFIG libpng --libs`" +dnl AC_MSG_RESULT(ok) +dnl else +dnl AC_MSG_ERROR(no) +dnl fi + AC_MSG_CHECKING(for $PERL suitability) -if $PERL -MExtUtils::Embed -e "use v5.8" >/dev/null 2>&1; then +if $PERL -MExtUtils::Embed -e "use 5.10.0" >/dev/null 2>&1; then save_CXXFLAGS="$CXXFLAGS" save_LIBS="$LIBS" xPERLFLAGS="`$PERL -MExtUtils::Embed -e ccopts`" - xPERLFLAGS="$xPERLFLAGS `$PERL -MEvent::MakeMaker -e 'print +{&Event::MakeMaker::event_args}->{INC}'`" + xPERLFLAGS="$xPERLFLAGS `$PERL -MEV::MakeMaker -e 'print +{&EV::MakeMaker::ev_args}->{INC}'`" xPERLFLAGS="$xPERLFLAGS `$PERL -MCoro::MakeMaker -e 'print +{&Coro::MakeMaker::coro_args}->{INC}'`" CXXFLAGS="$CXXFLAGS $xPERLFLAGS" LIBS="$LIBS `$PERL -MExtUtils::Embed -e ldopts`" @@ -65,7 +139,8 @@ #include #include #include -#include "EventAPI.h" +#include "EVAPI.h" +#include "CoroAPI.h" ],[ PerlInterpreter *perl = perl_alloc (); ],[perl_link=yes],[perl_link=no]) @@ -74,76 +149,72 @@ if test x$perl_link = xyes; then AC_MSG_RESULT(ok) - AC_DEFINE(ENABLE_PERL, 1, Define if you can embed a perl interpreter) PERLFLAGS="$xPERLFLAGS" PERLLIB="`$PERL -MExtUtils::Embed -e ldopts`" PERLPRIVLIBEXP="`$PERL -MConfig -e 'print $Config{privlibexp}'`" CPPFLAGS="$CPPFLAGS $PERLFLAGS" else - AC_MSG_ERROR([no, unable to link]) + AC_MSG_ERROR([no, unable to link test program]) fi else - AC_MSG_ERROR([no working perl found, or perl not version >= 5.8]) + AC_MSG_ERROR([no working perl found, or perl not version >= 5.10]) fi AC_SUBST(PERLLIB) AC_SUBST(PERLFLAGS) AC_SUBST(PERLPRIVLIBEXP) AC_SUBST(PERL) +dnl AC_PROG_LIBTOOL +AC_PROG_RANLIB + +AC_CHECK_HEADERS(execinfo.h malloc.h) +AC_CHECK_FUNCS(backtrace) + dnl check for some other programs AC_PATH_PROG(TAR, tar) AC_PATH_PROG(BASENAME, basename) -AC_PATH_PROG(GPERF, gperf) -if test -z "$GPERF"; then - AC_MSG_ERROR([we need gperf, the GNU perfect hash generator]) -fi - -AC_CHECK_LIB(nsl, main) -AC_CHECK_LIB(socket, main) +AC_CHECK_LIB(nsl, gethostbyname) +AC_CHECK_LIB(socket, connect) +AC_CHECK_LIB(pthread, pthread_create) dnl Checks for libraries. AC_CHECK_LIB(m, main) -AC_CHECK_HEADER(tr1/unordered_map,[],[AC_MSG_ERROR([Your compiler must support the Library Technical Report 1 extensions.])]) - AC_CHECK_SIZEOF(long) AC_CHECK_SIZEOF(long long) -AC_PATH_PROG(PKG_CONFIG, pkg-config, no) - -AC_MSG_CHECKING(glib >= 2.10) -if $PKG_CONFIG glib-2.0 --atleast-version 2.10; then - CXXFLAGS="$CXXFLAGS `$PKG_CONFIG glib-2.0 --cflags`" - LIBS="$LIBS `$PKG_CONFIG glib-2.0 --libs`" - AC_MSG_RESULT(ok) -else - AC_MSG_ERROR(no) -fi - -AC_MSG_CHECKING(libpng) -if $PKG_CONFIG libpng --exists; then - CXXFLAGS="$CXXFLAGS `$PKG_CONFIG libpng --cflags`" - LIBS="$LIBS `$PKG_CONFIG libpng --libs`" - AC_MSG_RESULT(ok) -else - AC_MSG_ERROR(no) -fi - -AC_SUBST(x_includes) -AC_SUBST(x_libraries) -AC_SUBST(no_x) -AM_CONDITIONAL(HAVE_X,test "x$no_x" = "x") -AC_SUBST(X11LIBS) +AC_MSG_CHECKING(for tcp_info support) +AC_TRY_LINK([ +#include +#include +#include +#include +],[ + int fd; + struct tcp_info tcpi; + socklen_t len = sizeof (tcpi); + getsockopt (fd, IPPROTO_TCP, TCP_INFO, &tcpi, &len); + fd = 0 + + tcpi.tcpi_snd_mss + + tcpi.tcpi_rtt + + tcpi.tcpi_rttvar + + tcpi.tcpi_last_ack_recv + + tcpi.tcpi_last_data_sent + + tcpi.tcpi_unacked; +],[ + AC_DEFINE(HAVE_TCP_INFO, [1], [TCP_INFO info option supported]) + AC_MSG_RESULT(yes) +],[ + AC_MSG_RESULT(no) +]) AC_SUBST(pkgstatedir,$localstatedir/$PACKAGE) AC_SUBST(pkgconfdir,$sysconfdir/$PACKAGE) AC_OUTPUT([Makefile include/Makefile lib/Makefile pod/Makefile random_maps/Makefile socket/Makefile - server/Makefile src/Makefile utils/Makefile ext/Makefile - lib/checkarch.pl lib/collect.pl utils/add_throw.perl - utils/crossloop.tmpl utils/crossloop.pl.tmpl utils/metaserver.pl - utils/crossloop.web utils/scores.pl utils/player_dl.pl common/Makefile + server/Makefile utils/Makefile ext/Makefile doc/Makefile + common/Makefile utils/cfutil ])