| 1 |
dnl Process this file with autoconf to produce a configure script. |
| 2 |
AC_INIT([crossfire], [1.75.0], [[email protected]]) |
| 3 |
AC_CONFIG_AUX_DIR([utils]) |
| 4 |
AC_CONFIG_HEADERS([include/autoconf.h]) |
| 5 |
AC_CONFIG_MACRO_DIR([macros]) |
| 6 |
AC_CONFIG_SRCDIR([server/main.c]) |
| 7 |
AC_PREFIX_DEFAULT([/usr/games/crossfire]) |
| 8 |
AM_INIT_AUTOMAKE([foreign subdir-objects]) |
| 9 |
AM_SILENT_RULES([yes]) |
| 10 |
|
| 11 |
dnl############################################################################# |
| 12 |
dnl Configuration Options |
| 13 |
dnl############################################################################# |
| 14 |
AC_ARG_ENABLE(mapper, [AS_HELP_STRING([--enable-mapper], |
| 15 |
[Build the crossfire-mapper utility (requires libgd)])], |
| 16 |
[enable_mapper=yes], [enable_mapper=no]) |
| 17 |
|
| 18 |
dnl Options for plugins |
| 19 |
AC_ARG_ENABLE(cfrhg, [AS_HELP_STRING([--enable-cfrhg], |
| 20 |
[Build the random house generator plugin])], |
| 21 |
[], [enable_cfrhg=no]) |
| 22 |
|
| 23 |
AC_ARG_ENABLE(logger, [AS_HELP_STRING([--enable-logger], |
| 24 |
[Build the SQLite logging plugin])], |
| 25 |
[enable_logger=yes], [enable_logger=no]) |
| 26 |
|
| 27 |
AC_ARG_ENABLE(newspaper, [AS_HELP_STRING([--enable-newspaper], |
| 28 |
[Build the newspaper plugin])], |
| 29 |
[enable_newspaper=yes], [enable_newspaper=no]) |
| 30 |
|
| 31 |
AC_ARG_ENABLE(cfcitybell, [AS_HELP_STRING([--disable-cfcitybell], |
| 32 |
[Build the city bell plugin])], |
| 33 |
[enable_cfcitybell=no], [enable_cfcitybell=yes]) |
| 34 |
|
| 35 |
dnl Unit test configuration |
| 36 |
AC_ARG_ENABLE(check, [AS_HELP_STRING([--disable-check], |
| 37 |
[Disable the unit tests even if check is available])], |
| 38 |
[enable_check=no], [enable_check=yes]) |
| 39 |
|
| 40 |
dnl Add support for dmalloc, if the user wants it. |
| 41 |
AM_WITH_DMALLOC |
| 42 |
|
| 43 |
dnl############################################################################# |
| 44 |
dnl Program Checks |
| 45 |
dnl############################################################################# |
| 46 |
AC_PROG_AWK |
| 47 |
AC_PROG_CC_C99 |
| 48 |
AC_PROG_LIBTOOL |
| 49 |
AM_PROG_LEX |
| 50 |
|
| 51 |
AC_PATH_PROG(BASENAME, basename) |
| 52 |
AC_PATH_PROG(GZIP, gzip) |
| 53 |
AC_PATH_PROG(LATEX, latex) |
| 54 |
AC_PATH_PROG(PERL, perl) |
| 55 |
AC_PATH_PROG(SVNVERSION, svnversion) |
| 56 |
AC_PATH_PROG(TAR, tar) |
| 57 |
|
| 58 |
AC_SUBST(BASENAME) |
| 59 |
AC_SUBST(GZIP) |
| 60 |
AC_SUBST(PERL) |
| 61 |
|
| 62 |
dnl############################################################################# |
| 63 |
AS_BOX([Library Checks]) |
| 64 |
dnl############################################################################# |
| 65 |
AC_SEARCH_LIBS([crypt], [crypt]) |
| 66 |
AC_SEARCH_LIBS([pow], [m]) |
| 67 |
AC_SEARCH_LIBS([pthread_create], [pthread]) |
| 68 |
AC_SEARCH_LIBS([sqrt], [m]) |
| 69 |
AC_SEARCH_LIBS([clock_gettime], [rt]) |
| 70 |
|
| 71 |
dnl Metaserver2 |
| 72 |
LIBCURL_CHECK_CONFIG() |
| 73 |
LIBS="$LIBS $LIBCURL" |
| 74 |
CPPFLAGS="$CPPFLAGS $LIBCURL_CPPFLAGS" |
| 75 |
|
| 76 |
dnl Plugins |
| 77 |
AC_SEARCH_LIBS([dlopen], [dl], [cf_have_libdl=yes]) |
| 78 |
AC_SEARCH_LIBS([sqlite3_open], [sqlite3], [cf_have_libsqlite=yes]) |
| 79 |
|
| 80 |
dnl For utils/mapper |
| 81 |
AS_IF([test "$enable_mapper" = "yes"], [ |
| 82 |
PKG_CHECK_MODULES([GD], [gdlib]) |
| 83 |
]) |
| 84 |
AM_CONDITIONAL(MAPPER, test "$enable_mapper" = "yes") |
| 85 |
|
| 86 |
dnl Random house generator |
| 87 |
AM_CONDITIONAL(CFRHG_PLUGIN, test "$enable_cfrhg" = "yes") |
| 88 |
|
| 89 |
dnl City bell |
| 90 |
AM_CONDITIONAL(CFCITYBELL_PLUGIN, test "$enable_cfcitybell" = "yes") |
| 91 |
|
| 92 |
dnl Unit tests |
| 93 |
AS_IF([test "$enable_check" = "yes"], [ |
| 94 |
PKG_CHECK_MODULES([CHECK], [check], [have_check="yes"], [have_check="no"]) |
| 95 |
], [ |
| 96 |
have_check="no" |
| 97 |
]) |
| 98 |
|
| 99 |
dnl############################################################################# |
| 100 |
dnl Header File, Type, Structure, and Compiler Checks |
| 101 |
dnl############################################################################# |
| 102 |
dnl Checks for header files. |
| 103 |
AC_HEADER_DIRENT |
| 104 |
AC_CHECK_HEADERS([crypt.h]) |
| 105 |
|
| 106 |
dnl Checks for typedefs, structures, and compiler characteristics. |
| 107 |
CF_CHECK_VISIBILITY() |
| 108 |
|
| 109 |
dnl############################################################################# |
| 110 |
dnl Library Function Checks |
| 111 |
dnl############################################################################# |
| 112 |
dnl Checks for library functions. |
| 113 |
AC_CHECK_FUNCS([getdtablesize strcasecmp strcasestr strdup strncasecmp srandom srand48 sysconf tempnam getaddrinfo getnameinfo]) |
| 114 |
|
| 115 |
dnl Check for better but non-portable functions. |
| 116 |
AC_CHECK_FUNCS([strlcat strlcpy]) |
| 117 |
|
| 118 |
AC_SUBST(pkgstatedir,$localstatedir/$PACKAGE) |
| 119 |
AC_SUBST(pkgconfdir,$sysconfdir/$PACKAGE) |
| 120 |
|
| 121 |
dnl############################################ |
| 122 |
dnl Plugin configuration |
| 123 |
dnl############################################ |
| 124 |
AM_CONDITIONAL(HAVE_LIBDL, test "$cf_have_libdl" = "yes") |
| 125 |
PKG_CHECK_MODULES([PYTHON], [python3], |
| 126 |
[PLUGIN_PYTHON="cfpython.la"] |
| 127 |
[cf_will_build_python="yes"], |
| 128 |
[PKG_CHECK_MODULES([PYTHON], [python-2.7], |
| 129 |
[PLUGIN_PYTHON="cfpython.la"] |
| 130 |
[cf_will_build_python="yes"], |
| 131 |
[cf_will_build_python="no"] |
| 132 |
[AC_MSG_NOTICE([No Python found. Python plugin will not be built.])])]) |
| 133 |
AM_CONDITIONAL(PYTHON_PLUGIN,test "x$PLUGIN_PYTHON" != "x") |
| 134 |
AC_SUBST(PLUGIN_PYTHON) |
| 135 |
|
| 136 |
AM_CONDITIONAL(HAVE_CFLOGGER, [test "$cf_have_libsqlite" = "yes" -a "$enable_logger" = "yes"]) |
| 137 |
AM_CONDITIONAL(HAVE_CFNEWSPAPER, [test "$cf_have_libsqlite" = "yes" -a "$enable_newspaper" = "yes"]) |
| 138 |
|
| 139 |
dnl Unit tests |
| 140 |
AM_CONDITIONAL(HAVE_CHECK, test "$have_check" = "yes" -a "$enable_check" = "yes") |
| 141 |
|
| 142 |
if test "$have_check" = "yes"; then |
| 143 |
CF_CHECK_XSLT(xsltengine) |
| 144 |
AC_SUBST(XSLTENGINE, ["$xsltengine"]) |
| 145 |
else |
| 146 |
AC_MSG_WARN([Check not found; cannot run unit tests!]) |
| 147 |
fi |
| 148 |
|
| 149 |
AM_CONDITIONAL(PROCESS_XSLT, [test -n "$xsltengine"]) |
| 150 |
|
| 151 |
dnl Make sure pre-built archetypes or an 'arch' directory exists. |
| 152 |
AC_CHECK_FILE([$srcdir/lib/archetypes], [], [has_archetypes=no]) |
| 153 |
AC_CHECK_FILE([$srcdir/lib/arch], [], [has_arch_dir=no]) |
| 154 |
|
| 155 |
AS_IF([test "$has_archetypes" == no -a "$has_arch_dir" == no], [ |
| 156 |
AC_MSG_ERROR([Could not find pre-built or raw archetypes.]) |
| 157 |
]) |
| 158 |
|
| 159 |
dnl############################################################################# |
| 160 |
AS_BOX([Generate Output]) |
| 161 |
dnl############################################################################# |
| 162 |
AC_CONFIG_FILES([Makefile |
| 163 |
doc/Makefile |
| 164 |
doc/Developers/Makefile |
| 165 |
doc/playbook/Makefile doc/playbook-html/Makefile |
| 166 |
doc/scripts/Makefile |
| 167 |
doc/spell-docs/Makefile |
| 168 |
doc/spoiler/Makefile doc/spoiler-html/Makefile |
| 169 |
common/Makefile |
| 170 |
include/Makefile |
| 171 |
lib/Makefile |
| 172 |
random_maps/Makefile |
| 173 |
server/Makefile |
| 174 |
socket/Makefile |
| 175 |
types/Makefile |
| 176 |
utils/Makefile |
| 177 |
utils/scores.pl utils/player_dl.pl |
| 178 |
utils/crossloop |
| 179 |
utils/crossloop.web |
| 180 |
plugins/Makefile |
| 181 |
plugins/cfanim/Makefile plugins/cfanim/include/Makefile |
| 182 |
plugins/cflogger/Makefile |
| 183 |
plugins/cfnewspaper/Makefile |
| 184 |
plugins/cfnewspaper/include/Makefile |
| 185 |
plugins/cfpython/Makefile plugins/cfpython/include/Makefile |
| 186 |
plugins/cfrhg/Makefile |
| 187 |
plugins/cfrhg/include/Makefile |
| 188 |
plugins/citylife/Makefile |
| 189 |
plugins/citylife/include/Makefile |
| 190 |
plugins/cfcitybell/Makefile |
| 191 |
plugins/cfcitybell/include/Makefile |
| 192 |
plugins/common/Makefile plugins/common/include/Makefile |
| 193 |
test/Makefile |
| 194 |
test/bugs/Makefile test/bugs/bugtrack/Makefile |
| 195 |
test/include/Makefile test/templates/Makefile test/toolkit/Makefile |
| 196 |
test/unit/Makefile |
| 197 |
test/unit/common/Makefile test/unit/random_maps/Makefile |
| 198 |
test/unit/server/Makefile test/unit/socket/Makefile]) |
| 199 |
AC_OUTPUT |
| 200 |
|
| 201 |
dnl############################################################################# |
| 202 |
dnl Configuration Summary |
| 203 |
dnl############################################################################# |
| 204 |
AC_MSG_NOTICE([Configuration Summary ----------------------------------------------]) |
| 205 |
AC_MSG_NOTICE([]) |
| 206 |
AC_MSG_NOTICE([ Paths]) |
| 207 |
AC_MSG_NOTICE([ Installation prefix ${prefix}]) |
| 208 |
AC_MSG_NOTICE([ Will put executables in $bindir]) |
| 209 |
AC_MSG_NOTICE([ Will put resources in $datadir]) |
| 210 |
AC_MSG_NOTICE([ Will put config in $sysconfdir]) |
| 211 |
AC_MSG_NOTICE([ Will put server runtime data in $localstatedir]) |
| 212 |
AC_MSG_NOTICE([]) |
| 213 |
AC_MSG_NOTICE([ Options]) |
| 214 |
AC_MSG_NOTICE([ Build metaserver2 support? $ac_cv_header_curl_curl_h]) |
| 215 |
AC_MSG_NOTICE([ Build plugins? $cf_have_libdl]) |
| 216 |
|
| 217 |
if test "$cf_have_libsqlite" = "yes" ; then |
| 218 |
AC_MSG_NOTICE([ Build cflogger? $enable_logger]) |
| 219 |
AC_MSG_NOTICE([ Build cfnewspaper? $enable_newspaper]) |
| 220 |
fi |
| 221 |
|
| 222 |
if test "$cf_have_libdl" = "yes" ; then |
| 223 |
AC_MSG_NOTICE([ Build python plugin? $cf_will_build_python]) |
| 224 |
fi |
| 225 |
|
| 226 |
AC_MSG_NOTICE([ Build random house plugin? $enable_cfrhg]) |
| 227 |
AC_MSG_NOTICE([ Build city bell plugin? $enable_cfcitybell]) |
| 228 |
|
| 229 |
if test x"$xsltengine" != "x" ; then |
| 230 |
check_complement=["(will generate report)"] |
| 231 |
fi |
| 232 |
if test "$have_check" = "yes" -a "$enable_check" = "yes" ; then |
| 233 |
AC_MSG_NOTICE([ Process unit testing? yes $check_complement]) |
| 234 |
AC_MSG_NOTICE([ (run make; make -k check)]) |
| 235 |
else |
| 236 |
AC_MSG_NOTICE([ Process unit testing? no]) |
| 237 |
AC_MSG_NOTICE([ If you are a developer, you MUST install the check framework]) |
| 238 |
AC_MSG_NOTICE([ and write automated tests for all your add-ons!]) |
| 239 |
fi |
| 240 |
AC_MSG_NOTICE([]) |
| 241 |
AC_MSG_NOTICE([ Utilities (not required to build or run the server)]) |
| 242 |
AC_MSG_NOTICE([ Build crossfire-mapper? $enable_mapper]) |