| 1 | dnl Process this file with autoconf to produce a configure script. |
| 2 | |
| 3 | dnl ***************************************************************** |
| 4 | dnl IMPORTANT: Don't forget to add corresponding output for --options |
| 5 | dnl if you add a non-trivial configure option here. |
| 6 | dnl ***************************************************************** |
| 7 | |
| 8 | dnl this is to determine if the config script is running in the proper place |
| 9 | dnl just give it one file relative to where it should be |
| 10 | AC_INIT([gnugo], [3.8]) |
| 11 | AC_CONFIG_SRCDIR([engine/dragon.c]) |
| 12 | |
| 13 | AM_CONFIG_HEADER(config.h) |
| 14 | AC_PREREQ(2.52)dnl dnl Minimum Autoconf version required. |
| 15 | |
| 16 | AH_TEMPLATE([PACKAGE], |
| 17 | [Define to the name of the distribution.]) |
| 18 | |
| 19 | AH_TEMPLATE([GNU_PACKAGE], |
| 20 | [The concatenation of the strings "GNU ", and PACKAGE.]) |
| 21 | |
| 22 | AH_TEMPLATE([VERSION], |
| 23 | [Define to the version of the distribution.]) |
| 24 | |
| 25 | dnl this defines VERSION and PACKAGE |
| 26 | AM_INIT_AUTOMAKE |
| 27 | GNU_PACKAGE="GNU $PACKAGE" |
| 28 | AC_DEFINE_UNQUOTED(GNU_PACKAGE, "$GNU_PACKAGE") |
| 29 | |
| 30 | AM_MAINTAINER_MODE |
| 31 | |
| 32 | dnl See if user has expressed a preference for use of curses and/or color |
| 33 | dnl These set variables $enable_color and $with_curses to "no" if disabled |
| 34 | dnl "yes" if enabled, or undefined if not specified |
| 35 | |
| 36 | AC_ARG_WITH(readline, |
| 37 | [ --with-readline try to use GNU Readline for command reading |
| 38 | --without-readline do not use GNU Readline (default)]) |
| 39 | |
| 40 | AC_ARG_WITH(curses, |
| 41 | [ --with-curses try to use curses for colored debugging output (default) |
| 42 | --without-curses do not use curses for colored debugging output]) |
| 43 | |
| 44 | AC_ARG_ENABLE(color, |
| 45 | [ --enable-color use curses or ansi escape sequences for colored |
| 46 | debug output |
| 47 | --disable-color do not try to generated colored debug output]) |
| 48 | |
| 49 | dnl and look to see if they want to disable the grid optimisation |
| 50 | |
| 51 | AC_ARG_ENABLE(grid-opt, |
| 52 | [ --enable-grid-opt enable the grid optimisation within the pattern |
| 53 | matcher (default) |
| 54 | --enable-grid-opt=distrust enable the grid optimisation in non-trusting mode |
| 55 | --disable-grid-opt disable the grid optimisation]) |
| 56 | |
| 57 | default_cache_size=-1 |
| 58 | default_level=10 |
| 59 | default_semeai_node_limit=500 |
| 60 | default_owl_node_limit=1000 |
| 61 | |
| 62 | AC_ARG_ENABLE(cache-size, |
| 63 | [ --enable-cache-size=n reserve n MB RAM for caching (special value -1 |
| 64 | default, corresponding to 8-11 MB depending on |
| 65 | platform)]) |
| 66 | |
| 67 | AC_ARG_ENABLE(level, |
| 68 | [ --enable-level=n n = default level (10 standard)]) |
| 69 | |
| 70 | AC_ARG_ENABLE(semeai-node-limit, |
| 71 | [ --enable-semeai-node-limit=n n = semeai variations (500 standard)]) |
| 72 | |
| 73 | AC_ARG_ENABLE(level, |
| 74 | [ --enable-owl-node-limit=n n = owl node limit (1000 standard)]) |
| 75 | |
| 76 | AC_ARG_ENABLE(dfa, |
| 77 | [ --disable-dfa use old non-dfa pattern matcher], |
| 78 | [ if test ${enableval} = no; then |
| 79 | dfa_c= |
| 80 | else |
| 81 | dfa_c=dfa |
| 82 | fi] , |
| 83 | [ dfa_c=dfa ]) |
| 84 | |
| 85 | AC_ARG_ENABLE(chinese-rules, |
| 86 | [ --enable-chinese-rules use Chinese (area) counting |
| 87 | --disable-chinese-rules use Japanese counting (default)]) |
| 88 | |
| 89 | AC_ARG_ENABLE(resignation-allowed, |
| 90 | [ --enable-resignation-allowed resign lost games (default) |
| 91 | --disable-resignation-allowed never resign]) |
| 92 | |
| 93 | AC_ARG_ENABLE(metamachine, |
| 94 | [ --enable-metamachine enable metamachine |
| 95 | --disable-metamachine don't enable metamachine (default)]) |
| 96 | |
| 97 | AC_ARG_ENABLE(experimental-break-in, |
| 98 | [ --enable-experimental-break-in use the breakin module (default) |
| 99 | --disable-experimental-break-in don't use the breakin module]) |
| 100 | |
| 101 | AC_ARG_ENABLE(experimental-owl-ext, |
| 102 | [ --enable-experimental-owl-ext use the experimental GAIN/LOSS codes |
| 103 | --disable-experimental-owl-ext use standard owl module (default)]) |
| 104 | |
| 105 | AC_ARG_ENABLE(cosmic-gnugo, |
| 106 | [ --enable-cosmic-gnugo use center-oriented influence code |
| 107 | --disable-cosmic-gnugo use standard influence code (default)]) |
| 108 | |
| 109 | AC_ARG_ENABLE(large-scale, |
| 110 | [ --enable-large-scale look for large scale captures |
| 111 | --disable-large-scale don't seek large scale captures (default)]) |
| 112 | |
| 113 | AC_ARG_ENABLE(experimental-connections, |
| 114 | [ --enable-experimental-connections use experimental connection analysis |
| 115 | (default) |
| 116 | --disable-experimental-connections use standard connection analysis]) |
| 117 | |
| 118 | AC_ARG_ENABLE(alternate-connections, |
| 119 | [ --enable-alternate-connections use alternate experimental connection |
| 120 | analysis |
| 121 | --disable-alternate-connections use primary experimental connection |
| 122 | analysis (default)]) |
| 123 | |
| 124 | AC_ARG_ENABLE(socket-support, |
| 125 | [ --disable-socket-support don't compile GTP over TCP/IP support |
| 126 | --enable-socket-support compile TCP/IP support (default)]) |
| 127 | |
| 128 | AC_PROG_CC |
| 129 | |
| 130 | dnl for automake 1.4.x |
| 131 | AC_EXEEXT |
| 132 | |
| 133 | dnl add -lm to library list since we use some |
| 134 | dnl math functions such as pow and fabs |
| 135 | |
| 136 | AC_SEARCH_LIBS(pow,m) |
| 137 | |
| 138 | AC_CACHE_CHECK( |
| 139 | [for mingw32], |
| 140 | ac_cv_mingw32, |
| 141 | AC_TRY_COMPILE(, |
| 142 | [return __MINGW32__], |
| 143 | ac_cv_mingw32="yes", |
| 144 | ac_cv_mingw32="no") |
| 145 | ) |
| 146 | |
| 147 | if test $ac_cv_mingw32 = yes;then |
| 148 | LIBS="$LIBS -lwsock32" |
| 149 | AC_SEARCH_LIBS(vsnprintf, mingwex) |
| 150 | fi |
| 151 | |
| 152 | AC_PROG_CPP |
| 153 | AC_PROG_RANLIB |
| 154 | |
| 155 | dnl required since we use SUBDIRS in Makefile.am |
| 156 | AC_PROG_MAKE_SET |
| 157 | |
| 158 | AC_HEADER_TIME |
| 159 | |
| 160 | AC_C_CONST |
| 161 | |
| 162 | AC_CHECK_HEADERS(unistd.h sys/time.h sys/times.h) |
| 163 | AC_CHECK_HEADERS(curses.h term.h ncurses/curses.h ncurses/term.h) |
| 164 | |
| 165 | if test "$ac_cv_header_curses_h" = "yes";then |
| 166 | curses_header="curses.h" |
| 167 | elif test "$ac_cv_header_ncurses_curses_h" = "yes";then |
| 168 | curses_header="ncurses/curses.h" |
| 169 | else |
| 170 | curses_header="no" |
| 171 | fi |
| 172 | |
| 173 | if test "$ac_cv_header_term_h" = "yes";then |
| 174 | term_header="term.h" |
| 175 | elif test "$ac_cv_header_ncurses_term_h" = "yes";then |
| 176 | term_header="ncurses/term.h" |
| 177 | else |
| 178 | term_header="no" |
| 179 | fi |
| 180 | |
| 181 | AC_CHECK_SIZEOF(long,,[#include <stdio.h>]) |
| 182 | |
| 183 | dnl vsnprintf not universally available |
| 184 | dnl usleep not available in Unicos and mingw32 |
| 185 | AC_CHECK_FUNCS(vsnprintf gettimeofday usleep times) |
| 186 | |
| 187 | dnl if snprintf not available try to use g_snprintf from GLib |
| 188 | if test $ac_cv_func_vsnprintf = no; then |
| 189 | AC_CHECK_PROG(glibconfig,glib-config,yes,no) |
| 190 | if test $ac_cv_prog_glibconfig = yes;then |
| 191 | glib_cflags=`glib-config --cflags` |
| 192 | glib_libs=`glib-config --libs` |
| 193 | CPPFLAGS="$CPPFLAGS $glib_cflags" |
| 194 | LIBS="$LIBS $glib_libs" |
| 195 | AC_CHECK_FUNCS(g_vsnprintf) |
| 196 | AC_CHECK_HEADERS(glib.h) |
| 197 | if test $ac_cv_func_g_vsnprintf = no; then |
| 198 | AC_MSG_WARN([GLib installation problem. |
| 199 | Continuing without GLib ]) |
| 200 | fi |
| 201 | else |
| 202 | AC_MSG_WARN([Neither vsnprintf nor GLib found. GNU Go is |
| 203 | compiled but it is safer to get GLib at |
| 204 | http://www.gtk.org/]) |
| 205 | fi |
| 206 | fi |
| 207 | |
| 208 | dnl ------ variadic #define ----------------------- |
| 209 | |
| 210 | AH_TEMPLATE([HAVE_VARIADIC_DEFINE], |
| 211 | [Define if #define can take a variable number of arguments]) |
| 212 | |
| 213 | AC_CACHE_CHECK( |
| 214 | [for variadic cpp define], |
| 215 | gnugo_cv_cpp_variadic_define, |
| 216 | AC_TRY_COMPILE( |
| 217 | [#include <stdio.h> |
| 218 | #define zz(fmt,arg...) printf(fmt,##arg)], |
| 219 | [zz("Hello");zz("%s","Hello");zz("%s%s","Hello","World")], |
| 220 | gnugo_cv_cpp_variadic_define="yes", |
| 221 | gnugo_cv_cpp_variadic_define="no") |
| 222 | ) |
| 223 | if test "$gnugo_cv_cpp_variadic_define" = "yes";then |
| 224 | AC_DEFINE(HAVE_VARIADIC_DEFINE) |
| 225 | fi |
| 226 | |
| 227 | dnl ------ transparent unions --------------------- |
| 228 | |
| 229 | AH_TEMPLATE([HAVE_TRANSPARENT_UNIONS], |
| 230 | [Define if your compiler supports transparent unions]) |
| 231 | |
| 232 | AC_CACHE_CHECK( |
| 233 | [whether $CC supports transparent unions], |
| 234 | gnugo_cv_transparent_unions, |
| 235 | AC_TRY_COMPILE([], |
| 236 | [[ struct { |
| 237 | union { |
| 238 | int x; |
| 239 | float y; |
| 240 | } |
| 241 | } A = { { .y = 0.0 } }; |
| 242 | A.y = 1.0;]], |
| 243 | gnugo_cv_transparent_unions="yes", |
| 244 | gnugo_cv_transparent_unions="no") |
| 245 | ) |
| 246 | |
| 247 | if test "$gnugo_cv_transparent_unions" = "yes"; then |
| 248 | AC_DEFINE(HAVE_TRANSPARENT_UNIONS) |
| 249 | fi |
| 250 | |
| 251 | dnl -------- color debugging support ----------- |
| 252 | |
| 253 | AH_TEMPLATE([TERMINFO], |
| 254 | [Define to 1 if termcap/terminfo is available.]) |
| 255 | |
| 256 | AH_TEMPLATE([ANSI_COLOR], |
| 257 | [Define to use ansi escape sequences for color debugging]) |
| 258 | |
| 259 | tmp_color_result="none" |
| 260 | |
| 261 | if test "$with_curses" != no -a "$enable_color" != no ; then |
| 262 | tmp_color_result="none (curses failed)" |
| 263 | |
| 264 | dnl Do a separate test for curses and termcap |
| 265 | dnl DJGPP does have pdcurses, but not termcap |
| 266 | |
| 267 | dnl make sure that both curses.h and term.h are available |
| 268 | dnl FIXME: better to actually figure out here what headers |
| 269 | dnl are really required |
| 270 | if test "$term_header" != "no" -a "$curses_header" != "no" ; then |
| 271 | |
| 272 | dnl check for a working termcap library |
| 273 | AC_SEARCH_LIBS(tparm,ncurses curses pdcurses termcap terminfo termlib) |
| 274 | |
| 275 | if test "$ac_cv_search_tparm" != "no" ; then |
| 276 | AC_DEFINE(TERMINFO) |
| 277 | tmp_color_result="curses" |
| 278 | fi |
| 279 | fi |
| 280 | fi |
| 281 | |
| 282 | if test "$with_curses" = no -a "$enable_color" != no ; then |
| 283 | dnl we asked for color, but there is no termcap |
| 284 | AC_DEFINE(ANSI_COLOR) |
| 285 | tmp_color_result="ANSI color" |
| 286 | |
| 287 | fi |
| 288 | |
| 289 | AC_MSG_CHECKING(for color support) |
| 290 | AC_MSG_RESULT($tmp_color_result) |
| 291 | |
| 292 | dnl -------- readline support ------------------- |
| 293 | |
| 294 | AH_TEMPLATE([READLINE], [Enable GNU Readline support]) |
| 295 | |
| 296 | if test "$with_readline" = yes ; then |
| 297 | |
| 298 | dnl check for a working termcap and readline library |
| 299 | AC_SEARCH_LIBS(readline,termcap readline) |
| 300 | |
| 301 | if test "$ac_cv_search_readline" != "no" ; then |
| 302 | AC_DEFINE(READLINE,1) |
| 303 | else |
| 304 | AC_DEFINE(READLINE,0) |
| 305 | fi |
| 306 | else |
| 307 | AC_DEFINE(READLINE,0) |
| 308 | fi |
| 309 | |
| 310 | dnl ---------- grid optimisation ------------ |
| 311 | |
| 312 | AH_TEMPLATE([GRID_OPT], |
| 313 | [Define as 1 to use the grid optimisation, or 2 to run it in self-test mode]) |
| 314 | |
| 315 | if test "$enable_grid_opt" = "distrust" ; then |
| 316 | AC_DEFINE(GRID_OPT, 2) |
| 317 | else |
| 318 | if test "$enable_grid_opt" = "no" ; then |
| 319 | AC_DEFINE(GRID_OPT, 0) |
| 320 | else |
| 321 | AC_DEFINE(GRID_OPT, 1) |
| 322 | fi |
| 323 | fi |
| 324 | |
| 325 | |
| 326 | dnl ------------ set cache size ---------- |
| 327 | |
| 328 | AH_TEMPLATE([DEFAULT_MEMORY], |
| 329 | [Default hash table size in megabytes]) |
| 330 | |
| 331 | if test "$enable_cache_size" ; then |
| 332 | AC_DEFINE_UNQUOTED(DEFAULT_MEMORY, $enable_cache_size) |
| 333 | else |
| 334 | AC_DEFINE_UNQUOTED(DEFAULT_MEMORY, $default_cache_size) |
| 335 | fi |
| 336 | |
| 337 | |
| 338 | dnl ------------ set default level ---------- |
| 339 | |
| 340 | AH_TEMPLATE([DEFAULT_LEVEL], |
| 341 | [Default level (strength). Up to 10 supported]) |
| 342 | |
| 343 | if test "$enable_level" ; then |
| 344 | AC_DEFINE_UNQUOTED(DEFAULT_LEVEL, $enable_level) |
| 345 | else |
| 346 | AC_DEFINE_UNQUOTED(DEFAULT_LEVEL, $default_level) |
| 347 | fi |
| 348 | |
| 349 | dnl ------------ set cache size ---------- |
| 350 | |
| 351 | AH_TEMPLATE([OWL_NODE_LIMIT], |
| 352 | [Owl Node Limit]) |
| 353 | |
| 354 | if test "$enable_owl_node_limit" ; then |
| 355 | AC_DEFINE_UNQUOTED(OWL_NODE_LIMIT, $enable_owl_node_limit) |
| 356 | else |
| 357 | AC_DEFINE_UNQUOTED(OWL_NODE_LIMIT, $default_owl_node_limit) |
| 358 | fi |
| 359 | |
| 360 | |
| 361 | dnl ------------ set semeai variations ---------- |
| 362 | |
| 363 | AH_TEMPLATE([SEMEAI_NODE_LIMIT], |
| 364 | [Semeai Variations. 500 default]) |
| 365 | |
| 366 | if test "$enable_semeai_node_limit" ; then |
| 367 | AC_DEFINE_UNQUOTED(SEMEAI_NODE_LIMIT, $enable_semeai_node_limit) |
| 368 | else |
| 369 | AC_DEFINE_UNQUOTED(SEMEAI_NODE_LIMIT, $default_semeai_node_limit) |
| 370 | fi |
| 371 | |
| 372 | dnl ------------ dfa ------------------- |
| 373 | |
| 374 | AM_CONDITIONAL(DFA_ENABLED, test "$enable_dfa" != "no") |
| 375 | |
| 376 | dnl FIXME: Is there a more elegant approach for this? |
| 377 | dnl force owl c files rebuild |
| 378 | rm -f \ |
| 379 | patterns/owl_attackpat.c \ |
| 380 | patterns/owl_defendpat.c \ |
| 381 | patterns/owl_vital_apat.c |
| 382 | |
| 383 | |
| 384 | dnl ------------ Chinese Rules ------------------- |
| 385 | |
| 386 | AH_TEMPLATE([CHINESE_RULES], |
| 387 | [Ruleset. Default Japanese]) |
| 388 | |
| 389 | if test "$enable_chinese_rules" = "yes" ; then |
| 390 | AC_DEFINE(CHINESE_RULES, 1) |
| 391 | else |
| 392 | AC_DEFINE(CHINESE_RULES, 0) |
| 393 | fi |
| 394 | |
| 395 | dnl ------------ Resignation allowed------------------- |
| 396 | |
| 397 | AH_TEMPLATE([RESIGNATION_ALLOWED], |
| 398 | [Allow resignation. Default enabled]) |
| 399 | |
| 400 | if test "$disable_resignation_allowed" = "yes" ; then |
| 401 | AC_DEFINE(RESIGNATION_ALLOWED, 0) |
| 402 | else |
| 403 | AC_DEFINE(RESIGNATION_ALLOWED, 1) |
| 404 | fi |
| 405 | |
| 406 | dnl ------------ Oracle enabled------------------- |
| 407 | |
| 408 | AH_TEMPLATE([ORACLE], |
| 409 | [Oracle. Default not enabled.]) |
| 410 | |
| 411 | if test "$enable_metamachine" = "yes" ; then |
| 412 | AC_DEFINE(ORACLE, 1) |
| 413 | else |
| 414 | AC_DEFINE(ORACLE, 0) |
| 415 | fi |
| 416 | |
| 417 | dnl ------------ Experimental Breakin enabled------------------- |
| 418 | |
| 419 | AH_TEMPLATE([USE_BREAK_IN], |
| 420 | [Break-in module. Enabled by default.]) |
| 421 | |
| 422 | if test "$enable_experimental_break_in" = "no" ; then |
| 423 | AC_DEFINE(USE_BREAK_IN, 0) |
| 424 | else |
| 425 | AC_DEFINE(USE_BREAK_IN, 1) |
| 426 | fi |
| 427 | |
| 428 | dnl ------------ Owl extensions ------------ |
| 429 | |
| 430 | AH_TEMPLATE([EXPERIMENTAL_OWL_EXT], |
| 431 | [GAIN/LOSS codes. Disabled by default.]) |
| 432 | |
| 433 | if test "$enable_experimental_owl_ext" = "yes" ; then |
| 434 | AC_DEFINE(EXPERIMENTAL_OWL_EXT, 1) |
| 435 | else |
| 436 | AC_DEFINE(EXPERIMENTAL_OWL_EXT, 0) |
| 437 | fi |
| 438 | |
| 439 | dnl ------------ Cosmic Consciousness ------------------- |
| 440 | |
| 441 | AH_TEMPLATE([COSMIC_GNUGO], |
| 442 | [Center oriented influence. Disabled by default.]) |
| 443 | |
| 444 | if test "$enable_cosmic_gnugo" = "yes" ; then |
| 445 | AC_DEFINE(COSMIC_GNUGO, 1) |
| 446 | else |
| 447 | AC_DEFINE(COSMIC_GNUGO, 0) |
| 448 | fi |
| 449 | |
| 450 | dnl ------------ Large Scale ------------------- |
| 451 | |
| 452 | AH_TEMPLATE([LARGE_SCALE], |
| 453 | [Large Scale Captures. Disabled by default.]) |
| 454 | |
| 455 | if test "$enable_large_scale" = "yes" ; then |
| 456 | AC_DEFINE(LARGE_SCALE, 1) |
| 457 | else |
| 458 | AC_DEFINE(LARGE_SCALE, 0) |
| 459 | fi |
| 460 | |
| 461 | dnl ------------ Connections ------------------- |
| 462 | |
| 463 | AH_TEMPLATE([EXPERIMENTAL_CONNECTIONS], |
| 464 | [Connection module. Default experimental.]) |
| 465 | |
| 466 | if test "$enable_experimental_connections" = "no" ; then |
| 467 | AC_DEFINE(EXPERIMENTAL_CONNECTIONS, 0) |
| 468 | else |
| 469 | AC_DEFINE(EXPERIMENTAL_CONNECTIONS, 1) |
| 470 | fi |
| 471 | |
| 472 | dnl ------------ Connections ------------------- |
| 473 | |
| 474 | AH_TEMPLATE([ALTERNATE_CONNECTIONS], |
| 475 | [Connection module. Default standard.]) |
| 476 | |
| 477 | if test "$enable_alternate_connections" = "no" ; then |
| 478 | AC_DEFINE(ALTERNATE_CONNECTIONS, 0) |
| 479 | else |
| 480 | AC_DEFINE(ALTERNATE_CONNECTIONS, 1) |
| 481 | fi |
| 482 | |
| 483 | dnl ------------ Owl Threats ------------------- |
| 484 | |
| 485 | AH_TEMPLATE([OWL_THREATS], |
| 486 | [Owl Threats. 0 standard.]) |
| 487 | |
| 488 | if test "$enable_owl_threats" = "yes" ; then |
| 489 | AC_DEFINE(OWL_THREATS, 1) |
| 490 | else |
| 491 | AC_DEFINE(OWL_THREATS, 0) |
| 492 | fi |
| 493 | |
| 494 | dnl ------------ additional valgrind macros ------ |
| 495 | |
| 496 | AH_TEMPLATE([USE_VALGRIND], |
| 497 | [Define special valgrind macros.]) |
| 498 | |
| 499 | if test "$enable_valgrind" = "yes" ; then |
| 500 | AC_DEFINE(USE_VALGRIND, 1) |
| 501 | else |
| 502 | AC_DEFINE(USE_VALGRIND, 0) |
| 503 | fi |
| 504 | |
| 505 | dnl ----------- special-case use of gcc --------- |
| 506 | |
| 507 | dnl Not sure if we are supposed to be accessing this variable, but... |
| 508 | |
| 509 | AM_CONDITIONAL(GCC_ONLY, test "$ac_compiler_gnu" = "yes") |
| 510 | |
| 511 | dnl Now lines in Makefile.am can be prefixed @GCC_ONLY@. |
| 512 | |
| 513 | AC_SUBST(GCC_MAJOR_VERSION) |
| 514 | AC_SUBST(GCC_MINOR_VERSION) |
| 515 | AC_SUBST(GNU_GO_WARNINGS) |
| 516 | |
| 517 | if test "$ac_compiler_gnu" = "yes"; then |
| 518 | |
| 519 | dnl M4 escaping of brackets |
| 520 | GCC_MAJOR_VERSION=`echo __GNUC__ | $CC -E -xc - | tail -n 1` |
| 521 | GCC_MINOR_VERSION=`echo __GNUC_MINOR__ | $CC -E -xc - | tail -n 1` |
| 522 | |
| 523 | GNU_GO_WARNINGS='-Wall -W -Wpointer-arith -Wbad-function-cast -Wcast-qual -Wcast-align -Wwrite-strings -Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations -Wundef' |
| 524 | |
| 525 | if (test $GCC_MAJOR_VERSION -eq 3 && test $GCC_MINOR_VERSION -ge 4) || test $GCC_MAJOR_VERSION -gt 3; then |
| 526 | GNU_GO_WARNINGS="$GNU_GO_WARNINGS -Wdeclaration-after-statement" |
| 527 | fi |
| 528 | |
| 529 | else |
| 530 | GCC_MAJOR_VERSION=0 |
| 531 | GCC_MINOR_VERSION=0 |
| 532 | GNU_GO_WARNINGS='' |
| 533 | fi |
| 534 | |
| 535 | dnl FIXME: please add warnings for other compilers! |
| 536 | |
| 537 | |
| 538 | AH_TEMPLATE([ENABLE_SOCKET_SUPPORT], |
| 539 | [Compile support for GTP communication over TCP/IP channel.]) |
| 540 | |
| 541 | if test "$enable_socket_support" != "no"; then |
| 542 | # Check for all required headers, macros, structures and functions |
| 543 | # at once. |
| 544 | AC_CACHE_CHECK( |
| 545 | [whether socket support can be compiled], |
| 546 | gnugo_cv_sockets_supported, |
| 547 | AC_TRY_LINK([#if !defined(_WIN32) && !defined(_WIN32_WCE) |
| 548 | #include <sys/socket.h> |
| 549 | #include <netinet/in.h> |
| 550 | #include <arpa/inet.h> |
| 551 | #include <netdb.h> |
| 552 | #else /* on Windows */ |
| 553 | #include <winsock.h> |
| 554 | #endif /* on Windows */], |
| 555 | [[ struct sockaddr_in A; |
| 556 | struct hostent *H; |
| 557 | A.sin_family = AF_INET; |
| 558 | A.sin_addr.s_addr = htonl(INADDR_ANY); |
| 559 | A.sin_port = htons(0); |
| 560 | gethostbyname(0); |
| 561 | socket(PF_INET, SOCK_STREAM, 0); |
| 562 | connect(0, 0, 0); |
| 563 | bind(0, 0, 0); |
| 564 | listen(0, 0); |
| 565 | accept(0, 0, 0);]], |
| 566 | gnugo_cv_sockets_supported="yes", |
| 567 | gnugo_cv_sockets_supported="no")) |
| 568 | |
| 569 | if test "$gnugo_cv_sockets_supported" = "yes"; then |
| 570 | AC_DEFINE(ENABLE_SOCKET_SUPPORT) |
| 571 | else |
| 572 | if test "$enable_socket_support" = "yes"; then |
| 573 | AC_MSG_WARN( |
| 574 | [[ |
| 575 | *** Socket support was requested but does not pass configure test. *** |
| 576 | *** Proceed only if you know what you are doing. ***]]) |
| 577 | AC_DEFINE(ENABLE_SOCKET_SUPPORT) |
| 578 | fi |
| 579 | fi |
| 580 | fi |
| 581 | |
| 582 | #AM_GNU_GETTEXT |
| 583 | #AC_LINK_FILES($nls_cv_header_libgt, $nls_cv_header_intl) |
| 584 | |
| 585 | dnl FIXME: |
| 586 | dnl autoconf 2.50 recommends AC_CONFIG_FILES and AC_OUPUT |
| 587 | dnl This however requires automake 1.4p2 or better |
| 588 | |
| 589 | AC_OUTPUT([Makefile interface/Makefile patterns/Makefile sgf/Makefile |
| 590 | utils/Makefile engine/Makefile doc/Makefile regression/Makefile config.vc:config.vcin]) |