File: configure.in

package info (click to toggle)
gnugo 2.4-2
  • links: PTS
  • area: main
  • in suites: potato
  • size: 1,816 kB
  • ctags: 1,828
  • sloc: ansic: 22,091; tcl: 401; sh: 376; makefile: 202
file content (184 lines) | stat: -rw-r--r-- 5,094 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
dnl Process this file with autoconf to produce a configure script.

dnl this is to determine if the config script is running in the proper place
dnl just give it one file relative to where it should be
AC_INIT(src/dragon.c)

AM_CONFIG_HEADER(config.h)
AC_PREREQ(2.12)dnl               dnl Minimum Autoconf version required.

dnl this defines VERSION and PACKAGE
AM_INIT_AUTOMAKE([gnugo], [2.4])
GNU_PACKAGE="GNU $PACKAGE"
AC_DEFINE_UNQUOTED(GNU_PACKAGE, "$GNU_PACKAGE")

AM_MAINTAINER_MODE


dnl See if user has expressed a preference for use of curses and/or color
dnl These set variables $enable_color and $with_curses to "no" if disabled
dnl "yes" if enabled, or undefined if not specified

AC_ARG_WITH(curses,
 [  --with-curses       try to use curses for colored debugging output (default)
  --without-curses    do not use curses for colored debugging output])

AC_ARG_ENABLE(color,
 [  --enable-color        use curses or ansi escape sequences for colored debug output
  --disable-color       do not try to generated colored debug output])


dnl and look to see if they want to disable the grid optimisation

AC_ARG_ENABLE(grid-opt,
 [  --enable-grid-opt           enable the grid optimsation within the pattern matcher (default)
  --enable-grid-opt=distrust  enable the grid optimsation in non-trusting mode
  --disable-grid-opt          disable the grid optimisation])


dnl or the hashing code

AC_ARG_ENABLE(hashing,
 [  --enable-hashing            enable hashing (default)
  --disable-hashing           disable the hashing code])


AC_PROG_CC
AC_PROG_CPP
AC_PROG_GCC_TRADITIONAL
AC_PROG_RANLIB

dnl required since we use SUBDIRS in Makefile.am
AC_PROG_MAKE_SET

dnl AC_PROG_YACC
dnl AM_WITH_REGEX

dnl This test must precede tests of compiler characteristics like
dnl that for the inline keyword, since it may change the degree to
dnl which the compiler supports such features.
AM_C_PROTOTYPES

AC_HEADER_MAJOR

AC_C_CONST
AC_HEADER_STDC

dnl This test replaces the obsolescent AC_ISC_POSIX kludge.
AC_CHECK_LIB(cposix, strerror, [LIBS="$LIBS -lcposix"])

AC_CHECK_HEADERS(getopt.h string.h limits.h \
    errno.h unistd.h sys/param.h utime.h \
    sys/wait.h sys/ioctl.h values.h)


#AM_FUNC_GETLINE
#if test $am_cv_func_working_getline != yes; then
#  AC_CHECK_FUNCS(getdelim)
#fi

dnl Most of these are ansi fns : do we really need them ?

AC_CHECK_FUNCS(isascii memcpy strchr strsep strerror strrchr)

dnl AM_FUNC_ERROR_AT_LINE

AC_FUNC_VPRINTF


dnl -------- color debugging support -----------

dnl replace occurrences of @gp_tcap@ in Makefile.in
AC_SUBST(gp_tcap)
gp_tcap=''

dnl curses detection - derived from gnuplot's configure.in
if test "$with_curses" != no -a "$enable_color" != no ; then

  AC_MSG_CHECKING(for color support)

  dnl first, make sure that both curses.h and term.h are available
  dnl FIXME : better to actually figure out here what headers are really required

  AC_CHECK_HEADER( curses.h,[
   AC_CHECK_HEADER( term.h,[

    dnl so far so good - now check for the library

    dnl check for terminal library
    dnl this is a very cool solution from octave's configure.in
    for termlib in ncurses curses termcap terminfo termlib; do
      AC_CHECK_LIB(${termlib}, tputs, [gp_tcap="${gp_tcap} -l${termlib}"])
      case "${gp_tcap}" in
        *-l${termlib}*)
          AC_MSG_RESULT([using ${gp_tcap} for curses])
          AC_DEFINE(CURSES)
          break
        ;;
      esac
    done
  fi
 ])
])

if test "$enable_color" = yes -a "$gp_tcap" = '' ; then
  dnl we asked for color, but there is no curses
  AC_DEFINE(ANSI_COLOR)
fi


dnl ---------- grid optimisation --------

if test "$enable_grid_opt" = "distrust" ; then
  AC_DEFINE(GRID_OPT, 2)
else
  if test "$enable_grid_opt" = "no" ; then
    AC_DEFINE(GRID_OPT, 0)
  else
    AC_DEFINE(GRID_OPT, 1)
  fi
fi


dnl --------- hashing ---------

if test "$enable_hashing" = "no" ; then
  AC_DEFINE(HASHING, 0)
else
  AC_DEFINE(HASHING, 1)
fi




dnl  ----------- special-case use of gcc ---------

dnl Not sure if we are supposed to be accessing this variable, but...

AC_SUBST(GCC_ONLY)
AC_SUBST(GNUGO_SOME_WARNINGS)
AC_SUBST(GNUGO_ALL_WARNINGS)

dnl Please add -Wp,-lang-c89 to SOME_WARNINGS soon

if test $ac_cv_prog_gcc = yes; then
  GCC_ONLY=''
  GNUGO_SOME_WARNINGS='CFLAGS += -Wall -W -Wpointer-arith -Wbad-function-cast -Wcast-qual -Wcast-align -Wwrite-strings -Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations -Wp,-lang-c89'
  GNUGO_ALL_WARNINGS='CFLAGS += -Wall -W -Wshadow -Wpointer-arith -Wbad-function-cast -Wcast-qual -Wcast-align -Wwrite-strings -Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations -Wp,-lang-c89'
else
  GCC_ONLY='#'
  GNUGO_SOME_WARNINGS=''
  GNUGO_ALL_WARNINGS=''
fi

dnl Now lines in Makefile.am can be prefixed @GCC_ONLY@, and
dnl we can specify either @GNUGO_SOME_WARNINGS@ or @GNUGO_ALL_WARNINGS@

dnl FIXME : please add warnings for other compilers !



#AM_GNU_GETTEXT
#AC_LINK_FILES($nls_cv_header_libgt, $nls_cv_header_intl)

AC_OUTPUT([Makefile interface/Makefile patterns/Makefile sgf/Makefile utils/Makefile src/Makefile])