2
dnl Configure script for lifelines software
4
dnl Process this file with autoconf to produce a configure script.
6
dnl **************************************************************
8
dnl **************************************************************
10
AC_INIT(src/liflines/main.c)
12
AC_REVISION([for lifelines, built with autoconf] AC_ACVERSION)
13
AC_CONFIG_AUX_DIR(build/autotools)
16
AM_INIT_AUTOMAKE(lifelines, 3.0.61)
18
AM_CONFIG_HEADER(config.h)
21
dnl **************************************************************
22
dnl Check for Compile-Chain Programs
23
dnl **************************************************************
25
dnl Checks for programs.
30
dnl MTE: 01/11/04: Force the use of GNU Bison only.
31
dnl MTE: AC_PROG_YACC will find any YACC, but only
32
dnl MTE: Bison works for us.
34
if test "$YACC" != "bison -y";
36
echo "LifeLines requires GNU Bison to compile src/interp/yacc.y."
40
dnl **************************************************************
41
dnl Check for Internationalization Support (gettext and iconv)
42
dnl **************************************************************
44
dnl Internationalization (gettext)
45
dnl ALL_LINGUAS is not needed with latest autotools
46
dnl but debian maintainer still needs it
47
dnl These languages should be a copy of po/LINGUAS
48
ALL_LINGUAS="da de el eo es fr it nl pl rw sv"
49
AM_GNU_GETTEXT(,need-ngettext)
51
dnl codeset conversion library
54
dnl **************************************************************
55
dnl Apply OS/Compiler-Specific Settings
56
dnl **************************************************************
58
dnl Add warning flags when using The GNU C Compiler
59
if test "${ac_cv_prog_gcc}" = "yes"; then
60
# -ansi breaks compile of liflines/askprogram.c [pere 2000-12-31]
65
-Wmissing-declarations \
66
-Wmissing-prototypes \
71
JAPHAR_GREP_CFLAGS($flag, [ CFLAGS="$CFLAGS $flag" ])
74
dnl Add debugging as well
79
# Cygwin - fixes linker problems
80
# Darwin - will pick up Fink-installed headers and libraries
83
CFLAGS="${CFLAGS} -DBROKEN_LINKER"
86
CPPFLAGS="${CPPFLAGS} -I/sw/include";
87
LDFLAGS="${LDFLAGS} -L/sw/lib"
91
dnl **************************************************************
92
dnl Handle Docs Target
93
dnl **************************************************************
95
# Shall we build the docs?
97
[ --with-docs Build the docs (requires sgmltools) ],
103
if test "$with_docs" = "yes"
105
echo Looking for sgmltools
106
AC_PATH_PROG(SGMLTOOLS, sgmltools, FAIL)
107
if test "$SGMLTOOLS" = "FAIL"; then
108
AC_MSG_RESULT( ******************************************************************* )
109
AC_MSG_RESULT( *** Cannot find sgmltools to build docs. skipping building docs *** )
110
AC_MSG_RESULT( *** Visit http://sgmltools-lite.sourceforge.net and install it. *** )
111
AC_MSG_RESULT( ******************************************************************* )
118
AC_SUBST(DOCS_TARGET)
120
dnl **************************************************************
121
dnl Handle Profiling Target
122
dnl **************************************************************
124
# Compile with profiling, to find bottlenecks
125
AC_ARG_WITH(profiling,
126
[ --with-profiling Compile with profiling support],
127
[# Does it work for other compilers then GCC? [pere 2000-12-30]
128
if test "${ac_cv_prog_gcc}" = "yes"; then
129
CFLAGS="${CFLAGS} -pg -a"
130
LDFLAGS="${LDFLAGS} -pg -a"
132
# Make sure 'config.h' is changed if profiling is turned on, to
133
# trigger recompile for every source file.
134
AC_DEFINE(PROFILING, 1, [Profiling enabled?])
136
echo "Do not know how to perform profiling using this compiler!"
141
dnl **************************************************************
142
dnl Check for Standard Headers/Structures/Libraries
143
dnl **************************************************************
145
echo Looking for header files
146
AC_CHECK_HEADERS( getopt.h dirent.h pwd.h locale.h windows.h )
147
AC_CHECK_HEADERS( wchar.h wctype.h )
148
AC_CHECK_HEADERS( math.h )
149
AC_CHECK_HEADERS( ncurses/curses.h ncursesw/curses.h )
151
echo Looking for library functions
152
AC_CHECK_FUNCS( _vsnprintf heapwalk _heapwalk getpwuid setlocale )
153
AC_CHECK_FUNCS( wcscoll towlower towupper iswspace iswalpha)
154
AC_CHECK_LIB( m, sin )
155
AC_CHECK_LIB( m, cos )
156
AC_CHECK_LIB( m, tan )
157
AC_CHECK_LIB( m, asin )
158
AC_CHECK_LIB( m, acos )
159
AC_CHECK_LIB( m, atan )
161
echo Looking for curses-compatible screen output library
162
AC_CHECK_LIB(ncursesw, tparm)
163
if test "$ac_cv_lib_ncursesw_tparm" = "yes"; then
166
AC_CHECK_LIB(ncurses, tparm)
167
if test "$ac_cv_lib_ncurses_tparm" = "yes"; then
170
echo Looking for curses
171
AC_CHECK_LIB(curses, main)
172
if test "$ac_cv_lib_curses_main" = "yes"; then
177
echo "Didn't find an up-to-date ncurses or curses library!"
178
echo "Using LifeLines version of curses for Windows."
181
echo "Didn't find an up-to-date ncurses or curses library!"
182
echo "Link problems may result!"
189
dnl Check for replacement functions
190
AC_REPLACE_FUNCS( sleep scandir alphasort getopt snprintf vsnprintf )
191
AC_REPLACE_FUNCS( nl_langinfo wcslen has_key )
192
AC_REPLACE_FUNCS( _llnull )
194
dnl **************************************************************
195
dnl Platform/Version-Specific Checks
196
dnl **************************************************************
198
echo Looking for header files and libraries to support heap walking
199
dnl We need to cheat on OSX/Darwin. The standard configure
200
dnl check brings in a C++ header which bombs and causes
201
dnl configure to display a particularly nasty warning, which
202
dnl we don't want to expose to end-users.
211
AC_CHECK_HEADERS( alloc.h malloc.h )
212
AC_CHECK_FUNCS( heapwalk _heapwalk )
216
dnl ngettext function missing from 0.10.35
217
echo Looking for ngettext
219
LIBS="$LIBS $LIBINTL"
220
AC_TRY_LINK([#include <libintl.h>], [ngettext("","",0);],
221
ac_cv_func_ngettext=yes, ac_cv_func_ngettext=no)
222
if test "$ac_cv_func_ngettext" = yes; then
223
echo "found ngettext"
224
AC_DEFINE(HAVE_NGETTEXT, 1, [Define if you have the ngettext() function.])
226
echo "couldn't find ngettext"
232
AC_DEFINE(LINES_CONFIG_FILE,"lines.cfg",[lifelines configuration file])
235
AC_DEFINE(LINES_CONFIG_FILE,".linesrc",[lifelines configuration file])
239
dnl bind_textdomain_codeset function missing from 0.10.35
240
echo Looking for bind_textdomain_codeset
242
LIBS="$LIBS $LIBINTL"
243
AC_TRY_LINK([#include <libintl.h>], [bind_textdomain_codeset("","");],
244
ac_cv_func_bind_textdomain_codeset=yes, ac_cv_func_bind_textdomain_codeset=no)
245
if test "$ac_cv_func_bind_textdomain_codeset" = yes; then
246
echo "found bind_textdomain_codeset"
247
AC_DEFINE(HAVE_BIND_TEXTDOMAIN_CODESET, 1, [Define if you have the bind_textdomain_codeset() function.])
249
echo "couldn't find bind_textdomain_codeset"
253
dnl **************************************************************
255
dnl **************************************************************
261
src/interp/Makefile \
262
src/gedlib/Makefile \
263
src/stdlib/Makefile \
264
src/liflines/Makefile \
268
src/hdrs/win32/Makefile \
271
reports/st/Makefile \