X-Git-Url: http://winboard.nl/cgi-bin?a=blobdiff_plain;f=configure.ac;h=e852a7376fb0789b979cc8ea31e22dd53e04adfb;hb=1ad6c36feffec9aef9011a7585179f9e75b85600;hp=8f5c10f40ab6abd2030ca40ba3e0c803104bee3f;hpb=1aca00e04580e7b3effefa535edb469876ecce74;p=gnushogi.git diff --git a/configure.ac b/configure.ac index 8f5c10f..e852a73 100644 --- a/configure.ac +++ b/configure.ac @@ -5,81 +5,73 @@ dnl Process this file with autoconf to produce a configure script. AC_PREREQ(2.57) -AC_INIT([gnushogi],[1.3.2],[mvanier@cs.caltech.edu]) -AC_CONFIG_SRCDIR([version.h]) +AC_INIT([gnushogi],[1.4.1+],[https://savannah.gnu.org/bugs/?group=gnushogi]) +AM_INIT_AUTOMAKE +AC_CONFIG_SRCDIR([gnushogi/gnushogi.h]) AC_CONFIG_HEADER(config.h) - -# -# Check for C compiler. -# - -echo -AC_MSG_CHECKING(for C compiler) -echo - +########## +AC_MSG_NOTICE([C compiler]) AC_PROG_CC - -# -# Check for parser generators. -# - -echo -AC_MSG_CHECKING([for yacc/bison, lex/flex, and install]) -echo - +########## +AC_MSG_NOTICE([yacc/bison, lex/flex, and install]) AC_PROG_YACC AC_PROG_LEX AC_PROG_INSTALL - -# -# Check for X windows. -# - -echo +########## +AC_MSG_NOTICE([X]) AC_PATH_XTRA - -# -# Check for other libraries. -# - -AC_CHECK_LIB(curses, clrtoeol) -AC_CHECK_LIB(m, pow) -dnl Replace `main' with a function in -ltermcap: -AC_CHECK_LIB(termcap, tgoto) - - -# +########## +AC_MSG_NOTICE([libs]) + +# curses +AC_ARG_WITH([curses], + [AS_HELP_STRING([--with-curses], + [enable curses UI (default: yes if available)])], + [], + [with_curses=check]) + +LIBCURSES= +AS_IF([test "x$with_curses" != xno], + [AC_CHECK_LIB([curses], [clrtoeol], + [AC_SUBST([LIBCURSES], [-lcurses]) + AC_SUBST([CURSESDSP], [gnushogi-cursesdsp.o]) + AC_SUBST([CURSESDSPMINI], [gnuminishogi-cursesdsp.o]) + AC_DEFINE([HAVE_LIBCURSES], [1], + [Define if you have lib]) + ], + [AS_IF([test "x$with_curses" = xyes], + [AC_MSG_ERROR( + [--with-curses was given, but test for curses failed])])], + [-ltermcap])]) + +# other libraries. +AC_CHECK_LIB([m], [pow]) +AC_CHECK_LIB([termcap], [tgoto]) + + + +########## # C compiler warnings. -# if [[ $ac_cv_c_compiler_gnu = yes ]] then -WARNINGS="-Wall -Wno-implicit-int -Wstrict-prototypes -ansi -pedantic" -CEXTRAFLAGS="-fsigned-char -funroll-loops \$(HASH)" -# For profiling targets: -CEXTRAFLAGS2="-fsigned-char -pg -fprofile-arcs -ftest-coverage \$(HASH)" +WARNINGS="-Wall -Wno-implicit-int -Wstrict-prototypes -ansi" +CEXTRAFLAGS="-fsigned-char -funroll-loops" else # Who knows what warnings your compiler uses? WARNINGS= -CEXTRAFLAGS="\$(HASH)" +CEXTRAFLAGS= fi AC_SUBST(WARNINGS) AC_SUBST(CEXTRAFLAGS) -AC_SUBST(CEXTRAFLAGS2) - - -# -# Check for header files. -# -echo -AC_MSG_CHECKING(for header files) -echo +########## +AC_MSG_NOTICE([header files]) AC_HEADER_STDC AC_HEADER_SYS_WAIT @@ -88,14 +80,8 @@ AC_CHECK_HEADERS([sys/param.h sys/time.h unistd.h]) AC_CHECK_HEADERS(errno.h) AC_HEADER_TIME - -# -# Check for typedefs, structures, and compiler characteristics. -# - -echo -AC_MSG_CHECKING(for typedefs) -echo +########## +AC_MSG_NOTICE([typedefs]) AC_C_CONST AC_HEADER_STDBOOL @@ -105,44 +91,27 @@ AC_TYPE_SIZE_T AC_HEADER_TIME AC_STRUCT_TM -echo -AC_MSG_CHECKING(for compiler characteristics) -echo +########## +AC_MSG_NOTICE([compiler characteristics]) AC_CHECK_SIZEOF(long) - -# -# Check for library functions. -# - -echo -AC_MSG_CHECKING(for library functions) -echo +########## +AC_MSG_NOTICE([library functions]) AC_FUNC_FORK AC_PROG_GCC_TRADITIONAL AC_FUNC_MALLOC -AC_FUNC_SETVBUF_REVERSED AC_TYPE_SIGNAL AC_CHECK_FUNCS([dup2 gethostname gettimeofday memset pow strcasecmp]) AC_CHECK_FUNCS([strchr strerror strrchr strstr strtol]) -AC_CHECK_FUNCS(memcpy bcopy) -AC_CHECK_FUNCS(setlinebuf setvbuf) +AC_CHECK_FUNCS([memcpy bcopy]) +AC_CHECK_FUNCS([setvbuf setlinebuf]) # # Set various user-definable options. # -# Valid OPT settings: -# --with-top-part-bitmaps -# -# Other settings: -# --with-first-shogi-program=PROGNAME -# --with-second-shogi-program=PROGNAME -# --with-first-host=HOSTNAME -# --with-second-host=HOSTNAME -# OPT= FIRST_SHOGI_PROGRAM=gnushogi @@ -150,37 +119,36 @@ SECOND_SHOGI_PROGRAM=gnushogi FIRST_HOST=localhost SECOND_HOST=localhost -AC_ARG_WITH(top-part-bitmaps, -[ --with-top-part-bitmaps Use top part of Kanji bitmaps only.], -OPT=-DTOP_PART_BITMAPS) - -AC_ARG_WITH(first-shogi-program, -[ --with-first-shogi-program=PROGNAME - Use PROGNAME as the first shogi program (default: gnushogi)], -FIRST_SHOGI_PROGRAM=$withval) - -AC_ARG_WITH(second-shogi-program, -[ --with-second-shogi-program=PROGNAME - Use PROGNAME as the second shogi program (default: gnushogi)], -SECOND_SHOGI_PROGRAM=$withval) - -AC_ARG_WITH(first-host, -[ --with-first-host=HOSTNAME - Use HOSTNAME as the machine on which the first shogi program - runs (default: localhost)], -FIRST_HOST=$withval) - -AC_ARG_WITH(second-host, -[ --with-second-host=HOSTNAME - Use HOSTNAME as the machine on which the second shogi program - runs (default: localhost)], -SECOND_HOST=$withval) - -AC_ARG_WITH(xshogi, -[ --with-xshogi - Compile the xshogi graphical interface to GNU shogi (default: yes)], -with_xshogi=$withval, -with_xshogi=yes) +AC_ARG_ENABLE([xshogi], +AS_HELP_STRING([--enable-xshogi], + [compile the xshogi graphical interface to GNU shogi (default: no)]), +[enable_xshogi=$enableval], +[enable_xshogi=no]) + +AC_ARG_WITH([top-part-bitmaps], +AS_HELP_STRING([--with-top-part-bitmaps], + [use top part of Kanji bitmaps only in xshogi]), +[OPT=-DTOP_PART_BITMAPS]) + +AC_ARG_WITH([first-shogi-program], +AS_HELP_STRING([--with-first-shogi-program=PROGNAME], + [use PROGNAME as the first shogi program in xshogi (default: gnushogi)]), +[FIRST_SHOGI_PROGRAM=$withval]) + +AC_ARG_WITH([second-shogi-program], +AS_HELP_STRING([--with-second-shogi-program=PROGNAME], + [use PROGNAME as the second shogi program in xshogi (default: gnushogi)]), +[SECOND_SHOGI_PROGRAM=$withval]) + +AC_ARG_WITH([first-host], +AS_HELP_STRING([--with-first-host=HOSTNAME], + [use HOSTNAME as the machine on which the first shogi program runs in xshogi (default: localhost)]), +[FIRST_HOST=$withval]) + +AC_ARG_WITH([second-host], +AS_HELP_STRING([--with-second-host=HOSTNAME], + [use HOSTNAME as the machine on which the second shogi program runs in xshogi (default: localhost)]), +[SECOND_HOST=$withval]) AC_SUBST(OPT) AC_SUBST(FIRST_SHOGI_PROGRAM) @@ -188,28 +156,25 @@ AC_SUBST(SECOND_SHOGI_PROGRAM) AC_SUBST(FIRST_HOST) AC_SUBST(SECOND_HOST) -if [[ $with_xshogi = yes ]] +if [[ $enable_xshogi = yes ]] then -XSHOGI=xshogi_compile -XSHOGIINSTALL=xshogi_install -XSHOGICLEAN=xshogi_clean +XSHOGI=xshogi +XSHOGIMAN=xshogi.6 +XDOCS='$(XDOCS)' else XSHOGI= -XSHOGIINSTALL= -XSHOGICLEAN= +XSHOGIMAN= +XDOCS= fi AC_SUBST(XSHOGI) -AC_SUBST(XSHOGIINSTALL) -AC_SUBST(XSHOGICLEAN) - - -echo -echo outputting files... +AC_SUBST(XSHOGIMAN) +AC_SUBST(XDOCS) +########## AC_CONFIG_FILES([Makefile gnushogi/Makefile - gnushogi/Makefile.profile + win32/config.h + doc/Makefile xshogi/Makefile]) AC_OUTPUT -