--- deliantra/server/configure.ac 2006/08/13 17:20:42 1.10 +++ deliantra/server/configure.ac 2006/12/14 22:45:40 1.26 @@ -1,6 +1,6 @@ dnl Process this file with autoconf to produce a configure script. -AC_INIT([crossfire], [1.9.1], [crossfire-devel@listserv.real-time.com]) +AC_INIT([crossfire], [2.0+], [crossfire-devel@listserv.real-time.com]) AC_CONFIG_AUX_DIR(utils) AC_CONFIG_SRCDIR([server/main.C]) AM_INIT_AUTOMAKE @@ -13,8 +13,9 @@ dnl we want a config.h file instead of -D options. dnl Checks for programs. +AC_LANG(C++) +AC_PROG_CXX AC_PROG_LIBTOOL -AC_PROG_CC case "$target" in alpha-dec-osf*) @@ -28,43 +29,30 @@ ;; esac - AC_PROG_CPP AM_PROG_LEX AC_PROG_AWK -AC_ARG_ENABLE(dmalloc, [ --enable-dmalloc Use the dmalloc library if available, may prevent plugins from working], - use_dmalloc=yes, use_dmalloc=no) - -AC_ARG_WITH(python, [ --with-python=dir Directory to look for python headers/library (default=standard system location) ], - PYTHON_HOME="$withval") - +dnl AC_ARG_WITH(python, [ --with-python=dir Directory to look for python headers/library (default=standard system location) ], PYTHON_HOME="$withval") dnl check for some other programs AC_PATH_PROG(LATEX, latex) AC_PATH_PROG(GZIP, gzip) -AC_PATH_PROG(GUNZIP, gunzip) +AC_PATH_PROG(BZIP, bzip2) AC_PATH_PROG(TAR, tar) -AC_PATH_PROG(PERL, perl) AC_PATH_PROG(BASENAME, basename) -if test -n "$GZIP" -a -z "$GUNZIP" ; then - echo "Found gzip, but not gunzip - setting GUNZIP to gzip -c"; - GUNZIP="$GZIP -c" -fi; +AC_PATH_PROG(PERL, perl5.8) +AC_PATH_PROG(PERL, perl5) +AC_PATH_PROG(PERL, perl) -if test -z "$COMPRESS" ; then - AC_PATH_PROG(COMPRESS, compress) - AC_PATH_PROG(UNCOMPRESS, uncompress) +AC_PATH_PROG(GPERF, gperf) +if test -z "$GPERF"; then + AC_MSG_ERROR([we need gperf, the GNU perfect hash generator]) fi -AC_PATH_PROG(BZIP, bzip2) -AC_PATH_PROG(BUNZIP, bunzip2) - -if test -n "$BZIP" -a -z "$BUNZIP" ; then - echo "Found bzip2, but not bunzip2 - setting BUNZIP to bzip2 -c"; - BUNZIP="$BZIP -c" -fi; +GUNZIP="$GZIP -c" +BUNZIP="$BZIP -c" if test -z "$COMPRESS" -a -z "$GZIP" -a -z "$BZIP" ; then echo "Unable to find either compress, bzip2, or gzip - hope you don't plan on compressing"; @@ -77,36 +65,7 @@ AC_CHECK_LIB(socket, main) dnl Checks for libraries. -dnl Start of X11 libraries -AC_PATH_XTRA - -dnl Some of these checks are probably excessive. Unfortunately, on -dnl some systems, to link in Xaw, Xt you need SM, which needs ICE. -dnl the order of the checks below is important -OLD_LD_FLAGS="$LDFLAGS" -LDFLAGS="$X_PRE_LIBS $X_LIBS $X_EXTRA_LIBS" - -AC_CHECK_LIB(X11, main, AC_DEFINE(HAVE_LIBX11,[],[Define if libX11 is available]) X11LIBS="$X11LIBS -lX11") - -AC_CHECK_LIB(ICE, main, AC_DEFINE(HAVE_LIBICE,[],[Define if libICE is available]) X11LIBS="$X11LIBS -lICE") - -AC_CHECK_LIB(SM, main, AC_DEFINE(HAVE_LIBSM,[],[Define if libSM is available]) X11LIBS="$X11LIBS -lSM", , $X11LIBS) - -AC_CHECK_LIB(Xext, main, AC_DEFINE(HAVE_LIBXEXT,[],[Define if libEXT is available]) X11LIBS="$X11LIBS -lXext", , -lX11) - -AC_CHECK_LIB(Xt, main, AC_DEFINE(HAVE_LIBXT,[],[Define if libXT is available]) X11LIBS="$X11LIBS -lXt", , $X11LIBS) - -AC_CHECK_LIB(Xmu, main, AC_DEFINE(HAVE_LIBXMU,[],[Define if libXMU is available]) X11LIBS="$X11LIBS -lXmu", ,$X11LIBS) - -AC_CHECK_LIB(Xaw, main, AC_DEFINE(HAVE_LIBXAW,[],[Define if libXAW is available]) X11LIBS="-lXaw $X11LIBS", , $X11LIBS) - -LDFLAGS="$OLD_LD_FLAGS" -X11LIBS="$X_LIBS $X11LIBS" - -AC_CHECK_LIB(Xpm, main, AC_DEFINE(HAVE_LIBXPM,[],[Define if libXpm is available]) X11LIBS="$X11LIBS -lXpm", , $X11LIBS ) - AC_CHECK_LIB(m, main) - AC_CHECK_LIB(png, main, AC_DEFINE(HAVE_LIBPNG,[],[Define if libpng is available]) X11LIBS="$X11LIBS -lpng", , $X11LIBS ) dnl png has a dependency in some cases on libz - if we have it, can't really @@ -117,41 +76,18 @@ AC_CHECK_LIB(crypt, main) AC_CHECK_LIB(des, des_crypt) -dnl Gros - Changed this to support some external programs that do not like dmalloc (like Python). -dnl If you really need to make some memory debugging, uncomment the dmalloc line and comment out the dmalloclp one. - -if eval "test x$use_dmalloc = xyes"; then - AC_CHECK_LIB(dmalloc, main) -else - AC_CHECK_LIB(dmalloclp, main) -fi - dnl Checks for header files. -AC_HEADER_DIRENT -AC_HEADER_STDC -AC_CHECK_HEADERS(fcntl.h limits.h malloc.h strings.h sys/file.h sys/ioctl.h sys/time.h time.h unistd.h stddef.h stdlib.h sys/ttycom.h sys/termios.h crypt.h arpa/inet.h des.h) - +AC_CHECK_HEADERS(crypt.h des.h) dnl Checks for typedefs, structures, and compiler characteristics. -AC_C_CONST AC_C_INLINE -AC_TYPE_PID_T -AC_TYPE_SIZE_T -AC_HEADER_TIME -AC_STRUCT_TM -AC_TYPE_UID_T AC_CHECK_SIZEOF(long) AC_CHECK_SIZEOF(long long) dnl Checks for library functions. AC_PROG_GCC_TRADITIONAL -AC_FUNC_MEMCMP -AC_FUNC_SETPGRP AC_TYPE_SIGNAL -AC_FUNC_STRFTIME -AC_FUNC_VPRINTF -AC_CHECK_FUNCS(gettimeofday mkdir mktime rmdir select socket strcspn strerror strspn strstr strtol strcasecmp strncasecmp snprintf setsid srandom getdtablesize srand48 srand sysconf scandir) dnl alphasort can not be added to AC_CHECK_FUNCS because AC_MSG_CHECKING(checking if alphasort is defined) @@ -197,13 +133,22 @@ AC_MSG_RESULT(unknown) fi +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_SUBST(x_includes) AC_SUBST(x_libraries) AC_SUBST(no_x) AM_CONDITIONAL(HAVE_X,test "x$no_x" = "x") AC_SUBST(X11LIBS) -AC_SUBST(PERL) -AC_SUBST(BASENAME) AC_SUBST(pkgstatedir,$localstatedir/$PACKAGE) AC_SUBST(pkgconfdir,$sysconfdir/$PACKAGE) @@ -215,15 +160,12 @@ AC_DEFINE_UNQUOTED(BZIP,"${BZIP}",[Path to the bzip binary]) AC_DEFINE_UNQUOTED(BUNZIP,"${BUNZIP}",[Path to the bunzip binary]) -AC_PATH_PROG(PERL, perl5) -AC_PATH_PROG(PERL, perl) - AC_MSG_CHECKING(for $PERL suitability) if $PERL -MExtUtils::Embed -e "use v5.8" >/dev/null 2>/dev/null; then - save_CFLAGS="$CFLAGS" + save_CXXFLAGS="$CXXFLAGS" save_LIBS="$LIBS" - CFLAGS="$CFLAGS `$PERL -MExtUtils::Embed -e ccopts` `$PERL -MEvent::MakeMaker -e 'print +{&Event::MakeMaker::event_args}->{INC}'`" + CXXFLAGS="$CXXFLAGS `$PERL -MExtUtils::Embed -e ccopts` `$PERL -MEvent::MakeMaker -e 'print +{&Event::MakeMaker::event_args}->{INC}'`" LIBS="$LIBS `$PERL -MExtUtils::Embed -e ldopts`" AC_TRY_LINK([ #include @@ -233,7 +175,7 @@ ],[ PerlInterpreter *perl = perl_alloc (); ],[perl_link=yes],[perl_link=no]) - CXXFLAGS="$save_CFLAGS" + CXXFLAGS="$save_CXXFLAGS" LIBS="$save_LIBS" if test x$perl_link = xyes; then @@ -242,7 +184,7 @@ PERLFLAGS="`$PERL -MExtUtils::Embed -e ccopts` `$PERL -MEvent::MakeMaker -e 'print +{&Event::MakeMaker::event_args}->{INC}'`" PERLLIB="`$PERL -MExtUtils::Embed -e ldopts`" PERLPRIVLIBEXP="`$PERL -MConfig -e 'print $Config{privlibexp}'`" - PERL_PLUGIN=yes + CPPFLAGS="$CPPFLAGS $PERLFLAGS" else AC_MSG_ERROR([no, unable to link]) fi @@ -253,40 +195,11 @@ AC_SUBST(PERLFLAGS) AC_SUBST(PERLPRIVLIBEXP) AC_SUBST(PERL) -AM_CONDITIONAL(PERL_PLUGIN,test "x$PERL_PLUGIN" != "x") -AC_SUBST(PERL_PLUGIN) - -############################################# -# Plugin configuration -AC_CHECK_LIB(dl, dlopen,[ cf_have_libdl=yes ]) -AM_CONDITIONAL(HAVE_LIBDL,test "x$cf_have_libdl" = "xyes") - -if test "x$cf_have_libdl" = "xyes" ; then - ############### - # Python plugin - CF_CHECK_PYTHON( - [PLUGIN_PYTHON="cfpython.la"], - [AC_MSG_NOTICE([No Python found. Python plugin will not be built.])] - ) - dnl *** Put other plugins configuration code here *** -else - AC_MSG_NOTICE([No dl library found. Plugins will not be supported.]) -fi -AM_CONDITIONAL(PYTHON_PLUGIN,test "x$PLUGIN_PYTHON" != "x") -AC_SUBST(PLUGIN_PYTHON) AC_OUTPUT([Makefile - doc/Makefile doc/Developers/Makefile doc/spell-docs/Makefile - doc/spoiler/Makefile doc/spoiler-html/Makefile - doc/playbook/Makefile doc/playbook-html/Makefile - doc/scripts/Makefile - lib/Makefile random_maps/Makefile socket/Makefile server/Makefile - include/Makefile utils/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 plugins/Makefile plugins/cfpython/Makefile - plugins/cfpython/include/Makefile plugins/cfanim/Makefile - plugins/common/Makefile plugins/common/include/Makefile - devel/Makefile - plugins/cfperl/Makefile - ]) + include/Makefile lib/Makefile pod/Makefile random_maps/Makefile socket/Makefile + server/Makefile src/Makefile utils/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 +])