Long-dead code removal: unused macro
[gnushogi.git] / configure.ac
blob2fec8c810af8b6b82bbb9fd1b282b3f3e0182b10
1 # ------------------------------------------------------------
2 # GNU shogi and xshogi configuration script.
3 # ------------------------------------------------------------
5 dnl Process this file with autoconf to produce a configure script.
7 AC_PREREQ(2.57)
8 AC_INIT([gnushogi],[1.5pre],[https://savannah.gnu.org/bugs/?group=gnushogi])
9 AM_INIT_AUTOMAKE
10 AC_CONFIG_SRCDIR([gnushogi/gnushogi.h])
11 AC_CONFIG_HEADERS(config.h)
12 AM_MAINTAINER_MODE
14 ##########
15 AC_MSG_NOTICE([C compiler])
16 AC_PROG_CC
17 AC_CANONICAL_BUILD
18 AC_PROG_INSTALL
19 AM_PROG_CC_C_O
21 ##########
22 AC_MSG_NOTICE([libs])
24 # curses
25 AC_ARG_WITH([curses],
26   [AS_HELP_STRING([--with-curses],
27     [enable curses UI (default: yes if available)])],
28   [],
29   [with_curses=check])
31 LIBCURSES=
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])
39     ],
40     [AS_IF([test "x$with_curses" = xyes],
41       [AC_MSG_ERROR(
42          [--with-curses was given, but test for curses failed])])],
43     [-ltermcap])])
45 # other libraries.
46 AC_CHECK_LIB([m], [pow])
47 AC_CHECK_LIB([termcap], [tgoto])
51 ##########
52 # C compiler warnings.
54 if [[ $ac_cv_c_compiler_gnu = yes ]]
55 then
56 WARNINGS="-Wall -Wno-implicit-int -Wstrict-prototypes"
57 CEXTRAFLAGS="-fsigned-char -funroll-loops"
58 else
59 # Who knows what warnings your compiler uses?
60 WARNINGS=
61 CEXTRAFLAGS=
64 AC_SUBST(WARNINGS)
65 AC_SUBST(CEXTRAFLAGS)
67 ##########
68 AC_MSG_NOTICE([header files])
70 AC_HEADER_STDC
71 AC_HEADER_SYS_WAIT
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)
75 AC_HEADER_TIME
76 AC_HEADER_STDBOOL
78 ##########
79 AC_MSG_NOTICE([typedefs])
81 AC_C_CONST
82 AC_HEADER_STDBOOL
83 AC_C_INLINE
84 AC_TYPE_PID_T
85 AC_TYPE_SIZE_T
86 AC_HEADER_TIME
87 AC_STRUCT_TM
89 ##########
90 AC_MSG_NOTICE([compiler characteristics])
92 AC_CHECK_SIZEOF(long)
94 ##########
95 AC_MSG_NOTICE([library functions])
97 AC_PROG_GCC_TRADITIONAL
98 AC_TYPE_SIGNAL
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])
104 ##########
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])
112 ##########
113 AC_CONFIG_FILES([Makefile
114                  gnushogi/Makefile
115                  doc/Makefile])
116 AC_OUTPUT