1 # ------------------------------------------------------------
2 # GNU shogi and xshogi configuration script.
3 # ------------------------------------------------------------
5 dnl Process this file with autoconf to produce a configure script.
8 AC_INIT([gnushogi],[1.5pre],[https://savannah.gnu.org/bugs/?group=gnushogi])
10 AC_CONFIG_SRCDIR([gnushogi/gnushogi.h])
11 AC_CONFIG_HEADERS(config.h)
15 AC_MSG_NOTICE([C compiler])
26 [AS_HELP_STRING([--with-curses],
27 [enable curses UI (default: yes if available)])],
32 AS_IF([test "x$with_curses" != xno],
33 [AC_CHECK_LIB([curses], [clrtoeol],
34 [AC_SUBST([LIBCURSES], [-lcurses])
35 AC_SUBST([CURSESDSP], [gnushogi-cursesdsp.o])
36 AC_SUBST([CURSESDSPMINI], [gnuminishogi-cursesdsp.o])
37 AC_DEFINE([HAVE_LIBCURSES], [1],
38 [Define if you have lib])
40 [AS_IF([test "x$with_curses" = xyes],
42 [--with-curses was given, but test for curses failed])])],
46 AC_CHECK_LIB([m], [pow])
47 AC_CHECK_LIB([termcap], [tgoto])
52 # C compiler warnings.
54 if [[ $ac_cv_c_compiler_gnu = yes ]]
56 WARNINGS="-Wall -Wno-implicit-int -Wstrict-prototypes"
57 CEXTRAFLAGS="-fsigned-char -funroll-loops"
59 # Who knows what warnings your compiler uses?
68 AC_MSG_NOTICE([header files])
72 AC_CHECK_HEADERS([fcntl.h stdlib.h string.h sys/file.h sys/ioctl.h])
73 AC_CHECK_HEADERS([sys/param.h sys/time.h unistd.h])
74 AC_CHECK_HEADERS(errno.h)
79 AC_MSG_NOTICE([typedefs])
90 AC_MSG_NOTICE([compiler characteristics])
95 AC_MSG_NOTICE([library functions])
97 AC_PROG_GCC_TRADITIONAL
99 AC_CHECK_FUNCS([gettimeofday memset pow])
100 AC_CHECK_FUNCS([strchr strerror strrchr strstr strtol])
101 AC_CHECK_FUNCS([memcpy bcopy])
102 AC_CHECK_FUNCS([setvbuf setlinebuf])
106 # don't build pat2inc when cross-compiling, we don't need it
107 if test "$cross_compiling" = no; then
108 AC_SUBST([PAT2INC], [pat2inc])
109 AC_SUBST([PAT2INCEXE], [pat2inc$EXEEXT])
113 AC_CONFIG_FILES([Makefile